clean up dac code a bit
[picodrive.git] / pico / sms.c
index 1e1e748..7dc796e 100644 (file)
@@ -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,8 +255,16 @@ 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];