Add force 60Hz core option.

This commit is contained in:
vanfanel 2022-12-16 14:31:05 +01:00
parent 9c48124dc1
commit 1871b3bdfa
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));
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 },
};