Prev: 69A1 Up: Map Next: 6A1C
69DC: Load From Tape
Used by the routine at Action_Load.
Load a game position from tape and redraw the room.
Print "LOADING. Start tape.".
LoadTape 69DC LD HL,$63B2 Print "LOADING. Start tape.".
69DF CALL PrintStringAndANewline
69E2 LD IX,$61AB Load the starting address into IX at the object locations.
69E6 LD DE,$00B4 Set the block length in DE to 00B4 bytes.
69E9 LD A,$FF Set A to FF which indicates this is a data block.
69EB SCF Set the carry flag to indicate this is loading.
69EC CALL $0556 Call LD_BYTES.
69EF JR C,LoadTape_Success Jump to LoadTape_Success if the data block loaded.
Print "Tape error.".
69F1 LD HL,$63C7 Print "Tape error.".
69F4 CALL PrintStringAndANewline
69F7 RET Return.
There is nothing to unpack when no saved locations were stored.
LoadTape_Success 69F8 LD A,($62DC) Fetch how many locations the save file stores.
69FB OR A Return if there are no saved locations to unpack.
69FC RET Z
69FD LD B,A Copy the saved-location count into B and point at the location table and the tape workspace.
69FE LD IX,($62DE)
6A02 LD DE,$622D
6A05 JR LoadTape_Write
The next saved location address.
LoadTape_WriteLoop 6A07 INC IX Move IX on to the next saved-location address and DE on to the next packed location byte.
6A09 INC IX
6A0B INC DE
LoadTape_Write 6A0C LD L,(IX+$00) Fetch the location address from *IX into HL.
6A0F LD H,(IX+$01)
6A12 LD A,(DE) Write that packed location byte back into the game.
6A13 LD (HL),A
6A14 DJNZ LoadTape_WriteLoop Decrease the unpack counter and loop back to LoadTape_WriteLoop until every location byte is restored.
6A16 LD E,$00 Show the room picture even if it has been seen before.
6A18 CALL Handler_DisplayRoom Call Handler_DisplayRoom to display the room.
6A1B RET Return.
Prev: 69A1 Up: Map Next: 6A1C