X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=pico%2Fpico.c;h=c919507ea296d24f19c7450b36aff1f108743bfe;hb=87b0845f3733166b491ae236feb8bc2eb0fca2ec;hp=e079f8aff939be5f8957a9d1fa03c525b4d2441a;hpb=7b3f44c6b677a60b63b092f825a2b6c58166b70c;p=picodrive.git diff --git a/pico/pico.c b/pico/pico.c index e079f8a..c919507 100644 --- a/pico/pico.c +++ b/pico/pico.c @@ -141,14 +141,23 @@ int PicoReset(void) { unsigned char sram_reg=Pico.m.sram_reg; // must be preserved - if (Pico.romsize<=0) return 1; + if (Pico.romsize <= 0) + return 1; /* must call now, so that banking is reset, and correct vectors get fetched */ - if (PicoResetHook) PicoResetHook(); + if (PicoResetHook) + PicoResetHook(); PicoMemReset(); - SekReset(); memset(&PicoPadInt,0,sizeof(PicoPadInt)); + emustatus = 0; + + if (PicoAHW & PAHW_SMS) { + PicoResetMS(); + return 0; + } + + SekReset(); // s68k doesn't have the TAS quirk, so we just globally set normal TAS handler in MCD mode (used by Batman games). SekSetRealTAS(PicoAHW & PAHW_MCD); SekCycleCntT=0; @@ -156,7 +165,6 @@ int PicoReset(void) if (PicoAHW & PAHW_MCD) // needed for MCD to reset properly, probably some bug hides behind this.. memset(Pico.ioports,0,sizeof(Pico.ioports)); - emustatus = 0; Pico.m.dirtyPal = 1; @@ -169,7 +177,7 @@ int PicoReset(void) PsndReset(); // pal must be known here // create an empty "dma" to cause 68k exec start at random frame location - if (Pico.m.dma_xfers == 0 && !(PicoOpt&POPT_DIS_VDP_FIFO)) + if (Pico.m.dma_xfers == 0 && !(PicoOpt & POPT_DIS_VDP_FIFO)) Pico.m.dma_xfers = rand() & 0x1fff; SekFinishIdleDet(); @@ -289,6 +297,10 @@ void PicoFrame(void) PicoFrameMCD(); return; } + else if (PicoAHW & PAHW_SMS) { + PicoFrameMS(); + return; + } //if(Pico.video.reg[12]&0x2) Pico.video.status ^= 0x10; // change odd bit in interlace mode @@ -300,8 +312,12 @@ void PicoFrame(void) void PicoFrameDrawOnly(void) { - PicoFrameStart(); - PicoDrawSync(223, 0); + if (!(PicoAHW & PAHW_SMS)) { + PicoFrameStart(); + PicoDrawSync(223, 0); + } else { + PicoFrameDrawOnlyMS(); + } } void PicoGetInternal(pint_t which, pint_ret_t *r)