[Core/VDP] fixed V28/V30 mode switching during active display (verified on real hardware)

This commit is contained in:
EkeEke 2013-10-20 23:40:00 +02:00
parent 42ea79cf73
commit 5d67b14cea
2 changed files with 16 additions and 13 deletions

View File

@ -404,11 +404,23 @@ void system_frame_gen(int do_skip)
/* active screen height */
if (reg[1] & 0x04)
{
bitmap.viewport.h = 224 + ((reg[1] & 0x08) << 1);
bitmap.viewport.y = (config.overscan & 1) * ((240 + 48*vdp_pal - bitmap.viewport.h) >> 1);
/* Mode 5 */
if (reg[1] & 0x08)
{
/* 240 active lines */
bitmap.viewport.h = 240;
bitmap.viewport.y = (config.overscan & 1) * 24 * vdp_pal;
}
else
{
/* 224 active lines */
bitmap.viewport.h = 224;
bitmap.viewport.y = (config.overscan & 1) * (8 + (24 * vdp_pal));
}
}
else
{
/* Mode 4 (192 active lines) */
bitmap.viewport.h = 192;
bitmap.viewport.y = (config.overscan & 1) * 24 * (vdp_pal + 1);
}

View File

@ -1659,17 +1659,8 @@ static void vdp_reg_w(unsigned int r, unsigned int d, unsigned int cycles)
/* Mode 5 only */
if (d & 0x04)
{
if (status & 8)
{
/* Changes should be applied on next frame */
bitmap.viewport.changed |= 2;
}
else
{
/* Update active display height */
bitmap.viewport.h = 224 + ((d & 8) << 1);
bitmap.viewport.y = (config.overscan & 1) * (8 - (d & 8) + 24*vdp_pal);
}
/* Changes should be applied on next frame */
bitmap.viewport.changed |= 2;
/* Update vertical counter max value */
vc_max = vc_table[(d >> 2) & 3][vdp_pal];