--- /dev/null
+ ; init the actor saves
+ ; sets everything to 0xFF
+act_save_init:
+ ld hl, act_sg
+ ld bc, act_sg_end - act_sg
+ ld d, ACT_SG_DEFAULT_VALUE
+ call memset
+ ret
+
+ ; stores actor save game
+ ; based on the current map's seed offset
+act_sg_store:
+ ret
+
+ ; restores actor save game based on
+ ; current map's seed offset
+act_sg_restore:
+ ret
.de act_size, 0
; actor save game data
+ ; if pos y and x is 0xFF
+ ; it is not restored
.se 0
.de act_sg_pos_y, 1
.de act_sg_pos_x, 1
.de act_sg_p0, 1
.de act_sg_size, 0
+#define ACT_SG_DEFAULT_VALUE 0xFF
+
#define MAP_BG_TILE_OFFSET 0
#define MAP_BG_FLAGS_OFFSET 1
#include "exittables.s"
#include "demos.s"
#include "mainmenu.s"
+#include "actsave.s"
; fill bank
.fill 0xFF, 0x4000 - $
; TODO: do not touch lcd or interrupts if
; they were not enabled!
map_load:
+ ; clear act save data
+ push hl
+ call act_save_init
+ pop hl
+
; backup the map header
ld a, l
ld [map_header], a
; actor savegame data;
; store actor data here on map load
; and re-load on map restore
- ; if pos y and pos x are both 0 do not restore
+ ; if pos y and pos x are both 0xFF do not restore
act_sg: .adv act_sg_size * UNITS_MAX * FLOOR_MAP_COUNT
+act_sg_end:
state_end: