debug: fixed top debug rectangle draw
authorLukas Krickl <lukas@krickl.dev>
Sun, 21 Sep 2025 15:55:19 +0000 (17:55 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sun, 21 Sep 2025 15:55:19 +0000 (17:55 +0200)
src/debug.s
src/video.s

index 929c22b4f70cfe3781cad798af005c99e7913e02..d4e0882477c7da9a3896045cdeab2968b2ec998c 100644 (file)
@@ -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
index 4f73debcf8437f612e24bdc67784f2a42e07dd07..2e86d40356419b3e9cc793066057acc7165de734 100644 (file)
@@ -133,7 +133,7 @@ scroll_up_adjust:
                ; check if off-screen
                pop de
                push de
-               cp a, 0x7
+               cp a, 0xB
                call nc, rect_despawn
                
                pop hl