diff options
author | Nebuleon Fumika | 2013-02-14 16:24:42 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-02-14 16:24:42 -0500 |
commit | 52b11e6c1cc54962c195cf97e4e6b71b635a9784 (patch) | |
tree | c2caf7bba61f6cb14a3af42c32f6cdf4fa82479e /source | |
parent | 11c08d9d8f28d1abd2d36d658a8e10515ac05228 (diff) | |
download | snesemu-52b11e6c1cc54962c195cf97e4e6b71b635a9784.tar.gz snesemu-52b11e6c1cc54962c195cf97e4e6b71b635a9784.tar.bz2 snesemu-52b11e6c1cc54962c195cf97e4e6b71b635a9784.zip |
Adjust hotkeys to allow using the directional pad for them. Suggested usage is L+Up, R+Up, etc.
Diffstat (limited to 'source')
-rw-r--r-- | source/nds/draw.c | 5 | ||||
-rw-r--r-- | source/nds/gui.c | 28 |
2 files changed, 18 insertions, 15 deletions
diff --git a/source/nds/draw.c b/source/nds/draw.c index 3eab510..19720e5 100644 --- a/source/nds/draw.c +++ b/source/nds/draw.c @@ -898,12 +898,11 @@ u32 draw_hotkey_dialog(enum SCREEN_ID screen, u32 sy, char *clear, char *cancel) // Now, while there are keys pressed, keep a tally of keys that have // been pressed. (IGNORE TOUCH AND LID! Otherwise, closing the lid or - // touching to get to the menu will do stuff the user doesn't expect. - // Also ignore the direction pad because every game uses it.) + // touching to get to the menu will do stuff the user doesn't expect.) u32 TotalKeys = 0; do { - TotalKeys |= inputdata.key & ~(KEY_TOUCH | KEY_LID | KEY_UP | KEY_DOWN | KEY_LEFT | KEY_RIGHT); + TotalKeys |= inputdata.key & ~(KEY_TOUCH | KEY_LID); // If there's a touch on either button, turn it into a // clear (A) or cancel (B) request. if (inputdata.key & KEY_TOUCH) diff --git a/source/nds/gui.c b/source/nds/gui.c index 17b2e47..2fca75c 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -103,10 +103,10 @@ const uint8 HOTKEY_R_DISPLAY[] = {0xD7, 0x8D, 0x00}; const uint8 HOTKEY_START_DISPLAY[] = {0xD7, 0x8E, 0x00}; const uint8 HOTKEY_SELECT_DISPLAY[] = {0xD7, 0x8F, 0x00}; // These are U+2190 and subsequent codepoints encoded in UTF-8. -const uint8 DIRECTION_LEFT_DISPLAY[] = {0xE2, 0x86, 0x90, 0x00}; -const uint8 DIRECTION_UP_DISPLAY[] = {0xE2, 0x86, 0x91, 0x00}; -const uint8 DIRECTION_RIGHT_DISPLAY[] = {0xE2, 0x86, 0x92, 0x00}; -const uint8 DIRECTION_DOWN_DISPLAY[] = {0xE2, 0x86, 0x93, 0x00}; +const uint8 HOTKEY_LEFT_DISPLAY[] = {0xE2, 0x86, 0x90, 0x00}; +const uint8 HOTKEY_UP_DISPLAY[] = {0xE2, 0x86, 0x91, 0x00}; +const uint8 HOTKEY_RIGHT_DISPLAY[] = {0xE2, 0x86, 0x92, 0x00}; +const uint8 HOTKEY_DOWN_DISPLAY[] = {0xE2, 0x86, 0x93, 0x00}; #define MAKE_MENU(name, init_function, passive_function, key_function, end_function, \ focus_option, screen_focus) \ @@ -3360,6 +3360,10 @@ u32 menu(u16 *screen, bool8 FirstInvocation) if (HotkeyBitfield & KEY_X) strcat(tmp_buf, HOTKEY_X_DISPLAY); if (HotkeyBitfield & KEY_START) strcat(tmp_buf, HOTKEY_START_DISPLAY); if (HotkeyBitfield & KEY_SELECT) strcat(tmp_buf, HOTKEY_SELECT_DISPLAY); + if (HotkeyBitfield & KEY_UP) strcat(tmp_buf, HOTKEY_UP_DISPLAY); + if (HotkeyBitfield & KEY_DOWN) strcat(tmp_buf, HOTKEY_DOWN_DISPLAY); + if (HotkeyBitfield & KEY_LEFT) strcat(tmp_buf, HOTKEY_LEFT_DISPLAY); + if (HotkeyBitfield & KEY_RIGHT) strcat(tmp_buf, HOTKEY_RIGHT_DISPLAY); PRINT_STRING_BG(down_screen_addr, tmp_buf, color, COLOR_TRANS, HOTKEY_CONTENT_X, 40 + display_option-> line_number*27); } @@ -4334,24 +4338,24 @@ int load_language_msg(char *filename, u32 language) dstLen += sizeof (HOTKEY_SELECT_DISPLAY) - 1; break; case 'u': - memcpy(&dst[dstLen], DIRECTION_UP_DISPLAY, sizeof (DIRECTION_UP_DISPLAY) - 1); + memcpy(&dst[dstLen], HOTKEY_UP_DISPLAY, sizeof (HOTKEY_UP_DISPLAY) - 1); srcChar++; - dstLen += sizeof (DIRECTION_UP_DISPLAY) - 1; + dstLen += sizeof (HOTKEY_UP_DISPLAY) - 1; break; case 'd': - memcpy(&dst[dstLen], DIRECTION_DOWN_DISPLAY, sizeof (DIRECTION_DOWN_DISPLAY) - 1); + memcpy(&dst[dstLen], HOTKEY_DOWN_DISPLAY, sizeof (HOTKEY_DOWN_DISPLAY) - 1); srcChar++; - dstLen += sizeof (DIRECTION_DOWN_DISPLAY) - 1; + dstLen += sizeof (HOTKEY_DOWN_DISPLAY) - 1; break; case 'l': - memcpy(&dst[dstLen], DIRECTION_LEFT_DISPLAY, sizeof (DIRECTION_LEFT_DISPLAY) - 1); + memcpy(&dst[dstLen], HOTKEY_LEFT_DISPLAY, sizeof (HOTKEY_LEFT_DISPLAY) - 1); srcChar++; - dstLen += sizeof (DIRECTION_LEFT_DISPLAY) - 1; + dstLen += sizeof (HOTKEY_LEFT_DISPLAY) - 1; break; case 'r': - memcpy(&dst[dstLen], DIRECTION_RIGHT_DISPLAY, sizeof (DIRECTION_RIGHT_DISPLAY) - 1); + memcpy(&dst[dstLen], HOTKEY_RIGHT_DISPLAY, sizeof (HOTKEY_RIGHT_DISPLAY) - 1); srcChar++; - dstLen += sizeof (DIRECTION_RIGHT_DISPLAY) - 1; + dstLen += sizeof (HOTKEY_RIGHT_DISPLAY) - 1; break; case '\0': dst[dstLen] = pt[srcChar]; |