map: Added definition for exit table
authorLukas Krickl <lukas@krickl.dev>
Thu, 3 Jul 2025 03:55:54 +0000 (05:55 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 3 Jul 2025 03:55:54 +0000 (05:55 +0200)
src/defs.s
src/macros.inc
tiles/bank8800.inc

index a2a74d4b08d74e0c5a059a796d87220e9a5d90f7..bffca01a9335024e5a1441c85b0a5925c45c53c8 100644 (file)
 .de map_tile_bank2_ptr, 2
 .de map_tile_bank3_ptr, 2
 
+  ; pointer to exit table
+  ; 
+.de map_exit_table_ptr, 2
+
+
 
   ; map actor table struct
 .se 0
   ; list of be pointers to actors
 .de map_actor_table_act_ptrs, 0
 
+  ; map exit flags
+.se 1
+  ; if set players Y/X position
+  ; to the opposite side of the 
+  ; map upon entering
+.de MAP_EXITF_FLIPY, 1
+.de MAP_EXITF_FLIPX, 2
+  ; goto will set the actual position
+  ; based on the exit table entry
+.de MAP_EXITF_GOTOY, 4
+.de MAP_EXITF_GOTOX, 8
+
+  ; map exit table entry struct
+.se 0
+.de map_exit_flags, 1
+.de map_exit_goto_y, 1
+.de map_exit_goto_x, 1
+  ; pointer to new map struct
+.de map_exit_to, 2
+
 ; special text commands
 
 ; consumes the command 
index ac6e41f833dff11f5867bc2291c852ce75002107..bc375194105586aa7caee95dcd02113aced913f8 100644 (file)
   .db 0, 0
 #endmacro
 
+  ; defines an exit table entry
+  ; inputs:
+  ;   $1: flags
+  ;   $2: goto y
+  ;   $3: goto x
+  ;   $4: map header pointer
+#macro map_exit_table_entry
+  .db $1
+  .db $2
+  .db $3
+  dw $4
+#endmacro
+
   ; loads NULL into a 16 bit register
   ; inputs:
   ;   $1: register
index 72073f067860664c07a9fa6694d20618c6735d4f..50db6fe17d9dc9ef6e43ecb5f0b8833f7623594a 100644 (file)
@@ -67,6 +67,7 @@
 .chr 00000000
 .chr 00000000
 ; tile 4
+.chr 00000000
 .chr 00000003
 .chr 00000033
 .chr 00000333
 .chr 00000333
 .chr 00000333
 .chr 00000333
-.chr 00000333
-.chr 00000113
 .chr 00000110
+.chr 00000000
 ; tile 5
+.chr 00000000
 .chr 30000000
 .chr 33000000
 .chr 33300000
 .chr 21103100
 .chr 22203300
 .chr 33303300
+.chr 33332300
+.chr 33332300
 .chr 33303300
 .chr 33303300
-.chr 33122300
-.chr 33122300
-.chr 33303300
 .chr 33303300
-.chr 31103300
 .chr 01103300
+.chr 00000000
 ; tile 6
 .chr 00000000
 .chr 00000000