![]() |
Routines |
| Prev: 6992 | Up: Map | Next: 69DC |
|
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 | The save file has no extra locations to copy. | ||
| 69A5 | JR Z,SaveGame_Step2 | |||
| 69A7 | LD B,A | Prepare to copy each saved location into the tape workspace. | ||
| 69A8 | LD IX,($62DE) | |||
| 69AC | LD DE,$622D | |||
| 69AF | JR SaveGame_Step1 | |||
| SaveGame_Loop1 | 69B1 | INC IX | Step to the next saved-location pointer. | |
| 69B3 | INC IX | |||
| 69B5 | INC DE | |||
| SaveGame_Step1 | 69B6 | LD L,(IX+$00) | Read the address of this saved location. | |
| 69B9 | LD H,(IX+$01) | |||
| 69BC | LD A,(HL) | Read the byte that location holds. | ||
| 69BD | LD (DE),A | Store it in the tape workspace. | ||
| 69BE | DJNZ SaveGame_Loop1 | Repeat for the remaining saved locations. | ||
| SaveGame_Step2 | 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 | The save starts at the object locations. | ||
| 69CD | LD DE,$00B4 | Save B4 bytes from the object locations as a data block. | ||
| 69D0 | LD A,$FF | |||
| 69D2 | CALL $04C2 | Call SA_BYTES. | ||
| 69D5 | LD HL,$63F5 | Print Stop tape.Saving complete.. | ||
| 69D8 | CALL PrintStringAndANewline | |||
| 69DB | RET | Return. | ||
| Prev: 6992 | Up: Map | Next: 69DC |