fully reinit drc on change
authornotaz <notasas@gmail.com>
Sun, 6 Jan 2013 02:11:26 +0000 (04:11 +0200)
committernotaz <notasas@gmail.com>
Sun, 6 Jan 2013 02:11:26 +0000 (04:11 +0200)
frontend/menu.c
libpcsxcore/new_dynarec/emu_if.c
libpcsxcore/new_dynarec/pcsxmem.c
libpcsxcore/new_dynarec/pcsxmem.h

index 8e182bf..eb004d8 100644 (file)
@@ -2499,9 +2499,12 @@ void menu_prepare_emu(void)
        plat_video_menu_leave();
 
        psxCpu = (Config.Cpu == CPU_INTERPRETER) ? &psxInt : &psxRec;
        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();
                // 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
 
        // core doesn't care about Config.Cdda changes,
        // so handle them manually here
index b8e9883..02e108f 100644 (file)
@@ -344,6 +344,7 @@ static void ari64_clear(u32 addr, u32 size)
 static void ari64_shutdown()
 {
        new_dynarec_cleanup();
 static void ari64_shutdown()
 {
        new_dynarec_cleanup();
+       new_dyna_pcsx_mem_shutdown();
 }
 
 extern void intExecute();
 }
 
 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_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
 #endif
 
 #ifdef DRC_DBG
index 90f7765..4d83452 100644 (file)
@@ -475,3 +475,9 @@ void new_dyna_pcsx_mem_reset(void)
 
        map_item(&mem_iowtab[IOMEM32(0x1810)], GPU_writeData, 1);
 }
 
        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;
+}
index f962562..99bb5d4 100644 (file)
@@ -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_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);
 
 int pcsxmem_is_handler_dynamic(u_int addr);