Prev: 44927 Up: Map Next: 45017
44969: Backup Entity And Game State
Used by the routine at Initialise_New_Game.
Backup entity and game state walking the entity tables at StateData_SimpleEntities / StateData_Boney.
Measure and copy Boney's complex entity state into the backup buffer at Buffer_EntityStateBackup.
Backup_Entity_And_Game_State 44969 LD HL,37047 Point HL at State Data: Scenery Entities (StateData_SceneryEntities).
44972 LD DE,36585 Point DE at Boney's complex entity state (StateData_Boney).
44975 AND A Clear the success marker and test whether A is zero.
44976 SBC HL,DE Subtract DE from HL with carry.
44978 LD (29347),HL Store HL in the entity-state copy length (CopyLength_EntityStateData).
44981 LD B,H Copy the high byte of the pointer into B.
44982 LD C,L Copy the low byte of the pointer into C.
44983 LD HL,36585 Point HL at Boney's complex entity state (StateData_Boney).
44986 LD DE,64014 Point DE at the entity-state backup buffer (Buffer_EntityStateBackup).
44989 LDIR Copy the block at HL to DE.
44991 INC DE Advance the pointer in DE by one.
44992 LD (29351),DE Store DE in Pointer: Entity State Backup End (Pointer_EntityStateBackupEnd).
44996 PUSH DE Stash DE on the stack.
Measure and copy the task/game-status block that follows the entity backup.
44997 LD HL,29416 Point HL at saved room index (SavedRoomIndex).
45000 LD DE,29358 Point DE at the current task index (CurrentTaskIndex).
45003 SBC HL,DE Subtract DE from HL with carry.
45005 LD (29349),HL Store HL in the game-state copy length (CopyLength_GameState).
45008 LD B,H Copy the high byte of the pointer into B.
45009 LD C,L Copy the low byte of the pointer into C.
45010 LD HL,29358 Point HL at the current task index (CurrentTaskIndex).
45013 POP DE Restore DE from the stack.
45014 LDIR Copy the block at HL to DE.
45016 RET Return.
Prev: 44927 Up: Map Next: 45017