changeset 921:2be771c4dfbd

After reviewing the results of my test ROM again it seems pretty clear that the VBlank flag gets set at the same time as the vcounter changes
author Michael Pavone <pavone@retrodev.com>
date Tue, 26 Jan 2016 19:23:10 -0800
parents e64168bb2b25
children 913a6336ce20
files vdp.c
diffstat 1 files changed, 1 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/vdp.c	Sun Jan 17 14:46:12 2016 -0800
+++ b/vdp.c	Tue Jan 26 19:23:10 2016 -0800
@@ -1692,22 +1692,7 @@
 	uint32_t line= context->vcounter;
 	uint32_t slot = context->hslot;
 	uint32_t inactive_start = (context->latched_mode & BIT_PAL ? PAL_INACTIVE_START : NTSC_INACTIVE_START);
-	if (
-		(
-			line > inactive_start
-			&& line < 0x1FF
-		)
-		|| (line == inactive_start
-			&& (
-				slot >= (context->regs[REG_MODE_4] & BIT_H40 ? VBLANK_START_H40 : VBLANK_START_H32)
-				|| slot < (context->regs[REG_MODE_4] & BIT_H40 ? LINE_CHANGE_H40 : LINE_CHANGE_H32)
-			)
-		)
-		|| (line == 0x1FF
-			&& slot < (context->regs[REG_MODE_4] & BIT_H40 ? VBLANK_START_H40 : VBLANK_START_H32))
-			&& slot >= (context->regs[REG_MODE_4] & BIT_H40 ? LINE_CHANGE_H40 : LINE_CHANGE_H32)
-		|| !(context->regs[REG_MODE_2] & BIT_DISP_EN)
-	) {
+	if ((line >= inactive_start && line < 0x1FF) || !(context->regs[REG_MODE_2] & BIT_DISP_EN)) {
 		value |= 0x8;
 	}
 	if (context->regs[REG_MODE_4] & BIT_H40) {