From f10b647f53acbddb64e238224e4e32c5121d6002 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Thu, 24 Jul 2025 22:41:27 +0200 Subject: [PATCH] rooms: Added room pattern definitions --- src/main.s | 1 + src/map.s | 17 ---------------- src/roompatterns.s | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 src/roompatterns.s diff --git a/src/main.s b/src/main.s index ad78fb5..ba05eb5 100644 --- a/src/main.s +++ b/src/main.s @@ -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" diff --git a/src/map.s b/src/map.s index 0da455a..ca1b648 100644 --- 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 index 0000000..e9e2074 --- /dev/null +++ b/src/roompatterns.s @@ -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 -- 2.30.2