![]() |
Routines |
| Prev: 5B00 | Up: Map | Next: 5B4F |
|
Used by the routine at TapeLoader.
Pull one tape block into the address and length set up by the caller.
|
||||
|
Tape loading routine.
|
||||
| TapeLoading | 5B21 | SCF | Set the carry flag to indicate "loading". | |
| 5B22 | INC D | This resets the Z flag (D cannot hold +FF.) | ||
| 5B23 | EX AF,AF' | The A register holds +00 for a header and +FF for a block of data. The carry flag is reset for verifying and set for loading. | ||
| 5B24 | DEC D | Put back D to its original value. | ||
| 5B25 | DI | Disable interrupts while the tape loads, as the start of LD_BYTES would. | ||
| 5B26 | LD A,$0F | Set the border to WHITE. | ||
| 5B28 | OUT ($FE),A | |||
| 5B2A | CALL $0562 | Call LD_BYTES at 0562. | ||
| 5B2D | PUSH AF | Remember whether the block loaded. | ||
| 5B2E | LD A,($5C48) | A=*BORDCR. | ||
| 5B31 | AND %00111000 | Keep the border colour (bits 3-5 of *BORDCR). | ||
| 5B33 | RRC A | Move the border colour into the low three bits. | ||
| 5B35 | RRC A | |||
| 5B37 | RRC A | |||
| 5B39 | OUT ($FE),A | Set border to the colour held by A. | ||
| 5B3B | LD A,$7F | See whether SPACE is pressed. | ||
| 5B3D | IN A,($FE) | |||
| 5B3F | RRA | |||
| 5B40 | EI | Re-enable interrupts, as the ROM does when its own load ends. | ||
| 5B41 | JP NC,$0000 | Jump to START if the carry flag is not set. | ||
| 5B44 | POP AF | Restore the load result from the stack (the carry flag is set when the block loaded). | ||
| 5B45 | RET C | Return if the carry flag is set. | ||
| 5B46 | LD HL,($5C53) | Write *PROG to *VARS. | ||
| 5B49 | LD ($5C4B),HL | |||
| 5B4C | LD (HL),$80 | Write 80 to *PROG. | ||
| 5B4E | RST $08 | Call ERROR_1. | ||
| Prev: 5B00 | Up: Map | Next: 5B4F |