Prev: 6992 Up: Map Next: 69DC
69A1: Save Game
Used by the routine at Action_Save.
Save the game position to tape.
SaveGame 69A1 LD A,($62DC) Fetch how many locations the save file stores.
69A4 OR A Jump to SaveGame_PrintSaving if there are no saved locations to pack.
69A5 JR Z,SaveGame_PrintSaving
69A7 LD B,A Copy the saved-location count into B and point at the location table and the tape workspace.
69A8 LD IX,($62DE)
69AC LD DE,$622D
69AF JR SaveGame_StoreFlag
Move on to the next saved-location address.
SaveGame_Copy 69B1 INC IX Move IX on to the next saved-location address and DE on to the next packed location byte.
69B3 INC IX
69B5 INC DE
SaveGame_StoreFlag 69B6 LD L,(IX+$00) Fetch the location address from *IX into HL.
69B9 LD H,(IX+$01)
69BC LD A,(HL) Copy the location byte into the packed save buffer.
69BD LD (DE),A
69BE DJNZ SaveGame_Copy Decrease the pack counter and loop back to SaveGame_Copy until every location byte is packed.
Print "SAVING. Start tape,press any key.".
SaveGame_PrintSaving 69C0 LD HL,$63D3 Print "SAVING. Start tape,press any key.".
69C3 CALL PrintStringAndANewline
69C6 CALL GetUserInput Call GetUserInput to wait for a keypress.
69C9 LD IX,$61AB Load the starting address into IX at the object locations.
69CD LD DE,$00B4 Set the block length in DE to 00B4 bytes.
69D0 LD A,$FF Set A to FF which indicates this is a data block.
69D2 CALL $04C2 Call SA_BYTES.
Print "Stop tape.Saving complete.".
69D5 LD HL,$63F5 Print "Stop tape.Saving complete.".
69D8 CALL PrintStringAndANewline
69DB RET Return.
Prev: 6992 Up: Map Next: 69DC