Prev: 44141 Up: Map Next: 44266
44200: Load From Tape
Used by the routine at Action_Load.
Read a save block back from tape into the configurable exits.
LoadTape 44200 LD HL,45087 Print "LOADING. Start tape." and start a new line.
44203 CALL PrintStringAndNewline
44206 LD IX,44406 Load the starting address into IX at the item-location table.
44210 LD DE,390 Set the block length in DE to 390 bytes.
44213 LD A,255 Set A to 255 which indicates this is a data block.
44215 SCF Set the carry flag to indicate this is loading.
44216 CALL 1366 Call LD_BYTES.
44219 JR C,LoadTape_Success Branch to LoadTape_Success if the block loaded without error (carry flag set).
44221 LD HL,45108 Print "Tape error. Press any key to restart." and start a new line.
44224 CALL PrintStringAndNewline
44227 SCF Set the carry flag to report that the load failed, so Action_Load restarts the game.
44228 RET Return.
There is nothing to unpack when no configurable exits were saved.
LoadTape_Success 44229 LD A,(44794) Read the configurable-exit count into A.
44232 OR A Return if there are no configurable exits to unpack.
44233 RET Z
B counts the exits, IX walks their addresses and DE the save buffer.
44234 LD B,A Take the exit count and point at the exit table and the save buffer.
44235 LD IX,(44774)
44239 LD DE,44699
44242 JR LoadTape_Write Restore the first configurable exit.
The next saved exit address.
LoadTape_Restore 44244 INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
44246 INC IX
44248 INC DE
LoadTape_Write 44249 LD L,(IX+0) Fetch the exit address from *IX into HL, write that packed exit byte back into the game, and repeat until every exit byte is restored.
44252 LD H,(IX+1)
44255 LD A,(DE)
44256 LD (HL),A
44257 DJNZ LoadTape_Restore
44259 LD E,0 Show the room picture only when it has not already been seen.
44261 CALL HandlerDisplayRoomImage
44264 AND A Clear the carry flag to report that the load worked, so Action_Load goes back to the game.
44265 RET Return.
Prev: 44141 Up: Map Next: 44266