diff options
author | notaz | 2011-01-26 18:31:27 +0200 |
---|---|---|
committer | notaz | 2011-01-26 18:31:27 +0200 |
commit | 0ce47d46e07dfb02f3eeef481b963927beeee481 (patch) | |
tree | eda32f73e1dcdaeb6b694dfaf02c412f95900324 | |
parent | 68b3faeed93986cef07197ee2471a9e561803dbc (diff) | |
download | pcsx_rearmed-0ce47d46e07dfb02f3eeef481b963927beeee481.tar.gz pcsx_rearmed-0ce47d46e07dfb02f3eeef481b963927beeee481.tar.bz2 pcsx_rearmed-0ce47d46e07dfb02f3eeef481b963927beeee481.zip |
drc: invalidate RAM mirrors correctly
-rw-r--r-- | libpcsxcore/new_dynarec/emu_if.c | 9 | ||||
-rw-r--r-- | libpcsxcore/new_dynarec/new_dynarec.c | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c index 0942874..bdb9675 100644 --- a/libpcsxcore/new_dynarec/emu_if.c +++ b/libpcsxcore/new_dynarec/emu_if.c @@ -202,23 +202,20 @@ static void ari64_execute() static void ari64_clear(u32 addr, u32 size) { - u32 start, end; + u32 start, end, main_ram; size *= 4; /* PCSX uses DMA units */ evprintf("ari64_clear %08x %04x\n", addr, size); /* check for RAM mirrors */ - if ((addr & ~0xe0600000) < 0x200000) { - addr &= ~0xe0600000; - addr |= 0x80000000; - } + main_ram = (addr & 0xffe00000) == 0x80000000; start = addr >> 12; end = (addr + size) >> 12; for (; start <= end; start++) - if (!invalid_code[start]) + if (!main_ram || !invalid_code[start]) invalidate_block(start); } diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index b2b5d28..abfd834 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -309,7 +309,14 @@ static void tlb_hacks() static u_int get_page(u_int vaddr) { +#ifndef PCSX u_int page=(vaddr^0x80000000)>>12; +#else + u_int page=vaddr&~0xe0000000; + if (page < 0x1000000) + page &= ~0x0e00000; // RAM mirrors + page>>=12; +#endif #ifndef DISABLE_TLB if(page>262143&&tlb_LUT_r[vaddr>>12]) page=(tlb_LUT_r[vaddr>>12]^0x80000000)>>12; #endif |