int PicoSkipFrame = 0; // skip rendering frame?\r
int emustatus = 0; // rapid_ym2612, multi_ym_updates\r
int PicoPad[2]; // Joypads, format is SACB RLDU\r
-int PicoAHW = 0; // active addon hardware: scd_active, 32x_active, svp_active\r
+int PicoAHW = 0; // active addon hardware: scd_active, 32x_active, svp_active, pico_active\r
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 z80startCycle, z80stopCycle; // in 68k cycles\r
\r
void PicoPower(void)\r
{\r
+ unsigned char sram_reg=Pico.m.sram_reg; // must be preserved\r
+\r
// clear all memory of the emulated machine\r
memset(&Pico.ram,0,(unsigned int)&Pico.rom-(unsigned int)&Pico.ram);\r
\r
if (PicoAHW & PAHW_MCD)\r
PicoPowerMCD();\r
\r
+ Pico.m.sram_reg=sram_reg;\r
PicoReset();\r
}\r
\r
-int PicoReset(void)\r
+PICO_INTERNAL void PicoDetectRegion(void)\r
{\r
- unsigned int region=0;\r
- int support=0,hw=0,i=0;\r
+ int support=0, hw=0, i;\r
unsigned char pal=0;\r
- unsigned char sram_reg=Pico.m.sram_reg; // must be preserved\r
-\r
- if (Pico.romsize<=0) return 1;\r
\r
- /* must call now, so that banking is reset, and correct vectors get fetched */\r
- if (PicoResetHook) PicoResetHook();\r
-\r
- PicoMemReset();\r
- 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
-\r
- if (PicoAHW & PAHW_MCD)\r
- // needed for MCD to reset properly, probably some bug hides behind this..\r
- memset(Pico.ioports,0,sizeof(Pico.ioports));\r
- emustatus = 0;\r
-\r
- Pico.m.dirtyPal = 1;\r
-\r
- if(PicoRegionOverride)\r
+ if (PicoRegionOverride)\r
{\r
support = PicoRegionOverride;\r
}\r
else\r
{\r
// Read cartridge region data:\r
- region=PicoRead32(0x1f0);\r
+ int region=PicoRead32(0x1f0);\r
\r
for (i=0;i<4;i++)\r
{\r
\r
Pico.m.hardware=(unsigned char)(hw|0x20); // No disk attached\r
Pico.m.pal=pal;\r
- Pico.video.status = 0x3408 | pal; // 'always set' bits | vblank | pal\r
+}\r
+\r
+int PicoReset(void)\r
+{\r
+ unsigned char sram_reg=Pico.m.sram_reg; // must be preserved\r
+\r
+ if (Pico.romsize<=0) return 1;\r
+\r
+ /* must call now, so that banking is reset, and correct vectors get fetched */\r
+ if (PicoResetHook) PicoResetHook();\r
+\r
+ PicoMemReset();\r
+ 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
+\r
+ if (PicoAHW & PAHW_MCD)\r
+ // needed for MCD to reset properly, probably some bug hides behind this..\r
+ memset(Pico.ioports,0,sizeof(Pico.ioports));\r
+ emustatus = 0;\r
+\r
+ Pico.m.dirtyPal = 1;\r
+\r
+ PicoDetectRegion();\r
+ Pico.video.status = 0x3408 | Pico.m.pal; // 'always set' bits | vblank | pal\r
\r
PsndReset(); // pal must be known here\r
\r