drc: tune invalidation
[picodrive.git] / pico / 32x / memory.c
index fc4f177..2ec7563 100644 (file)
@@ -40,9 +40,7 @@
  */
 #include "../pico_int.h"
 #include "../memory.h"
-#ifdef DRC_SH2
 #include "../../cpu/sh2/compiler.h"
-#endif
 
 #if 0
 #undef ash2_end_run
@@ -121,8 +119,8 @@ void p32x_poll_event(int cpu_mask, int is_vdp)
 
 // SH2 faking
 //#define FAKE_SH2
-int p32x_csum_faked;
 #ifdef FAKE_SH2
+static int p32x_csum_faked;
 static const u16 comm_fakevals[] = {
   0x4d5f, 0x4f4b, // M_OK
   0x535f, 0x4f4b, // S_OK
@@ -1253,11 +1251,6 @@ static int REGPARM(3) sh2_write16_da(u32 a, u32 d, int id)
 }
 
 
-typedef struct {
-  uptr addr; // stores (membase >> 1) or ((handler >> 1) | (1<<31))
-  u32 mask;
-} sh2_memmap;
-
 typedef u32 (sh2_read_handler)(u32 a, int id);
 typedef int REGPARM(3) (sh2_write_handler)(u32 a, u32 d, int id);
 
@@ -1611,25 +1604,18 @@ void PicoMemSetup32x(void)
   sh2_poll[1].flag = P32XF_SSH2POLL;
   sh2_poll[1].cyc_max = 16;
 
-#ifdef DRC_SH2
   sh2_drc_mem_setup(&msh2);
   sh2_drc_mem_setup(&ssh2);
-#endif
 }
 
-void Pico32xStateLoaded(void)
+void Pico32xMemStateLoaded(void)
 {
-  sh2s[0].m68krcycles_done = sh2s[1].m68krcycles_done = SekCycleCntT;
-  p32x_poll_event(3, 0);
-
   bank_switch(Pico32x.regs[4 / 2]);
   Pico32xSwapDRAM((Pico32x.vdp_regs[0x0a / 2] & P32XV_FS) ^ P32XV_FS);
-  Pico32x.dirty_pal = 1;
   memset(Pico32xMem->pwm, 0, sizeof(Pico32xMem->pwm));
-  p32x_timers_recalc();
-#ifdef DRC_SH2
+  Pico32x.dirty_pal = 1;
+
   sh2_drc_flush_all();
-#endif
 }
 
 // vim:shiftwidth=2:ts=2:expandtab