![]() |
Routines |
| Prev: EA15 | Up: Map | Next: EAAE |
|
Used by the routine at MicromegaLoader.
Reads the 16-byte main-image header into MainImageHeader, then loads the twelve overlapping chunks and the final short block.
|
||||
|
Load the main-image header.
|
||||
| Control_Loading | EA2E | CALL Switch_Timing_FirstSet | Call Switch_Timing_FirstSet. | |
| EA31 | LD IX,$EB70 | Point IX at MainImageHeader. | ||
| EA35 | LD DE,$0010 | Set the block length in DE to 0010. | ||
| EA38 | XOR A | Clear A and set the carry flag (load a header block). | ||
| EA39 | SCF | |||
| EA3A | CALL Sample_Tape | Call Sample_Tape. | ||
| EA3D | JP NC,$0000 | Jump to START if the carry flag is reset. | ||
|
Prime the timing switch and read the destination and chunk count.
|
||||
| EA40 | LD A,$01 | Write 01 to *Timing_Switch_Flag. | ||
| EA42 | LD ($E9E9),A | |||
| EA45 | CALL Switch_Timing | Call Switch_Timing. | ||
| EA48 | LD IX,($EB7D) | Copy the destination from *Main_Image_Destination into IX and *Current_Load_Destination. | ||
| EA4C | LD ($EB84),IX | |||
| EA50 | XOR A | Write 00 to *Load_Progress_Counter. | ||
| EA51 | LD ($EB86),A | |||
| EA54 | LD A,($EB7F) | Fetch the chunk count from *Main_Image_Chunk_Count into B. | ||
| EA57 | LD B,A | |||
|
Load each overlapping chunk.
|
||||
| Control_Loading_ChunkLoop | EA58 | PUSH BC | Stash the remaining chunk count on the stack. | |
| EA59 | CALL Print_Progress | Call Print_Progress. | ||
| EA5C | LD DE,$0DB6 | Set the tape length in DE to 0DB6. | ||
| EA5F | LD IX,($EB84) | Point IX at *Current_Load_Destination. | ||
| EA63 | LD A,$FF | Set A to FF and set the carry flag (load a data block). | ||
| EA65 | SCF | |||
| EA66 | CALL Sample_Tape | Call Sample_Tape. | ||
| EA69 | JP NC,$0000 | Jump to START if the carry flag is reset. | ||
| EA6C | CALL Switch_Timing | Call Switch_Timing. | ||
| EA6F | EI | Enable interrupts. | ||
| EA70 | LD HL,($EB84) | Advance *Current_Load_Destination by 0DAC. | ||
| EA73 | LD DE,$0DAC | |||
| EA76 | ADD HL,DE | |||
| EA77 | LD ($EB84),HL | |||
| EA7A | POP BC | Restore the remaining chunk count from the stack. | ||
| EA7B | DJNZ Control_Loading_ChunkLoop | Jump back to Control_Loading_ChunkLoop until the chunk count is zero. | ||
|
Reload the header, then load the final short chunk.
|
||||
| EA7D | LD A,($EB86) | Decrease *Load_Progress_Counter by one. | ||
| EA80 | DEC A | |||
| EA81 | LD ($EB86),A | |||
| EA84 | CALL Print_Progress | Call Print_Progress. | ||
| EA87 | LD IX,$EB70 | Point IX at MainImageHeader. | ||
| EA8B | LD DE,$0010 | Set the block length in DE to 0010. | ||
| EA8E | XOR A | Clear A and set the carry flag (load a header block). | ||
| EA8F | SCF | |||
| EA90 | CALL Sample_Tape | Call Sample_Tape. | ||
| EA93 | JP NC,$0000 | Jump to START if the carry flag is reset. | ||
| EA96 | CALL Switch_Timing | Call Switch_Timing. | ||
| EA99 | CALL Print_Progress | Call Print_Progress. | ||
| EA9C | LD IX,($EB84) | Point IX at *Current_Load_Destination. | ||
| EAA0 | LD DE,($EB7B) | Fetch the final length from *Final_Chunk_Length into DE. | ||
| EAA4 | LD A,$FF | Set A to FF and set the carry flag (load a data block). | ||
| EAA6 | SCF | |||
| EAA7 | CALL Sample_Tape | Call Sample_Tape. | ||
| EAAA | JP NC,$0000 | Jump to START if the carry flag is reset. | ||
| EAAD | RET | Return. | ||
| Prev: EA15 | Up: Map | Next: EAAE |