Fix incorrect register values when changing the color palette via the boot ROM

This commit is contained in:
Lior Halphon 2019-06-08 13:37:49 +03:00
parent 5cda1f2f5f
commit bb7fa95426
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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 ../$<