From d62ff4eb75bb2a2f2ceab5822d52135f06e81a3b Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 31 Dec 2017 23:02:28 +0200 Subject: [PATCH] Fixed timing issues with the DMG boot ROM. Closes #20. --- BootROMs/dmg_boot.asm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/BootROMs/dmg_boot.asm b/BootROMs/dmg_boot.asm index e22dee0..d4176a8 100644 --- a/BootROMs/dmg_boot.asm +++ b/BootROMs/dmg_boot.asm @@ -80,14 +80,14 @@ Start: ; Play first sound ld a, $83 call PlaySound - ld b, 15 + ld b, 5 call WaitBFrames ; Play second sound ld a, $c1 call PlaySound -; Wait ~2.5 seconds - ld b, 150 +; Wait ~1.15 seconds + ld b, 70 call WaitBFrames ; Set registers to match the original DMG boot @@ -123,9 +123,13 @@ DoubleBitsAndWriteRow: ret WaitFrame: - ldh a, [$44] - cp $90 - jr nz, WaitFrame + push hl + ld hl, $FF0F + res 0, [hl] +.wait + bit 0, [hl] + jr z, .wait + pop hl ret WaitBFrames: