From 256ee94297b0e807771cfc445646f78853fc1cfd Mon Sep 17 00:00:00 2001 From: DaMarkov <35939509+DaMarkov@users.noreply.github.com> Date: Sat, 26 Mar 2022 16:23:33 +0100 Subject: [PATCH] Added Function to set Overscan (#13) * Added `gfx_set_overscan` to set overscan in GLideN64. * Set overscan as default. Co-authored-by: DaMarkov --- src/Config.cpp | 13 +++++++++++++ src/native/Native.cpp | 12 ++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index 06d5f0eb..68dd540c 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -87,7 +87,20 @@ void Config::resetToDefaults() #else frameBufferEmulation.fbInfoDisabled = 1; #endif + +#ifdef NATIVE + frameBufferEmulation.enableOverscan = 1; + config.frameBufferEmulation.overscanPAL.left = 4; + config.frameBufferEmulation.overscanPAL.right = 4; + config.frameBufferEmulation.overscanPAL.top = 0; + config.frameBufferEmulation.overscanPAL.bottom = 3; + config.frameBufferEmulation.overscanNTSC.left = 4; + config.frameBufferEmulation.overscanNTSC.right = 4; + config.frameBufferEmulation.overscanNTSC.top = 0; + config.frameBufferEmulation.overscanNTSC.bottom = 3; +#else frameBufferEmulation.enableOverscan = 0; +#endif textureFilter.txFilterMode = 0; textureFilter.txEnhancementMode = 0; diff --git a/src/native/Native.cpp b/src/native/Native.cpp index 5409a589..7078b2c9 100644 --- a/src/native/Native.cpp +++ b/src/native/Native.cpp @@ -175,8 +175,16 @@ extern "C" { g_width = newWidth; } - bool gfx_force_43_enabled() { - return config.frameBufferEmulation.aspect == 1; + void gfx_set_overscan(int left, int top, int right, int bottom) { + config.frameBufferEmulation.enableOverscan = 1; + config.frameBufferEmulation.overscanPAL.left = left; + config.frameBufferEmulation.overscanPAL.right = right; + config.frameBufferEmulation.overscanPAL.top = top; + config.frameBufferEmulation.overscanPAL.bottom = bottom; + config.frameBufferEmulation.overscanNTSC.left = left; + config.frameBufferEmulation.overscanNTSC.right = right; + config.frameBufferEmulation.overscanNTSC.top = top; + config.frameBufferEmulation.overscanNTSC.bottom = bottom; } void gfx_shutdown() {