Prev: 47961 Up: Map Next: 48084
48020: 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 48020 LD HL,48727 HL=Messaging_LoadingStartTape.
48023 CALL PrintStringAndNewline Call PrintStringAndNewline.
48026 LD IX,48112 Load the starting address into IX at Table_ItemLocations.
48030 LD DE,324 Set the block length in DE to 324 bytes.
48033 LD A,255 Set A to 255 which indicates this is a data block.
48035 SCF Set the carry flag to indicate this is loading.
48036 CALL 1366 Call LD_BYTES.
48039 JR C,LoadTape_Success Jump to LoadTape_Success if the load worked (carry flag set).
Print "Tape error.".
48041 LD HL,48748 HL=Messaging_TapeError.
48044 CALL PrintStringAndNewline Call PrintStringAndNewline.
48047 RET Return.
There is nothing to unpack when no configurable exits were saved.
LoadTape_Success 48048 LD A,(48434) Read the configurable-exit count into A.
48051 OR A Return if there are no configurable exits to unpack.
48052 RET Z
48053 LD B,A Copy the configurable-exit count into B.
48054 LD IX,(48418) IX=*Pointer_ConfigurableExits.
48058 LD DE,48281 DE=LoadSaveBuffer.
48061 JR LoadTape_Write Jump to LoadTape_Write.
The next saved exit address.
LoadTape_WriteLoop 48063 INC IX Move IX on to the next exit address.
48065 INC IX
48067 INC DE Move DE on to the next packed exit byte.
LoadTape_Write 48068 LD L,(IX+0) Fetch the exit address from *IX into HL.
48071 LD H,(IX+1)
48074 LD A,(DE) Write that packed exit byte back into the game.
48075 LD (HL),A
48076 DJNZ LoadTape_WriteLoop Decrease the unpack counter and loop back to LoadTape_WriteLoop until every exit byte is restored.
48078 LD E,0 E=0.
48080 CALL Handler_DisplayRoomImage Call Handler_DisplayRoomImage.
48083 RET Return.
Prev: 47961 Up: Map Next: 48084