dsda: decide aspect once on init
This commit is contained in:
parent
4fd52088e4
commit
2d23183569
|
@ -23,24 +23,34 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
{
|
{
|
||||||
var videoBufferSrc = IntPtr.Zero;
|
var videoBufferSrc = IntPtr.Zero;
|
||||||
var palletteBufferSrc = IntPtr.Zero;
|
var palletteBufferSrc = IntPtr.Zero;
|
||||||
|
|
||||||
_core.dsda_get_video(out var width, out var height, out var pitch, ref videoBufferSrc, out var paletteSize, ref palletteBufferSrc);
|
_core.dsda_get_video(out var width, out var height, out var pitch, ref videoBufferSrc, out var paletteSize, ref palletteBufferSrc);
|
||||||
|
|
||||||
// Handling pallette buffer
|
var videoBuffer = (byte*) videoBufferSrc.ToPointer();
|
||||||
PaletteSize = paletteSize;
|
|
||||||
if (_palBuffer.Length < PaletteSize) _palBuffer = new int[PaletteSize];
|
|
||||||
var paletteBuffer = (int*) palletteBufferSrc.ToPointer();
|
var paletteBuffer = (int*) palletteBufferSrc.ToPointer();
|
||||||
for (var i = 0; i < _palBuffer.Length; i++) _palBuffer[i] = paletteBuffer[i];
|
PaletteSize = paletteSize;
|
||||||
|
|
||||||
// Handling video buffer
|
|
||||||
BufferWidth = width;
|
BufferWidth = width;
|
||||||
BufferHeight = height;
|
BufferHeight = height;
|
||||||
if (_vidBuff.Length < BufferWidth * BufferHeight) _vidBuff = new int[BufferWidth * BufferHeight];
|
|
||||||
var videoBuffer = (byte*) videoBufferSrc.ToPointer();
|
|
||||||
for (var i = 0; i < _vidBuff.Length; i++) _vidBuff[i] = _palBuffer[videoBuffer[i]];
|
|
||||||
|
|
||||||
VirtualHeight = _settings.InternalAspect == AspectRatio.Native
|
// Handling pallette buffer
|
||||||
? BufferWidth * 3 / 4
|
if (_palBuffer.Length < PaletteSize)
|
||||||
: BufferHeight;
|
{
|
||||||
|
_palBuffer = new int[PaletteSize];
|
||||||
|
}
|
||||||
|
for (var i = 0; i < _palBuffer.Length; i++)
|
||||||
|
{
|
||||||
|
_palBuffer[i] = paletteBuffer[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handling video buffer
|
||||||
|
if (_vidBuff.Length < BufferWidth * BufferHeight)
|
||||||
|
{
|
||||||
|
_vidBuff = new int[BufferWidth * BufferHeight];
|
||||||
|
}
|
||||||
|
for (var i = 0; i < _vidBuff.Length; i++)
|
||||||
|
{
|
||||||
|
_vidBuff[i] = _palBuffer[videoBuffer[i]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,20 +87,24 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
resolution = resolutions[resolutions.Length - 1];
|
resolution = resolutions[resolutions.Length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BufferWidth = resolution.X * multiplier;
|
||||||
|
BufferHeight = resolution.Y * multiplier;
|
||||||
|
VirtualHeight = _settings.InternalAspect == AspectRatio.Native
|
||||||
|
? BufferWidth * 3 / 4
|
||||||
|
: BufferHeight;
|
||||||
|
|
||||||
_configFile = Encoding.ASCII.GetBytes(
|
_configFile = Encoding.ASCII.GetBytes(
|
||||||
$"screen_resolution \"{
|
$"screen_resolution \"{BufferWidth}x{BufferHeight}\"\n"
|
||||||
resolution.X * multiplier}x{
|
|
||||||
resolution.Y * multiplier}\"\n"
|
|
||||||
// we need the core to treat native resolution as 4:3 aspect,
|
// we need the core to treat native resolution as 4:3 aspect,
|
||||||
// that ensures FOV is correct on higher resolutions
|
// that ensures FOV is correct on higher resolutions
|
||||||
+ $"render_aspect {(int)(_settings.InternalAspect == AspectRatio.Native
|
+ $"render_aspect {(int)(_settings.InternalAspect == AspectRatio.Native
|
||||||
? AspectRatio._4by3
|
? AspectRatio._4by3
|
||||||
: _settings.InternalAspect)}\n"
|
: _settings.InternalAspect)}\n"
|
||||||
+ $"render_wipescreen {(_syncSettings.RenderWipescreen ? 1 : 0)}\n"
|
+ $"render_wipescreen {(_syncSettings.RenderWipescreen ? 1 : 0)}\n"
|
||||||
+ "boom_translucent_sprites 0\n"
|
+ "render_stretch_hud 1\n" // patch_stretch_doom_format
|
||||||
|
+ "boom_translucent_sprites 0\n" // may become a setting at some point
|
||||||
+ "uncapped_framerate 0\n"
|
+ "uncapped_framerate 0\n"
|
||||||
+ "dsda_show_level_splits 0\n"
|
+ "dsda_show_level_splits 0\n"
|
||||||
+ "render_stretch_hud 1\n"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
_elf = new WaterboxHost(new WaterboxOptions
|
_elf = new WaterboxHost(new WaterboxOptions
|
||||||
|
@ -178,7 +182,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
_elf.Seal();
|
_elf.Seal();
|
||||||
}
|
}
|
||||||
|
|
||||||
// pull the default video size from the core
|
|
||||||
UpdateVideo();
|
UpdateVideo();
|
||||||
|
|
||||||
// Registering memory domains
|
// Registering memory domains
|
||||||
|
|
Loading…
Reference in New Issue