![]() |
Routines |
| Prev: 27026 | Up: Map | Next: 27100 |
|
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 | The save file has no extra locations to copy. | ||
| 27045 | JR Z,SaveGame_Step2 | |||
| 27047 | LD B,A | Prepare to copy each saved location into the tape workspace. | ||
| 27048 | LD IX,(25310) | |||
| 27052 | LD DE,25133 | |||
| 27055 | JR SaveGame_Step1 | |||
| SaveGame_Loop1 | 27057 | INC IX | Step to the next saved-location pointer. | |
| 27059 | INC IX | |||
| 27061 | INC DE | |||
| SaveGame_Step1 | 27062 | LD L,(IX+0) | Read the address of this saved location. | |
| 27065 | LD H,(IX+1) | |||
| 27068 | LD A,(HL) | Read the byte that location holds. | ||
| 27069 | LD (DE),A | Store it in the tape workspace. | ||
| 27070 | DJNZ SaveGame_Loop1 | Repeat for the remaining saved locations. | ||
| SaveGame_Step2 | 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 | The save starts at the object locations. | ||
| 27085 | LD DE,180 | Save 180 bytes from the object locations as a data block. | ||
| 27088 | LD A,255 | |||
| 27090 | CALL 1218 | Call SA_BYTES. | ||
| 27093 | LD HL,25589 | Print Stop tape.Saving complete.. | ||
| 27096 | CALL PrintStringAndANewline | |||
| 27099 | RET | Return. | ||
| Prev: 27026 | Up: Map | Next: 27100 |