rooms: Added room pattern definitions
authorLukas Krickl <lukas@krickl.dev>
Thu, 24 Jul 2025 20:41:27 +0000 (22:41 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 24 Jul 2025 20:41:27 +0000 (22:41 +0200)
src/main.s
src/map.s
src/roompatterns.s [new file with mode: 0644]

index ad78fb55ac455c76e5319f157a2a553d6f566041..ba05eb5874125c45dad94820881b08c32c3aa7a7 100644 (file)
@@ -60,6 +60,7 @@ main:
 #include "ui.s"
 #include "audio.s"
 #include "map.s"
+#include "roompatterns.s"
 #include "mapgen.s"
 #include "state.s"
 #include "tiles.inc"
index 0da455aaf19613f3af1daca55b3aab72e9c82cae..ca1b64820a171b0ce7b5bc42553223f99c4b878d 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -530,20 +530,3 @@ map_null_state:
 #include "map_bc.s"
 #include "map_bw.s"
 
-; template rooms
-; rooms are template patterns that can be placed
-; on maps
-; the room pattern tiles used depend on the current floor
-; each pattern entry has a specific flag set that is placed in the map
-; room patterns are 6 by 6 areas with the following properties:
-.se 0
-.de ROOM_PAT_UP_LEFT_CORNER, 1
-.de ROOM_PAT_UP_WALL, 1
-.de ROOM_PAT_UP_RIGHT_CORNER, 1
-.de ROOM_PAT_LEFT_WALL, 1
-.de ROOM_PAT_BOTTOM_LEFT_CORNER, 1
-.de ROOM_PAT_BOTTOM_WALL, 1
-.de ROOM_PAT_BOTTOM_RIGHT_CORNER, 1
-.de ROOM_PAT_RIGHT_WALL, 1
-.de ROOM_PAT_FLOOR, 1
-.de ROOM_PAT_DOOR, 1
diff --git a/src/roompatterns.s b/src/roompatterns.s
new file mode 100644 (file)
index 0000000..e9e2074
--- /dev/null
@@ -0,0 +1,48 @@
+
+  ; room pattern row
+  ; inputs:
+  ;   $1-$6: RP entry
+#macro rprow
+  .db $1, $2, $3, $4, $5, $6
+#endmacro
+
+; template rooms
+; rooms are template patterns that can be placed
+; on maps
+; the room pattern tiles used depend on the current floor
+; each pattern entry has a specific flag set that is placed in the map
+; room patterns are 6 by 6 areas with the following properties:
+.se 0
+  ; room pattern up left corner
+.de RPUL, 1
+  ; room pattern up wall
+.de RPUW, 1
+  ; room pattern up right corner
+.de RPUR, 1
+  ; left wall
+.de RPLW, 1
+.de RPRW, 1
+  ; bottom right corner
+.de RPBR, 1
+  ; bottom wall
+.de RPBW, 1
+  ; bottom left corner
+.de RPBL, 1
+  ; floor
+.de RPFL, 1
+  ; door up
+.de RPDU, 1
+  ; door bottom 
+.de RPDB, 1
+  ; door left
+.de RPDL, 1
+  ; door right
+.de RPDR, 1
+
+room_pattern1:
+  rprow RPUL, RPUW, RPUW, RPDU, RPUW, RPUW, RPUR
+  rprow RPLW, RPFL, RPFL, RPFL, RPFL, RPFL, RPUW
+  rprow RPLW, RPFL, RPFL, RPFL, RPFL, RPFL, RPUW
+  rprow RPLW, RPFL, RPFL, RPFL, RPFL, RPFL, RPUW
+  rprow RPLW, RPFL, RPFL, RPFL, RPFL, RPFL, RPUW
+  rprow RPBL, RPBW, RPBW, RPDB, RPBW, RPBW, RPBR