SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 45bd5342e7ff2111f7effcfda8004ffee398adfa parent 0c2772942e8276dfe6e7d49f67f46043547d9f15 Author: Lior Halphon <LIJI32@gmail.com> Date: Sun, 24 Jul 2022 14:51:22 +0300 GBP support in SDL Diffstat:
| M | SDL/configuration.c | 1 | + |
| M | SDL/configuration.h | 1 | + |
| M | SDL/gui.c | 18 | +++++++++++++++++- |
| M | SDL/main.c | 5 | ++++- |
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/SDL/configuration.c b/SDL/configuration.c @@ -50,4 +50,5 @@ configuration_t configuration = .color_temperature = 10, .cgb_revision = GB_MODEL_CGB_E - GB_MODEL_CGB_0, .dmg_palette = 1, // Replacing the old default (0) as of 0.15.2 + .agb_revision = GB_MODEL_AGB_A, }; diff --git a/SDL/configuration.h b/SDL/configuration.h @@ -131,6 +131,7 @@ typedef struct { bool gui_pallete_enabled; // Change the GUI palette only once the user changed the DMG palette char dmg_palette_name[25]; hotkey_action_t hotkey_actions[2]; + uint16_t agb_revision; }; } configuration_t; diff --git a/SDL/gui.c b/SDL/gui.c @@ -517,10 +517,26 @@ static const char *current_rtc_mode_string(unsigned index) return ""; } +static void cycle_agb_revision(unsigned index) +{ + + configuration.agb_revision ^= GB_MODEL_GBP_BIT; + pending_command = GB_SDL_RESET_COMMAND; +} + +static const char *current_agb_revision_string(unsigned index) +{ + if (configuration.agb_revision == GB_MODEL_GBP_A) { + return "CPU AGB A (GBP)"; + } + return "CPU AGB A (AGB)"; +} + static const struct menu_item emulation_menu[] = { {"Emulated Model:", cycle_model, current_model_string, cycle_model_backwards}, - {"GBC Revision:", cycle_cgb_revision, current_cgb_revision_string, cycle_cgb_revision_backwards}, {"SGB Revision:", cycle_sgb_revision, current_sgb_revision_string, cycle_sgb_revision_backwards}, + {"GBC Revision:", cycle_cgb_revision, current_cgb_revision_string, cycle_cgb_revision_backwards}, + {"GBA Revision:", cycle_agb_revision, current_agb_revision_string, cycle_agb_revision}, {"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}, diff --git a/SDL/main.c b/SDL/main.c @@ -666,7 +666,7 @@ restart: { [MODEL_DMG] = GB_MODEL_DMG_B, [MODEL_CGB] = GB_MODEL_CGB_0 + configuration.cgb_revision, - [MODEL_AGB] = GB_MODEL_AGB_A, + [MODEL_AGB] = configuration.agb_revision, [MODEL_MGB] = GB_MODEL_MGB, [MODEL_SGB] = (GB_model_t []) { @@ -902,6 +902,9 @@ int main(int argc, char **argv) if (configuration.joypad_configuration[31] == 0) { memset(configuration.joypad_configuration + 12 , -1, 32 - 12); } + if ((configuration.agb_revision & ~GB_MODEL_GBP_BIT) != GB_MODEL_AGB_A) { + configuration.agb_revision = GB_MODEL_AGB_A; + } } if (configuration.model >= MODEL_MAX) {
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.