Prev: 24073 Up: Map Next: 59875
59830: 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 16384 (screen buffer), total length 43037 and 12 overlapping chunks. Each of the twelve main chunks carries 3510 tape bytes but only advances the destination by 3500, so the last ten bytes of one chunk overlap the next. A short final chunk finishes the 43037-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 59830 LD HL,0 Write 0000 to *Running_Checksum_Total.
59833 LD (59877),HL
59836 LD HL,59881 Point *LoaderChecksumData at Timing_Switch_Flag.
59839 LD (59875),HL
Add each byte from Timing_Switch_Flag through LoaderChecksumEnd into the running total.
MicromegaLoader_ChecksumLoop 59842 LD A,(HL) Fetch the next byte into DE.
59843 LD E,A
59844 LD D,0
59846 LD HL,(59877) Add it into *Running_Checksum_Total.
59849 ADD HL,DE
59850 LD (59877),HL
59853 LD HL,(59875) Fetch the scan pointer from *LoaderChecksumData.
59856 LD DE,60390 Jump to Control_Loading if the scan pointer has reached LoaderChecksumEnd.
59859 SCF
59860 CCF
59861 SBC HL,DE
59863 JP Z,Control_Loading
59866 LD HL,(59875) Advance *LoaderChecksumData.
59869 INC HL
59870 LD (59875),HL
59873 JR MicromegaLoader_ChecksumLoop Jump back to MicromegaLoader_ChecksumLoop.
Prev: 24073 Up: Map Next: 59875