Prev: C345 Up: Map Next: C3C0
C380: 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 C380 LD HL,$BC27 Print "LOADING. Start tape.".
C383 CALL PrintStringAndNewline
C386 LD IX,$B9C8 Load the starting address into IX at Table_ItemLocations.
C38A LD DE,$013C Set the block length in DE to 013C bytes.
C38D LD A,$FF Set A to FF which indicates this is a data block.
C38F SCF Set the carry flag to indicate this is loading.
C390 CALL $0556 Call LD_BYTES.
C393 JR C,LoadTape_Success Jump to LoadTape_Success when the load succeeded.
Print "Tape error.".
C395 LD HL,$BC3C Print "Tape error.".
C398 CALL PrintStringAndNewline
C39B RET Return.
There is nothing to unpack when no configurable exits were saved.
LoadTape_Success C39C LD A,($BB02) Return when *Count_ConfigurableExits is zero, so there are no configurable exits to unpack.
C39F OR A
C3A0 RET Z
C3A1 LD B,A Take the exit addresses and the packed exit bytes.
C3A2 LD IX,($BAF2)
C3A6 LD DE,$BA69
C3A9 JR LoadTape_StoreFlag
The next saved exit address.
LoadTape_Restore C3AB INC IX Move IX on to the next exit address and DE on to the next packed exit byte.
C3AD INC IX
C3AF INC DE
LoadTape_StoreFlag C3B0 LD L,(IX+$00) 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.
C3B3 LD H,(IX+$01)
C3B6 LD A,(DE)
C3B7 LD (HL),A
C3B8 DJNZ LoadTape_Restore
C3BA LD E,$00 Call Handler_DisplayRoom to show the restored room.
C3BC CALL Handler_DisplayRoom
C3BF RET Return.
Prev: C345 Up: Map Next: C3C0