From 5acf324fdf71f48f834aba9fa9c105664e4a061f Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:26:15 +0200 Subject: [PATCH] attempt to fix GPGX aspect ratio see #4042, not sure if this is fully correct yet --- .../Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs index 86face6854..257623b19e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.IVideoProvider.cs @@ -30,6 +30,14 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx var widthHasOverscan = (_syncSettings.Overscan & LibGPGX.InitSettings.OverscanType.Horizontal) != 0; var heightHasOverscan = (_syncSettings.Overscan & LibGPGX.InitSettings.OverscanType.Vertical) != 0; var isPal = Region == DisplayType.PAL; + bool isVdpPal = _syncSettings.ForceVDP switch + { + LibGPGX.ForceVDP.NTSC => false, + LibGPGX.ForceVDP.PAL => true, + _ => isPal + }; + double videoSampleRate = isVdpPal ? 14750000.0 : 135000000.0 / 11.0; + int clockRate = isPal ? 53203424 : 53693175; if (SystemId == VSystemID.Raw.GEN) { @@ -37,6 +45,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx VirtualHeight = 224; VirtualWidth += widthHasOverscan ? 28 : 0; VirtualHeight += heightHasOverscan ? (isPal ? 48 : 0) + 16 : 0; + + VirtualWidth = (int)(VirtualWidth * 4.0 * videoSampleRate / clockRate); } else { @@ -53,6 +63,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx VirtualWidth += widthHasOverscan ? 28 : 0; VirtualHeight += heightHasOverscan ? (isPal ? 96 : 48) : 0; } + + VirtualWidth = (int)(VirtualWidth * 5.0 * videoSampleRate / clockRate); } }