SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit bae91cdb1d5320d42f3b637c22d026e3cff64248 parent 72cb391612863a43cb3c876b1d210534a54a4020 Author: Lior Halphon <LIJI32@gmail.com> Date: Fri, 26 Feb 2021 01:04:24 +0200 Add RTC option to the SDL port, fix a bug where rewind setting didn't update Diffstat:
| M | SDL/gui.c | 15 | +++++++++++++++ |
| M | SDL/gui.h | 1 | + |
| M | SDL/main.c | 3 | +++ |
3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/SDL/gui.c b/SDL/gui.c @@ -482,11 +482,26 @@ static void toggle_bootrom(unsigned index) } } +static void toggle_rtc_mode(unsigned index) +{ + configuration.rtc_mode = !configuration.rtc_mode; +} + +const char *current_rtc_mode_string(unsigned index) +{ + switch (configuration.rtc_mode) { + case GB_RTC_MODE_SYNC_TO_HOST: return "Sync to System Clock"; + case GB_RTC_MODE_ACCURATE: return "Accurate"; + } + return ""; +} + static const struct menu_item emulation_menu[] = { {"Emulated Model:", cycle_model, current_model_string, cycle_model_backwards}, {"SGB Revision:", cycle_sgb_revision, current_sgb_revision_string, cycle_sgb_revision_backwards}, {"Boot ROMs Folder:", toggle_bootrom, current_bootrom_string, toggle_bootrom}, {"Rewind Length:", cycle_rewind, current_rewind_string, cycle_rewind_backwards}, + {"Real Time Clock:", toggle_rtc_mode, current_rtc_mode_string, toggle_rtc_mode}, {"Back", return_to_root_menu}, {NULL,} }; diff --git a/SDL/gui.h b/SDL/gui.h @@ -116,6 +116,7 @@ typedef struct { uint8_t color_temperature; char bootrom_path[4096]; uint8_t interference_volume; + GB_rtc_mode_t rtc_mode; } configuration_t; extern configuration_t configuration; diff --git a/SDL/main.c b/SDL/main.c @@ -125,6 +125,8 @@ static void open_menu(void) GB_set_border_mode(&gb, configuration.border_mode); update_palette(); GB_set_highpass_filter_mode(&gb, configuration.highpass_mode); + GB_set_rewind_length(&gb, configuration.rewind_length); + GB_set_rtc_mode(&gb, configuration.rtc_mode); if (previous_width != GB_get_screen_width(&gb)) { screen_size_changed(); } @@ -513,6 +515,7 @@ restart: } GB_set_highpass_filter_mode(&gb, configuration.highpass_mode); GB_set_rewind_length(&gb, configuration.rewind_length); + GB_set_rtc_mode(&gb, configuration.rtc_mode); GB_set_update_input_hint_callback(&gb, handle_events); GB_apu_set_sample_callback(&gb, gb_audio_callback); }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.