diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-12-27 13:59:01 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-12-27 13:59:01 -0800 |
commit | 757e3fc06a32641c1077a6023a46e4ff41245b66 (patch) | |
tree | 6ae6df4b2295934b741c1daa3b18854753b8f53f | |
parent | 4985c875c2548682fcf3bc31663ec8e8515750d1 (diff) |
Clear interrupt status flags after getting the status register value rather than before
-rw-r--r-- | sms.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } |