![]() |
Routines |
| Prev: 49211 | Up: Map | Next: 49289 |
|
Used by the routine at SaveGameState.
Stores the current game so it can be restored later.
|
||||
| SaveGame | 49216 | LD HL,2466 | Print the message at 2466 and wait for a key. | |
| 49219 | CALL PrintStringAndWaitForKeypress | |||
| 49222 | LD (49417),DE | Record the tape header: saved game. | ||
| 49226 | LD (49419),IX | |||
| 49230 | LD IX,49406 | Use the tape header: saved game (49406). | ||
| 49234 | LD DE,17 | |||
| 49237 | XOR A | Set A to 0 to indicate this is a header block. | ||
| 49238 | CALL 1218 | Call SA_BYTES. | ||
| 49241 | LD B,50 | Count 50. | ||
| SaveGame_PauseLoop | 49243 | HALT | Wait for 50 frames (one second) between the header and the data block. | |
| 49244 | DJNZ SaveGame_PauseLoop | |||
| 49246 | DI | Read the tape header: saved game. | ||
| 49247 | LD DE,(49417) | |||
| 49251 | LD IX,(49419) | Read the tape header: saved game. | ||
| 49255 | LD A,255 | Set A to 255 to indicate this is a data block. | ||
| 49257 | CALL 1218 | Call SA_BYTES. | ||
| 49260 | DI | Turn interrupts off again, as SA_BYTES leaves them on. | ||
| 49261 | LD HL,49317 | Take the messaging: rewind tape, then call PrintString to print string. | ||
| 49264 | CALL PrintString | |||
| 49267 | LD HL,2476 | Print the message at 2476 and wait for a key. | ||
| 49270 | CALL PrintStringAndWaitForKeypress | |||
| 49273 | LD IX,49406 | Use the tape header: saved game (49406). | ||
| 49277 | LD DE,17 | |||
| 49280 | LD A,0 | Set A to 0 to indicate this is a header block. | ||
| 49282 | AND A | Clear the carry so the ROM verifies this block. | ||
| 49283 | CALL 1366 | Call LD_BYTES. | ||
| 49286 | JR NC,LoadGameData_Error | Jump to LoadGameData_Error if the header did not load. | ||
| 49288 | AND A | Clear the carry before the next tape block. | ||
| Prev: 49211 | Up: Map | Next: 49289 |