aboutsummaryrefslogtreecommitdiff
path: root/source/nds/entry.cpp
diff options
context:
space:
mode:
authorNebuleon Fumika2013-01-22 04:16:15 -0500
committerNebuleon Fumika2013-01-22 04:16:15 -0500
commit2cf733eef4323886e00a1e4788a2b3e803a797d7 (patch)
treec9fd2375c0bc7b8cb76bae04e5f9bc3ef1f6970a /source/nds/entry.cpp
parentf81781ae8cc8e849d6c91410da7d8e511b7bae5a (diff)
downloadsnes9x2005-2cf733eef4323886e00a1e4788a2b3e803a797d7.tar.gz
snes9x2005-2cf733eef4323886e00a1e4788a2b3e803a797d7.tar.bz2
snes9x2005-2cf733eef4323886e00a1e4788a2b3e803a797d7.zip
Add three hotkeys: temporary fast-forward, sound toggle and return to menu. These hotkeys can be overridden per game so that the global version of the hotkey can be ignored.
* Language file fixups related to \n (newlines). * Pictochat fixups: shorten START and SELECT to ST and SEL. Should still be recognisable.
Diffstat (limited to 'source/nds/entry.cpp')
-rw-r--r--source/nds/entry.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp
index 8cd5c06..13486b0 100644
--- a/source/nds/entry.cpp
+++ b/source/nds/entry.cpp
@@ -1064,6 +1064,8 @@ const unsigned int keymap[12] = {
};
*/
+static bool8 SoundToggleWasHeld = FALSE;
+
unsigned int S9xReadJoypad (int which1)
{
struct key_buf inputdata;
@@ -1082,9 +1084,31 @@ unsigned int S9xReadJoypad (int which1)
set_cpu_clock(clock_speed_number);
}
- if(inputdata.key & KEY_TOUCH) //Active menu
+ u32 HotkeyReturnToMenu = game_config.HotkeyReturnToMenu != 0 ? game_config.HotkeyReturnToMenu : emu_config.HotkeyReturnToMenu;
+ u32 HotkeyTemporaryFastForward = game_config.HotkeyTemporaryFastForward != 0 ? game_config.HotkeyTemporaryFastForward : emu_config.HotkeyTemporaryFastForward;
+ u32 HotkeyToggleSound = game_config.HotkeyToggleSound != 0 ? game_config.HotkeyToggleSound : emu_config.HotkeyToggleSound;
+
+ if(inputdata.key & KEY_TOUCH ||
+ (HotkeyReturnToMenu && ((inputdata.key & HotkeyReturnToMenu) == HotkeyReturnToMenu))
+ ) //Active menu
Settings.Paused = 1;
+ temporary_fast_forward =
+ (HotkeyTemporaryFastForward && ((inputdata.key & HotkeyTemporaryFastForward) == HotkeyTemporaryFastForward))
+ ;
+
+ bool8 SoundToggleIsHeld =
+ (HotkeyToggleSound && ((inputdata.key & HotkeyToggleSound) == HotkeyToggleSound))
+ ;
+
+ if (SoundToggleIsHeld && !SoundToggleWasHeld)
+ {
+ game_enable_audio = !game_enable_audio;
+ game_disableAudio();
+ }
+
+ SoundToggleWasHeld = SoundToggleIsHeld;
+
if(which1 < 1)
{
unsigned int key;