aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2013-01-06 04:11:26 +0200
committernotaz2013-01-06 04:11:26 +0200
commit92879b62c06f6c1d363a138f77f7727d0fc7721e (patch)
treebb404095a1dd49be9796064fdaabba33ec48efb2
parent804789d73ee66857216f1e32c74c80dd65ef587f (diff)
downloadpcsx_rearmed-92879b62c06f6c1d363a138f77f7727d0fc7721e.tar.gz
pcsx_rearmed-92879b62c06f6c1d363a138f77f7727d0fc7721e.tar.bz2
pcsx_rearmed-92879b62c06f6c1d363a138f77f7727d0fc7721e.zip
fully reinit drc on change
-rw-r--r--frontend/menu.c5
-rw-r--r--libpcsxcore/new_dynarec/emu_if.c2
-rw-r--r--libpcsxcore/new_dynarec/pcsxmem.c6
-rw-r--r--libpcsxcore/new_dynarec/pcsxmem.h1
4 files changed, 13 insertions, 1 deletions
diff --git a/frontend/menu.c b/frontend/menu.c
index 8e182bf..eb004d8 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 b8e9883..02e108f 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 90f7765..4d83452 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 f962562..99bb5d4 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);