From dcf4286d06f410440d807c183792f74d98ad5a4a Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Fri, 6 Jun 2025 05:06:30 +0300 Subject: [PATCH] Port bind turbo fire icon + label cleanup (#17979) --- intl/msg_hash_us.h | 2 +- menu/drivers/ozone.c | 210 +++++++++++++++++++++---------------------- menu/drivers/xmb.c | 69 +++++++------- menu/menu_driver.h | 2 +- 4 files changed, 136 insertions(+), 147 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 3220d8e938..49449d9f65 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -4421,7 +4421,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_TURBO, - "Turbo" + "Turbo Fire" ) /* Settings > Latency */ diff --git a/menu/drivers/ozone.c b/menu/drivers/ozone.c index 4002b0eb0c..99beeea8ee 100644 --- a/menu/drivers/ozone.c +++ b/menu/drivers/ozone.c @@ -2447,10 +2447,8 @@ static uintptr_t ozone_entries_icon_get_texture( } #ifdef HAVE_CHEEVOS - if ( - (type >= MENU_SETTINGS_CHEEVOS_START) && - (type < MENU_SETTINGS_NETPLAY_ROOMS_START) - ) + if ( type >= MENU_SETTINGS_CHEEVOS_START + && type < MENU_SETTINGS_NETPLAY_ROOMS_START) { char buffer[64]; int index = type - MENU_SETTINGS_CHEEVOS_START; @@ -2458,129 +2456,125 @@ static uintptr_t ozone_entries_icon_get_texture( if (badge_texture) return badge_texture; - /* no state means its a header - show the info icon */ + /* No state means it's a header, show info icon */ if (!rcheevos_menu_get_state(index, buffer, sizeof(buffer))) return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INFO]; - /* placeholder badge image was not found, show generic menu icon */ + /* Placeholder badge image was not found, show generic menu icon */ return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_ACHIEVEMENTS]; } #endif - if ( - (type >= MENU_SETTINGS_INPUT_BEGIN) && - (type <= MENU_SETTINGS_INPUT_DESC_KBD_END) - ) + if ( type >= MENU_SETTINGS_INPUT_BEGIN + && type <= MENU_SETTINGS_INPUT_DESC_KBD_END) + { + /* This part is only utilized by Input User # Binds */ + unsigned input_id; + if (type < MENU_SETTINGS_INPUT_DESC_BEGIN) { - /* This part is only utilized by Input User # Binds */ - unsigned input_id; - if (type < MENU_SETTINGS_INPUT_DESC_BEGIN) - { - input_id = MENU_SETTINGS_INPUT_BEGIN; - if (type == input_id) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_ADC]; + input_id = MENU_SETTINGS_INPUT_BEGIN; + if (type == input_id) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_ADC]; #ifdef HAVE_LIBNX - /* account for the additional split joycon option in Input User # Binds */ - input_id++; + /* Account for the additional split JoyCon option in Input Port # Binds */ + input_id++; #endif - if (type >= input_id + 1 && type <= input_id + 3) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SETTINGS]; - if (type == input_id + 4) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_MOUSE]; - if (type == input_id + 5) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BIND_ALL]; - if (type == input_id + 6) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_RELOAD]; - if (type == input_id + 7) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SAVING]; - if ((type > (input_id + 31)) && (type < (input_id + 43))) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LGUN]; - if (type == input_id + 43) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_TURBO]; - /* align to use the same code of Quickmenu controls*/ - input_id = input_id + 8; - } + if (type >= input_id + 1 && type <= input_id + 3) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SETTINGS]; + if (type == input_id + 4) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_MOUSE]; + if (type == input_id + 5) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BIND_ALL]; + if (type == input_id + 6) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_RELOAD]; + if (type == input_id + 7) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SAVING]; + if (type >= input_id + 32 && type <= input_id + 42) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LGUN]; + if (type == input_id + 43) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_TURBO]; + /* Align to use the same code of Quickmenu controls */ + input_id = input_id + 8; + } + else + { + /* Quickmenu controls repeats the same icons for all users */ + if (type < MENU_SETTINGS_INPUT_DESC_KBD_BEGIN) + input_id = MENU_SETTINGS_INPUT_DESC_BEGIN; else - { - /* Quickmenu controls repeats the same icons for all users*/ - if (type < MENU_SETTINGS_INPUT_DESC_KBD_BEGIN) - input_id = MENU_SETTINGS_INPUT_DESC_BEGIN; - else - input_id = MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; - while (type > (input_id + 23)) - input_id = (input_id + 24); + input_id = MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; + while (type > (input_id + 23)) + input_id = (input_id + 24); - /* Human readable bind order */ - if (type < (input_id + RARCH_ANALOG_BIND_LIST_END)) + /* Human readable bind order */ + if (type < (input_id + RARCH_ANALOG_BIND_LIST_END)) + { + unsigned index = 0; + int input_num = type - input_id; + for (index = 0; index < ARRAY_SIZE(input_config_bind_order); index++) { - unsigned index = 0; - int input_num = type - input_id; - for (index = 0; index < ARRAY_SIZE(input_config_bind_order); index++) + if (input_num == (int)input_config_bind_order[index]) { - if ((int)input_config_bind_order[index] == input_num) - { - type = input_id + index; - break; - } + type = input_id + index; + break; } } } - - /* This is utilized for both Input Binds and Quickmenu controls*/ - if (type == input_id) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_U]; - if (type == (input_id + 1)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_D]; - if (type == (input_id + 2)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_L]; - if (type == (input_id + 3)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_R]; - if (type == (input_id + 4)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D]; - if (type == (input_id + 5)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R]; - if (type == (input_id + 6)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L]; - if (type == (input_id + 7)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U]; - if (type == (input_id + 8)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SELECT]; - if (type == (input_id + 9)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_START]; - if (type == (input_id + 10)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LB]; - if (type == (input_id + 11)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_RB]; - if (type == (input_id + 12)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LT]; - if (type == (input_id + 13)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_RT]; - if (type == (input_id + 14)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_P]; - if (type == (input_id + 15)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_P]; - if (type == (input_id + 16)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_U]; - if (type == (input_id + 17)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_D]; - if (type == (input_id + 18)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_L]; - if (type == (input_id + 19)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_R]; - if (type == (input_id + 20)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_U]; - if (type == (input_id + 21)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_D]; - if (type == (input_id + 22)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_L]; - if (type == (input_id + 23)) - return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_R]; } - if ( - (type >= MENU_SETTINGS_REMAPPING_PORT_BEGIN) && - (type <= MENU_SETTINGS_REMAPPING_PORT_END) - ) + /* This is used for both Input Port Binds and Quickmenu controls */ + if (type == input_id) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_U]; + if (type == (input_id + 1)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_D]; + if (type == (input_id + 2)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_L]; + if (type == (input_id + 3)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_DPAD_R]; + if (type == (input_id + 4)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_D]; + if (type == (input_id + 5)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_R]; + if (type == (input_id + 6)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_L]; + if (type == (input_id + 7)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_BTN_U]; + if (type == (input_id + 8)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SELECT]; + if (type == (input_id + 9)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_START]; + if (type == (input_id + 10)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LB]; + if (type == (input_id + 11)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_RB]; + if (type == (input_id + 12)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_LT]; + if (type == (input_id + 13)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_RT]; + if (type == (input_id + 14)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_P]; + if (type == (input_id + 15)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_P]; + if (type == (input_id + 16)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_U]; + if (type == (input_id + 17)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_D]; + if (type == (input_id + 18)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_L]; + if (type == (input_id + 19)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_R]; + if (type == (input_id + 20)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_U]; + if (type == (input_id + 21)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_D]; + if (type == (input_id + 22)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_L]; + if (type == (input_id + 23)) + return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_STCK_R]; + } + + if ( type >= MENU_SETTINGS_REMAPPING_PORT_BEGIN + && type <= MENU_SETTINGS_REMAPPING_PORT_END) return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_INPUT_SETTINGS]; /* No icon by default */ diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index f68f391702..6376e05af2 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -4008,11 +4008,11 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, if (badge_texture) return badge_texture; - /* No state means its a header - show the info icon */ + /* No state means it's a header, show info icon */ if (!rcheevos_menu_get_state(index, buffer, sizeof(buffer))) return xmb->textures.list[XMB_TEXTURE_INFO]; - /* Placeholder badge image was not found, - show generic menu icon */ + + /* Placeholder badge image was not found, show generic menu icon */ return xmb->textures.list[XMB_TEXTURE_ACHIEVEMENTS]; } #endif @@ -4020,16 +4020,15 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, if ( type >= MENU_SETTINGS_INPUT_BEGIN && type <= MENU_SETTINGS_INPUT_DESC_KBD_END) { + /* This part is only utilized by Input User # Binds */ unsigned input_id; if (type < MENU_SETTINGS_INPUT_DESC_BEGIN) - /* Input User # Binds only */ { input_id = MENU_SETTINGS_INPUT_BEGIN; if (type == input_id) return xmb->textures.list[XMB_TEXTURE_INPUT_ADC]; #ifdef HAVE_LIBNX - /* Account for the additional split JoyCon - option in Input # Binds */ + /* Account for the additional split JoyCon option in Input Port # Binds */ input_id++; #endif if (type >= input_id + 1 && type <= input_id + 3) @@ -4042,7 +4041,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, return xmb->textures.list[XMB_TEXTURE_RELOAD]; if (type == input_id + 7) return xmb->textures.list[XMB_TEXTURE_SAVING]; - if ((type > (input_id + 31)) && (type < (input_id + 43))) + if (type >= input_id + 32 && type <= input_id + 42) return xmb->textures.list[XMB_TEXTURE_INPUT_LGUN]; if (type == input_id + 43) return xmb->textures.list[XMB_TEXTURE_INPUT_TURBO]; @@ -4051,8 +4050,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, } else { - /* Quickmenu controls repeats the same icons - for all users */ + /* Quickmenu controls repeats the same icons for all users */ if (type < MENU_SETTINGS_INPUT_DESC_KBD_BEGIN) input_id = MENU_SETTINGS_INPUT_DESC_BEGIN; else @@ -4065,9 +4063,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, { unsigned index = 0; int input_num = type - input_id; - for ( index = 0; - index < ARRAY_SIZE(input_config_bind_order); - index++) + for (index = 0; index < ARRAY_SIZE(input_config_bind_order); index++) { if (input_num == (int)input_config_bind_order[index]) { @@ -4078,55 +4074,54 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, } } - /* This is utilized for both Input # Binds - and Quickmenu controls */ + /* This is used for both Input Port Binds and Quickmenu controls */ if (type == input_id) return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_U]; - else if (type == (input_id + 1)) + if (type == (input_id + 1)) return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_D]; - else if (type == (input_id + 2)) + if (type == (input_id + 2)) return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_L]; - else if (type == (input_id + 3)) + if (type == (input_id + 3)) return xmb->textures.list[XMB_TEXTURE_INPUT_DPAD_R]; - else if (type == (input_id + 4)) + if (type == (input_id + 4)) return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_D]; - else if (type == (input_id + 5)) + if (type == (input_id + 5)) return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_R]; - else if (type == (input_id + 6)) + if (type == (input_id + 6)) return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_L]; - else if (type == (input_id + 7)) + if (type == (input_id + 7)) return xmb->textures.list[XMB_TEXTURE_INPUT_BTN_U]; - else if (type == (input_id + 8)) + if (type == (input_id + 8)) return xmb->textures.list[XMB_TEXTURE_INPUT_SELECT]; - else if (type == (input_id + 9)) + if (type == (input_id + 9)) return xmb->textures.list[XMB_TEXTURE_INPUT_START]; - else if (type == (input_id + 10)) + if (type == (input_id + 10)) return xmb->textures.list[XMB_TEXTURE_INPUT_LB]; - else if (type == (input_id + 11)) + if (type == (input_id + 11)) return xmb->textures.list[XMB_TEXTURE_INPUT_RB]; - else if (type == (input_id + 12)) + if (type == (input_id + 12)) return xmb->textures.list[XMB_TEXTURE_INPUT_LT]; - else if (type == (input_id + 13)) + if (type == (input_id + 13)) return xmb->textures.list[XMB_TEXTURE_INPUT_RT]; - else if (type == (input_id + 14)) + if (type == (input_id + 14)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_P]; - else if (type == (input_id + 15)) + if (type == (input_id + 15)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_P]; - else if (type == (input_id + 16)) + if (type == (input_id + 16)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_U]; - else if (type == (input_id + 17)) + if (type == (input_id + 17)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_D]; - else if (type == (input_id + 18)) + if (type == (input_id + 18)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_L]; - else if (type == (input_id + 19)) + if (type == (input_id + 19)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_R]; - else if (type == (input_id + 20)) + if (type == (input_id + 20)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_U]; - else if (type == (input_id + 21)) + if (type == (input_id + 21)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_D]; - else if (type == (input_id + 22)) + if (type == (input_id + 22)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_L]; - else if (type == (input_id + 23)) + if (type == (input_id + 23)) return xmb->textures.list[XMB_TEXTURE_INPUT_STCK_R]; } if ( type >= MENU_SETTINGS_REMAPPING_PORT_BEGIN diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 2153ab01f1..1f6127d691 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -239,7 +239,7 @@ enum menu_settings_type MENU_SETTINGS_INPUT_ANALOG_DPAD_MODE, MENU_SETTINGS_INPUT_INPUT_REMAP_PORT, MENU_SETTINGS_INPUT_BEGIN, - MENU_SETTINGS_INPUT_END = MENU_SETTINGS_INPUT_BEGIN + RARCH_CUSTOM_BIND_LIST_END + 6, + MENU_SETTINGS_INPUT_END = MENU_SETTINGS_INPUT_BEGIN + RARCH_CUSTOM_BIND_LIST_END + 7, MENU_SETTINGS_INPUT_DESC_BEGIN, MENU_SETTINGS_INPUT_DESC_END = MENU_SETTINGS_INPUT_DESC_BEGIN + ((RARCH_FIRST_CUSTOM_BIND + 8) * MAX_USERS), MENU_SETTINGS_INPUT_DESC_KBD_BEGIN,