diff vdp.c @ 333:f16136a3835d

Update Z80 vint timing
author Mike Pavone <pavone@retrodev.com>
date Tue, 14 May 2013 00:40:10 -0700
parents 671a5be51522
children 4c91470e1a53
line wrap: on
line diff
--- a/vdp.c	Tue May 14 00:28:45 2013 -0700
+++ b/vdp.c	Tue May 14 00:40:10 2013 -0700
@@ -1572,6 +1572,18 @@
 	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) {