From 67cba14e38de721fb5b483ad1fce1f33e93e4923 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Thu, 19 Sep 2024 01:42:48 -0700 Subject: [PATCH] Don't "shrink" internal upscaled buffers with a smaller virtual width/height while this did "work", and mimicked other emulators handling internal upscaling, it was a hack, and ends up causing issue with lua padding. it is also more unneeded now that #4029 (makes the UX of a sudden "large window" more managable) and #4011 (allowing for mimicking the frozen smaller window state) are merged resolves #4039 --- .../Consoles/Nintendo/3DS/Encore.IEmulator.cs | 1 - .../Consoles/Nintendo/3DS/Encore.IVideoProvider.cs | 6 ++---- .../Consoles/Nintendo/NDS/MelonDS.IGLTextureProvider.cs | 4 ++-- .../Consoles/Nintendo/NDS/MelonDS.ISettable.cs | 4 +--- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IEmulator.cs index e7cd7bf60e4..1ae176e10e3 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IEmulator.cs @@ -53,7 +53,6 @@ public bool FrameAdvance(IController controller, bool render, bool renderSound = private void OnVideoRefresh() { - _core.Encore_GetVideoVirtualDimensions(_context, out _encoreVideoProvider.VW, out _encoreVideoProvider.VH); _core.Encore_GetVideoBufferDimensions(_context, out _encoreVideoProvider.BW, out _encoreVideoProvider.BH); _encoreVideoProvider.VideoDirty = true; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs index 246b026d231..1dfb1efe012 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/3DS/Encore.IVideoProvider.cs @@ -4,8 +4,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.N3DS { public class EncoreVideoProvider : IVideoProvider { - internal int VW = 400; - internal int VH = 480; internal int BW = 400; internal int BH = 480; internal bool VideoDirty; @@ -20,8 +18,8 @@ public EncoreVideoProvider(LibEncore core, IntPtr context) } // ReSharper disable ConvertToAutoPropertyWhenPossible - public int VirtualWidth => VW; - public int VirtualHeight => VH; + public int VirtualWidth => BW; + public int VirtualHeight => BH; public int BufferWidth => BW; public int BufferHeight => BH; public int VsyncNumerator => 268111856; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IGLTextureProvider.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IGLTextureProvider.cs index f93f6dc12e7..ce5d91ab812 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IGLTextureProvider.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IGLTextureProvider.cs @@ -33,8 +33,8 @@ public int[] GetVideoBuffer() return vb; } - public int VirtualWidth { get; internal set; } - public int VirtualHeight { get; internal set; } + public int VirtualWidth => _vp.BufferWidth; + public int VirtualHeight => _vp.BufferHeight; public int BufferWidth => _vp.BufferWidth; public int BufferHeight => _vp.BufferHeight; public int VsyncNumerator => _vp.VsyncNumerator; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs index b0a22006f4c..563ec856c21 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.ISettable.cs @@ -474,12 +474,10 @@ private void RefreshScreenSettings(NDSSettings settings) }; _openGLProvider.ActivateGLContext(_glContext); // SetScreenSettings will re-present the frame, so needs OpenGL context active - _core.SetScreenSettings(_console, ref screenSettings, out var w , out var h, out var vw, out var vh); + _core.SetScreenSettings(_console, ref screenSettings, out var w , out var h, out _, out _); BufferWidth = w; BufferHeight = h; - _glTextureProvider.VirtualWidth = vw; - _glTextureProvider.VirtualHeight = vh; _glTextureProvider.VideoDirty = true; }