X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsms.c;h=7dc796ef4bec9ebd1021228124c47ac97c3e9ba7;hb=4f2cdbf551ad1a7f487b65b4754cbf7983e80b8a;hp=cc75bffd270979cf5d68f20245aafe745754ca81;hpb=b4db550e41b2aa277f570d7bff890c8e8ee1831f;p=picodrive.git diff --git a/pico/sms.c b/pico/sms.c index cc75bff..7dc796e 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -1,10 +1,16 @@ +/* + * SMS emulation + * (C) notaz, 2009-2010 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ /* * TODO: * - start in a state as if BIOS ran * - remaining status flags (OVR/COL) * - RAM support in mapper * - region support - * - Pause button (NMI) * - SN76496 DAC-like usage * - H counter */ @@ -249,14 +255,24 @@ void PicoFrameMS(void) int skip = PicoSkipFrame; int lines_vis = 192; int hint; // Hint counter + int nmi; int y; + PsndStartFrame(); + + nmi = (PicoPad[0] >> 7) & 1; + if (!Pico.ms.nmi_state && nmi) + z80_nmi(); + Pico.ms.nmi_state = nmi; + PicoFrameStartMode4(); hint = pv->reg[0x0a]; for (y = 0; y < lines; y++) { pv->v_counter = Pico.m.scanline = y; + if (y > 218) + pv->v_counter = y - 6; if (y < lines_vis && !skip) PicoLineMode4(y);