Merge pull request #65 from vanfanel/force-60hz

Add force 60Hz core option.
This commit is contained in:
LibretroAdmin 2023-05-23 03:46:36 +02:00 committed by GitHub
commit 75c2fedc53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -31,6 +31,7 @@ static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
static bool overscan;
static bool force_60hz;
static MDFN_PixelFormat last_pixel_format;
static unsigned rotate_mode;
@ -150,6 +151,17 @@ static void check_variables(void)
rotate_fixed = 3;
}
}
var.key = "lynx_force_60hz";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
if (strcmp(var.value, "enabled") == 0)
force_60hz = true;
else
force_60hz = false;
}
}
#define MAX_PLAYERS 1
@ -468,7 +480,10 @@ void retro_get_system_info(struct retro_system_info *info)
void retro_get_system_av_info(struct retro_system_av_info *info)
{
memset(info, 0, sizeof(*info));
info->timing.fps = MEDNAFEN_CORE_TIMING_FPS;
if (!force_60hz)
info->timing.fps = MEDNAFEN_CORE_TIMING_FPS;
else
info->timing.fps = 60.0;
info->timing.sample_rate = 44100.0;
info->geometry.base_width = MEDNAFEN_CORE_GEOMETRY_BASE_W;
info->geometry.base_height = MEDNAFEN_CORE_GEOMETRY_BASE_H;

View File

@ -94,6 +94,21 @@ struct retro_core_option_v2_definition option_defs_us[] = {
"16",
},
{
"lynx_force_60hz",
"Force 60Hz",
NULL,
"Force 60Hz instead of original 75Hz refresh rate, for perfectly smooth movement on 60Hz displays",
NULL,
NULL,
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{ NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
};