diff vdp.c @ 1377:e587f16e7d3d

Implemented SMS pause button
author Michael Pavone <pavone@retrodev.com>
date Sun, 28 May 2017 21:03:55 -0700
parents 5b20840711c1
children 71c8b97eb962
line wrap: on
line diff
--- a/vdp.c	Sun May 28 21:02:47 2017 -0700
+++ b/vdp.c	Sun May 28 21:03:55 2017 -0700
@@ -1685,6 +1685,9 @@
 	if (context->state == PREPARING) {
 		context->state = ACTIVE;
 	}
+	if (context->vcounter == 0x1FF) {
+		context->flags2 &= ~FLAG2_PAUSE;
+	}
 
 	if (context->state != ACTIVE) {
 		context->hint_counter = context->regs[REG_HINT];
@@ -3383,6 +3386,19 @@
 	return context->cycles + cycles_to_vint;
 }
 
+uint32_t vdp_next_nmi(vdp_context *context)
+{
+	if (!(context->flags2 & FLAG2_PAUSE)) {
+		return 0xFFFFFFFF;
+	}
+	return context->cycles + vdp_cycles_to_line(context, 0x1FF);
+}
+
+void vdp_pbc_pause(vdp_context *context)
+{
+	context->flags2 |= FLAG2_PAUSE;
+}
+
 void vdp_int_ack(vdp_context * context)
 {
 	//CPU interrupt acknowledge is only used in Mode 5