From 92b6854315602761fabe9a4fa18a8b51504ab446 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 16 Sep 2018 08:57:27 +0200 Subject: [PATCH] CRT SwitchRes - step 3 - https://github.com/libretro/RetroArch/issues/6988 --- intl/msg_hash_ar.h | 5 +++- intl/msg_hash_chs.h | 5 +++- intl/msg_hash_cht.h | 5 +++- intl/msg_hash_de.h | 5 +++- intl/msg_hash_eo.h | 5 +++- intl/msg_hash_es.h | 2 +- intl/msg_hash_fr.h | 5 +++- intl/msg_hash_it.h | 5 +++- intl/msg_hash_ja.h | 5 +++- intl/msg_hash_ko.h | 5 +++- intl/msg_hash_nl.h | 5 +++- intl/msg_hash_pl.h | 5 +++- intl/msg_hash_pt_br.h | 2 +- intl/msg_hash_pt_pt.h | 5 +++- intl/msg_hash_ru.h | 6 ++-- intl/msg_hash_us.h | 2 +- intl/msg_hash_vn.h | 5 +++- menu/cbs/menu_cbs_get_value.c | 26 +++++++++++++++++ menu/menu_setting.c | 54 +++++++++++++++++++++++++++++++++++ 19 files changed, 139 insertions(+), 18 deletions(-) diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 4011a9832f..4e39b9f541 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3457,7 +3457,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 7279e0a552..d129473eb1 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3241,7 +3241,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 3eacc85f39..9d14d58c2f 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3233,7 +3233,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 58dcd24e7f..7f670f5363 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3343,7 +3343,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index feea997c62..818de5cc8c 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3108,7 +3108,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 1ef9f361dd..fa789570c4 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -6244,7 +6244,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, - "Al activar CRT SwitchRes, forzar resolución ultrawide horizontal para minimizar el cambio de modos" + "Switch among native and ultrawide super resolutions." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 1e9fa68a90..fca79c4b9b 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3267,7 +3267,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 7031e203a1..a30b6cd4a9 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3327,7 +3327,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Abilita lo spessore del riempimento dello sfondo") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "Solo per schermi CRT. Tenta di utilizzare la risoluzione esatta core/gioco e la frequenza di aggiornamento.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "Quando CRT SwitchRes è abilitato, forza la risoluzione orizzontale ultrawide per minimizzare il cambio di modalità.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Risoluzione") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Mostra impostazioni di riavvolgimento") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 658426d88e..bc0938409d 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3460,7 +3460,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "「巻き戻し」を表示") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index a0b33b1068..9e7cf1c2a8 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3228,7 +3228,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 9af33b1c54..36a6f68d6b 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3110,7 +3110,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index cace7a69a8..2e0eee766d 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3526,7 +3526,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Włącz grubość wypełniacza tła") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "Tylko dla wyświetlaczy CRT. Próby użycia dokładnej rozdzielczości rdzenia/gry i częstotliwości odświeżania.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT Przełącz rozdzielczość") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "Po włączeniu przełączników CRT wymuś ultrafioletową rozdzielczość poziomą, aby zminimalizować przełączanie trybu.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super rozdzielczość") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Pokaż ustawienia przewijania") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 28ef786209..f74512c1bb 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -6243,7 +6243,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, - "Quando Trocar para Resolução CRT está ativada, força a resolução horizontal ultrawide para minimizar a alternância de modo." + "Switch among native and ultrawide super resolutions." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 6a9d54af1c..23d900ec19 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3202,7 +3202,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 6f7d8e7ae8..fdb944ba4f 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3378,8 +3378,10 @@ MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "Только для CRT дисплеев. Пытается использовать точное разрешение и частоту обновления ядра/игры.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, - "Когда CRT SwitchRes включен, принудительно устанавливает ультраширокое горизонтальное разрешение чтобы минимизировать изменение режима.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_SUBLABEL_INPUT_OVERLAY_SHOW_PHYSICAL_INPUTS, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index b503f0e7ae..534bd04997 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -6244,7 +6244,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, - "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching." + "Switch among native and ultrawide super resolutions." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 02e6f17d21..0d2fa4e77d 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3265,7 +3265,10 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE, "Enable background filler thickness") MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For CRT displays only. Attempts to use exact core/game resolution and refresh rate.") MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes") -MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.") +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, + "Switch among native and ultrawide super resolutions." + ) MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution") MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND, "Show Rewind Settings") diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 3da936156f..4398fe5f2d 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -126,6 +126,28 @@ static void menu_action_setting_disp_set_label_cheevos_locked_entry( msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY), len); } +static void menu_action_setting_disp_set_label_crt_switch_resolution_super( + file_list_t* list, + unsigned *w, unsigned type, unsigned i, + const char *label, + char *s, size_t len, + const char *entry_label, + const char *path, + char *s2, size_t len2) +{ + settings_t *settings = config_get_ptr(); + *w = 19; + strlcpy(s2, path, len2); + + if (settings) + { + if (settings->uints.crt_switch_resolution_super == 0) + strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len); + else + snprintf(s, len, "%d", settings->uints.crt_switch_resolution_super); + } +} + static void menu_action_setting_disp_set_label_cheevos_unlocked_entry( file_list_t* list, unsigned *w, unsigned type, unsigned i, @@ -2371,6 +2393,10 @@ int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs, { switch (cbs->enum_idx) { + case MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER: + BIND_ACTION_GET_VALUE(cbs, + menu_action_setting_disp_set_label_crt_switch_resolution_super); + return 0; case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY: BIND_ACTION_GET_VALUE(cbs, menu_action_setting_disp_set_label_cheevos_unlocked_entry); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 44c24bdc0a..de0464061c 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -243,6 +243,58 @@ static void setting_get_string_representation_int_audio_wasapi_sh_buffer_length( } #endif +static int setting_uint_action_left_crt_switch_resolution_super( + void *data, bool wraparound) +{ + rarch_setting_t *setting = (rarch_setting_t*)data; + if (!setting) + return -1; + + switch (*setting->value.target.unsigned_integer) + { + case 0: + *setting->value.target.unsigned_integer = 3840; + break; + case 1920: + *setting->value.target.unsigned_integer = 0; + break; + case 2560: + *setting->value.target.unsigned_integer = 1920; + break; + case 3840: + *setting->value.target.unsigned_integer = 2560; + break; + } + + return 0; +} + +static int setting_uint_action_right_crt_switch_resolution_super( + void *data, bool wraparound) +{ + rarch_setting_t *setting = (rarch_setting_t*)data; + if (!setting) + return -1; + + switch (*setting->value.target.unsigned_integer) + { + case 0: + *setting->value.target.unsigned_integer = 1920; + break; + case 1920: + *setting->value.target.unsigned_integer = 2560; + break; + case 2560: + *setting->value.target.unsigned_integer = 3840; + break; + case 3840: + *setting->value.target.unsigned_integer = 0; + break; + } + + return 0; +} + static int setting_uint_action_right_custom_viewport_width( void *data, bool wraparound) { @@ -4536,6 +4588,8 @@ static bool setting_append_list( general_write_handler, general_read_handler); settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); + (*list)[list_info->index - 1].action_left = &setting_uint_action_left_crt_switch_resolution_super; + (*list)[list_info->index - 1].action_right = &setting_uint_action_right_crt_switch_resolution_super; END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group);