dsda: remove the workaround because it broke the FOV

increase the resolution for 1x 16:9 instead
This commit is contained in:
feos 2025-05-31 00:51:07 +03:00
parent 8632e9d3be
commit 621ad8e454
1 changed files with 21 additions and 20 deletions

View File

@ -70,30 +70,31 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
foreach (var wadFile in _wadFiles) totalWadSize += (uint) wadFile.FileData.Length;
uint totalWadSizeKb = (totalWadSize / 1024) + 1;
Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory");
// we already send exact resolution, but we also have to send aspect
// to control the automatic side effects:
// - we need it to treat native resolution as 4:3 aspect,
// that ensures FOV is correct on higher resolutions.
// - but when we send a 16:9 resolution that's too low,
// the core won't extend the statusbar, so we send 16:10 aspect to work around that.
// and when picking resolution we use original AspectRatio value as index
var renderAspect = (int)( _settings.InternalAspect == AspectRatio.Native
? AspectRatio._4by3 : _settings.InternalAspect == AspectRatio._16by9
? AspectRatio._16by10 : _settings.InternalAspect);
// resolutions are divided by 3 because lowest 16:9 resolution whose width
// is a multiple of native (corrected or not) is 1280x720.
// to still support 1x as a basis for every aspect we use
// roughly 1/3 of that for 16:9 and 16:10. it looks bad on low resolutions
// but it's not meant for them anyway, so 3x is where it shines.
// to still support 1x as a basis for every aspect (including widescreen)
// we use roughly 1/3 of that for 16:9 and 16:10. it looks bad on low resolutions
// but it's not meant for them anyway - 3x is where it shines.
// so whoever wants vanilla feel will use 320x200 and upscale in frontend,
// and modern people will use widescreen on some high resolution
// and modern people will use widescreen at high resolutions
var width = _resolutions[(int)_settings.InternalAspect].X / 3 * _settings.ScaleFactor;
var height = _resolutions[(int)_settings.InternalAspect].Y / 3 * _settings.ScaleFactor;
// when instead using lowres 16:9, internal heuristics result in stretched status bar
// so we slightly increase the res to just above the threshold (while keeping it even)
if (_settings.InternalAspect == AspectRatio._16by9 && _settings.ScaleFactor == 1)
{
width += 2;
}
_configFile = Encoding.ASCII.GetBytes(
$"screen_resolution \"{
_resolutions[(int)_settings.InternalAspect].X * _settings.ScaleFactor / 3}x{
_resolutions[(int)_settings.InternalAspect].Y * _settings.ScaleFactor / 3}\"\n"
+ $"render_aspect {renderAspect}\n"
$"screen_resolution \"{width}x{height}\"\n"
// we need the core to treat native resolution as 4:3 aspect,
// that ensures FOV is correct on higher resolutions
+ $"render_aspect {(int)(_settings.InternalAspect == AspectRatio.Native
? AspectRatio._4by3
: _settings.InternalAspect)}\n"
+ $"render_wipescreen {(_syncSettings.RenderWipescreen ? 1 : 0)}\n"
+ "boom_translucent_sprites 0\n"
+ "render_stretch_hud 0\n"