Prev: 84B9 Up: Map Next: 855A
84CC: Save Game
Saves the live game to tape. Reached through the special-key table at 8271, dispatched from Command_MatchASpecialKey.
SaveGame 84CC PUSH IX Save IX and DE, then call ThreeByteCopy with DE at B6EB and HL at C9E2.
84CE PUSH DE
84CF LD DE,$B6EB
84D2 LD HL,$C9E2
84D5 CALL ThreeByteCopy
84D8 LD A,$01 Write 01 to WaitCountdown.
84DA LD ($B701),A
84DD LD HL,$B342 Point at the message "start tape then press any key" (B342).
84E0 CALL PrintMessage Call PrintMessage to print message.
84E3 CALL DebounceAnyKey Call DebounceAnyKey to debounce keyboard.
Save "flags".
84E6 LD A,$FF Set the save as a "data block".
84E8 LD IX,$B6EB Set the start address to B6EB.
84EC LD DE,$001D Set the block length to 1D bytes.
84EF CALL $04C2 Call SA_BYTES.
Save "objects".
84F2 LD A,$FF Set the save as a "data block".
84F4 LD IX,$C11B Set the start address to Objects.
84F8 LD DE,$0615 Set the block length to 0615 bytes.
84FB CALL $04C2 Call SA_BYTES.
Save...
84FE LD A,$FF Set the save as a "data block".
8500 LD IX,$CA84 Set the start address to CA84.
8504 LD DE,$00BF Set the block length to BF bytes.
8507 CALL $04C2 Call SA_BYTES.
Save "locations".
850A LD A,$FF Set the save as a "data block".
850C LD IX,$BA8A Set the start address to Locations.
8510 LD DE,$05D9 Set the block length to 05D9 bytes.
8513 CALL $04C2 Call SA_BYTES.
Begin verification.
8516 LD HL,$B3A4 Point HL at B3A4.
8519 CALL PrintMessage Call PrintMessage to print message.
851C CALL DebounceAnyKey Call DebounceAnyKey to debounce keyboard.
Verify "flags".
851F LD A,$FF Set the load as a "data block".
8521 AND A Clear carry so the ROM verifies the flags.
8522 LD IX,$B6EB Set the start address to B6EB.
8526 LD DE,$001D Set the block length to 1D bytes.
8529 CALL VerifyBlock Call VerifyBlock to verify the block.
Verify "objects".
852C LD A,$FF Set the load as a "data block".
852E AND A Clear carry so the ROM verifies the object table.
852F LD IX,$C11B Set the start address to Objects.
8533 LD DE,$0615 Set the block length to 0615 bytes.
8536 CALL VerifyBlock Call VerifyBlock to verify the block.
Verify the object handlers.
8539 LD A,$FF Set the load as a "data block".
853B AND A Clear carry so the ROM verifies the object handlers.
853C LD IX,$CA84 Set the start address to CA84.
8540 LD DE,$00BF Set the block length to BF bytes.
8543 CALL VerifyBlock Call VerifyBlock to verify the block.
Verify "locations".
8546 LD A,$FF Set the load as a "data block".
8548 AND A Clear carry so the ROM verifies the location table.
8549 LD IX,$BA8A Set the start address to Locations.
854D LD DE,$05D9 Set the block length to 05D9 bytes.
8550 CALL VerifyBlock Call VerifyBlock to verify the block.
This entry point is used by the routine at VerifyBlock.
Success!
SaveGame_Done 8553 DI Disable interrupts.
8554 POP DE Jump back to CommandDispatchAControl to dispatch a control.
8555 POP IX
8557 JP CommandDispatchAControl
Prev: 84B9 Up: Map Next: 855A