rectangle: point test now returns the byte after the rectangle
authorLukas Krickl <lukas@krickl.dev>
Thu, 2 Oct 2025 03:27:21 +0000 (05:27 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 2 Oct 2025 03:27:21 +0000 (05:27 +0200)
This may help needing to increment the pointers in the test loop.

src/rectangle.s

index 6bedb4edcbf7968aac6c27f7af0708f99144cfe5..058474a6b5beb72f5ec174b7161075e9ae3b3f19 100644 (file)
@@ -158,6 +158,7 @@ rect_br:
        ;       returns:
        ;               a == 1: inside
        ;               a == 0: not inside
+       ;               hl: byte after original rectangle
 rect_point_test:
        inc hl ; skip mask
 
@@ -199,7 +200,7 @@ rect_point_test:
        ; top right
 
        ; get top right x
-       ld a, [hl]
+       ld a, [hl+]
        add a, e ; e = x + width
        capoverflow
        ld e, a