From 0a9137377b930b7a80200424db2bf3db806a3220 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 26 Jan 2016 19:23:10 -0800 Subject: 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 --- vdp.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/vdp.c b/vdp.c index b5a5713..b064b10 100644 --- a/vdp.c +++ b/vdp.c @@ -1692,22 +1692,7 @@ uint16_t vdp_control_port_read(vdp_context * context) 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) { -- cgit v1.2.3