more wip SVP code
[picodrive.git] / Pico / Pico.c
index aec354d..bb0f6e5 100644 (file)
@@ -17,7 +17,8 @@ int PicoSkipFrame=0; // skip rendering frame?
 int PicoRegionOverride = 0; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
 int PicoAutoRgnOrder = 0;\r
 int emustatus = 0; // rapid_ym2612, multi_ym_updates\r
-void (*PicoWriteSound)(int len) = 0; // called once per frame at the best time to send sound buffer (PsndOut) to hardware\r
+void (*PicoWriteSound)(int len) = NULL; // called at the best time to send sound buffer (PsndOut) to hardware\r
+void (*PicoResetHook)(void) = NULL;\r
 \r
 struct PicoSRAM SRam = {0,};\r
 int z80startCycle, z80stopCycle; // in 68k cycles\r
@@ -139,6 +140,8 @@ int PicoReset(int hard)
 \r
   PsndReset(); // pal must be known here\r
 \r
+  if (PicoResetHook) PicoResetHook();\r
+\r
   if (PicoMCD & 1) {\r
     PicoResetMCD(hard);\r
     return 0;\r
@@ -213,7 +216,7 @@ static __inline void SekRunM68k(int cyc)
 #elif defined(EMU_M68K)\r
   SekCycleCnt+=m68k_execute(cyc_do);\r
 #elif defined(EMU_F68K)\r
-  SekCycleCnt+=fm68k_emulate(cyc_do+1);\r
+  SekCycleCnt+=fm68k_emulate(cyc_do+1, 0);\r
 #endif\r
 }\r
 \r
@@ -230,7 +233,7 @@ static __inline void SekStep(void)
 #elif defined(EMU_M68K)\r
   SekCycleCnt+=m68k_execute(1);\r
 #elif defined(EMU_F68K)\r
-  SekCycleCnt+=fm68k_emulate(1);\r
+  SekCycleCnt+=fm68k_emulate(1, 0);\r
 #endif\r
   SekCycleAim=realaim;\r
 }\r
@@ -297,10 +300,10 @@ static void PicoRunZ80Simple(int line_from, int line_to)
       if ((line == 224 || line == line_sample) && PsndOut) getSamples(line);\r
       if (line == 32 && PsndOut) emustatus &= ~1;\r
       if (line >= line_from_r && line < line_to_r)\r
-        z80_run(228);\r
+        z80_run_nr(228);\r
     }\r
   } else if (line_to_r-line_from_r > 0) {\r
-    z80_run(228*(line_to_r-line_from_r));\r
+    z80_run_nr(228*(line_to_r-line_from_r));\r
     // samples will be taken by caller\r
   }\r
 }\r