Make the SGB boot ROMs closer in timing to the original ones, fixed #602

This commit is contained in:
Lior Halphon
2024-04-05 18:44:22 +03:00
parent a80a19b418
commit 3f799f21ff
2 changed files with 14 additions and 11 deletions

View File

@@ -119,6 +119,19 @@ Start:
ld a, $30
ld [c], a
; Wait 4 frames
ld e, 4
ld a, 1
ldh [rIE], a
xor a
.waitLoop
ldh [rIF], a
halt
nop
dec e
jr nz, .waitLoop
ldh [rIE], a
; Update command
ldh a, [_HRAM]
add 2
@@ -198,16 +211,6 @@ DoubleBitsAndWriteRow:
inc hl
ret
WaitFrame:
push hl
ld hl, $FF0F
res 0, [hl]
.wait
bit 0, [hl]
jr z, .wait
pop hl
ret
TrademarkSymbol:
db $3c,$42,$b9,$a5,$b9,$a5,$42,$3c

View File

@@ -629,7 +629,7 @@ $(BIN)/BootROMs/sgb2_boot: BootROMs/sgb_boot.asm
$(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb12
-@$(MKDIR) -p $(dir $@)
$(RGBASM) -i $(OBJ)/BootROMs/ -i BootROMs/ -o $@.tmp $<
$(RGBASM) -H -i $(OBJ)/BootROMs/ -i BootROMs/ -o $@.tmp $<
$(RGBLINK) -o $@.tmp2 $@.tmp
dd if=$@.tmp2 of=$@ count=1 bs=$(if $(findstring cgb,$@)$(findstring agb,$@),2304,256) 2> $(NULL)
@rm $@.tmp $@.tmp2