From 127e6e67015b4cedc8b69d5f3ca26b060356e981 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 28 May 2017 21:03:55 -0700 Subject: Implemented SMS pause button --- vdp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index f222b83..830ff41 100644 --- a/vdp.c +++ b/vdp.c @@ -1685,6 +1685,9 @@ static void vdp_advance_line(vdp_context *context) 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 @@ uint32_t vdp_next_vint_z80(vdp_context * context) 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 -- cgit v1.2.3