Prev: A5CA Up: Map Next: A647
A605: Load From Tape
Used by the routine at Action_Load.
Print "LOADING. Press PLAY.".
LoadTape A605 LD HL,$A915 HL=Messaging_LoadingPressPlay.
A608 CALL PrintStringAndNewline Call PrintStringAndNewline.
A60B LD IX,$A66C Load the starting address into IX at Table_ItemEventLocations.
A60F LD DE,$0186 Set the block length in DE to 0186 bytes.
A612 LD A,$FF Set A to FF which indicates this is a data block.
A614 SCF Set the carry flag to indicate this is loading.
A615 CALL $0556 Call LD_BYTES.
A618 JR C,LoadTape_Success Jump to LoadTape_Success if the data block loaded.
Print "Tape error. Press any key to restart.".
A61A LD HL,$A92A HL=Messaging_TapeError.
A61D CALL PrintStringAndNewline Call PrintStringAndNewline.
A620 SCF Set the carry flag to signal that loading failed.
A621 RET Return.
There is nothing to unpack when no configurable exits were saved.
LoadTape_Success A622 LD A,($A7F0) Read the configurable-exit count into A.
A625 OR A Return if there are no configurable exits to unpack.
A626 RET Z
A627 LD B,A Copy the configurable-exit count into B.
A628 LD IX,($A7DC) IX=*Pointer_ConfigurableExits.
A62C LD DE,$A791 DE=Buffer_LoadSave.
A62F JR LoadTape_Write Jump to LoadTape_Write.
The next saved exit address.
LoadTape_WriteLoop A631 INC IX Move IX on to the next exit address.
A633 INC IX
A635 INC DE Move DE on to the next packed exit byte.
LoadTape_Write A636 LD L,(IX+$00) Fetch the exit address from *IX into HL.
A639 LD H,(IX+$01)
A63C LD A,(DE) Write that packed exit byte back into the game.
A63D LD (HL),A
A63E DJNZ LoadTape_WriteLoop Decrease the unpack counter and loop back to LoadTape_WriteLoop until every exit byte is restored.
A640 LD E,$00 E=00.
A642 CALL Handler_DisplayRoomImage Call Handler_DisplayRoomImage.
A645 AND A Clear the carry flag to signal that loading succeeded.
A646 RET Return.
Prev: A5CA Up: Map Next: A647