![]() |
Routines |
| Prev: 5B30 | Up: Map | Next: 5BAA |
|
Used by the routine at TapeLoader_Game.
Calls the ROM tape loader, shows a white border while it runs, and records success or failure in the tape load result.
|
||||
|
Arrange the flags the ROM loader expects.
|
||||
| TapeLoader_LoadBytes | 5B8B | INC D | Leave D one below FF so the block length survives the ROM loader's test. | |
| 5B8C | EX AF,AF' | Park the header/data marker. A is 00 for a header and FF for a data block. | ||
| 5B8D | DEC D | Put the block length back. The ROM loader rejects a length whose top byte is FF. | ||
| 5B8E | DI | Disable interrupts so the tape timing is stable. | ||
|
Show a white border while the tape runs.
|
||||
| 5B8F | LD A,$0F | Set a white border ( WHITE) and raise the MIC bit on port FE. | ||
| 5B91 | OUT ($FE),A | |||
|
Enter the ROM loader and come back to TapeLoader_AfterBytes.
|
||||
| 5B93 | LD HL,$5B9A | Push TapeLoader_AfterBytes as the return address. | ||
| 5B96 | PUSH HL | |||
| 5B97 | JP $0562 | Jump into LD_BYTES at 0562. | ||
|
The ROM loader returns here. Restore the border.
|
||||
| TapeLoader_AfterBytes | 5B9A | PUSH AF | Set the border to WHITE, saving flags the ROM loader returned. | |
| 5B9B | LD A,$07 | |||
| 5B9D | OUT ($FE),A | |||
| 5B9F | POP AF | Restore the ROM flags from the stack. | ||
|
Record success as 01 and failure as 02.
|
||||
| 5BA0 | LD A,$01 | Record 01 when the block loaded, and 02 when it did not. | ||
| 5BA2 | JR C,TapeLoader_StoreResult | |||
| 5BA4 | INC A | |||
| TapeLoader_StoreResult | 5BA5 | LD ($5B2F),A | Store that result in the tape load result (5B2F). | |
| 5BA8 | DI | Disable interrupts before returning to the caller. | ||
| 5BA9 | RET | Return. | ||
| Prev: 5B30 | Up: Map | Next: 5BAA |