Map seeds were not set correctly and restoring was also broken.
; numbers into rng
ld b, MAPGEN_FLOORS_MAX * 2
@loop:
+ push hl
call rand
+ pop hl
ld [hl+], a
dec b
- jr z, @loop REL
-
+ jr nz, @loop REL
call mbc1_ram_disable
ret
ld [mapgen_game_seed+1], a
; load the seed
+ call mbc1_ram_enable
call save_file_select
ld d, 0
ld a, [mapgen_floor]
ld a, [hl+]
ld [srand], a
ld a, [hl]
- ld [srand], a
+ ld [srand+1], a
+ call mbc1_ram_disable
; 2) set up map header
; cleanup) finally
; restore game seed from rng
- ld [mapgen_game_seed], a
+ ld a, [mapgen_game_seed]
ld [srand], a
- ld [mapgen_game_seed+1], a
+ ld a, [mapgen_game_seed+1]
ld [srand+1], a
+ BREAK
ret
; makes a room at a sector offset