dw bank8C00
dw bank9000
dw map_bc_exit_table
+dw 0
map_bc_bg:
dw bank8C00
dw bank9000
dw map_bw_exit_table
+dw 0
map_be_bg:
dw bank8C00
dw bank9000
dw map_bw_exit_table
+dw 0
map_bw_bg:
dw bank8C00
dw bank9000
dw map_c_exit_table
+dw 0
map_c_bg:
dw bank8C00
dw bank9000
dw map_ce_exit_table
+dw 0
map_ce_bg:
dw bank8C00
dw bank9000
dw map_cw_exit_table
+dw 0
map_cw_bg:
dw bank8C00
dw bank9000
dw map_tc_exit_table
+dw 0
map_tc_bg:
dw bank8C00
dw bank9000
dw map_te_exit_table
+dw 0
map_te_bg:
dw bank8C00
dw bank9000
dw map_tw_exit_table
+dw 0
map_tw_bg:
.section defs
+#define FLOOR_MAP_COUNT 9
+
.def int OAMDMAFN = 0xFF80
#define WRAM 0xC000
#define WRAMLEN 0xFFF
; pointer to exit table
;
.de map_exit_table_ptr, 2
-
+ ; the seed to use for this map
+ ; read from [map_seeds]
+.de map_seed_index, 1
; map actor table struct
-
+
+ ; generates a new set of seeds
+ ; and places them into map_seeds
+mapgen_seed:
+ ret
; places a rectangular room
; into the currently loaded map
rprow RPLW, RPFL, RPFL, RPFL, RPFL, RPUW
rprow RPBL, RPBW, RPBW, RPDB, RPBW, RPBR
+ ; translation tables for tiles
+room_pattern_tile_translation:
+ ; walls
+ .db 0x6b, 0x6b, 0x6b
+ .db 0x6b, 0x6b, 0x6b
+ .db 0x6b, 0x6b
+ .db 0x00 ; floor
+ ; doors
+ .db 0x00, 0x00, 0x00, 0x00
+
+ ; translation table for flags
+room_pattern_floor1_flags_translation:
+
; table of 6 by 6 room patterns
room_pattern_6by6:
dw room_pattern1
; player_unit (unit 0) is reserved
player_unit: .adv 0
p0_units: .adv act_size * UNITS_MAX
-
+
+ ; list of seeds used
+ ; for the current maps
+ ; fill using mapgen_seed
+map_seeds:
+dw FLOOR_MAP_COUNT * 2
+
; map tiles and collision data
map: .adv c_size * MAP_SIZE
map_end:
tile_bank3 = "bank9000"
exit_table = "map_c_exit_table"
actor_table_ptr = "map_actor_table_null"
+map_seed_index = "0"
map_name = "noname"
NAME_LEN = 8
print("dw " + tile_bank2)
print("dw " + tile_bank3)
print("dw " + exit_table)
+ print("dw " + map_seed_index)
print("")
def get_flag(tile):
global tile_bank3
global map_name
global exit_table
+ global map_seed_index
for child in root:
if child.tag == "properties":
map_name = value
elif name == 'exit_table':
exit_table = value
+ elif name == 'seed_index':
+ seed_index = int(value)
return