From 50315f897c8ce3355c5f28ef2f78fd657f67952b Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 9 Nov 2025 12:30:43 +0100 Subject: [PATCH] defs: Added stub for getting adjacent tiles --- src/defs.s | 1 + src/tiles.s | 11 +++++++++++ src/wram.s | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/src/defs.s b/src/defs.s index 59504d7..d1009bb 100644 --- a/src/defs.s +++ b/src/defs.s @@ -82,6 +82,7 @@ .de TI_ENEMY_USED, 1 .de TI_ENEMY_HIVE, 1 .de TI_FOOD, 1 +.de TI_SIZE, 0 ; owner enum .se 0 diff --git a/src/tiles.s b/src/tiles.s index 0040986..31ba935 100644 --- a/src/tiles.s +++ b/src/tiles.s @@ -125,9 +125,20 @@ tile_str_table: ; returns NULL if TO_NULL is set ; inputs: ; de: tile + ; returns: + ; bc: actor tile_get_actor: ; TODO: ret + + ; stores pointers to + ; all adjacent tiles + ; stores NULL if adjacent tile is out + ; of bounds + ; also counts the amount of seen types + ; in tiles_adjacen_types +tile_get_adjacent: + ret ; updates empty tile ; inputs: diff --git a/src/wram.s b/src/wram.s index 2551010..2a5c9c5 100644 --- a/src/wram.s +++ b/src/wram.s @@ -80,6 +80,14 @@ tile_curr: .adv 2 tiles: .adv t_size * MAP_TILES tiles_end: .adv 0 + + ; list of pointers + ; to all adjacent tiles + ; set to NULL if no tile is adjacent +tiles_adjacent: .adv 2 * 8 + ; a list of adjacent types + ; one byte for each TI_* type +tiles_adjacent_types: .adv TI_SIZE ui_draw_routine: .adv 2 -- 2.30.2