Skip to content

Commit

Permalink
Make the SGB boot ROMs closer in timing to the original ones, fixed L…
Browse files Browse the repository at this point in the history
  • Loading branch information
LIJI32 committed Apr 5, 2024
1 parent a80a19b commit 3f799f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions BootROMs/sgb_boot.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f799f2

Please sign in to comment.