From ffa1c95279d2145a968e6c9b749194ee652e47cb Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 11 Oct 2024 13:13:48 +0200 Subject: [PATCH] wip: map tile flag lookup --- src/collision.s | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/collision.s b/src/collision.s index d1bca5e..2b9e5d7 100644 --- a/src/collision.s +++ b/src/collision.s @@ -75,9 +75,19 @@ collision_tile: sra e ; / 4 sra e ; / 8 sra e ; / 16 + ld a, e ; a = x pos + + ld e, d + ld d, 0 ; de = y position now ; -> now convert position to ; map flag index using a simple lut ; for y position + x + ld hl, collision_tile_lut + add hl, de ; hl + y offset + ; hl = row ptr + ld e, a ; e = x pos + ld a, [hl] ; a = map flags row offset + add a, e ; row + x = position of tile in map ret -- 2.30.2