Prev: 59925 Up: Map Next: 60078
59950: Control Loading
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 59950 CALL Switch_Timing_FirstSet Call Switch_Timing_FirstSet.
59953 LD IX,60272 Point IX at MainImageHeader.
59957 LD DE,16 Set the block length in DE to 0016.
59960 XOR A Clear A and set the carry flag (load a header block).
59961 SCF
59962 CALL Sample_Tape Call Sample_Tape.
59965 JP NC,0 Jump to START if the carry flag is reset.
Prime the timing switch and read the destination and chunk count.
59968 LD A,1 Write 1 to *Timing_Switch_Flag.
59970 LD (59881),A
59973 CALL Switch_Timing Call Switch_Timing.
59976 LD IX,(60285) Copy the destination from *Main_Image_Destination into IX and *Current_Load_Destination.
59980 LD (60292),IX
59984 XOR A Write 0 to *Load_Progress_Counter.
59985 LD (60294),A
59988 LD A,(60287) Fetch the chunk count from *Main_Image_Chunk_Count into B.
59991 LD B,A
Load each overlapping chunk.
Control_Loading_ChunkLoop 59992 PUSH BC Stash the remaining chunk count on the stack.
59993 CALL Print_Progress Call Print_Progress.
59996 LD DE,3510 Set the tape length in DE to 3510.
59999 LD IX,(60292) Point IX at *Current_Load_Destination.
60003 LD A,255 Set A to 255 and set the carry flag (load a data block).
60005 SCF
60006 CALL Sample_Tape Call Sample_Tape.
60009 JP NC,0 Jump to START if the carry flag is reset.
60012 CALL Switch_Timing Call Switch_Timing.
60015 EI Enable interrupts.
60016 LD HL,(60292) Advance *Current_Load_Destination by 3500.
60019 LD DE,3500
60022 ADD HL,DE
60023 LD (60292),HL
60026 POP BC Restore the remaining chunk count from the stack.
60027 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.
60029 LD A,(60294) Decrease *Load_Progress_Counter by one.
60032 DEC A
60033 LD (60294),A
60036 CALL Print_Progress Call Print_Progress.
60039 LD IX,60272 Point IX at MainImageHeader.
60043 LD DE,16 Set the block length in DE to 0016.
60046 XOR A Clear A and set the carry flag (load a header block).
60047 SCF
60048 CALL Sample_Tape Call Sample_Tape.
60051 JP NC,0 Jump to START if the carry flag is reset.
60054 CALL Switch_Timing Call Switch_Timing.
60057 CALL Print_Progress Call Print_Progress.
60060 LD IX,(60292) Point IX at *Current_Load_Destination.
60064 LD DE,(60283) Fetch the final length from *Final_Chunk_Length into DE.
60068 LD A,255 Set A to 255 and set the carry flag (load a data block).
60070 SCF
60071 CALL Sample_Tape Call Sample_Tape.
60074 JP NC,0 Jump to START if the carry flag is reset.
60077 RET Return.
Prev: 59925 Up: Map Next: 60078