mirror of
https://github.com/libretro/RetroArch
synced 2025-04-25 09:02:44 +00:00
Added ability to adjust porch values
Porches can now be manipulated from the CRTSwitchRes menu
This commit is contained in:
parent
7f1cd52d65
commit
55e3bd3d2d
@ -133,6 +133,8 @@
|
|||||||
|
|
||||||
#define DEFAULT_CRT_SWITCH_CENTER_ADJUST 0
|
#define DEFAULT_CRT_SWITCH_CENTER_ADJUST 0
|
||||||
|
|
||||||
|
#define DEFAULT_CRT_SWITCH_PORCH_ADJUST 0
|
||||||
|
|
||||||
#define DEFAULT_HISTORY_LIST_ENABLE true
|
#define DEFAULT_HISTORY_LIST_ENABLE true
|
||||||
|
|
||||||
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
|
#define DEFAULT_PLAYLIST_ENTRY_RENAME true
|
||||||
|
@ -2021,6 +2021,7 @@ static struct config_int_setting *populate_settings_int(
|
|||||||
SETTING_INT("audio_wasapi_sh_buffer_length", &settings->ints.audio_wasapi_sh_buffer_length, true, DEFAULT_WASAPI_SH_BUFFER_LENGTH, false);
|
SETTING_INT("audio_wasapi_sh_buffer_length", &settings->ints.audio_wasapi_sh_buffer_length, true, DEFAULT_WASAPI_SH_BUFFER_LENGTH, false);
|
||||||
#endif
|
#endif
|
||||||
SETTING_INT("crt_switch_center_adjust", &settings->ints.crt_switch_center_adjust, false, DEFAULT_CRT_SWITCH_CENTER_ADJUST, false);
|
SETTING_INT("crt_switch_center_adjust", &settings->ints.crt_switch_center_adjust, false, DEFAULT_CRT_SWITCH_CENTER_ADJUST, false);
|
||||||
|
SETTING_INT("crt_switch_porch_adjust", &settings->ints.crt_switch_porch_adjust, false, DEFAULT_CRT_SWITCH_PORCH_ADJUST, false);
|
||||||
#ifdef HAVE_VULKAN
|
#ifdef HAVE_VULKAN
|
||||||
SETTING_INT("vulkan_gpu_index", &settings->ints.vulkan_gpu_index, true, DEFAULT_VULKAN_GPU_INDEX, false);
|
SETTING_INT("vulkan_gpu_index", &settings->ints.vulkan_gpu_index, true, DEFAULT_VULKAN_GPU_INDEX, false);
|
||||||
#endif
|
#endif
|
||||||
|
@ -471,6 +471,7 @@ typedef struct settings
|
|||||||
int state_slot;
|
int state_slot;
|
||||||
int audio_wasapi_sh_buffer_length;
|
int audio_wasapi_sh_buffer_length;
|
||||||
int crt_switch_center_adjust;
|
int crt_switch_center_adjust;
|
||||||
|
int crt_switch_porch_adjust;
|
||||||
#ifdef HAVE_VULKAN
|
#ifdef HAVE_VULKAN
|
||||||
int vulkan_gpu_index;
|
int vulkan_gpu_index;
|
||||||
#endif
|
#endif
|
||||||
|
@ -165,7 +165,7 @@ static bool x11_display_server_set_window_decorations(void *data, bool on)
|
|||||||
|
|
||||||
#ifdef HAVE_XRANDR
|
#ifdef HAVE_XRANDR
|
||||||
static bool x11_display_server_set_resolution(void *data,
|
static bool x11_display_server_set_resolution(void *data,
|
||||||
unsigned width, unsigned height, int int_hz, float hz, int center, int monitor_index, int xoffset)
|
unsigned width, unsigned height, int int_hz, float hz, int center, int monitor_index, int xoffset, int padjust)
|
||||||
{
|
{
|
||||||
int screen;
|
int screen;
|
||||||
Window window;
|
Window window;
|
||||||
@ -201,11 +201,11 @@ static bool x11_display_server_set_resolution(void *data,
|
|||||||
/* following code is the mode line generator */
|
/* following code is the mode line generator */
|
||||||
if (width < 700)
|
if (width < 700)
|
||||||
{
|
{
|
||||||
hfp = (width * 1.033);
|
hfp = (width * 1.033)+(padjust*2);
|
||||||
hbp = width * 1.225;
|
hbp = (width * 1.225)+(padjust*2);
|
||||||
}else {
|
}else {
|
||||||
hfp = (width * 1.033) + (width / 112);
|
hfp = ((width * 1.033) + (width / 112))+(padjust*4);
|
||||||
hbp = (width * 1.225) + (width /58);
|
hbp = ((width * 1.225) + (width /58))+(padjust*4);
|
||||||
xoffset = xoffset*2;
|
xoffset = xoffset*2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,8 @@ static void switch_res_crt(
|
|||||||
p_switch->ra_core_hz,
|
p_switch->ra_core_hz,
|
||||||
p_switch->center_adjust,
|
p_switch->center_adjust,
|
||||||
p_switch->index,
|
p_switch->index,
|
||||||
p_switch->center_adjust);
|
p_switch->center_adjust,
|
||||||
|
p_switch->porch_adjust);
|
||||||
|
|
||||||
#if defined(HAVE_VIDEOCORE)
|
#if defined(HAVE_VIDEOCORE)
|
||||||
crt_rpi_switch(width, height,
|
crt_rpi_switch(width, height,
|
||||||
@ -196,6 +197,7 @@ void crt_switch_res_core(
|
|||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
float hz, unsigned crt_mode,
|
float hz, unsigned crt_mode,
|
||||||
int crt_switch_center_adjust,
|
int crt_switch_center_adjust,
|
||||||
|
int crt_switch_porch_adjust,
|
||||||
int monitor_index, bool dynamic)
|
int monitor_index, bool dynamic)
|
||||||
{
|
{
|
||||||
/* ra_core_hz float passed from within
|
/* ra_core_hz float passed from within
|
||||||
@ -206,6 +208,7 @@ void crt_switch_res_core(
|
|||||||
height = 240;
|
height = 240;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p_switch->porch_adjust = crt_switch_porch_adjust;
|
||||||
p_switch->ra_core_height = height;
|
p_switch->ra_core_height = height;
|
||||||
p_switch->ra_core_hz = hz;
|
p_switch->ra_core_hz = hz;
|
||||||
|
|
||||||
@ -229,7 +232,8 @@ void crt_switch_res_core(
|
|||||||
if (
|
if (
|
||||||
(p_switch->ra_tmp_height != p_switch->ra_core_height) ||
|
(p_switch->ra_tmp_height != p_switch->ra_core_height) ||
|
||||||
(p_switch->ra_core_width != p_switch->ra_tmp_width) ||
|
(p_switch->ra_core_width != p_switch->ra_tmp_width) ||
|
||||||
(p_switch->center_adjust != p_switch->tmp_center_adjust)
|
(p_switch->center_adjust != p_switch->tmp_center_adjust||
|
||||||
|
p_switch->porch_adjust != p_switch->tmp_porch_adjust )
|
||||||
)
|
)
|
||||||
crt_screen_setup_aspect(
|
crt_screen_setup_aspect(
|
||||||
p_switch,
|
p_switch,
|
||||||
|
@ -30,6 +30,8 @@ RETRO_BEGIN_DECLS
|
|||||||
typedef struct videocrt_switch
|
typedef struct videocrt_switch
|
||||||
{
|
{
|
||||||
int center_adjust;
|
int center_adjust;
|
||||||
|
int porch_adjust;
|
||||||
|
int tmp_porch_adjust;
|
||||||
int tmp_center_adjust;
|
int tmp_center_adjust;
|
||||||
unsigned ra_core_width;
|
unsigned ra_core_width;
|
||||||
unsigned ra_core_height;
|
unsigned ra_core_height;
|
||||||
@ -52,6 +54,7 @@ void crt_switch_res_core(
|
|||||||
float hz,
|
float hz,
|
||||||
unsigned crt_mode,
|
unsigned crt_mode,
|
||||||
int crt_switch_center_adjust,
|
int crt_switch_center_adjust,
|
||||||
|
int crt_switch_porch_adjust,
|
||||||
int monitor_index,
|
int monitor_index,
|
||||||
bool dynamic);
|
bool dynamic);
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ typedef struct video_display_server
|
|||||||
bool (*set_window_progress)(void *data, int progress, bool finished);
|
bool (*set_window_progress)(void *data, int progress, bool finished);
|
||||||
bool (*set_window_decorations)(void *data, bool on);
|
bool (*set_window_decorations)(void *data, bool on);
|
||||||
bool (*set_resolution)(void *data, unsigned width,
|
bool (*set_resolution)(void *data, unsigned width,
|
||||||
unsigned height, int int_hz, float hz, int center, int monitor_index, int xoffset);
|
unsigned height, int int_hz, float hz, int center, int monitor_index, int xoffset, int padjust );
|
||||||
void *(*get_resolution_list)(void *data,
|
void *(*get_resolution_list)(void *data,
|
||||||
unsigned *size);
|
unsigned *size);
|
||||||
const char *(*get_output_options)(void *data);
|
const char *(*get_output_options)(void *data);
|
||||||
|
@ -2900,6 +2900,10 @@ MSG_HASH(
|
|||||||
MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING,
|
MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING,
|
||||||
"crt_switch_center_adjust"
|
"crt_switch_center_adjust"
|
||||||
)
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_LABEL_CRT_SWITCH_PORCH_ADJUST,
|
||||||
|
"crt_switch_porch_adjust"
|
||||||
|
)
|
||||||
MSG_HASH(
|
MSG_HASH(
|
||||||
MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO,
|
MENU_ENUM_LABEL_VIDEO_ASPECT_RATIO,
|
||||||
"video_aspect_ratio"
|
"video_aspect_ratio"
|
||||||
|
@ -1375,6 +1375,14 @@ MSG_HASH(
|
|||||||
MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING,
|
MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING,
|
||||||
"Cycle through these options if the image is not centered properly on the display."
|
"Cycle through these options if the image is not centered properly on the display."
|
||||||
)
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_LABEL_VALUE_CRT_SWITCH_PORCH_ADJUST,
|
||||||
|
"Porch Adjust"
|
||||||
|
)
|
||||||
|
MSG_HASH(
|
||||||
|
MENU_ENUM_SUBLABEL_CRT_SWITCH_PORCH_ADJUST,
|
||||||
|
"Cycle through these options to adjust the porch settings to change the image size."
|
||||||
|
)
|
||||||
MSG_HASH(
|
MSG_HASH(
|
||||||
MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE,
|
MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE,
|
||||||
"Use Custom Refresh Rate"
|
"Use Custom Refresh Rate"
|
||||||
|
@ -5633,7 +5633,7 @@ int action_cb_push_dropdown_item_resolution(const char *path,
|
|||||||
refreshrate = (unsigned)strtoul(pch, NULL, 0);
|
refreshrate = (unsigned)strtoul(pch, NULL, 0);
|
||||||
|
|
||||||
if (video_display_server_set_resolution(width, height,
|
if (video_display_server_set_resolution(width, height,
|
||||||
refreshrate, (float)refreshrate, 0, 0, 0))
|
refreshrate, (float)refreshrate, 0, 0, 0, 0))
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quick_menu_stop_recording,
|
|||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_crt_switchres, MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION)
|
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_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_x_axis_centering, MENU_ENUM_SUBLABEL_CRT_SWITCH_X_AXIS_CENTERING)
|
||||||
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_crt_switchres_porch_adjust, MENU_ENUM_SUBLABEL_CRT_SWITCH_PORCH_ADJUST)
|
||||||
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_crt_switchres_use_custom_refresh_rate, MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE)
|
||||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_driver_settings_list, MENU_ENUM_SUBLABEL_DRIVER_SETTINGS)
|
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)
|
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_retro_achievements_settings_list, MENU_ENUM_SUBLABEL_RETRO_ACHIEVEMENTS_SETTINGS)
|
||||||
@ -1692,6 +1693,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING:
|
case MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_x_axis_centering);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_x_axis_centering);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_CRT_SWITCH_PORCH_ADJUST:
|
||||||
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_porch_adjust);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE:
|
case MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_use_custom_refresh_rate);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_crt_switchres_use_custom_refresh_rate);
|
||||||
break;
|
break;
|
||||||
|
@ -7362,6 +7362,7 @@ unsigned menu_displaylist_build_list(
|
|||||||
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION, PARSE_ONLY_UINT},
|
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION, PARSE_ONLY_UINT},
|
||||||
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER, PARSE_ONLY_UINT},
|
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_SUPER, PARSE_ONLY_UINT},
|
||||||
{MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING, PARSE_ONLY_INT },
|
{MENU_ENUM_LABEL_CRT_SWITCH_X_AXIS_CENTERING, PARSE_ONLY_INT },
|
||||||
|
{MENU_ENUM_LABEL_CRT_SWITCH_PORCH_ADJUST, PARSE_ONLY_INT },
|
||||||
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, PARSE_ONLY_BOOL},
|
{MENU_ENUM_LABEL_CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE, PARSE_ONLY_BOOL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10840,6 +10840,23 @@ static bool setting_append_list(
|
|||||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_ADVANCED);
|
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);
|
menu_settings_list_current_add_range(list, list_info, -3, 4, 1.0, true, true);
|
||||||
|
|
||||||
|
CONFIG_INT(
|
||||||
|
list, list_info,
|
||||||
|
&settings->ints.crt_switch_porch_adjust,
|
||||||
|
MENU_ENUM_LABEL_CRT_SWITCH_PORCH_ADJUST,
|
||||||
|
MENU_ENUM_LABEL_VALUE_CRT_SWITCH_PORCH_ADJUST,
|
||||||
|
DEFAULT_CRT_SWITCH_PORCH_ADJUST,
|
||||||
|
&group_info,
|
||||||
|
&subgroup_info,
|
||||||
|
parent_group,
|
||||||
|
general_write_handler,
|
||||||
|
general_read_handler);
|
||||||
|
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_SPINBOX;
|
||||||
|
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||||
|
(*list)[list_info->index - 1].offset_by = 0;
|
||||||
|
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_ADVANCED);
|
||||||
|
menu_settings_list_current_add_range(list, list_info, -20, 20, 1.0, true, true);
|
||||||
|
|
||||||
CONFIG_BOOL(
|
CONFIG_BOOL(
|
||||||
list, list_info,
|
list, list_info,
|
||||||
&settings->bools.crt_switch_custom_refresh_enable,
|
&settings->bools.crt_switch_custom_refresh_enable,
|
||||||
|
@ -940,6 +940,7 @@ enum msg_hash_enums
|
|||||||
MENU_LABEL(CRT_SWITCH_RESOLUTION_OUTPUT_DISPLAY_ID),
|
MENU_LABEL(CRT_SWITCH_RESOLUTION_OUTPUT_DISPLAY_ID),
|
||||||
MENU_LABEL(CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE),
|
MENU_LABEL(CRT_SWITCH_RESOLUTION_USE_CUSTOM_REFRESH_RATE),
|
||||||
MENU_LABEL(CRT_SWITCH_X_AXIS_CENTERING),
|
MENU_LABEL(CRT_SWITCH_X_AXIS_CENTERING),
|
||||||
|
MENU_LABEL(CRT_SWITCH_PORCH_ADJUST),
|
||||||
MENU_LABEL(VIDEO_FONT_ENABLE),
|
MENU_LABEL(VIDEO_FONT_ENABLE),
|
||||||
MENU_LABEL(VIDEO_FONT_PATH),
|
MENU_LABEL(VIDEO_FONT_PATH),
|
||||||
MENU_LABEL(VIDEO_FONT_SIZE),
|
MENU_LABEL(VIDEO_FONT_SIZE),
|
||||||
|
@ -32827,6 +32827,7 @@ static void video_driver_frame(const void *data, unsigned width,
|
|||||||
p_rarch->video_driver_core_hz,
|
p_rarch->video_driver_core_hz,
|
||||||
video_info.crt_switch_resolution,
|
video_info.crt_switch_resolution,
|
||||||
video_info.crt_switch_center_adjust,
|
video_info.crt_switch_center_adjust,
|
||||||
|
video_info.crt_switch_porch_adjust,
|
||||||
video_info.monitor_index,
|
video_info.monitor_index,
|
||||||
p_rarch->video_driver_crt_dynamic_super_width);
|
p_rarch->video_driver_crt_dynamic_super_width);
|
||||||
}
|
}
|
||||||
@ -32938,6 +32939,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
|||||||
video_info->crt_switch_resolution = settings->uints.crt_switch_resolution;
|
video_info->crt_switch_resolution = settings->uints.crt_switch_resolution;
|
||||||
video_info->crt_switch_resolution_super = settings->uints.crt_switch_resolution_super;
|
video_info->crt_switch_resolution_super = settings->uints.crt_switch_resolution_super;
|
||||||
video_info->crt_switch_center_adjust = settings->ints.crt_switch_center_adjust;
|
video_info->crt_switch_center_adjust = settings->ints.crt_switch_center_adjust;
|
||||||
|
video_info->crt_switch_porch_adjust = settings->ints.crt_switch_porch_adjust;
|
||||||
video_info->black_frame_insertion = settings->bools.video_black_frame_insertion;
|
video_info->black_frame_insertion = settings->bools.video_black_frame_insertion;
|
||||||
video_info->hard_sync = settings->bools.video_hard_sync;
|
video_info->hard_sync = settings->bools.video_hard_sync;
|
||||||
video_info->hard_sync_frames = settings->uints.video_hard_sync_frames;
|
video_info->hard_sync_frames = settings->uints.video_hard_sync_frames;
|
||||||
|
@ -1141,6 +1141,7 @@ typedef struct video_frame_info
|
|||||||
int custom_vp_x;
|
int custom_vp_x;
|
||||||
int custom_vp_y;
|
int custom_vp_y;
|
||||||
int crt_switch_center_adjust;
|
int crt_switch_center_adjust;
|
||||||
|
int crt_switch_porch_adjust;
|
||||||
|
|
||||||
unsigned hard_sync_frames;
|
unsigned hard_sync_frames;
|
||||||
unsigned aspect_ratio_idx;
|
unsigned aspect_ratio_idx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user