From e4506d5a3ef6c1bbf8181c29351fbe7c656213e5 Mon Sep 17 00:00:00 2001 From: TwinAphex51224 Date: Mon, 5 Mar 2012 17:32:55 +0100 Subject: [PATCH] (PS3) Keybind name LUT --- input/input_luts.c | 36 ++++++++++++++++++++++++++++++++++++ input/input_luts.h | 1 + ps3/menu-entries.h | 24 ++++++++++++------------ ps3/menu.h | 2 +- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/input/input_luts.c b/input/input_luts.c index d97b076a13..ed1821f824 100644 --- a/input/input_luts.c +++ b/input/input_luts.c @@ -87,6 +87,42 @@ uint64_t platform_keybind_lut[SSNES_LAST_PLATFORM_KEY+1] = CTRL_UP_MASK | CTRL_RSTICK_UP_MASK, CTRL_DOWN_MASK | CTRL_RSTICK_DOWN_MASK, }; + +char platform_keybind_name_lut[SSNES_LAST_PLATFORM_KEY+1][256] = +{ + "Circle button", + "Cross button", + "Triangle button", + "Square button", + "D-Pad Up", + "D-Pad Down", + "D-Pad Left", + "D-Pad Right", + "Select button", + "Start button", + "L1 button", + "L2 button", + "L3 button", + "R1 button", + "R2 button", + "R3 button", + "LStick Left", + "LStick Right", + "LStick Up", + "LStick Down", + "LStick D-Pad Left", + "LStick D-Pad Right", + "LStick D-Pad Up", + "LStick D-Pad Down", + "RStick Left", + "RStick Right", + "RStick Up", + "RStick Down", + "RStick D-Pad Left", + "RStick D-Pad Right", + "RStick D-Pad Up", + "RStick D-Pad Down" +}; #elif defined(_XBOX) #endif diff --git a/input/input_luts.h b/input/input_luts.h index bb470373e7..3455333aab 100644 --- a/input/input_luts.h +++ b/input/input_luts.h @@ -68,6 +68,7 @@ enum #endif uint64_t platform_keybind_lut[SSNES_LAST_PLATFORM_KEY+1]; +char platform_keybind_name_lut[SSNES_LAST_PLATFORM_KEY+1][256]; #endif extern uint64_t default_keybind_lut[SSNES_FIRST_META_KEY]; diff --git a/ps3/menu-entries.h b/ps3/menu-entries.h index 0db436b9f3..3997a7fe41 100644 --- a/ps3/menu-entries.h +++ b/ps3/menu-entries.h @@ -559,7 +559,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_CROSS, - "Cross button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_CROSS], "", 0.0f, 0.0f, @@ -573,7 +573,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_SQUARE, - "Square button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_SQUARE], "", 0.0f, 0.0f, @@ -587,7 +587,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_SELECT, - "Select button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_SELECT], "", 0.0f, 0.0f, @@ -601,7 +601,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_START, - "Start button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_START], "", 0.0f, 0.0f, @@ -615,7 +615,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_DPAD_UP, - "D-Pad Up", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_UP], "", 0.0f, 0.0f, @@ -629,7 +629,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_DPAD_DOWN, - "D-Pad Down", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_DOWN], "", 0.0f, 0.0f, @@ -643,7 +643,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_DPAD_LEFT, - "D-Pad Left", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_LEFT], "", 0.0f, 0.0f, @@ -657,7 +657,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_DPAD_RIGHT, - "D-Pad Right", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_RIGHT], "", 0.0f, 0.0f, @@ -671,7 +671,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_CIRCLE, - "Circle button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_CIRCLE], "", 0.0f, 0.0f, @@ -685,7 +685,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_TRIANGLE, - "Triangle button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_TRIANGLE], "", 0.0f, 0.0f, @@ -699,7 +699,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_L1, - "L1 button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_L1], "", 0.0f, 0.0f, @@ -713,7 +713,7 @@ static item items_generalsettings[MAX_NO_OF_CONTROLS_SETTINGS] = }, { SETTING_CONTROLS_BUTTON_R1, - "R1 button", + platform_keybind_name_lut[PS3_DEVICE_ID_JOYPAD_R1], "", 0.0f, 0.0f, diff --git a/ps3/menu.h b/ps3/menu.h index 8f0d580817..274721beda 100644 --- a/ps3/menu.h +++ b/ps3/menu.h @@ -22,7 +22,7 @@ typedef struct { uint32_t enum_id; /* enum ID of item */ - char text[256]; /* item label */ + const char * text; /* item label */ char setting_text[256]; /* setting label */ float text_xpos; /* text X position (upper left corner) */ float text_ypos; /* text Y position (upper left corner) */