; struct for base_room
-base_room_struct:
+base_room_header:
dw base_room_bg
dw base_room_flags
dw base_room_actors
; struct for base_room2
-base_room2_struct:
+base_room2_header:
dw base_room2_bg
dw base_room2_flags
dw base_room2_actors
room_load_from:
; copy de to current room struct
; and then load the room
- ld hl, curr_room_struct
+ ld hl, curr_room_header
ld bc, room_size
call memcpy
; sets the current room
; sets player position
map_generate:
+ ld d, ROOMS_TOTAL ; d = loop counter
+ ld hl, map0 ; hl = current room
; TODO: this is placeholder mapgen
+
+
+ ret
+
+ ; copies a base room
+ ; inputs:
+ ; hl: target
+ ; de: base room
+ ; bc: default exit room ptr
+map_gen_copy_base_room:
ret
; base room
; exit table for empty exits
room_empty_exits:
-dw base_room2_struct
-dw base_room_struct
-dw base_room2_struct
-dw base_room_struct
-dw base_room_struct
+dw base_room2_header
+dw base_room_header
+dw base_room2_header
+dw base_room_header
+dw base_room_header
call map_generate
; initial test map
- ld de, base_room_struct
+ ld de, base_room_header
call room_load_from
; set up bgp
; current room struct
; same layout as room struct itself
; always should point at the current map's memory region
-curr_room_struct:
+curr_room_header:
; pointer to current room struct
curr_room: .adv 2
; flags for current tiles
; total size of a room including the struct header
; tiles, flags, actors and exits
; rooms are always in the order specified here:
- ; room_struct, tiles, flags, actor_table, exit_table
+ ; room_header, tiles, flags, actor_table, exit_table
; room body including all tiles, flags, actors
; and exits
def print_struct(name):
print(" ; struct for ", name)
- print(name + "_struct:")
+ print(name + "_header:")
print("dw " + name + '_bg')
print("dw " + name + '_flags')
print("dw " + name + '_actors')