From: notaz Date: Mon, 26 Aug 2013 00:44:53 +0000 (+0300) Subject: fix yet another portability issue X-Git-Tag: v1.85~2^2~11 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=add51c49ecdda53f59bd4c01d4b2e03817002a71;p=picodrive.git fix yet another portability issue --- diff --git a/pico/memory.c b/pico/memory.c index 24e5f21e..4f38e5e2 100644 --- a/pico/memory.c +++ b/pico/memory.c @@ -49,7 +49,7 @@ static void xmap_set(uptr *map, int shift, int start_addr, int end_addr, for (i = start_addr >> shift; i <= end_addr >> shift; i++) { map[i] = addr >> 1; if (is_func) - map[i] |= (uptr)1 << (sizeof(addr) * 8 - 1); + map[i] |= MAP_FLAG; } } @@ -126,19 +126,19 @@ void m68k_map_unmap(int start_addr, int end_addr) addr = (uptr)m68k_unmapped_read8; for (i = start_addr >> shift; i <= end_addr >> shift; i++) - m68k_read8_map[i] = (addr >> 1) | (1 << 31); + m68k_read8_map[i] = (addr >> 1) | MAP_FLAG; addr = (uptr)m68k_unmapped_read16; for (i = start_addr >> shift; i <= end_addr >> shift; i++) - m68k_read16_map[i] = (addr >> 1) | (1 << 31); + m68k_read16_map[i] = (addr >> 1) | MAP_FLAG; addr = (uptr)m68k_unmapped_write8; for (i = start_addr >> shift; i <= end_addr >> shift; i++) - m68k_write8_map[i] = (addr >> 1) | (1 << 31); + m68k_write8_map[i] = (addr >> 1) | MAP_FLAG; addr = (uptr)m68k_unmapped_write16; for (i = start_addr >> shift; i <= end_addr >> shift; i++) - m68k_write16_map[i] = (addr >> 1) | (1 << 31); + m68k_write16_map[i] = (addr >> 1) | MAP_FLAG; } MAKE_68K_READ8(m68k_read8, m68k_read8_map) diff --git a/pico/memory.h b/pico/memory.h index 44213714..afca0826 100644 --- a/pico/memory.h +++ b/pico/memory.h @@ -45,7 +45,8 @@ void cpu68k_map_set(uptr *map, int start_addr, int end_addr, void cpu68k_map_all_ram(int start_addr, int end_addr, void *ptr, int is_sub); void m68k_map_unmap(int start_addr, int end_addr); -#define map_flag_set(x) ((x) & ((uptr)1 << (sizeof(uptr) * 8 - 1))) +#define MAP_FLAG ((uptr)1 << (sizeof(uptr) * 8 - 1)) +#define map_flag_set(x) ((x) & MAP_FLAG) #define MAKE_68K_READ8(name, map) \ u32 name(u32 a) \