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); } }