call memset
ret
+ ; loads current start of save game slot
+ ; based on the current map seed index
+ ; returns:
+ ; bc: act save game slot
+act_sg_load_current_slot:
+ ld a, [map_header]
+ ld l, a
+ ld a, [map_header+1]
+ ld h, a
+ ld de, map_seed_index
+ add hl, de
+ ld a, [hl] ; a = seed index
+
+ ld hl, act_sg
+ ; no need to loop if a is 0
+ cp a, 0
+ ret z
+ ld de, act_sg_size * UNITS_MAX
+
+ ; add sg size for every index offset
+@loop:
+ add hl, de
+ dec a
+ jr z, @loop REL
+
+ push hl
+ pop bc ; we want return value in bc
+
+ ret
+
; stores actor save game
; based on the current map's seed offset
+ ; skipped if [map_header] is NULL
act_sg_store:
+ ; check if map header is NULL
+ ld a, [map_header]
+ ld b, a
+ ld a, [map_header+1]
+ or a, b
+ ret z
+
+ call act_sg_load_current_slot
+
+ ret
+
+ ; stores data from a single actor into
+ ; the save slot
+ ; inputs:
+ ; bc: act save game slot
+ ; hl: actor
+act_sg_store_single:
ret
; restores actor save game based on
; current map's seed offset
act_sg_restore:
+ call act_sg_load_current_slot
ret