The test loader for a hard coded room was still present in video init.
This lead to an incorrect assumption being made in the map converter.
Rooms are now loaded directly from the actual base struct.
The base struct now also always points to an empty room exit table.
; struct for base_room
base_room_struct:
-dwb base_room_bg
-dwb base_room_flags
-dwb base_room_actors
+dw base_room_bg
+dw base_room_flags
+dw base_room_actors
+dw room_empty_exits
base_room_actors:
.db 8
.db 1 , 64 , 72 , 0
; and then load the room
ld hl, curr_room_struct
ld bc, room_size
+ call memcpy
call room_draw
call room_load_actors
ret
+ ; sets the current room
+ ; inputs:
+ ; de: ptr to room struct
+ ; sets curr_room entries
+ ; as expected by room loader
+room_set_curr:
+ ret
+
; loads actors from
; [curr_room_init_act]
; into the active actor table
; this can be copied and modified
; by the map gen
#include "./maps/base_room.s"
+
+ ; exit table for empty exits
+room_empty_exits:
+.db 0x00, 0x00
+.db 0x00, 0x00
+.db 0x00, 0x00
+.db 0x00, 0x00
; initial test map
- ldlo a, base_room_bg
- ld [curr_room], a
- ldhi a, base_room_bg
- ld [curr_room+1], a
-
- ldlo a, base_room_flags
- ld [curr_room_flags], a
- ldhi a, base_room_flags
- ld [curr_room_flags+1], a
-
- ldlo a, base_room_actors
- ld [curr_room_init_act], a
- ldhi a, base_room_actors
- ld [curr_room_init_act+1], a
-
ld de, base_room_struct
call room_load_from
def print_struct(name):
print(" ; struct for ", name)
print(name + "_struct:")
- print("dwb " + name + '_bg')
- print("dwb " + name + '_flags')
- print("dwb " + name + '_actors')
+ print("dw " + name + '_bg')
+ print("dw " + name + '_flags')
+ print("dw " + name + '_actors')
+ print("dw room_empty_exits")
def convert(src, name):
tree = ET.parse(src)