Add files via upload

Variables removed from headers.
This commit is contained in:
alphanu1 2018-03-29 17:54:46 +01:00 committed by GitHub
parent 0fe838bfcd
commit d06386d0a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 12 deletions

View File

@ -24,6 +24,7 @@
#include "video_crt_switch.h" #include "video_crt_switch.h"
#include "video_crt_win.h" #include "video_crt_win.h"
#include "video_crt_linux.h"
static float ra_tmp_core_hz; static float ra_tmp_core_hz;
static int ra_core_width; static int ra_core_width;
@ -31,6 +32,8 @@ static int ra_core_height;
static int ra_tmp_width; static int ra_tmp_width;
static int ra_tmp_height; static int ra_tmp_height;
static float fly_aspect; 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) 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 != ra_tmp_core_hz)
{ {
if (ra_core_hz < 53 ) if (ra_core_hz < 53 )
{ {
ra_set_core_hz = 50; ra_set_core_hz = 50;
@ -152,7 +156,7 @@ void switch_crt_hz()
{ {
ra_set_core_hz = 60; 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; ra_tmp_core_hz = ra_core_hz;
} }

View File

@ -17,12 +17,6 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
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 switch_res_core(int width, int height, float hz);
void check_first_run(); void check_first_run();
void screen_setup_aspect(int width, int height); void screen_setup_aspect(int width, int height);

View File

@ -24,6 +24,8 @@
#include "video_crt_switch.h" #include "video_crt_switch.h"
static int first_run; static int first_run;
static int orig_width;
static int orig_height;
void check_first_run() void check_first_run()
{ /* ruin of first boot to get current display resolution */ { /* ruin of first boot to get current display resolution */
@ -147,3 +149,5 @@ void video_restore()
{ {
switch_res(orig_width, orig_height,0,60); switch_res(orig_width, orig_height,0,60);
} }

View File

@ -119,7 +119,9 @@
#define video_driver_context_unlock() ((void)0) #define video_driver_context_unlock() ((void)0)
#endif #endif
bool crt_switching_active; static bool crt_switching_active;
static float video_driver_core_hz;
typedef struct video_pixel_scaler 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; const struct retro_system_timing *info = (const struct retro_system_timing*)&video_driver_av_info.timing;
rarch_ctl(RARCH_CTL_UNSET_NONBLOCK_FORCED, NULL); 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) if (!info || info->fps <= 0.0)
return; return;
if (crt_switching_active == true){ 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 { }else {
timing_skew = fabs(1.0f - info->fps / video_refresh_rate); 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); (float)info->fps);
if (crt_switching_active == true){ if (crt_switching_active == true){
if (info->fps <= ra_core_hz) if (info->fps <= video_driver_core_hz)
return; return;
} else { } else {
if (info->fps <= video_refresh_rate) if (info->fps <= video_refresh_rate)
@ -2597,6 +2599,7 @@ void video_driver_frame(const void *data, unsigned width,
/* trigger set resolution*/ /* trigger set resolution*/
if (video_info.crt_switch_resolution == true){ if (video_info.crt_switch_resolution == true){
crt_switching_active = true; crt_switching_active = true;
if (video_info.crt_switch_resolution_super == 2560){ if (video_info.crt_switch_resolution_super == 2560){
width = 2560; width = 2560;
} }
@ -2606,7 +2609,7 @@ void video_driver_frame(const void *data, unsigned width,
if (video_info.crt_switch_resolution_super == 1920){ if (video_info.crt_switch_resolution_super == 1920){
width = 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){ } else if (video_info.crt_switch_resolution == false){
crt_switching_active = false; crt_switching_active = false;
} }