[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 committed by twinaphex
parent 50d3603c17
commit 1b0db486e7
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 */ /* active screen height */
if (reg[1] & 0x04) if (reg[1] & 0x04)
{ {
bitmap.viewport.h = 224 + ((reg[1] & 0x08) << 1); /* Mode 5 */
bitmap.viewport.y = (config.overscan & 1) * ((240 + 48*vdp_pal - bitmap.viewport.h) >> 1); if (reg[1] & 0x08)
{
/* 240 active lines */
bitmap.viewport.h = 240;
bitmap.viewport.y = (config.overscan & 1) * 24 * vdp_pal;
} }
else 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.h = 192;
bitmap.viewport.y = (config.overscan & 1) * 24 * (vdp_pal + 1); bitmap.viewport.y = (config.overscan & 1) * 24 * (vdp_pal + 1);
} }

View File

@ -1658,18 +1658,9 @@ static void vdp_reg_w(unsigned int r, unsigned int d, unsigned int cycles)
{ {
/* Mode 5 only */ /* Mode 5 only */
if (d & 0x04) if (d & 0x04)
{
if (status & 8)
{ {
/* Changes should be applied on next frame */ /* Changes should be applied on next frame */
bitmap.viewport.changed |= 2; 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);
}
/* Update vertical counter max value */ /* Update vertical counter max value */
vc_max = vc_table[(d >> 2) & 3][vdp_pal]; vc_max = vc_table[(d >> 2) & 3][vdp_pal];