; 3) make rooms
- ; TODO: this is a test room
- ld hl, mapgen_tiles+1+MAP_W
- ld bc, 0x0505 ; 5x5
- call mapgen_mak_room
+ call mapgen_make_rooms
; cleanup) finally
ld [mapgen_game_seed+1], a
ld [srand+1], a
ret
+
+ ; generates all rooms
+ ; for each section of the map
+ ; the map is split into MAP_SECTION_SIZExMAP_SECTION_SIZE
+ ; sections (e.g. 4x4 sections of 8x8 tiles)
+ ; rooms are placed in each section and then linked up using hallways
+mapgen_make_rooms:
+ ; TODO: this is a test room
+ ld hl, mapgen_tiles+1+MAP_W
+ ld bc, 0x0505 ; 5x5
+ call mapgen_make_room
+ ret
; generates a single rectanglular room
; the caller must ensutre hl has enough tiles in
; inputs:
; hl: start position in tile map
; b/c: height/width of room
-mapgen_mak_room:
+mapgen_make_room:
ld de, MAP_W
@draw_row:
; save original hl