all repos — mgba @ c640819179b9ef6f441bd97327634bd70c8842a8

mGBA Game Boy Advance Emulator

GB: Downgrade DMG-only ROMs from CGB mode even without boot ROM
Vicki Pfau vi@endrift.com
Fri, 20 Nov 2020 00:35:52 -0800
commit

c640819179b9ef6f441bd97327634bd70c8842a8

parent

bf611e01f238b3366dcde7a5f176a0a9d198c520

2 files changed, 6 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -17,6 +17,7 @@ - ARM: Fix ALU reading PC after shifting

- ARM: Fix STR storing PC after address calculation - ARM: Fix Addressing mode 1 shifter on rs == pc (fixes mgba.io/i/1926) - GB: Partially fix timing for skipped BIOS + - GB: Downgrade DMG-only ROMs from CGB mode even without boot ROM - GB Audio: Fix serializing sweep time - GB MBC: Fix MBC1 mode changing behavior - GB MBC: Fix some MBC3 bit masking
M src/gb/gb.csrc/gb/gb.c

@@ -489,6 +489,11 @@ struct SM83Core* cpu = gb->cpu;

const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; int nextDiv = 0; + if (gb->model >= GB_MODEL_CGB && !(cart->cgb & 0x80)) { + gb->model = GB_MODEL_DMG; + GBVideoDisableCGB(&gb->video); + } + switch (gb->model) { case GB_MODEL_AUTODETECT: // Silence warnings gb->model = GB_MODEL_DMG;