![]() |
Routines |
| Prev: 27041 | Up: Map | Next: 27164 |
|
Used by the routine at Action_Load.
Load a game position from tape and redraw the room.
|
||||
|
Print "LOADING. Start tape.".
|
||||
| LoadTape | 27100 | LD HL,25522 | Print "LOADING. Start tape.". | |
| 27103 | CALL PrintStringAndANewline | |||
| 27106 | LD IX,25003 | Load the starting address into IX at the object locations. | ||
| 27110 | LD DE,180 | Set the block length in DE to 0180 bytes. | ||
| 27113 | LD A,255 | Set A to 255 which indicates this is a data block. | ||
| 27115 | SCF | Set the carry flag to indicate this is loading. | ||
| 27116 | CALL 1366 | Call LD_BYTES. | ||
| 27119 | JR C,LoadTape_Success | Jump to LoadTape_Success if the data block loaded. | ||
|
Print "Tape error.".
|
||||
| 27121 | LD HL,25543 | Print "Tape error.". | ||
| 27124 | CALL PrintStringAndANewline | |||
| 27127 | RET | Return. | ||
|
There is nothing to unpack when no saved locations were stored.
|
||||
| LoadTape_Success | 27128 | LD A,(25308) | Fetch how many locations the save file stores. | |
| 27131 | OR A | Return if there are no saved locations to unpack. | ||
| 27132 | RET Z | |||
| 27133 | LD B,A | Copy the saved-location count into B and point at the location table and the tape workspace. | ||
| 27134 | LD IX,(25310) | |||
| 27138 | LD DE,25133 | |||
| 27141 | JR LoadTape_Write | |||
|
The next saved location address.
|
||||
| LoadTape_WriteLoop | 27143 | INC IX | Move IX on to the next saved-location address and DE on to the next packed location byte. | |
| 27145 | INC IX | |||
| 27147 | INC DE | |||
| LoadTape_Write | 27148 | LD L,(IX+0) | Fetch the location address from *IX into HL. | |
| 27151 | LD H,(IX+1) | |||
| 27154 | LD A,(DE) | Write that packed location byte back into the game. | ||
| 27155 | LD (HL),A | |||
| 27156 | DJNZ LoadTape_WriteLoop | Decrease the unpack counter and loop back to LoadTape_WriteLoop until every location byte is restored. | ||
| 27158 | LD E,0 | Show the room picture even if it has been seen before. | ||
| 27160 | CALL Handler_DisplayRoom | Call Handler_DisplayRoom to display the room. | ||
| 27163 | RET | Return. | ||
|
View the equivalent code in;
|
||||
| Prev: 27041 | Up: Map | Next: 27164 |