mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Add files via upload
Variables removed from headers.
This commit is contained in:
parent
0fe838bfcd
commit
d06386d0a5
@ -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;
|
||||
}
|
||||
|
||||
|
@ -17,12 +17,6 @@
|
||||
* 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 check_first_run();
|
||||
void screen_setup_aspect(int width, int height);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user