defs: Added stub for getting adjacent tiles
authorLukas Krickl <lukas@krickl.dev>
Sun, 9 Nov 2025 11:30:43 +0000 (12:30 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 9 Nov 2025 11:30:43 +0000 (12:30 +0100)
src/defs.s
src/tiles.s
src/wram.s

index 59504d78e847fc55975a63b7975ba87fafc2b662..d1009bb17a903b5ffe4530d776c0843e183bdaf9 100644 (file)
@@ -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
index 0040986959e6af6d78f9f2bf229e35f78eaf67da..31ba935aa1e3606a2849de60ded2d11a3410cadb 100644 (file)
@@ -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:
index 2551010f148dffbbb0d07bea9f7260dd78aef437..2a5c9c515d5ad36a4e6ccf25c879e3bf57ad3e34 100644 (file)
@@ -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