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 *47874 is zero, so there is no flag state to copy.
49992 OR A
49993 JR Z,SaveGame_PrintSaving
49995 LD B,A Take the flag addresses and the save area.
49996 LD IX,(47858)
50000 LD DE,47721
50003 JR SaveGame_StoreFlag
SaveGame_Copy 50005 INC IX Step to the next flag address and the next save byte.
50007 INC IX
50009 INC DE
SaveGame_StoreFlag 50010 LD L,(IX+0) Copy that flag into the save area and repeat until every flag is stored.
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 PrintStringAndANewline
50026 CALL GetUserInput
50029 LD IX,47560 Point the save at the game state (GameState) for 316 bytes, marked as a data block.
50033 LD DE,316
50036 LD A,255
50038 CALL 1218 Call SA_BYTES.
Print "Stop tape.Saving complete.".
50041 LD HL,48234 Print "Stop tape.Saving complete.".
50044 CALL PrintStringAndANewline
50047 RET Return.
Prev: 49965 Up: Map Next: 50048