![]() |
Routines |
| Prev: 4000 | Up: Map | Next: 5B4F |
|
Load the screen, the room pictures and the game. The last block falls straight into the tape loading routine.
|
||||
|
Load the first block: the loading screen.
|
||||
| TapeLoader | 5B00 | LD IX,$4000 | Load 1B00 bytes of the loading screen to 4000 with flag byte D7. | |
| 5B04 | LD DE,$1B00 | |||
| 5B07 | LD A,$D7 | |||
| 5B09 | CALL TapeLoading | |||
|
Load the second block: the room pictures.
|
||||
| 5B0C | LD IX,$61A8 | Load 4A2C bytes of picture data to Image_TheField with flag byte 0A. | ||
| 5B10 | LD DE,$4A2C | |||
| 5B13 | LD A,$0A | |||
| 5B15 | CALL TapeLoading | |||
|
Load the third block: the game. Execution falls into TapeLoading.
|
||||
| 5B18 | LD IX,$ABD4 | Load 5235 bytes of the game to GameEntryPoint with flag byte 2B. | ||
| 5B1C | LD DE,$5235 | |||
| 5B1F | LD A,$2B | |||
|
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. | ||
|
View the equivalent code in;
|
||||
| Prev: 4000 | Up: Map | Next: 5B4F |