Prev: 49989 Up: Map Next: 50112
50048: Load From Tape
Used by the routine at Action_Load.
Ask for a tape and read a previously saved game state back in.
Print "LOADING. Start tape.".
LoadTape 50048 LD HL,48167 Print "LOADING. Start tape.".
50051 CALL PrintStringAndNewline
50054 LD IX,47560 Load the starting address into IX at Table_ItemLocations.
50058 LD DE,316 Set the block length in DE to 316 bytes.
50061 LD A,255 Set A to 255 which indicates this is a data block.
50063 SCF Set the carry flag to indicate this is loading.
50064 CALL 1366 Call LD_BYTES.
50067 JR C,LoadTape_Success Jump to LoadTape_Success when the load succeeded.
Print "Tape error.".
50069 LD HL,48188 Print "Tape error.".
50072 CALL PrintStringAndNewline
50075 RET Return.
There is nothing to unpack when no configurable exits were saved.
LoadTape_Success 50076 LD A,(47874) Return when *Count_ConfigurableExits is zero, so there are no configurable exits to unpack.
50079 OR A
50080 RET Z
50081 LD B,A Take the exit addresses and the packed exit bytes.
50082 LD IX,(47858)
50086 LD DE,47721
50089 JR LoadTape_StoreFlag
The next saved exit address.
LoadTape_Restore 50091 INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
50093 INC IX
50095 INC DE
LoadTape_StoreFlag 50096 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.
50099 LD H,(IX+1)
50102 LD A,(DE)
50103 LD (HL),A
50104 DJNZ LoadTape_Restore
50106 LD E,0 Call Handler_DisplayRoom to show the restored room.
50108 CALL Handler_DisplayRoom
50111 RET Return.
Prev: 49989 Up: Map Next: 50112