Prev: 27026 Up: Map Next: 27100
27041: Save Game
Used by the routine at Action_Save.
Save the game position to tape.
SaveGame 27041 LD A,(25308) Fetch how many locations the save file stores.
27044 OR A Jump to SaveGame_PrintSaving if there are no saved locations to pack.
27045 JR Z,SaveGame_PrintSaving
27047 LD B,A Copy the saved-location count into B and point at the location table and the tape workspace.
27048 LD IX,(25310)
27052 LD DE,25133
27055 JR SaveGame_StoreFlag
Move on to the next saved-location address.
SaveGame_Copy 27057 INC IX Move IX on to the next saved-location address and DE on to the next packed location byte.
27059 INC IX
27061 INC DE
SaveGame_StoreFlag 27062 LD L,(IX+0) Fetch the location address from *IX into HL.
27065 LD H,(IX+1)
27068 LD A,(HL) Copy the location byte into the packed save buffer.
27069 LD (DE),A
27070 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 27072 LD HL,25555 Print "SAVING. Start tape,press any key.".
27075 CALL PrintStringAndANewline
27078 CALL GetUserInput Call GetUserInput to wait for a keypress.
27081 LD IX,25003 Load the starting address into IX at the object locations.
27085 LD DE,180 Set the block length in DE to 0180 bytes.
27088 LD A,255 Set A to 255 which indicates this is a data block.
27090 CALL 1218 Call SA_BYTES.
Print "Stop tape.Saving complete.".
27093 LD HL,25589 Print "Stop tape.Saving complete.".
27096 CALL PrintStringAndANewline
27099 RET Return.
Prev: 27026 Up: Map Next: 27100