From 757e3fc06a32641c1077a6023a46e4ff41245b66 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 27 Dec 2016 13:59:01 -0800 Subject: Clear interrupt status flags after getting the status register value rather than before --- sms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sms.c') diff --git a/sms.c b/sms.c index 9ca96d6..5e3b9a9 100644 --- a/sms.c +++ b/sms.c @@ -56,9 +56,10 @@ static uint8_t vdp_read(uint32_t location, void *vcontext) sms_context *sms = z80->system; vdp_run_context(sms->vdp, z80->current_cycle); if (location & 1) { + uint8_t ret = vdp_control_port_read(sms->vdp); sms->vdp->flags2 &= ~(FLAG2_VINT_PENDING|FLAG2_HINT_PENDING); update_interrupts(sms); - return vdp_control_port_read(sms->vdp); + return ret; } else { return vdp_data_port_read(sms->vdp); } -- cgit v1.2.3