From: Lukas Krickl Date: Tue, 11 Nov 2025 17:19:35 +0000 (+0100) Subject: tiles: adjacent tiles are now stored in an array X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=d83f4258e2c2956173d14b26493a10cd5ec78b65;p=gbrg%2F.git tiles: adjacent tiles are now stored in an array --- diff --git a/src/tiles.s b/src/tiles.s index a1534bf..86c4a19 100644 --- a/src/tiles.s +++ b/src/tiles.s @@ -216,8 +216,25 @@ tile_get_adjacent: ; 2) get tiles left and right (up to 2 tiles) + ; left + tile_adjacent_store 0, (-1 * t_size) & 0xFFFF + ; right + tile_adjacent_store (MAP_W-1), t_size + ; 3) get tiles below (up to 3 tiles) + ; check if y is already MAP_H-1 if so skip + ld a, [update_tile_y] + cp a, MAP_H-1 + jp z, @skip_below + + ; down/center tile + tile_adjacent_store 0xFF, (t_size * MAP_W) + ; down/left tile + tile_adjacent_store 0, (t_size * (MAP_W+1)) + ; down/right tile + tile_adjacent_store (MAP_W-1), (t_size * (MAP_W-1)) +@skip_below: ret