summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNebuleon <nebuleon@alakazam>2014-05-25 01:08:18 +0000
committerNebuleon <nebuleon@alakazam>2014-05-25 01:28:00 +0000
commite8c989e23bf3140abacaa55a173e6141437cd63b (patch)
treec80db5209a5620f45cbd593b696070fb1cee19f2
parent5e8f59188b3f24cac1da9716cf12021f7476a75d (diff)
downloadReGBA-e8c989e23bf3140abacaa55a173e6141437cd63b.zip
ReGBA-e8c989e23bf3140abacaa55a173e6141437cd63b.tar.gz
ReGBA-e8c989e23bf3140abacaa55a173e6141437cd63b.tar.bz2
GCW Zero: Allow Start+Select to enter the menu as well as Power.
This implements the unified emulator menu buttons requested by the community at Dingoonity. It also disables the prior Menu hotkeys set by users in the interface. The manuals in English and French are updated. The manual in Spanish is not.
-rw-r--r--source/opendingux/data/manual-en.txt2
-rw-r--r--source/opendingux/data/manual-fr.txt2
-rw-r--r--source/opendingux/gui.c24
-rw-r--r--source/opendingux/od-input.c11
4 files changed, 29 insertions, 10 deletions
diff --git a/source/opendingux/data/manual-en.txt b/source/opendingux/data/manual-en.txt
index 5943640..5479dc0 100644
--- a/source/opendingux/data/manual-en.txt
+++ b/source/opendingux/data/manual-en.txt
@@ -33,7 +33,7 @@ While playing a game, the default button bindings allow the use of everything on
Saved data is written a short period of time after saving in a GBA game's menus, meaning that your save is likely not lost if ReGBA crashes. However, running out of battery power or the kernel crashing can cause corrupted saves. See the 'Files' section for more information.
== Entering the ReGBA Main Menu ==
-To properly leave ReGBA after emulating a ROM, or to change settings for emulation, you need to enter the ReGBA Main Menu. By default, the top face button (Y on the GCW Zero, or X on the Dingoo A320) does this. On the GCW Zero, raising the Power switch also allows entering the menu. It needs to be pressed on its own; pressing it while any other button is pressed will not do anything. This is to allow hotkeys to use the same buttons and not trigger the Main Menu.
+To properly leave ReGBA after emulating a ROM, or to change settings for emulation, you need to enter the ReGBA Main Menu. On the GCW Zero, flicking the Power switch upwards or pressing the Start and Select buttons at once does this. On the Dingoo A320, pressing X does this. X needs to be pressed on its own; pressing it while any other button is pressed will not do anything. This is to allow hotkeys to use the same buttons and not trigger the Main Menu.
- Using per-game settings -
In the Main Menu or any submenu containing options, you can press the Select key to enter a variation of the menu in which you can make changes to the options only for the current ROM. Press Select again to return to the variation of the menu that affects the defaults. The title of the per-game menu will contain "for <game name>". Once you make the first override, a per-game configuration will be created. See 'Files' for more information.
diff --git a/source/opendingux/data/manual-fr.txt b/source/opendingux/data/manual-fr.txt
index b19f0d8..2ba6858 100644
--- a/source/opendingux/data/manual-fr.txt
+++ b/source/opendingux/data/manual-fr.txt
@@ -32,7 +32,7 @@ Lorsque vous jouez à un jeu, les affectations de boutons par défaut permettent
Les données sauvegardées sont écrites peu après que vous ayez sauvegardé dans le menu d'un jeu, ce qui signifie que votre partie n'est peut-être pas perdue si ReGBA plante. Par contre, si votre pile s'épuise ou que le noyau Linux plante, les données risquent d'être corrompues. Voir la section 'Fichiers' pour plus d'informations.
== Entrer dans le Menu Principal de ReGBA ==
-Pour sortir de ReGBA après avoir émulé une ROM, ou pour changer les réglages, vous devez entrer dans le Menu Principal de ReGBA. Par défaut, le bouton en façade supérieur (Y sur la GCW Zero, X sur la Dingoo A320) déclenche cette fonction. Sur la GCW Zero, monter l'interrupteur de mise en marche permet aussi d'entrer dans le menu. Si vous appuyez sur d'autres boutons en même temps, le menu n'apparaîtra pas. Ceci permet aux raccourcis d'utiliser le bouton en combinaison avec d'autres sans déclencher celui du menu.
+Pour sortir de ReGBA après avoir émulé une ROM, ou pour changer les réglages, vous devez entrer dans le Menu Principal de ReGBA. Sur la GCW Zero, monter l'interrupteur de mise en marche ou appuyer sur Start et Select en même temps déclenche cette fonction. Sur la Dingoo A320, c'est le bouton X. Si vous appuyez sur d'autres boutons en même temps que X, le menu n'apparaîtra pas. Ceci permet aux raccourcis d'utiliser le bouton en combinaison avec d'autres sans déclencher celui du menu.
- Utilisation de réglages par jeu -
Dans le Menu Principal ou tout sous-menu comportant des options, vous pouvez appuyer sur Select pour entrer dans une version du menu qui modifie les options pour seulement la ROM actuelle. Appuyez de nouveau sur Select pour retourner à la version du menu qui affecte les options par défaut. Le titre du menu par jeu comportera "for <nom du jeu>". Une fois votre première modification effectuée, un fichier de configuration par jeu sera créé. Voir la section 'Fichiers' pour plus d'information.
diff --git a/source/opendingux/gui.c b/source/opendingux/gui.c
index f96c2c8..753b2fc 100644
--- a/source/opendingux/gui.c
+++ b/source/opendingux/gui.c
@@ -1325,10 +1325,12 @@ static struct MenuEntry HotkeyMenu_FastForward = {
ENTRY_OPTIONAL_HOTKEY
};
+#if !defined GCW_ZERO
static struct MenuEntry HotkeyMenu_Menu = {
ENTRY_OPTION("hotkey_menu", "Menu", &Hotkeys[1]),
ENTRY_MANDATORY_HOTKEY
};
+#endif
static struct MenuEntry PerGameHotkeyMenu_FastForwardToggle = {
ENTRY_OPTION("hotkey_fast_forward_toggle", "Fast-forward toggle", &PerGameHotkeys[2]),
@@ -1366,7 +1368,14 @@ static struct Menu PerGameHotkeyMenu = {
static struct Menu HotkeyMenu = {
.Parent = &MainMenu, .Title = "Hotkeys",
.AlternateVersion = &PerGameHotkeyMenu,
- .Entries = { &HotkeyMenu_Menu, &HotkeyMenu_FastForward, &HotkeyMenu_FastForwardToggle, &HotkeyMenu_QuickLoadState, &HotkeyMenu_QuickSaveState, NULL }
+ .Entries = {
+#if !defined GCW_ZERO
+ &HotkeyMenu_Menu,
+#else
+ &Strut,
+#endif
+ &HotkeyMenu_FastForward, &HotkeyMenu_FastForwardToggle, &HotkeyMenu_QuickLoadState, &HotkeyMenu_QuickSaveState, NULL
+ }
};
// -- Saved States --
@@ -1471,6 +1480,14 @@ u32 ReGBA_Menu(enum ReGBA_MenuEntryReason EntryReason)
SDL_PauseAudio(SDL_ENABLE);
MainMenu.UserData = copy_screen();
ScaleModeUnapplied();
+
+ // Avoid entering the menu with menu keys pressed (namely the one bound to
+ // the per-game option switching key, Select).
+ while (ReGBA_GetPressedButtons() != 0)
+ {
+ usleep(5000);
+ }
+
struct Menu *ActiveMenu = &MainMenu, *PreviousMenu = ActiveMenu;
if (MainMenu.InitFunction != NULL)
{
@@ -1637,11 +1654,6 @@ u32 ReGBA_Menu(enum ReGBA_MenuEntryReason EntryReason)
// the native exit button, B).
while (ReGBA_GetPressedButtons() != 0)
{
- // Draw.
- ReGBA_VideoFlip();
-
- // Wait. (This is for platforms on which flips don't wait for vertical
- // sync.)
usleep(5000);
}
diff --git a/source/opendingux/od-input.c b/source/opendingux/od-input.c
index ced3631..b6c242b 100644
--- a/source/opendingux/od-input.c
+++ b/source/opendingux/od-input.c
@@ -291,11 +291,18 @@ enum ReGBA_Buttons ReGBA_GetPressedButtons()
if ((Result & REGBA_BUTTON_UP) && (Result & REGBA_BUTTON_DOWN))
Result &= ~REGBA_BUTTON_UP;
+ if (
+#if defined GCW_ZERO
+ // Unified emulator menu buttons: Start+Select
+ ((LastButtons & (OPENDINGUX_BUTTON_START | OPENDINGUX_BUTTON_SELECT)) == (OPENDINGUX_BUTTON_START | OPENDINGUX_BUTTON_SELECT))
+#else
// The ReGBA Menu key should be pressed if ONLY the hotkey bound to it
// is pressed on the native device.
// This is not in ProcessSpecialKeys because REGBA_BUTTON_MENU needs to
// be returned by ReGBA_GetPressedButtons.
- if (LastButtons == Hotkeys[1] || (LastButtons & OPENDINGUX_BUTTON_MENU))
+ LastButtons == Hotkeys[1]
+#endif
+ || (LastButtons & OPENDINGUX_BUTTON_MENU))
Result |= REGBA_BUTTON_MENU;
return Result;
@@ -326,7 +333,7 @@ enum OpenDingux_Buttons GetPressedOpenDinguxButtons()
LastButtons = CurButtons;
CurButtons = FutureButtons;
- return LastButtons;
+ return LastButtons & ~OPENDINGUX_BUTTON_MENU;
}
static void EnsureJoystick()