diff --git a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs index e3ff96b01a..635b71a023 100644 --- a/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs +++ b/src/BizHawk.Emulation.Cores/Computers/DOS/DOSBox.cs @@ -37,6 +37,10 @@ namespace BizHawk.Emulation.Cores.Computers.DOS private readonly List _romAssets; private readonly List _discAssets; private const int _messageDuration = 4; + private const double _wAspect = 4.0; + private const double _hAspect = 3.0; + private int _correctedWidth = LibDOSBox.VGA_MAX_WIDTH; + private int _correctedHeight = LibDOSBox.VGA_MAX_HEIGHT; // Drive management variables private List _floppyDiskImageFiles = new List(); @@ -54,8 +58,9 @@ namespace BizHawk.Emulation.Cores.Computers.DOS private List _cdRomFileNames = new List(); private Dictionary _cdRomFileToReaderMap = new Dictionary(); private readonly LibDOSBox.CDReadCallback _CDReadCallback; - - public override int VirtualWidth => BufferHeight * 4 / 3; + + public override int VirtualWidth => _correctedWidth; + public override int VirtualHeight => _correctedHeight; // Image selection / swapping variables @@ -537,6 +542,12 @@ namespace BizHawk.Emulation.Cores.Computers.DOS { DriveLightOn = _libDOSBox.GetDriveActivityFlag(); + // never shrink the virtual buffer + _correctedHeight = BufferWidth > BufferHeight * _wAspect / _hAspect + ? (int)Math.Round(BufferWidth * _hAspect / _wAspect) + : BufferHeight; + _correctedWidth = (int)Math.Round(VirtualHeight * _wAspect / _hAspect); + // Checking refresh rate base on the reported refresh rate updates var currentRefreshRateNumerator = VsyncNumerator; var currentRefreshRateDenominator = VsyncDenominator;