SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 526b7130b1564b777641199407593e94b4c25ea1 parent 202073bb5cfd9911328cd2e3bc60389987ac34a3 Author: Lior Halphon <LIJI32@gmail.com> Date: Mon, 2 Mar 2026 21:28:48 +0200 Fix missing RTC option in libretro link mode, move menu options around. Fixes #653 Diffstat:
| M | libretro/libretro.c | 16 | ++++++++++++++-- |
| M | libretro/libretro_core_options.inc | 88 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
2 files changed, 59 insertions(+), 45 deletions(-)
diff --git a/libretro/libretro.c b/libretro/libretro.c @@ -33,7 +33,7 @@ static const char slash = '/'; #define RETRO_MEMORY_GAMEBOY_1_SRAM ((1 << 8) | RETRO_MEMORY_SAVE_RAM) #define RETRO_MEMORY_GAMEBOY_1_RTC ((2 << 8) | RETRO_MEMORY_RTC) #define RETRO_MEMORY_GAMEBOY_2_SRAM ((3 << 8) | RETRO_MEMORY_SAVE_RAM) -#define RETRO_MEMORY_GAMEBOY_2_RTC ((3 << 8) | RETRO_MEMORY_RTC) +#define RETRO_MEMORY_GAMEBOY_2_RTC ((4 << 8) | RETRO_MEMORY_RTC) #define RETRO_GAME_TYPE_GAMEBOY_LINK_2P 0x101 @@ -369,7 +369,6 @@ static void set_variable_visibility(void) const char *key = option_defs_us[i].key; if ((strcmp(key, "sameboy_model") == 0) || (strcmp(key, "sameboy_auto_sgb_model") == 0) || - (strcmp(key, "sameboy_rtc") == 0) || (strcmp(key, "sameboy_scaling_filter") == 0) || (strcmp(key, "sameboy_mono_palette") == 0) || (strcmp(key, "sameboy_color_correction_mode") == 0) || @@ -1032,6 +1031,19 @@ static void check_variables() auto_sgb_model[1] = new_model; } + + 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); + GB_set_rtc_mode(&gameboy[1], GB_RTC_MODE_SYNC_TO_HOST); + } + else if (strcmp(var.value, "accurate") == 0) { + GB_set_rtc_mode(&gameboy[0], GB_RTC_MODE_ACCURATE); + GB_set_rtc_mode(&gameboy[1], GB_RTC_MODE_ACCURATE); + } + } var.key = "sameboy_mono_palette_1"; var.value = NULL; diff --git a/libretro/libretro_core_options.inc b/libretro/libretro_core_options.inc @@ -116,20 +116,6 @@ struct retro_core_option_v2_definition option_defs_us[] = { "Super Game Boy" }, { - "sameboy_rtc", - "System - Real Time Clock Emulation", - "Real Time Clock Emulation", - "Specifies how the emulation of the real-time clock feature used in certain Game Boy and Game Boy Color games should function.", - NULL, - "system", - { - { "sync to system clock", "Sync to System Clock" }, - { "accurate", "Accurate" }, - { NULL, NULL }, - }, - "sync to system clock" - }, - { "sameboy_mono_palette", "Video - GB Mono Palette", "GB Mono Palette", @@ -293,35 +279,6 @@ struct retro_core_option_v2_definition option_defs_us[] = { "enabled" }, { - "sameboy_screen_layout", - "System - Screen Layout", - "Screen Layout", - "When emulating two systems at once, this option defines the respective position of the two screens.", - NULL, - "system", - { - { "top-down", "Top-Down" }, - { "left-right", "Left-Right" }, - { NULL, NULL }, - }, - "top-down" - }, - { - "sameboy_audio_output", - "System - Audio Output", - "Audio Output", - "Selects which of the two emulated Game Boy systems should output audio. If Mix Both is chosen, both Game Boys must have the same clock speed.", - NULL, - "system", - { - { "Game Boy #1", NULL }, - { "Game Boy #2", NULL }, - { "Mix Both", NULL }, - { NULL, NULL }, - }, - "Game Boy #1" - }, - { "sameboy_model_1", "System - Emulated Model for Game Boy #1 (Requires Restart)", "Emulated Model for Game Boy #1 (Requires Restart)", @@ -406,6 +363,20 @@ struct retro_core_option_v2_definition option_defs_us[] = { "Super Game Boy" }, { + "sameboy_screen_layout", + "Video - Screen Layout", + "Screen Layout", + "When emulating two systems at once, this option defines the respective position of the two screens.", + NULL, + "video", + { + { "top-down", "Top-Down" }, + { "left-right", "Left-Right" }, + { NULL, NULL }, + }, + "top-down" + }, + { "sameboy_mono_palette_1", "Video - GB Mono Palette for Game Boy #1", "GB Mono Palette for Game Boy #1", @@ -542,6 +513,21 @@ struct retro_core_option_v2_definition option_defs_us[] = { "0" }, { + "sameboy_audio_output", + "Audio - Audio Output", + "Audio Output", + "Selects which of the two emulated Game Boy systems should output audio. If Mix Both is chosen, both Game Boys must have the same clock speed.", + NULL, + "audio", + { + { "Game Boy #1", NULL }, + { "Game Boy #2", NULL }, + { "Mix Both", NULL }, + { NULL, NULL }, + }, + "Game Boy #1" + }, + { "sameboy_high_pass_filter_mode_1", "Audio - Highpass Filter for Game Boy #1", "Highpass Filter for Game Boy #1", @@ -667,6 +653,22 @@ struct retro_core_option_v2_definition option_defs_us[] = { }, "rumble-enabled games" }, + + /* Options available in both mode */ + { + "sameboy_rtc", + "System - Real Time Clock Emulation", + "Real Time Clock Emulation", + "Specifies how the emulation of the real-time clock feature used in certain Game Boy and Game Boy Color games should function.", + NULL, + "system", + { + { "sync to system clock", "Sync to System Clock" }, + { "accurate", "Accurate" }, + { NULL, NULL }, + }, + "sync to system clock" + }, { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL }, };
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.