Prev: C00C Up: Map Next: C0A5
C040: Save Game
Used by the routine at B0E4.
Prints "Start tape, then press any key.".
SaveGame C040 LD HL,$09A2 HL=09A2.
C043 CALL $C1C0 Call C1C0.
C046 LD ($C109),DE Write DE to *C109.
C04A LD ($C10B),IX Write IX to *C10B.
C04E LD IX,$C0FE IX=C0FE.
C052 LD DE,$0011 DE=0011.
C055 XOR A Set A to 00 to indicate this is a header block.
C056 CALL $04C2 Call SA_BYTES.
C059 LD B,$32 B=32.
SaveGame_PauseLoop C05B HALT Halt operation (suspend CPU until the next interrupt).
C05C DJNZ SaveGame_PauseLoop Decrease counter by one and loop back to SaveGame_PauseLoop until counter is zero.
C05E DI Disable interrupts.
C05F LD DE,($C109) DE=*C109.
C063 LD IX,($C10B) IX=*C10B.
C067 LD A,$FF Set A to FF to indicate this is a data block.
C069 CALL $04C2 Call SA_BYTES.
C06C DI Disable interrupts.
Prints "REWIND TAPE.".
C06D LD HL,$C0A5 HL=Messaging_RewindTape.
C070 CALL PrintString Call PrintString.
Prints ", then press any key.".
C073 LD HL,$09AC HL=09AC.
C076 CALL $C1C0 Call C1C0.
C079 LD IX,$C0FE IX=C0FE.
C07D LD DE,$0011 DE=0011.
C080 LD A,$00 Set A to 00 to indicate this is a header block.
C082 AND A Set flags.
C083 CALL $0556 Call LD_BYTES.
C086 JR NC,SaveGame_Error Jump to SaveGame_Error if there was any error returned.
C088 AND A Set flags.
This entry point is used by the routine at LoadGame.
LoadGameData C089 LD DE,($C109) DE=*C109.
C08D LD IX,($C10B) IX=*C10B.
C091 LD A,$FF Set A to FF to indicate this is a data block.
C093 CALL $0556 Call LD_BYTES.
C096 DI Disable interrupts.
C097 RET C Return if there were no tape loading errors.
There were errors ... so alert the player.
SaveGame_Error C098 DI Disable interrupts.
Prints "TAPE ERROR.".
C099 LD HL,$C0B1 HL=Messaging_TapeError.
C09C CALL PrintString Call PrintString.
Prints " press any key.".
C09F LD HL,$09B2 HL=09B2.
C0A2 JP $C1C0 Jump to C1C0.
Prev: C00C Up: Map Next: C0A5