Prev: 8271 Up: Map Next: 8312
8284: SAVE
Saves the game to tape. Three bytes at C8D1 (part of the data after the room-entry handlers) are first copied over the start of the saved variables at B5DC so that they are saved too. The player is asked to start the tape and press a key, and the four blocks listed under 8209 are saved with the ROM routine SA-BYTES ($04C2).
Then, unusually for a 1982 game, it offers to VERIFY the save: 'rewind and prepare tape for verification - then hit any key', and reads the four blocks back with the ROM routine in verify mode (8312).
8284 PUSH IX Save IX and DE
8286 PUSH DE
8287 LD DE,$B5DC Tuck Bard's own remembered order (from C8D1) in among the saved variables for a moment...
828A LD HL,$C8D1
828D CALL $826B
8290 LD A,$01 Ask the player to get the tape ready, in the lower window
8292 LD ($B5F2),A
8295 LD HL,$B234
8298 CALL $72D4
829B CALL $8271 Wait for a key
829E LD A,$FF Save the 28 bytes of game variables (with Bard's order folded in)...
82A0 LD IX,$B5DC
82A4 LD DE,$001C
82A7 CALL $04C2 ...using the ROM's own SA-BYTES routine
82AA LD A,$FF Then the object table...
82AC LD IX,$C00B
82B0 LD DE,$0614
82B3 CALL $04C2
82B6 LD A,$FF Then the timers and character table...
82B8 LD IX,$C973
82BC LD DE,$00BF
82BF CALL $04C2
82C2 LD A,$FF Then the room table...
82C4 LD IX,$B97A
82C8 LD DE,$05D9
82CB CALL $04C2
82CE LD HL,$B296 Ask for the tape to be rewound, ready to verify what was just saved
82D1 CALL $72D4
82D4 CALL $8271 Wait for a key
82D7 LD A,$FF Verify the variables...
82D9 AND A
82DA LD IX,$B5DC
82DE LD DE,$001C
82E1 CALL $8312
82E4 LD A,$FF ...then the object table...
82E6 AND A
82E7 LD IX,$C00B
82EB LD DE,$0614
82EE CALL $8312
82F1 LD A,$FF ...the timers and characters...
82F3 AND A
82F4 LD IX,$C973
82F8 LD DE,$00BF
82FB CALL $8312
82FE LD A,$FF ...and the room table
8300 AND A
8301 LD IX,$B97A
8305 LD DE,$05D9
8308 CALL $8312
This entry point is used by the routine at 8312.
830B DI Interrupts off while poking at memory directly
830C POP DE Restore DE and IX
830D POP IX
830F JP $806B Carry on parsing
Prev: 8271 Up: Map Next: 8312