From d06386d0a532cbbd5668b3621d0a1c8f3e042f4b Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Thu, 29 Mar 2018 17:54:46 +0100 Subject: [PATCH] Add files via upload Variables removed from headers. --- gfx/video_crt_switch.c | 6 +++++- gfx/video_crt_switch.h | 6 ------ gfx/video_crt_win.c | 4 ++++ gfx/video_driver.c | 13 ++++++++----- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 78bede1243..7fc36dd3c9 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -24,6 +24,7 @@ #include "video_crt_switch.h" #include "video_crt_win.h" +#include "video_crt_linux.h" static float ra_tmp_core_hz; static int ra_core_width; @@ -31,6 +32,8 @@ static int ra_core_height; static int ra_tmp_width; static int ra_tmp_height; static float fly_aspect; +static float ra_core_hz; +static int ra_set_core_hz; void switch_res_core(int width, int height, float hz) { @@ -139,6 +142,7 @@ void switch_crt_hz() if (ra_core_hz != ra_tmp_core_hz) { + if (ra_core_hz < 53 ) { ra_set_core_hz = 50; @@ -152,7 +156,7 @@ void switch_crt_hz() { ra_set_core_hz = 60; } - video_monitor_set_refresh_rate(ra_core_hz); + video_monitor_set_refresh_rate(ra_set_core_hz); ra_tmp_core_hz = ra_core_hz; } diff --git a/gfx/video_crt_switch.h b/gfx/video_crt_switch.h index cd51ada523..f518dc7bfa 100644 --- a/gfx/video_crt_switch.h +++ b/gfx/video_crt_switch.h @@ -17,12 +17,6 @@ * If not, see . */ - -static float ra_core_hz; /* Shared with video_driver.c */ -static int ra_set_core_hz; -static int orig_width; -static int orig_height; - void switch_res_core(int width, int height, float hz); void check_first_run(); void screen_setup_aspect(int width, int height); diff --git a/gfx/video_crt_win.c b/gfx/video_crt_win.c index 6d6264b431..f843279b97 100644 --- a/gfx/video_crt_win.c +++ b/gfx/video_crt_win.c @@ -24,6 +24,8 @@ #include "video_crt_switch.h" static int first_run; +static int orig_width; +static int orig_height; void check_first_run() { /* ruin of first boot to get current display resolution */ @@ -147,3 +149,5 @@ void video_restore() { switch_res(orig_width, orig_height,0,60); } + + diff --git a/gfx/video_driver.c b/gfx/video_driver.c index bef90c75ae..823a74c3c9 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -119,7 +119,9 @@ #define video_driver_context_unlock() ((void)0) #endif -bool crt_switching_active; +static bool crt_switching_active; +static float video_driver_core_hz; + typedef struct video_pixel_scaler { @@ -1417,13 +1419,13 @@ void video_driver_monitor_adjust_system_rates(void) const struct retro_system_timing *info = (const struct retro_system_timing*)&video_driver_av_info.timing; rarch_ctl(RARCH_CTL_UNSET_NONBLOCK_FORCED, NULL); - ra_core_hz = info->fps; + video_driver_core_hz = info->fps; if (!info || info->fps <= 0.0) return; if (crt_switching_active == true){ - timing_skew = fabs(1.0f - info->fps / ra_core_hz); + timing_skew = fabs(1.0f - info->fps / video_driver_core_hz); }else { timing_skew = fabs(1.0f - info->fps / video_refresh_rate); } @@ -1437,7 +1439,7 @@ void video_driver_monitor_adjust_system_rates(void) (float)info->fps); if (crt_switching_active == true){ - if (info->fps <= ra_core_hz) + if (info->fps <= video_driver_core_hz) return; } else { if (info->fps <= video_refresh_rate) @@ -2597,6 +2599,7 @@ void video_driver_frame(const void *data, unsigned width, /* trigger set resolution*/ if (video_info.crt_switch_resolution == true){ crt_switching_active = true; + if (video_info.crt_switch_resolution_super == 2560){ width = 2560; } @@ -2606,7 +2609,7 @@ void video_driver_frame(const void *data, unsigned width, if (video_info.crt_switch_resolution_super == 1920){ width = 1920; } - switch_res_core(width, height, ra_core_hz); + switch_res_core(width, height, video_driver_core_hz); } else if (video_info.crt_switch_resolution == false){ crt_switching_active = false; }