From a5ee22f1f54069c92c7e255f3a7c21244c88aabc Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Tue, 14 May 2013 00:40:10 -0700 Subject: Update Z80 vint timing --- vdp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vdp.c') diff --git a/vdp.c b/vdp.c index 881d54f..1ef315f 100644 --- a/vdp.c +++ b/vdp.c @@ -1572,6 +1572,18 @@ uint32_t vdp_next_vint(vdp_context * context) return vcycle; } +uint32_t vdp_next_vint_z80(vdp_context * context) +{ + uint32_t active_lines = context->latched_mode & BIT_PAL ? PAL_ACTIVE : NTSC_ACTIVE; + uint32_t vcycle = MCLKS_LINE * active_lines; + if (context->latched_mode & BIT_H40) { + vcycle += VINT_CYCLE_H40; + } else { + vcycle += VINT_CYCLE_H32; + } + return vcycle; +} + void vdp_int_ack(vdp_context * context, uint16_t int_num) { if (int_num == 6) { -- cgit v1.2.3