From 4b421010647aba998fe2ebfc7d6f226623d47954 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 10 Dec 2010 01:36:33 +0200 Subject: [PATCH] drc: handle invalidate on clear() calls and reset --- libpcsxcore/new_dynarec/emu_if.c | 21 +++++++++++++++++++-- libpcsxcore/new_dynarec/new_dynarec.h | 3 +++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c index dff7f21b..9b20e5ca 100644 --- a/libpcsxcore/new_dynarec/emu_if.c +++ b/libpcsxcore/new_dynarec/emu_if.c @@ -160,8 +160,9 @@ static int ari64_init() static void ari64_reset() { - /* hmh */ printf("ari64_reset\n"); + invalidate_all_pages(); + pending_exception = 1; } static void ari64_execute() @@ -177,8 +178,24 @@ static void ari64_execute() psxRegs.cycle, next_interupt, next_interupt - psxRegs.cycle); } -static void ari64_clear(u32 Addr, u32 Size) +static void ari64_clear(u32 addr, u32 size) { + u32 start, end; + + evprintf("ari64_clear %08x %04x\n", addr, size); + + /* check for RAM mirrors */ + if ((start & ~0xe0000000) < 0x200000) { + start &= ~0xe0000000; + start |= 0x80000000; + } + + start = addr >> 12; + end = (addr + size) >> 12; + + for (; start <= end; start++) + if (!invalid_code[start]) + invalidate_block(start); } static void ari64_shutdown() diff --git a/libpcsxcore/new_dynarec/new_dynarec.h b/libpcsxcore/new_dynarec/new_dynarec.h index 6f0c74e9..580977b5 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.h +++ b/libpcsxcore/new_dynarec/new_dynarec.h @@ -7,3 +7,6 @@ extern int stop; void new_dynarec_init(); void new_dynarec_cleanup(); void new_dyna_start(); + +void invalidate_all_pages(); +void invalidate_block(unsigned int block); -- 2.39.5