mirror of https://github.com/mgba-emu/mgba.git
mGUI: Add mute (closes #1494)
This commit is contained in:
parent
37ef9c6d83
commit
5a1ec94b02
1
CHANGES
1
CHANGES
|
@ -2,6 +2,7 @@
|
|||
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
|
||||
|
|
|
@ -81,6 +81,16 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t
|
|||
},
|
||||
.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",
|
||||
|
@ -91,10 +101,12 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t
|
|||
},
|
||||
.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",
|
||||
|
|
|
@ -56,6 +56,7 @@ static const struct mInputPlatformInfo _mGUIKeyInfo = {
|
|||
[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
|
||||
};
|
||||
|
@ -490,6 +491,11 @@ void mGUIRun(struct mGUIRunner* runner, const char* path) {
|
|||
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) {
|
||||
runner->prepareForFrame(runner);
|
||||
|
|
|
@ -23,7 +23,8 @@ enum mGUIInput {
|
|||
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 {
|
||||
|
|
Loading…
Reference in New Issue