Skip to content

Commit

Permalink
Don't "shrink" internal upscaled buffers with a smaller virtual width…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
CasualPokePlayer committed Sep 19, 2024
1 parent e568305 commit 67cba14
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 67cba14

Please sign in to comment.