Prev: 49965 Up: Map Next: 50048
49989: Save Game
Used by the routines at Action_Save and Action_Quit.
Ask for a tape and write the game state out.
SaveGame 49989 LD A,(47874) Jump to SaveGame_PrintSaving when *Count_ConfigurableExits is zero, so there are no configurable exits to pack.
49992 OR A
49993 JR Z,SaveGame_PrintSaving
49995 LD B,A Take the exit addresses and the save area.
49996 LD IX,(47858)
50000 LD DE,47721
50003 JR SaveGame_StoreFlag
Move on to the next configurable-exit address.
SaveGame_Copy 50005 INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
50007 INC IX
50009 INC DE
SaveGame_StoreFlag 50010 LD L,(IX+0) Fetch the exit address from *IX into HL, copy the exit byte into the packed save buffer, and repeat until every exit byte is packed.
50013 LD H,(IX+1)
50016 LD A,(HL)
50017 LD (DE),A
50018 DJNZ SaveGame_Copy
Print "SAVING. Start tape,press any key.".
SaveGame_PrintSaving 50020 LD HL,48200 Print "SAVING. Start tape,press any key." and wait for a key.
50023 CALL PrintStringAndNewline
50026 CALL GetUserInput
50029 LD IX,47560 Load the starting address into IX at Table_ItemLocations.
50033 LD DE,316 Set the block length in DE to 316 bytes.
50036 LD A,255 Set A to 255 which indicates this is a data block.
50038 CALL 1218 Call SA_BYTES.
Print "Stop tape.Saving complete.".
50041 LD HL,48234 Print "Stop tape.Saving complete.".
50044 CALL PrintStringAndNewline
50047 RET Return.
Prev: 49965 Up: Map Next: 50048