From a6ca64c2840e5c8ec07a238cc9909761249ce87c Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 7 Oct 2025 06:00:29 +0200 Subject: [PATCH] video: rectangles now despawn if the top corner is off-screen --- src/video.s | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video.s b/src/video.s index 3975e71..33f3bc4 100644 --- a/src/video.s +++ b/src/video.s @@ -142,7 +142,8 @@ scroll_up_adjust: ld a, [hl] add a, SCROLL_ADJUST_STEP - ld [hl], a + ld [hl+], a + ; hl = r_pos_x ; check if off-screen cp a, -16 & 0xFF ; do not despawn if -16 @@ -150,6 +151,11 @@ scroll_up_adjust: pop de push de + ; go to r_h + inc hl ; hl = r_h + sub a, [hl] + capunderflow + ; despawn if *top* corner is far off-screen cp a, 0xA0 call nc, rect_despawn -- 2.30.2