diff --git a/libretro/libretro.c b/libretro/libretro.c index 0fb8dc5..6b531b6 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -237,6 +237,7 @@ static const struct retro_variable vars_single[] = { { "sameboy_model", "Emulated model (Restart game); Auto|Game Boy|Game Boy Color|Game Boy Advance|Super Game Boy|Super Game Boy 2" }, { "sameboy_border", "Display border; Super Game Boy only|always|never" }, { "sameboy_rumble", "Enable rumble; rumble-enabled games|all games|never" }, + { "sameboy_rtc", "Real Time Clock emulation; sync to system clock|accurate" }, { NULL } }; @@ -594,6 +595,17 @@ static void check_variables() GB_set_rumble_mode(&gameboy[0], GB_RUMBLE_ALL_GAMES); } } + + var.key = "sameboy_rtc"; + var.value = NULL; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + if (strcmp(var.value, "sync to system clock") == 0) { + GB_set_rtc_mode(&gameboy[0], GB_RTC_MODE_SYNC_TO_HOST); + } + else if (strcmp(var.value, "accurate") == 0) { + GB_set_rtc_mode(&gameboy[0], GB_RTC_MODE_ACCURATE); + } + } var.key = "sameboy_high_pass_filter_mode"; var.value = NULL; @@ -654,6 +666,8 @@ static void check_variables() else { GB_set_border_mode(&gameboy[0], GB_BORDER_NEVER); GB_set_border_mode(&gameboy[1], GB_BORDER_NEVER); + GB_set_rtc_mode(&gameboy[0], GB_RTC_MODE_ACCURATE); + GB_set_rtc_mode(&gameboy[1], GB_RTC_MODE_ACCURATE); var.key = "sameboy_color_correction_mode_1"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {