From bb7fa95426d25bb03d6e37e6e34412c218acdbf8 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 8 Jun 2019 13:37:49 +0300 Subject: [PATCH] Fix incorrect register values when changing the color palette via the boot ROM --- BootROMs/cgb_boot.asm | 4 ++++ Makefile | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/BootROMs/cgb_boot.asm b/BootROMs/cgb_boot.asm index ee0198a..3e07399 100644 --- a/BootROMs/cgb_boot.asm +++ b/BootROMs/cgb_boot.asm @@ -758,13 +758,17 @@ ENDC ld a, [$143] bit 7, a call z, EmulateDMG + bit 7, a + ldh [$4C], a ldh a, [TitleChecksum] ld b, a + jr z, .skipDMGForCGBCheck ldh a, [InputPalette] and a jr nz, .emulateDMGForCGBGame +.skipDMGForCGBCheck IF DEF(AGB) ; Set registers to match the original AGB-CGB boot ; AF = $1100, C = 0 diff --git a/Makefile b/Makefile index 38b3e83..e052287 100644 --- a/Makefile +++ b/Makefile @@ -322,6 +322,10 @@ $(BIN)/SDL/Shaders: Shaders # Boot ROMs +$(BIN)/BootROMs/agb_boot.bin: BootROMs/cgb_boot.asm +$(BIN)/BootROMs/cgb_boot_fast.bin: BootROMs/cgb_boot.asm +$(BIN)/BootROMs/sgb2_boot: BootROMs/sgb_boot.asm + $(BIN)/BootROMs/%.bin: BootROMs/%.asm -@$(MKDIR) -p $(dir $@) cd BootROMs && rgbasm -o ../$@.tmp ../$<