Merge pull request #17987 from alphanu1/Geom
Added Horizontal and vertical geometry adjustments
This commit is contained in:
commit
84a5ded33c
|
@ -2687,7 +2687,7 @@ static struct config_int_setting *populate_settings_int(
|
|||
|
||||
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);
|
||||
SETTING_INT("crt_switch_porch_adjust", &settings->ints.crt_switch_porch_adjust, false, DEFAULT_CRT_SWITCH_VERTICAL_ADJUST, false);
|
||||
SETTING_INT("crt_switch_vertical_adjust", &settings->ints.crt_switch_vertical_adjust, false, DEFAULT_CRT_SWITCH_VERTICAL_ADJUST, false);
|
||||
#ifdef HAVE_WINDOW_OFFSET
|
||||
SETTING_INT("video_window_offset_x", &settings->ints.video_window_offset_x, true, DEFAULT_WINDOW_OFFSET_X, false);
|
||||
SETTING_INT("video_window_offset_y", &settings->ints.video_window_offset_y, true, DEFAULT_WINDOW_OFFSET_Y, false);
|
||||
|
|
|
@ -46,6 +46,9 @@ static void crt_adjust_sr_ini(videocrt_switch_t *p_switch);
|
|||
static bool ini_overrides_loaded = false;
|
||||
static char core_name[NAME_MAX_LENGTH]; /* Same size as library_name on retroarch_data.h */
|
||||
static char content_dir[DIR_MAX_LENGTH];
|
||||
static char _hSize[12];
|
||||
static char _hShift[12];
|
||||
static char _vShift[12];
|
||||
|
||||
#if defined(HAVE_VIDEOCORE) /* Need to add video core to SR2 */
|
||||
#include "include/userland/interface/vmcs_host/vc_vchi_gencmd.h"
|
||||
|
@ -56,8 +59,9 @@ static bool crt_check_for_changes(videocrt_switch_t *p_switch)
|
|||
{
|
||||
if ( (p_switch->ra_core_height != p_switch->ra_tmp_height)
|
||||
|| (p_switch->ra_core_width != p_switch->ra_tmp_width)
|
||||
|| (p_switch->center_adjust != p_switch->tmp_center_adjust
|
||||
|| p_switch->porch_adjust != p_switch->tmp_porch_adjust)
|
||||
|| (p_switch->center_adjust != p_switch->tmp_center_adjust)
|
||||
|| (p_switch->porch_adjust != p_switch->tmp_porch_adjust)
|
||||
|| (p_switch->vert_adjust != p_switch->tmp_vert_adjust)
|
||||
|| (p_switch->ra_core_hz != p_switch->ra_tmp_core_hz)
|
||||
|| (p_switch->rotated != p_switch->tmp_rotated))
|
||||
return true;
|
||||
|
@ -72,6 +76,7 @@ static void crt_store_temp_changes(videocrt_switch_t *p_switch)
|
|||
p_switch->tmp_porch_adjust = p_switch->porch_adjust;
|
||||
p_switch->ra_tmp_core_hz = p_switch->ra_core_hz;
|
||||
p_switch->tmp_rotated = p_switch->rotated;
|
||||
p_switch->tmp_vert_adjust = p_switch->vert_adjust;
|
||||
}
|
||||
|
||||
static void crt_aspect_ratio_switch(
|
||||
|
@ -304,6 +309,14 @@ static void switch_res_crt(
|
|||
char current_content_dir[DIR_MAX_LENGTH];
|
||||
double rr = p_switch->ra_core_hz;
|
||||
const char *_core_name = (const char*)runloop_state_get_ptr()->system.info.library_name;
|
||||
|
||||
const char* hSize = (const char*)_hSize;
|
||||
const char* hShift = (const char*)_hShift;
|
||||
const char* vShift = (const char*)_vShift;
|
||||
|
||||
sr_set_option(SR_OPT_H_SIZE, hSize);
|
||||
sr_set_option(SR_OPT_H_SHIFT, hShift);
|
||||
sr_set_option(SR_OPT_V_SHIFT, vShift);
|
||||
/* Check for core and content changes in case we need
|
||||
to make any adjustments */
|
||||
if (string_is_empty(_core_name))
|
||||
|
@ -386,8 +399,11 @@ void crt_switch_res_core(
|
|||
int crt_switch_porch_adjust,
|
||||
int monitor_index, bool dynamic,
|
||||
int super_width, bool hires_menu,
|
||||
unsigned video_aspect_ratio_idx)
|
||||
unsigned video_aspect_ratio_idx,
|
||||
int crt_switch_vert_adjust)
|
||||
{
|
||||
|
||||
|
||||
if (height <= 4)
|
||||
{
|
||||
hz = 60;
|
||||
|
@ -400,7 +416,7 @@ void crt_switch_res_core(
|
|||
{
|
||||
native_width = 320;
|
||||
height = 240;
|
||||
}
|
||||
}
|
||||
width = native_width;
|
||||
}
|
||||
|
||||
|
@ -408,6 +424,7 @@ void crt_switch_res_core(
|
|||
{
|
||||
p_switch->menu_active = false;
|
||||
p_switch->porch_adjust = crt_switch_porch_adjust;
|
||||
p_switch->vert_adjust = crt_switch_vert_adjust;
|
||||
p_switch->ra_core_height = height;
|
||||
p_switch->ra_core_hz = hz;
|
||||
|
||||
|
@ -425,7 +442,13 @@ void crt_switch_res_core(
|
|||
#if defined(HAVE_VIDEOCORE)
|
||||
crt_rpi_switch(p_switch, width, height, hz, 0, native_width);
|
||||
#else
|
||||
|
||||
|
||||
sprintf(_hSize, "%lf", 1+
|
||||
((float)crt_switch_porch_adjust/100.0));
|
||||
sprintf(_hShift, "%d",
|
||||
crt_switch_center_adjust);
|
||||
sprintf(_vShift, "%d",
|
||||
crt_switch_vert_adjust);
|
||||
if (p_switch->hh_core)
|
||||
{
|
||||
int corrected_width = 320;
|
||||
|
|
|
@ -48,8 +48,10 @@ typedef struct videocrt_switch
|
|||
|
||||
int center_adjust;
|
||||
int porch_adjust;
|
||||
int vert_adjust;
|
||||
int tmp_porch_adjust;
|
||||
int tmp_center_adjust;
|
||||
int tmp_vert_adjust;
|
||||
int rtn;
|
||||
int interlace;
|
||||
int doublescan;
|
||||
|
@ -85,7 +87,8 @@ void crt_switch_res_core(
|
|||
bool dynamic,
|
||||
int super_width,
|
||||
bool hires_menu,
|
||||
unsigned video_aspect_ratio_idx);
|
||||
unsigned video_aspect_ratio_idx,
|
||||
int crt_switch_vert_adjust);
|
||||
|
||||
void crt_destroy_modes(videocrt_switch_t *p_switch);
|
||||
|
||||
|
|
|
@ -2890,6 +2890,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
|||
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_porch_adjust = settings->ints.crt_switch_porch_adjust;
|
||||
video_info->crt_switch_vert_adjust = settings->ints.crt_switch_vertical_adjust;
|
||||
video_info->crt_switch_hires_menu = settings->bools.crt_switch_hires_menu;
|
||||
video_info->black_frame_insertion = settings->uints.video_black_frame_insertion;
|
||||
video_info->bfi_dark_frames = settings->uints.video_bfi_dark_frames;
|
||||
|
@ -4363,8 +4364,8 @@ void video_driver_frame(const void *data, unsigned width,
|
|||
dynamic_super_width,
|
||||
video_info.crt_switch_resolution_super,
|
||||
video_info.crt_switch_hires_menu,
|
||||
config_get_ptr()->uints.video_aspect_ratio_idx
|
||||
);
|
||||
config_get_ptr()->uints.video_aspect_ratio_idx,
|
||||
video_info.crt_switch_vert_adjust);
|
||||
}
|
||||
else if (!video_info.crt_switch_resolution)
|
||||
#endif
|
||||
|
|
|
@ -395,6 +395,7 @@ typedef struct video_frame_info
|
|||
int custom_vp_y;
|
||||
int crt_switch_center_adjust;
|
||||
int crt_switch_porch_adjust;
|
||||
int crt_switch_vert_adjust;
|
||||
|
||||
unsigned hard_sync_frames;
|
||||
unsigned runahead_frames;
|
||||
|
|
|
@ -2187,7 +2187,7 @@ MSG_HASH(
|
|||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CRT_SWITCH_VERTICAL_ADJUST,
|
||||
"Vertical Size"
|
||||
"Vertical Centring"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_CRT_SWITCH_HIRES_MENU,
|
||||
|
|
|
@ -14090,11 +14090,11 @@ static bool setting_append_list(
|
|||
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 = -3;
|
||||
/*(*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, 2.0, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, -50, 50, 1.0, true, true);
|
||||
|
||||
CONFIG_INT(
|
||||
list, list_info,
|
||||
|
@ -14107,11 +14107,11 @@ static bool setting_append_list(
|
|||
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].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, -50, 50, 2.0, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, -50, 100, 2.0, true, true);
|
||||
|
||||
CONFIG_INT(
|
||||
list, list_info,
|
||||
|
@ -14124,11 +14124,11 @@ static bool setting_append_list(
|
|||
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].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, -10, 10, 2.0, true, true);
|
||||
menu_settings_list_current_add_range(list, list_info, -20, 20, 1.0, true, true);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
|
|
Loading…
Reference in New Issue