all repos — mgba @ 5a1ec94b02758b2fc4528572dda54ac0d648ef64

mGBA Game Boy Advance Emulator

mGUI: Add mute (closes #1494)
Vicki Pfau vi@endrift.com
Mon, 17 Aug 2020 17:51:27 -0700
commit

5a1ec94b02758b2fc4528572dda54ac0d648ef64

parent

37ef9c6d83ec080c00fc9858856b998bef8b185e

4 files changed, 21 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -2,6 +2,7 @@ 0.9.0: (Future)

Features: - e-Reader card scanning - Add WebP and APNG recording + - Add mute option in homebrew ports - Support for unlicensed Pokemon Jade/Diamond Game Boy mapper - Support for unlicensed BBD Game Boy mapper - Support for unlicensed Hitek Game Boy mapper
M src/feature/gui/gui-config.csrc/feature/gui/gui-config.c

@@ -82,6 +82,16 @@ },

.nStates = 2 }; *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { + .title = "Mute", + .data = "mute", + .submenu = 0, + .state = false, + .validStates = (const char*[]) { + "Off", "On" + }, + .nStates = 2 + }; + *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { .title = "Use BIOS if found", .data = "useBios", .submenu = 0,

@@ -91,10 +101,12 @@ "Off", "On"

}, .nStates = 2 }; +#ifdef M_CORE_GBA *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { .title = "Select GBA BIOS path", .data = "gba.bios", }; +#endif #ifdef M_CORE_GB *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { .title = "Select GB BIOS path",
M src/feature/gui/gui-runner.csrc/feature/gui/gui-runner.c

@@ -56,6 +56,7 @@ [mGUI_INPUT_SCREEN_MODE] = "Screen mode",

[mGUI_INPUT_SCREENSHOT] = "Take screenshot", [mGUI_INPUT_FAST_FORWARD_HELD] = "Fast forward (held)", [mGUI_INPUT_FAST_FORWARD_TOGGLE] = "Fast forward (toggle)", + [mGUI_INPUT_MUTE_TOGGLE] = "Mute (toggle)", }, .nKeys = GUI_INPUT_MAX };

@@ -489,6 +490,11 @@ runner->setFrameLimiter(runner, false);

} else { runner->setFrameLimiter(runner, true); } + } + if (guiKeys & (1 << mGUI_INPUT_MUTE_TOGGLE)) { + int mute = !runner->core->opts.mute; + mCoreConfigSetUIntValue(&runner->config, "mute", mute); + runner->core->reloadConfigOption(runner->core, "mute", &runner->config); } uint16_t keys = runner->pollGameInput(runner); if (runner->prepareForFrame) {
M src/feature/gui/gui-runner.hsrc/feature/gui/gui-runner.h

@@ -23,7 +23,8 @@ mGUI_INPUT_DECREASE_BRIGHTNESS,

mGUI_INPUT_SCREEN_MODE, mGUI_INPUT_SCREENSHOT, mGUI_INPUT_FAST_FORWARD_HELD, - mGUI_INPUT_FAST_FORWARD_TOGGLE + mGUI_INPUT_FAST_FORWARD_TOGGLE, + mGUI_INPUT_MUTE_TOGGLE, }; struct mGUIBackground {