{\r
unsigned char sram_reg=Pico.m.sram_reg; // must be preserved\r
\r
- if (Pico.romsize<=0) return 1;\r
+ if (Pico.romsize <= 0)\r
+ return 1;\r
\r
/* must call now, so that banking is reset, and correct vectors get fetched */\r
- if (PicoResetHook) PicoResetHook();\r
+ if (PicoResetHook)\r
+ PicoResetHook();\r
\r
PicoMemReset();\r
- SekReset();\r
memset(&PicoPadInt,0,sizeof(PicoPadInt));\r
+ emustatus = 0;\r
+\r
+ if (PicoAHW & PAHW_SMS) {\r
+ PicoResetMS();\r
+ return 0;\r
+ }\r
+\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
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
PsndReset(); // pal must be known here\r
\r
// create an empty "dma" to cause 68k exec start at random frame location\r
- if (Pico.m.dma_xfers == 0 && !(PicoOpt&POPT_DIS_VDP_FIFO))\r
+ if (Pico.m.dma_xfers == 0 && !(PicoOpt & POPT_DIS_VDP_FIFO))\r
Pico.m.dma_xfers = rand() & 0x1fff;\r
\r
SekFinishIdleDet();\r
#endif\r
}\r
\r
-\r
-// to be called on 224 or line_sample scanlines only\r
-static __inline void getSamples(int y)\r
-{\r
-#if SIMPLE_WRITE_SOUND\r
- if (y != 224) return;\r
- PsndRender(0, PsndLen);\r
- if (PicoWriteSound) PicoWriteSound(PsndLen);\r
- PsndClear();\r
-#else\r
- static int curr_pos = 0;\r
-\r
- if(y == 224) {\r
- if(emustatus & 2)\r
- curr_pos += PsndRender(curr_pos, PsndLen-PsndLen/2);\r
- else curr_pos = PsndRender(0, PsndLen);\r
- if (emustatus&1) emustatus|=2; else emustatus&=~2;\r
- if (PicoWriteSound) PicoWriteSound(curr_pos);\r
- // clear sound buffer\r
- PsndClear();\r
- }\r
- else if(emustatus & 3) {\r
- emustatus|= 2;\r
- emustatus&=~1;\r
- curr_pos = PsndRender(0, PsndLen/2);\r
- }\r
-#endif\r
-}\r
-\r
#include "pico_cmn.c"\r
\r
int z80stopCycle;\r
PicoFrameMCD();\r
return;\r
}\r
+ else if (PicoAHW & PAHW_SMS) {\r
+ PicoFrameMS();\r
+ return;\r
+ }\r
\r
//if(Pico.video.reg[12]&0x2) Pico.video.status ^= 0x10; // change odd bit in interlace mode\r
\r
\r
void PicoFrameDrawOnly(void)\r
{\r
- PicoFrameStart();\r
- PicoDrawSync(223, 0);\r
+ if (!(PicoAHW & PAHW_SMS)) {\r
+ PicoFrameStart();\r
+ PicoDrawSync(223, 0);\r
+ } else {\r
+ PicoFrameDrawOnlyMS();\r
+ }\r
}\r
\r
void PicoGetInternal(pint_t which, pint_ret_t *r)\r