From 6aae618b71e6afbd43bfe2ebc35d9a3d60abf50c Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 21 Sep 2025 17:55:19 +0200 Subject: [PATCH] debug: fixed top debug rectangle draw --- src/debug.s | 18 ++++++++++++++---- src/video.s | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) 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 -- 2.30.2