distinguish VR SVP from 32X version
[picodrive.git] / pico / pico.c
index 12677d7..bbc514f 100644 (file)
@@ -1,11 +1,11 @@
-// PicoDrive\r
-\r
-// (c) Copyright 2004 Dave, All rights reserved.\r
-// (c) Copyright 2006-2008 notaz, All rights reserved.\r
-// Free for non-commercial use.\r
-\r
-// For commercial use, separate licencing terms must be obtained.\r
-\r
+/*\r
+ * PicoDrive\r
+ * (c) Copyright Dave, 2004\r
+ * (C) notaz, 2006-2010\r
+ *\r
+ * This work is licensed under the terms of MAME license.\r
+ * See COPYING file in the top-level directory.\r
+ */\r
 \r
 #include "pico_int.h"\r
 #include "sound/ym2612.h"\r
@@ -16,6 +16,7 @@ int PicoSkipFrame;     // skip rendering frame?
 int PicoPad[2];        // Joypads, format is MXYZ SACB RLDU\r
 int PicoPadInt[2];     // internal copy\r
 int PicoAHW;           // active addon hardware: PAHW_*\r
+int PicoQuirks;        // game-specific quirks\r
 int PicoRegionOverride; // override the region detection 0: Auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe\r
 int PicoAutoRgnOrder;\r
 \r
@@ -54,6 +55,7 @@ void PicoExit(void)
 \r
   if (SRam.data)\r
     free(SRam.data);\r
+  pevt_dump();\r
 }\r
 \r
 void PicoPower(void)\r
@@ -69,6 +71,9 @@ void PicoPower(void)
   Pico.video.pending_ints=0;\r
   z80_reset();\r
 \r
+  // my MD1 VA6 console has this in IO\r
+  Pico.ioports[1] = Pico.ioports[2] = Pico.ioports[3] = 0xff;\r
+\r
   // default VDP register values (based on Fusion)\r
   Pico.video.reg[0] = Pico.video.reg[1] = 0x04;\r
   Pico.video.reg[0xc] = 0x81;\r
@@ -145,6 +150,10 @@ int PicoReset(void)
   if (Pico.romsize <= 0)\r
     return 1;\r
 \r
+#if defined(CPU_CMP_R) || defined(CPU_CMP_W) || defined(DRC_CMP)\r
+  PicoOpt |= POPT_DIS_VDP_FIFO|POPT_DIS_IDLE_DET;\r
+#endif\r
+\r
   /* must call now, so that banking is reset, and correct vectors get fetched */\r
   if (PicoResetHook)\r
     PicoResetHook();\r
@@ -160,7 +169,7 @@ int PicoReset(void)
   SekReset();\r
   // s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games).\r
   SekSetRealTAS(PicoAHW & PAHW_MCD);\r
-  SekCycleCntT=0;\r
+  SekCycleCntT = SekCycleCnt = SekCycleAim = 0;\r
 \r
   if (PicoAHW & PAHW_MCD)\r
     // needed for MCD to reset properly, probably some bug hides behind this..\r
@@ -217,8 +226,8 @@ void PicoLoopPrepare(void)
   // FIXME: PAL has 313 scanlines..\r
   scanlines_total = Pico.m.pal ? 312 : 262;\r
 \r
-  if (PicoAHW & PAHW_32X)\r
-    p32x_timers_recalc();\r
+  Pico.m.dirtyPal = 1;\r
+  rendstatus_old = -1;\r
 }\r
 \r
 \r
@@ -267,29 +276,6 @@ PICO_INTERNAL int CheckDMA(void)
   return burn;\r
 }\r
 \r
-static __inline void SekRunM68k(int cyc)\r
-{\r
-  int cyc_do;\r
-  pprof_start(m68k);\r
-\r
-  SekCycleAim+=cyc;\r
-  if ((cyc_do=SekCycleAim-SekCycleCnt) <= 0) return;\r
-#if defined(EMU_CORE_DEBUG)\r
-  // this means we do run-compare\r
-  SekCycleCnt+=CM_compareRun(cyc_do, 0);\r
-#elif defined(EMU_C68K)\r
-  PicoCpuCM68k.cycles=cyc_do;\r
-  CycloneRun(&PicoCpuCM68k);\r
-  SekCycleCnt+=cyc_do-PicoCpuCM68k.cycles;\r
-#elif defined(EMU_M68K)\r
-  SekCycleCnt+=m68k_execute(cyc_do);\r
-#elif defined(EMU_F68K)\r
-  SekCycleCnt+=fm68k_emulate(cyc_do+1, 0, 0);\r
-#endif\r
-\r
-  pprof_end(m68k);\r
-}\r
-\r
 #include "pico_cmn.c"\r
 \r
 int z80stopCycle;\r