![]() |
Routines |
| Prev: C345 | Up: Map | Next: C3C0 |
|
Used by the routine at Action_Load.
Ask for a tape and read a previously saved game state back in.
|
||||
|
Print "LOADING. Start tape.".
|
||||
| LoadFromTape | C380 | LD HL,$BC27 | Print "LOADING. Start tape.". | |
| C383 | CALL PrintStringAndANewline | |||
| C386 | LD IX,$B9C8 | Point the load at the game state (GameState) for 013C bytes. | ||
| C38A | LD DE,$013C | |||
| C38D | LD A,$FF | Mark it as a data block and set the carry flag for "loading". | ||
| C38F | SCF | |||
| C390 | CALL $0556 | Call LD_BYTES. | ||
| C393 | JR C,LoadFromTape_Success | Jump to LoadFromTape_Success when the load succeeded. | ||
|
Print "Tape error.".
|
||||
| C395 | LD HL,$BC3C | Print "Tape error.". | ||
| C398 | CALL PrintStringAndANewline | |||
| C39B | RET | Return. | ||
| LoadFromTape_Success | C39C | LD A,($BB02) | Return when *BB02 is zero, so there is no flag state to restore. | |
| C39F | OR A | |||
| C3A0 | RET Z | |||
| C3A1 | LD B,A | Take the flag addresses and the saved bytes. | ||
| C3A2 | LD IX,($BAF2) | |||
| C3A6 | LD DE,$BA69 | |||
| C3A9 | JR LoadFromTape_StoreFlag | |||
| LoadFromTape_Restore | C3AB | INC IX | Step to the next flag address and the next saved byte. | |
| C3AD | INC IX | |||
| C3AF | INC DE | |||
| LoadFromTape_StoreFlag | C3B0 | LD L,(IX+$00) | Write that saved byte back and repeat until every flag is restored. | |
| C3B3 | LD H,(IX+$01) | |||
| C3B6 | LD A,(DE) | |||
| C3B7 | LD (HL),A | |||
| C3B8 | DJNZ LoadFromTape_Restore | |||
| C3BA | LD E,$00 | Call Handler_DisplayRoom to show the restored room. | ||
| C3BC | CALL Handler_DisplayRoom | |||
| C3BF | RET | Return. | ||
|
View the equivalent code in;
|
||||
| Prev: C345 | Up: Map | Next: C3C0 |