From 369f8206d127859e7078cae9cf56e24071eb5ac6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 16 Sep 2018 21:00:04 +0200 Subject: [PATCH] Add 'X-Axis Centering' - https://github.com/libretro/RetroArch/issues/6988 --- config.def.h | 12 ++++++------ configuration.c | 1 + configuration.h | 1 + intl/msg_hash_ar.h | 8 ++++++++ intl/msg_hash_chs.h | 8 ++++++++ intl/msg_hash_cht.h | 8 ++++++++ intl/msg_hash_de.h | 8 ++++++++ intl/msg_hash_eo.h | 8 ++++++++ intl/msg_hash_es.h | 8 ++++++++ intl/msg_hash_fr.h | 8 ++++++++ intl/msg_hash_it.h | 8 ++++++++ intl/msg_hash_ja.h | 8 ++++++++ intl/msg_hash_ko.h | 8 ++++++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 8 ++++++++ intl/msg_hash_pl.h | 8 ++++++++ intl/msg_hash_pt_br.h | 8 ++++++++ intl/msg_hash_pt_pt.h | 8 ++++++++ intl/msg_hash_ru.h | 8 ++++++++ intl/msg_hash_us.h | 8 ++++++++ intl/msg_hash_vn.h | 8 ++++++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/menu_displaylist.c | 3 +++ menu/menu_setting.c | 14 ++++++++++++++ msg_hash.h | 1 + 25 files changed, 168 insertions(+), 6 deletions(-) diff --git a/config.def.h b/config.def.h index 8ecacdc99d..c8ffc48469 100644 --- a/config.def.h +++ b/config.def.h @@ -67,15 +67,15 @@ static bool bundle_assets_extract_enable = false; static bool materialui_icons_enable = true; #endif -static const bool crt_switch_resolution = false; +static const bool crt_switch_resolution = false; static const int crt_switch_resolution_super = 2560; +static const int crt_switch_center_adjust = 0; +static const bool def_history_list_enable = true; +static const bool def_playlist_entry_remove = true; +static const bool def_playlist_entry_rename = true; -static const bool def_history_list_enable = true; -static const bool def_playlist_entry_remove = true; -static const bool def_playlist_entry_rename = true; - -static const unsigned int def_user_language = 0; +static const unsigned int def_user_language = 0; #if (defined(_WIN32) && !defined(_XBOX)) || (defined(__linux) && !defined(ANDROID) && !defined(HAVE_LAKKA)) || (defined(__MACH__) && !defined(IOS)) || defined(EMSCRIPTEN) static const bool def_mouse_enable = true; diff --git a/configuration.c b/configuration.c index 4c8b373ff3..c55e757c33 100644 --- a/configuration.c +++ b/configuration.c @@ -1630,6 +1630,7 @@ static struct config_int_setting *populate_settings_int(settings_t *settings, in #ifdef HAVE_WASAPI SETTING_INT("audio_wasapi_sh_buffer_length", &settings->ints.audio_wasapi_sh_buffer_length, true, wasapi_sh_buffer_length, false); #endif + SETTING_INT("crt_switch_center_adjust", &settings->ints.crt_switch_center_adjust, false, 0 /* TODO */, false); *size = count; diff --git a/configuration.h b/configuration.h index c3a4c9c539..46c5618ecf 100644 --- a/configuration.h +++ b/configuration.h @@ -322,6 +322,7 @@ typedef struct settings int location_update_interval_distance; int state_slot; int audio_wasapi_sh_buffer_length; + int crt_switch_center_adjust; } ints; struct diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 80ad426688..b1e25fdad3 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3563,3 +3563,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index c87b5f38db..9af88fe177 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3347,3 +3347,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 85e971df48..5138b6743f 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3339,3 +3339,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 39d46a06b3..23fcfff99d 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3449,3 +3449,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 0226dc05ce..46062b34fe 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3214,3 +3214,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 35195d8102..dc55c8778e 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -7461,3 +7461,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 2a9013ea1e..c95ff88046 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3373,3 +3373,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 5c3c0e2279..eb1a088cd4 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3433,3 +3433,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Emissione di segnali nativi a bassa risoluzione per l'uso con display CRT." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index e376dba5a8..7f1316d401 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3834,3 +3834,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 22c98aa9d0..532ba620a4 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3334,3 +3334,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 09c674c2ef..a87752e573 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1147,6 +1147,8 @@ MSG_HASH(MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION, "crt_switch_resolution") MSG_HASH(MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER, "crt_switch_resolution_super") +MSG_HASH(MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING, + "crt_switch_center_adjust") MSG_HASH(MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO, "video_aspect_ratio") MSG_HASH(MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO_AUTO, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 5eae460fbe..e8f0538e30 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3216,3 +3216,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 9bc4e401a7..69a4bf95b3 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3644,3 +3644,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index bb7c84f72c..4bf1a81bbd 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -7460,3 +7460,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 7e34b7cfa4..4b7209d3ea 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3308,3 +3308,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 05a16ccef6..20512917d0 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3503,3 +3503,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 0380e4a39c..b71dc9d6c5 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -7461,3 +7461,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 6ceb778c1f..07ccb7998d 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3371,3 +3371,11 @@ MSG_HASH( MENU_ENUM_SUBLABEL_CRT_SWITCHRES_SETTINGS, "Output native, low-resolution signals for use with CRT displays." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING, + "Cycle through these options if the image is not centered properly on the display." + ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + "X-Axis Centering" + ) diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index ead0767075..bff90a79d5 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -69,6 +69,7 @@ default_sublabel_macro(menu_action_sublabel_setting_audio_mixer_stream_volume, default_sublabel_macro(action_bind_sublabel_quick_menu_override_options, MENU_ENUM_SUBLABEL_QUICK_MENU_OVERRIDE_OPTIONS) default_sublabel_macro(action_bind_sublabel_crt_switchres, MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION) default_sublabel_macro(action_bind_sublabel_crt_switchres_super, MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER) +default_sublabel_macro(action_bind_sublabel_crt_switchres_x_axis_centering, MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING) default_sublabel_macro(action_bind_sublabel_automatically_add_content_to_playlist, MENU_ENUM_SUBLABEL_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST) default_sublabel_macro(action_bind_sublabel_driver_settings_list, MENU_ENUM_SUBLABEL_DRIVER_SETTINGS) default_sublabel_macro(action_bind_sublabel_retro_achievements_settings_list, MENU_ENUM_SUBLABEL_RETRO_ACHIEVEMENTS_SETTINGS) @@ -744,6 +745,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_super); break; + case MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_x_axis_centering); + break; case MENU_ENUM_LABEL_AUDIO_RESAMPLER_QUALITY: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_audio_resampler_quality); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 6d6a845bde..5de1d0458f 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -6296,6 +6296,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER, PARSE_ONLY_UINT, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING, + PARSE_ONLY_INT, false); info->need_refresh = true; info->need_push = true; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index de0464061c..458de3001f 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -4591,6 +4591,20 @@ static bool setting_append_list( (*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; + CONFIG_INT( + list, list_info, + &settings->ints.crt_switch_center_adjust, + MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING, + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, + crt_switch_center_adjust, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); + menu_settings_list_current_add_range(list, list_info, -3, 4, 1.0, true, true); + END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); break; diff --git a/msg_hash.h b/msg_hash.h index c6ddc9e917..2a9281653c 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -696,6 +696,7 @@ enum msg_hash_enums /* Video */ MENU_LABEL(CRT_SWITCH_RESOLUTION), MENU_LABEL(CRT_SWITCH_RESOLUTION_SUPER), + MENU_LABEL(CRT_SWITCH_X_AXIS_CENTERING), MENU_LABEL(VIDEO_FONT_ENABLE), MENU_LABEL(VIDEO_FONT_PATH), MENU_LABEL(VIDEO_FONT_SIZE),