all repos — mgba @ 2c9dd238cc3520af8af8584d366e89ed00f9fea4

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

2c9dd238cc3520af8af8584d366e89ed00f9fea4

parent

ce00cf77274f5f83d9f2156e417a0fe145acaaa9

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

jump to
M CHANGESCHANGES

@@ -1,6 +1,7 @@

0.8.5: (Future) Emulation fixes: - ARM: Fix Addressing mode 1 shifter on rs == pc (fixes mgba.io/i/1926) + - GB: Downgrade DMG-only ROMs from CGB mode even without boot ROM - GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring Other fixes: - CMake: Fix build with downstream minizip that exports incompatible symbols
M src/gb/gb.csrc/gb/gb.c

@@ -481,6 +481,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;