32x: some mapping corrections
[picodrive.git] / cpu / sh2 / compiler.c
index 106fab5..0b59920 100644 (file)
@@ -3126,6 +3126,7 @@ int sh2_execute(SH2 *sh2c, int cycles)
   if (ret_cycles > 0)
     dbg(1, "warning: drc returned with cycles: %d", ret_cycles);
 
+  sh2c->sr &= 0x3f3;
   return sh2c->cycles_timeslice - ret_cycles;
 }
 
@@ -3307,7 +3308,8 @@ static void *dr_get_pc_base(u32 pc, int is_slave)
   }
   else if ((pc & 0xc6000000) == 0x02000000) {
     // ROM
-    ret = Pico.rom;
+    if ((pc & 0x3fffff) < Pico.romsize)
+      ret = Pico.rom;
     mask = 0x3fffff;
   }