; map exit table entry struct
.se 0
-.de map_exit_flags, 1
+.de exit_flags, 1
; if this is != 0
; the exit will only trigger
; if the input specified is pressed
-.de map_exit_required_input, 1
-.de map_exit_goto_y, 1
-.de map_exit_goto_x, 1
+.de exit_required_input, 1
+.de exit_goto_y, 1
+.de exit_goto_x, 1
; pointer to new map struct
-.de map_exit_to, 2
+.de exit_to, 2
; special text commands
default_map_exit_table:
-exit_entry 0, 0, 0, 0, default_map_header
-exit_entry 0, 0, 0, 0, default_map_header
+exit_def 0, 0, 0, 0, default_map_header
+exit_def 0, 0, 0, 0, default_map_header
; $3: goto y
; $4: goto x
; $5: map header pointer
-#macro exit_entry
+#macro exit_def
.db $1
.db $2
.db $3
call map_actors_load
pop hl
+ push hl
call map_tile_banks_load
+ pop hl
+
+ push hl
+ call map_load_exit_table
+ pop hl
call map_draw_all
ld d, a
call tiles_load_bank9000
+ ret
+
+ ; loads the exit table
+ ; inputs:
+ ; hl: map ptr
+map_load_exit_table:
+ ld de, map_exit_table_ptr
+ add hl, de ; hl = exit table
+
+ ld a, [hl+]
+ ld [map_exit_table], a
+ ld a, [hl]
+ ld [map_exit_table+1], a
+
ret
; draws all cells currently loaded to the screen