From: notaz Date: Tue, 1 Mar 2022 22:49:11 +0000 (+0200) Subject: drc: fix some wrong inv address calculations X-Git-Tag: r23~5 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab4377be5e2d461703aaba706f419f1bc466abd7;p=pcsx_rearmed.git drc: fix some wrong inv address calculations Fixes: 882a08fc49541450bc403b2e920e4bccc257dfdf notaz/pcsx_rearmed#243 --- diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 760d4273..45c3bff7 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -603,9 +603,9 @@ static void hash_table_remove(int vaddr) static void mark_invalid_code(u_int vaddr, u_int len, char invalid) { + u_int vaddr_m = vaddr & 0x1fffffff; u_int i, j; - vaddr &= 0x1fffffff; - for (i = vaddr & ~0xfff; i < vaddr + len; i += 0x1000) { + for (i = vaddr_m & ~0xfff; i < vaddr_m + len; i += 0x1000) { // ram mirrors, but should not hurt bios for (j = 0; j < 0x800000; j += 0x200000) { invalid_code[(i|j) >> 12] = @@ -1352,7 +1352,7 @@ static int invalidate_range(u_int start, u_int end, u_int start_page = get_page_prev(start); u_int end_page = get_page(end - 1); u_int start_m = pmmask(start); - u_int end_m = pmmask(end); + u_int end_m = pmmask(end - 1); u_int inv_start, inv_end; u_int blk_start_m, blk_end_m; u_int page;