32x: vints, dram read, hw divider. Doom runs, but fragile to timing
[picodrive.git] / pico / 32x / 32x.c
index 20a942a..76423f1 100644 (file)
@@ -92,6 +92,8 @@ static void p32x_start_blank(void)
     Pico32xSwapDRAM(Pico32x.pending_fb ^ 1);
   }
 
+  Pico32x.sh2irqs |= P32XI_VINT;
+  p32x_update_irls();
   p32x_poll_event(1);
 }
 
@@ -122,7 +124,7 @@ static __inline void SekRunM68k(int cyc)
 
 // ~1463.8, but due to cache misses and slow mem
 // it's much lower than that
-#define SH2_LINE_CYCLES 700
+#define SH2_LINE_CYCLES 735
 
 #define PICO_32X
 #define RUN_SH2S \
@@ -135,12 +137,15 @@ static __inline void SekRunM68k(int cyc)
 
 void PicoFrame32x(void)
 {
+  pwm_frame_smp_cnt = 0;
+
   Pico32x.vdp_regs[0x0a/2] &= ~P32XV_VBLK; // get out of vblank
-  if ((Pico32x.vdp_regs[0] & ) != 0) // no forced blanking
-    Pico32x.vdp_regs[0x0a/2] &= ~P32XV_PEN; // no pal access
+  if ((Pico32x.vdp_regs[0] & P32XV_Mx) != 0) // no forced blanking
+    Pico32x.vdp_regs[0x0a/2] &= ~P32XV_PEN; // no palette access
 
   p32x_poll_event(1);
 
   PicoFrameStart();
   PicoFrameHints();
 }
+