From: notaz Date: Sun, 6 Jan 2013 02:11:26 +0000 (+0200) Subject: fully reinit drc on change X-Git-Tag: r18~4 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92879b62c06f6c1d363a138f77f7727d0fc7721e;p=pcsx_rearmed.git fully reinit drc on change --- diff --git a/frontend/menu.c b/frontend/menu.c index 8e182bf6..eb004d8f 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -2499,9 +2499,12 @@ void menu_prepare_emu(void) plat_video_menu_leave(); psxCpu = (Config.Cpu == CPU_INTERPRETER) ? &psxInt : &psxRec; - if (psxCpu != prev_cpu) + if (psxCpu != prev_cpu) { + prev_cpu->Shutdown(); + psxCpu->Init(); // note that this does not really reset, just clears drc caches psxCpu->Reset(); + } // core doesn't care about Config.Cdda changes, // so handle them manually here diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c index b8e98836..02e108f8 100644 --- a/libpcsxcore/new_dynarec/emu_if.c +++ b/libpcsxcore/new_dynarec/emu_if.c @@ -344,6 +344,7 @@ static void ari64_clear(u32 addr, u32 size) static void ari64_shutdown() { new_dynarec_cleanup(); + new_dyna_pcsx_mem_shutdown(); } extern void intExecute(); @@ -394,6 +395,7 @@ void invalidate_block(unsigned int block) {} void new_dyna_pcsx_mem_init(void) {} void new_dyna_pcsx_mem_reset(void) {} void new_dyna_pcsx_mem_load_state(void) {} +void new_dyna_pcsx_mem_shutdown(void) {} #endif #ifdef DRC_DBG diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c index 90f77657..4d83452d 100644 --- a/libpcsxcore/new_dynarec/pcsxmem.c +++ b/libpcsxcore/new_dynarec/pcsxmem.c @@ -475,3 +475,9 @@ void new_dyna_pcsx_mem_reset(void) map_item(&mem_iowtab[IOMEM32(0x1810)], GPU_writeData, 1); } + +void new_dyna_pcsx_mem_shutdown(void) +{ + psxUnmap(mem_readtab, 0x200000 * 4, MAP_TAG_LUTS); + mem_writetab = mem_readtab = NULL; +} diff --git a/libpcsxcore/new_dynarec/pcsxmem.h b/libpcsxcore/new_dynarec/pcsxmem.h index f9625626..99bb5d4f 100644 --- a/libpcsxcore/new_dynarec/pcsxmem.h +++ b/libpcsxcore/new_dynarec/pcsxmem.h @@ -4,5 +4,6 @@ extern u8 zero_mem[0x1000]; void new_dyna_pcsx_mem_init(void); void new_dyna_pcsx_mem_reset(void); void new_dyna_pcsx_mem_load_state(void); +void new_dyna_pcsx_mem_shutdown(void); int pcsxmem_is_handler_dynamic(u_int addr);