From dd1514cb8aa41d0071c1f756c86a0acbbbfa3a0e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 29 May 2019 15:13:55 -0700 Subject: [PATCH] Ports: Interframe blending menu option --- src/feature/gui/gui-config.c | 10 ++++++++++ src/platform/psp2/psp2-context.c | 5 +++-- src/platform/switch/main.c | 5 +++-- src/platform/wii/main.c | 5 +++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/feature/gui/gui-config.c b/src/feature/gui/gui-config.c index 7aa397833..484465b43 100644 --- a/src/feature/gui/gui-config.c +++ b/src/feature/gui/gui-config.c @@ -108,6 +108,16 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t .title = "Select SGB BIOS path", .data = "sgb.bios", }; + *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { + .title = "Interframe blending", + .data = "interframeBlending", + .submenu = 0, + .state = false, + .validStates = (const char*[]) { + "Off", "On" + }, + .nStates = 2 + }; *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { .title = "Enable SGB borders", .data = "sgb.borders", diff --git a/src/platform/psp2/psp2-context.c b/src/platform/psp2/psp2-context.c index b933dab4f..f33738e65 100644 --- a/src/platform/psp2/psp2-context.c +++ b/src/platform/psp2/psp2-context.c @@ -394,8 +394,9 @@ void mPSP2LoadROM(struct mGUIRunner* runner) { } int fakeBool; - mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool); - interframeBlending = fakeBool; + if (mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool)) { + interframeBlending = fakeBool; + } MutexInit(&audioContext.mutex); ConditionInit(&audioContext.cond); diff --git a/src/platform/switch/main.c b/src/platform/switch/main.c index 33e2b9298..86d6abdfb 100644 --- a/src/platform/switch/main.c +++ b/src/platform/switch/main.c @@ -289,8 +289,9 @@ static void _gameLoaded(struct mGUIRunner* runner) { } int fakeBool; - mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool); - interframeBlending = fakeBool; + if (mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool)) { + interframeBlending = fakeBool; + } rumble.up = 0; rumble.down = 0; diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index 1c2ab5ada..eea6b17d6 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -859,8 +859,9 @@ void _unpaused(struct mGUIRunner* runner) { } } int fakeBool; - mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool); - interframeBlending = fakeBool; + if (mCoreConfigGetIntValue(&runner->config, "interframeBlending", &fakeBool)) { + interframeBlending = fakeBool; + } float stretch; if (mCoreConfigGetFloatValue(&runner->config, "stretchWidth", &stretch)) {