map: Fixed f1 room table size calculation.
authorLukas Krickl <lukas@krickl.dev>
Mon, 6 Jan 2025 06:28:06 +0000 (07:28 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 6 Jan 2025 06:28:06 +0000 (07:28 +0100)
This was an off-by-one error due to the placement of the start label
which included the table length itself.

src/map.s

index 050e054b3c6410a10e1c93665b0f37e4d00e133e..623157e63b129dacaec6de08a5eafba5c181cd37 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -1020,13 +1020,14 @@ map_gen_copy_base_room:
 #include "base_room4.s"
 
   ;  count of all pointers in base room table
-#define F1_ROOM_TABLE_LEN ((f1_room_table_end - f1_room_table) / 2)
+#define F1_ROOM_TABLE_LEN ((f1_room_table_end - f1_room_table_start) / 2)
 
   ; the first byte of the table is the length of the table 
   ; a table of all base room ptrs
   ; length must be divisible by 2
 f1_room_table:
   .db F1_ROOM_TABLE_LEN
+f1_room_table_start:
   dw base_room_header
   dw base_room2_header
   dw base_room3_header