From eb95f1de5598807b07d5ee59771515d6aacc1d6e Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Tue, 16 Jul 2019 23:14:26 +0300 Subject: [PATCH] Fixed a bug where the SDL port loaded the incorrect boot ROM for SGB2. Made SameBoy compatible with older SDL versions. --- SDL/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SDL/main.c b/SDL/main.c index df6837f..ba2a5fb 100755 --- a/SDL/main.c +++ b/SDL/main.c @@ -23,6 +23,11 @@ #define AUDIO_FREQUENCY 48000 #endif +/* Compatibility with older SDL versions */ +#ifndef SDL_AUDIO_ALLOW_SAMPLES_CHANGE +#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0 +#endif + GB_gameboy_t gb; static bool paused = false; static uint32_t pixel_buffer_1[256 * 224], pixel_buffer_2[256 * 224]; @@ -464,7 +469,7 @@ restart: start_capturing_logs(); const char * const boot_roms[] = {"dmg_boot.bin", "cgb_boot.bin", "agb_boot.bin", "sgb_boot.bin"}; const char *boot_rom = boot_roms[configuration.model]; - if (configuration.model == GB_MODEL_SGB && configuration.sgb_revision == SGB_2) { + if (configuration.model == MODEL_SGB && configuration.sgb_revision == SGB_2) { boot_rom = "sgb2_boot.bin"; } error = GB_load_boot_rom(&gb, resource_path(boot_rom));