comparison sms.c @ 1126:63cd87d910cc

Clear interrupt status flags after getting the status register value rather than before
author Michael Pavone <pavone@retrodev.com>
date Tue, 27 Dec 2016 13:59:01 -0800
parents e9369d6f0101
children 6b5c92b6205c
comparison
equal deleted inserted replaced
1125:fba485949723 1126:63cd87d910cc
54 { 54 {
55 z80_context *z80 = vcontext; 55 z80_context *z80 = vcontext;
56 sms_context *sms = z80->system; 56 sms_context *sms = z80->system;
57 vdp_run_context(sms->vdp, z80->current_cycle); 57 vdp_run_context(sms->vdp, z80->current_cycle);
58 if (location & 1) { 58 if (location & 1) {
59 uint8_t ret = vdp_control_port_read(sms->vdp);
59 sms->vdp->flags2 &= ~(FLAG2_VINT_PENDING|FLAG2_HINT_PENDING); 60 sms->vdp->flags2 &= ~(FLAG2_VINT_PENDING|FLAG2_HINT_PENDING);
60 update_interrupts(sms); 61 update_interrupts(sms);
61 return vdp_control_port_read(sms->vdp); 62 return ret;
62 } else { 63 } else {
63 return vdp_data_port_read(sms->vdp); 64 return vdp_data_port_read(sms->vdp);
64 } 65 }
65 } 66 }
66 67