From: Lukas Krickl Date: Sun, 21 Sep 2025 15:55:19 +0000 (+0200) Subject: debug: fixed top debug rectangle draw X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=6aae618b71e6afbd43bfe2ebc35d9a3d60abf50c;p=gbrg%2F.git debug: fixed top debug rectangle draw --- diff --git a/src/debug.s b/src/debug.s index 929c22b..d4e0882 100644 --- a/src/debug.s +++ b/src/debug.s @@ -124,8 +124,13 @@ dbg_rect_draw: ; write top left y ld a, [de] ; a = heigth - sub a, b ; height - y - add a, 16 + OBJ_OFF_Y ; off by one obj height so it won't end up off-screen + + push bc + ld c, a + ld a, b + sub a, c ; height - y + pop bc + ld [hl+], a ; write top left x @@ -163,8 +168,13 @@ dbg_rect_draw: ; write top right y ld a, [de] ; a = height - sub a, b ; height - y - add a, 16 + OBJ_OFF_Y ; off by one obj height so it won't end up off-screen + + push bc + ld c, a + ld a, b + sub a, c ; height - y + pop bc + ld [hl+], a ; write top left x diff --git a/src/video.s b/src/video.s index 4f73deb..2e86d40 100644 --- a/src/video.s +++ b/src/video.s @@ -133,7 +133,7 @@ scroll_up_adjust: ; check if off-screen pop de push de - cp a, 0x70 + cp a, 0xB0 call nc, rect_despawn pop hl