From e34c529f7edda021bcf6121b503eaf2f62eb9481 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 5 Jun 2019 12:55:30 -0700 Subject: [PATCH] Ports: Ability to enable or disable all SGB features (closes #1205) --- CHANGES | 1 + src/feature/gui/gui-config.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a96f51dcb..1dbc740ea 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ Features: - Interframe blending for games that use flicker effects - Frame inspector for dissecting and debugging rendering - Switch: Option to use built-in brightness sensor for Boktai + - Ports: Ability to enable or disable all SGB features (closes mgba.io/i/1205) Emulation fixes: - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208) - GBA: Reset now reloads multiboot ROMs diff --git a/src/feature/gui/gui-config.c b/src/feature/gui/gui-config.c index 484465b43..4695115a3 100644 --- a/src/feature/gui/gui-config.c +++ b/src/feature/gui/gui-config.c @@ -118,6 +118,20 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t }, .nStates = 2 }; + *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { + .title = "Enable SGB features", + .data = "sgb.model", + .submenu = 0, + .state = true, + .validStates = (const char*[]) { + "Off", "On" + }, + .stateMappings = (const struct GUIVariant[]) { + GUI_V_S("DMG"), + GUI_V_S("SGB"), + }, + .nStates = 2 + }; *GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) { .title = "Enable SGB borders", .data = "sgb.borders", @@ -173,8 +187,6 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t continue; } if (item->stateMappings) { - item->state = 0; - size_t j; for (j = 0; j < item->nStates; ++j) { const struct GUIVariant* v = &item->stateMappings[j];