defs: wip rowpatterns
authorLukas Krickl <lukas@krickl.dev>
Fri, 19 Sep 2025 08:48:34 +0000 (10:48 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 19 Sep 2025 08:48:34 +0000 (10:48 +0200)
TODO.md
src/defs.s
src/main.s
src/map.s
src/rowpatterns.s [new file with mode: 0644]
src/wram.s

diff --git a/TODO.md b/TODO.md
index b988cd244c8a1a936e4f93efa409ca1b352c59fc..3475240f46132d0e1d056656092a16c68b93add9 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -41,6 +41,7 @@
 ## actors:
 
 [ ] actors have a specific collision box
+[ ] actors update code is based on type
 
 ## map
 
@@ -53,6 +54,7 @@
                - enemy spwaner (spwans n enemies of a specific type)
                - enemies always spawn slightly off screen and walk in once a spwaner is triggered
 [ ] scrolling is only possible up. moving back cannot be done
+[ ] maps can run code when objects are loaded based on type
 
 ## sate machine
 
index 76868ed47124d639a1d65c6e8b74f4dbc4ac64d9..df046ab87d7480626b028d3368fc94036a32f7f7 100644 (file)
 .def int DIRLEFT = BTNLEFT
 .def int DIRRIGHT = BTNRIGHT
 
+       
+       ; row pattern struct
+.se 0
+.de pat_tilemap, 10
+.de pat_size, 0
 
-; mapgen flags
-.se 1
-.de MAPGEN_F_NO_ACT_SG, 1
+       ; map object struct
+.se 0
+.de mo_type, 1
+.de mo_flags, 1
+.de mo_page, 1
+.de mo_row, 1
+.de mo_dat, 4
+.de mo_size, 0
index 24402c5961f34dd1cce7c77644b148c72664f0b0..1a46e01e890b73f2cfa9d2f69b591acc9be7245b 100644 (file)
@@ -60,6 +60,7 @@ main:
 #include "ui.s"
 #include "audio.s"
 #include "map.s"
+#include "rowpatterns.s"
 #include "math.s"
 #include "game.s"
 
index 916032d48c0d9eabdd3082f4c19bb8ba990e013c..480856fe9098e1ef7853b84f01afe0ad67c98529 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -1,12 +1,9 @@
-       ; loads a map 
-       ; including the required tileset
-       ; sets current page to 0
-       ; draws page 0 to the screen
-       ; loads map objects
-map_load:
-       ret
-       
-       ; draws a single row of tiles:w
-map_draw_row:
-       ret
+       ; tile space
+.def int TS = 0x30
 
+pat_empty:
+.db TS, TS, TS, TS, TS, TS, TS, TS, TS, TS 
+       
+       ; enf of level row pattern
+pat_eol:
+.db 0xFF       
diff --git a/src/rowpatterns.s b/src/rowpatterns.s
new file mode 100644 (file)
index 0000000..e69de29
index 5e2f38ca88358cb092fa6668b56b422fe22bc6ca..2ebcb352ae92b5cf6e8757486a6d6dc9d3235eb2 100644 (file)
@@ -60,6 +60,9 @@ srand: .adv 2
 player_unit: .adv 0 
 actors: .adv act_size * ACTS_MAX 
 
+       ; current page the map is on
 map_current_page: .adv 1
-       
-state_end:
+       ; current row that is being drawn
+map_current_row: .adv 1
+       ; current pattern to be drawn
+map_current_pattern: .adv 2