From: notaz Date: Sat, 8 Jul 2023 14:53:56 +0000 (+0300) Subject: drc: fix some table math X-Git-Tag: r24~266 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3973c6949814717f22e3db91129829a62941232;p=pcsx_rearmed.git drc: fix some table math libretro/pcsx_rearmed#713 --- diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c index 69a4c99d..a32b4183 100644 --- a/libpcsxcore/new_dynarec/pcsxmem.c +++ b/libpcsxcore/new_dynarec/pcsxmem.c @@ -47,7 +47,8 @@ void map_item(uintptr_t *out, const void *h, uintptr_t flag) // size must be power of 2, at least 4k #define map_l1_mem(tab, i, addr, size, base) \ - map_item(&tab[((addr)>>12) + i], (u8 *)(base) - (u32)(addr) - ((i << 12) & ~(size - 1)), 0) + map_item(&tab[((addr)>>12) + i], \ + (u8 *)(base) - (u32)((addr) + ((i << 12) & ~(size - 1))), 0) #define IOMEM32(a) (((a) & 0xfff) / 4) #define IOMEM16(a) (0x1000/4 + (((a) & 0xfff) / 2))