diff --git a/config.def.h b/config.def.h index 76b199a313..1a6d531b82 100644 --- a/config.def.h +++ b/config.def.h @@ -452,6 +452,7 @@ static const float refresh_rate = (32730.0 * 8192.0) / 4481134.0 ; #else static const float refresh_rate = 60/1.001; #endif +static const float crt_refresh_rate = refresh_rate; /* Allow games to set rotation. If false, rotation requests are * honored, but ignored. diff --git a/configuration.c b/configuration.c index 8bb74fe308..8ed205fc14 100644 --- a/configuration.c +++ b/configuration.c @@ -1234,6 +1234,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, struct config_bool_setting *tmp = (struct config_bool_setting*)malloc((*size + 1) * sizeof(struct config_bool_setting)); unsigned count = 0; + SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false); SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, automatically_add_content_to_playlist, false); SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false); SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, ui_companion_enable, false); @@ -1484,6 +1485,7 @@ static struct config_float_setting *populate_settings_float(settings_t *settings SETTING_FLOAT("video_aspect_ratio", &settings->floats.video_aspect_ratio, true, aspect_ratio, false); SETTING_FLOAT("video_scale", &settings->floats.video_scale, false, 0.0f, false); + SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, crt_refresh_rate, false); SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, refresh_rate, false); SETTING_FLOAT("audio_rate_control_delta", audio_get_float_ptr(AUDIO_ACTION_RATE_CONTROL_DELTA), true, rate_control_delta, false); SETTING_FLOAT("audio_max_timing_skew", &settings->floats.audio_max_timing_skew, true, max_timing_skew, false); diff --git a/configuration.h b/configuration.h index 3ec49df82f..04a43cd572 100644 --- a/configuration.h +++ b/configuration.h @@ -190,6 +190,8 @@ typedef struct settings bool quick_menu_show_information; bool kiosk_mode_enable; + bool crt_switch_custom_refresh_enable; + /* Netplay */ bool netplay_public_announce; bool netplay_start_as_spectator; @@ -296,6 +298,7 @@ typedef struct settings float video_scale; float video_aspect_ratio; float video_refresh_rate; + float crt_video_refresh_rate; float video_font_size; float video_msg_pos_x; float video_msg_pos_y; diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index b1e25fdad3..6c8dfe1297 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3571,3 +3571,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 9af88fe177..7ae8dd7ab1 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3355,3 +3355,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 5138b6743f..5c93b94763 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3347,3 +3347,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 23fcfff99d..9480d286e7 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3457,3 +3457,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 46062b34fe..ca7185c11f 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3222,3 +3222,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index dc55c8778e..0b0ffac2ec 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -7469,3 +7469,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index c95ff88046..56c63ddd4d 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3381,3 +3381,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index eb1a088cd4..f93e29ab95 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3441,3 +3441,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 7f1316d401..2d659d8902 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3842,3 +3842,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 532ba620a4..de568c0428 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3342,3 +3342,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index a87752e573..a04a39aa35 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1663,3 +1663,5 @@ MSG_HASH(MENU_ENUM_LABEL_CHEAT_COPY_MATCH, "cheat_copy_match") MSG_HASH(MENU_ENUM_LABEL_CHEAT_DELETE_MATCH, "cheat_delete_match") +MSG_HASH(MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "crt_switch_resolution_use_custom_refresh_rate") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index e8f0538e30..ca63fb6814 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3224,3 +3224,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 69a4bf95b3..c5241df3f1 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3652,3 +3652,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 4bf1a81bbd..39795cacc1 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -7468,3 +7468,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 4b7209d3ea..dc0a8493bf 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3316,3 +3316,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 20512917d0..e110331077 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3511,3 +3511,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index b71dc9d6c5..dfee2499b5 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -7469,3 +7469,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 07ccb7998d..0b69b485ee 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3379,3 +3379,9 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CRT_SWITCH_X_AXIS_CENTERING, "X-Axis Centering" ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use a custom refresh rate specified in the config file if needed.") +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + "Use Custom Refresh Rate") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index bff90a79d5..3e1cc55210 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -70,6 +70,7 @@ default_sublabel_macro(action_bind_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_crt_switchres_use_custom_refresh_rate, MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE) 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) @@ -748,6 +749,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, 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_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_use_custom_refresh_rate); + 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 12bee24001..0612ef1f7d 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -6299,6 +6299,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_X_AXIS_CENTERING, PARSE_ONLY_INT, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + PARSE_ONLY_BOOL, false); info->need_refresh = true; info->need_push = true; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 9237afbee5..e1e4f4a8ae 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -4603,6 +4603,22 @@ static bool setting_append_list( 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); + CONFIG_BOOL( + list, list_info, + &settings->bools.crt_switch_custom_refresh_enable, + MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, + audio_enable, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE + ); + 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 2a9281653c..a9374f778b 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_RESOLUTION_USE_CUSTOM_REFRESH_RATE), MENU_LABEL(CRT_SWITCH_X_AXIS_CENTERING), MENU_LABEL(VIDEO_FONT_ENABLE), MENU_LABEL(VIDEO_FONT_PATH), diff --git a/retroarch.cfg b/retroarch.cfg index e226b7c390..671fa4a73c 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -141,6 +141,10 @@ # video_fullscreen_x = 0 # video_fullscreen_y = 0 +# Video refresh rate of your CRT monitor. +# Used to calculate a suitable audio input rate. +# crt_video_refresh_rate = 59.94 + # Video refresh rate of your monitor. # Used to calculate a suitable audio input rate. # video_refresh_rate = 59.94