+ ; initial map setup
+ ; seeds the floor
+ ; loads a random map from the map table
+ ; clears act_save
+ ; also places initial door locations
+mapgen_init:
+ call act_save_init
+ call mapgen_seed
+ call mapgen_make_doors
+ call mapgen_select_map
+ call map_load
+ ret
+
+ ; selects a map from the tables based on the current floor
+ ; and the current cursor seed
+ ; returns:
+ ; hl: map pointer
+mapgen_select_map:
+ ld hl, map_c_header
+ ret
+
+
; generates a new set of seeds
; and places them into map_seeds
- ; also places initial door locations
mapgen_seed:
ld hl, map_seeds
; 2 bytes per seed
dec b
jr nz, @loop REL
- call mapgen_make_doors
ret