From: Lukas Krickl Date: Tue, 7 Oct 2025 04:00:29 +0000 (+0200) Subject: video: rectangles now despawn if the top corner is off-screen X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=a6ca64c2840e5c8ec07a238cc9909761249ce87c;p=gbrg%2F.git video: rectangles now despawn if the top corner is off-screen --- 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