Fixed timing issues with the DMG boot ROM. Closes #20.

This commit is contained in:
Lior Halphon 2017-12-31 23:02:28 +02:00
parent 42bf575a0e
commit d62ff4eb75

View File

@ -80,14 +80,14 @@ Start:
; Play first sound ; Play first sound
ld a, $83 ld a, $83
call PlaySound call PlaySound
ld b, 15 ld b, 5
call WaitBFrames call WaitBFrames
; Play second sound ; Play second sound
ld a, $c1 ld a, $c1
call PlaySound call PlaySound
; Wait ~2.5 seconds ; Wait ~1.15 seconds
ld b, 150 ld b, 70
call WaitBFrames call WaitBFrames
; Set registers to match the original DMG boot ; Set registers to match the original DMG boot
@ -123,9 +123,13 @@ DoubleBitsAndWriteRow:
ret ret
WaitFrame: WaitFrame:
ldh a, [$44] push hl
cp $90 ld hl, $FF0F
jr nz, WaitFrame res 0, [hl]
.wait
bit 0, [hl]
jr z, .wait
pop hl
ret ret
WaitBFrames: WaitBFrames: