Prev: 5E09 Up: Map Next: E9E3
E9B6: Micromega Loader
Used by the routine at Load_Stage_Two.
Stage-2 Micromega 1.1 loader. It first checksums itself, then reads a 16-byte custom header that names destination 4000 (screen buffer), total length A81D and 0C overlapping chunks. Each of the twelve main chunks carries 0DB6 tape bytes but only advances the destination by 0DAC, so the last ten bytes of one chunk overlap the next. A short final chunk finishes the A81D-byte main image at Loading, which overwrites the REM bootstrap. Control then returns to BASIC so line 4 can ROM-load the final support block on top of this loader. While the chunks load, Switch_Timing alternates two timing-parameter sets and Patch_Timing patches them into the sampler at Sample_Tape.
Clear the running total and point the scan at the first timed byte.
MicromegaLoader E9B6 LD HL,$0000 Write 0000 to *Running_Checksum_Total.
E9B9 LD ($E9E5),HL
E9BC LD HL,$E9E9 Point *LoaderChecksumData at Timing_Switch_Flag.
E9BF LD ($E9E3),HL
Add each byte from Timing_Switch_Flag through LoaderChecksumEnd into the running total.
MicromegaLoader_ChecksumLoop E9C2 LD A,(HL) Fetch the next byte into DE.
E9C3 LD E,A
E9C4 LD D,$00
E9C6 LD HL,($E9E5) Add it into *Running_Checksum_Total.
E9C9 ADD HL,DE
E9CA LD ($E9E5),HL
E9CD LD HL,($E9E3) Fetch the scan pointer from *LoaderChecksumData.
E9D0 LD DE,$EBE6 Jump to Control_Loading if the scan pointer has reached LoaderChecksumEnd.
E9D3 SCF
E9D4 CCF
E9D5 SBC HL,DE
E9D7 JP Z,Control_Loading
E9DA LD HL,($E9E3) Advance *LoaderChecksumData.
E9DD INC HL
E9DE LD ($E9E3),HL
E9E1 JR MicromegaLoader_ChecksumLoop Jump back to MicromegaLoader_ChecksumLoop.
Prev: 5E09 Up: Map Next: E9E3