![]() |
Routines |
| Prev: 23344 | Up: Map | Next: 23466 |
|
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 | 23435 | INC D | Leave D one below 255 so the block length survives the ROM loader's test. | |
| 23436 | EX AF,AF' | Park the header/data marker. A is 0 for a header and 255 for a data block. | ||
| 23437 | DEC D | Put the block length back. The ROM loader rejects a length whose top byte is 255. | ||
| 23438 | DI | Disable interrupts so the tape timing is stable. | ||
|
Show a white border while the tape runs.
|
||||
| 23439 | LD A,15 | Set a white border ( WHITE) and raise the MIC bit on port 254. | ||
| 23441 | OUT (254),A | |||
|
Enter the ROM loader and come back to TapeLoader_AfterBytes.
|
||||
| 23443 | LD HL,23450 | Push TapeLoader_AfterBytes as the return address. | ||
| 23446 | PUSH HL | |||
| 23447 | JP 1378 | Jump into LD_BYTES at 1378. | ||
|
The ROM loader returns here. Restore the border.
|
||||
| TapeLoader_AfterBytes | 23450 | PUSH AF | Set the border to WHITE, saving flags the ROM loader returned. | |
| 23451 | LD A,7 | |||
| 23453 | OUT (254),A | |||
| 23455 | POP AF | Restore the ROM flags from the stack. | ||
|
Record success as 1 and failure as 2.
|
||||
| 23456 | LD A,1 | Record 1 when the block loaded, and 2 when it did not. | ||
| 23458 | JR C,TapeLoader_StoreResult | |||
| 23460 | INC A | |||
| TapeLoader_StoreResult | 23461 | LD (23343),A | Store that result in the tape load result (23343). | |
| 23464 | DI | Disable interrupts before returning to the caller. | ||
| 23465 | RET | Return. | ||
| Prev: 23344 | Up: Map | Next: 23466 |