From add51c49ecdda53f59bd4c01d4b2e03817002a71 Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 26 Aug 2013 03:44:53 +0300 Subject: [PATCH] fix yet another portability issue --- pico/memory.c | 10 +++++----- pico/memory.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) 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) \ -- 2.39.5