dw base_room_actors
dw room_empty_exits
base_room_actors:
-.db 8
.db 1 , 64 , 72 , 0
.db 1 , 48 , 56 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
base_room_bg:
.db 0x60, 0x62, 0x62, 0x64, 0x62, 0x62, 0x66, 0x62, 0x62, 0x68, 0x4c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x6a, 0x46, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xe0, 0x4c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x6a, 0x4c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x6a, 0x48, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xe2, 0x4c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x6a, 0x6c, 0x4a, 0x4a, 0x42, 0x4a, 0x4a, 0x44, 0x4a, 0x4a, 0x6e
base_room_flags:
dw base_room2_actors
dw room_empty_exits
base_room2_actors:
-.db 8
.db 1 , 64 , 72 , 0
.db 1 , 48 , 56 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
+.db 0 , 16 , 8 , 0
base_room2_bg:
.db 0x60, 0x62, 0x62, 0x64, 0x62, 0x62, 0x66, 0x62, 0x62, 0x68, 0x4c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x6a, 0x46, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xe0, 0x4c, 0x40, 0x40, 0x40, 0x4e, 0x4e, 0x40, 0x40, 0x40, 0x6a, 0x4c, 0x40, 0x40, 0x40, 0x4e, 0x4e, 0x40, 0x40, 0x40, 0x6a, 0x48, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xe2, 0x4c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x6a, 0x6c, 0x4a, 0x4a, 0x42, 0x4a, 0x4a, 0x44, 0x4a, 0x4a, 0x6e
base_room2_flags:
; curr_room_exits: ptr to exits table
; a: direction EAST, WEST, NORTH, SOUTH, EXIT_SPECIAL
room_goto:
- ; TODO: save current tables back
push af
; dst = original actor table
; src = actor_table
ld de, actor_table
ld bc, ACTOR_TABLE_SIZE
- ; TODO fix actor table saving
- ; call memcpy
+ call memcpy
pop af
ld e, a
ld a, [hl]
ld d, a
- ; de = length...source table
-
- ld b, 0
- ld a, [de]
- ld c, a ; bc = len
+ ; de = source table
+ ld bc, ACTOR_TABLE_SIZE
- inc de ; de = source table
; hl = dst
ld hl, actor_table
call memcpy
-
ret
; maps are collections of rooms
print_data(data.text, name, child.attrib['name'])
elif child.tag == "objectgroup":
print(name + '_actors:')
- print(".db ", len(child) * 4)
+ actors_printed = 0
for data in child:
flags = 0
atype = 0
elif prop.attrib['name'] == 'flags':
flags = prop.attrib['value']
print_actor(atype, data.attrib['y'], data.attrib['x'], flags)
+ actors_printed += 1
+ for not_filled in range(actors_printed, 8, 1):
+ print_actor(0, 0, 0, 0)