Home » Personal collection » Commodore disks » disk44b_mandelbrot.d64 » mandelcode22
mandelcode22
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Commodore disks » disk44b_mandelbrot.d64 |
Filename: | mandelcode22 |
Read OK: | ✔ |
File size: | 661F bytes |
Load address: | 0801 |
Exec address: | 0000 |
File contents
10 ;MANDELPLOT 20 ;SOURCE CODE 30 ;22/10/95 40 ; 100 *=$0E00 105 ; VARIABLES 110 XPIXEL=$4103 120 YPIXEL=$4104 130 COLOUR=$4105 140 YPIB=$4106 150 MAXCOL=$4107 160 XP=$4108 170 YP=$4109 180 XPB=$410A 190 CLICK=$410B 200 HOUR=$410C 210 XPIB=$410D 220 XPBIB=$410E 222 COL0=$410F 224 COL1=$4110 226 COL2=$4111 228 COL3=$4112 230 COL0S=$4113 232 COL1S=$4114 234 COL2S=$4115 236 COL3S=$4116 238 ELSETIME=$4117 240 SPEED=$4118 242 NEGREG=$4119 280 ; ROM ROUTINES 290 OUTDO =$AB47 291 SCNCLRLFS=$FFBA 292 SCNCLRNAM=$FFBD 293 SSHAPEROM=$FFD8 294 PLOTRROM=$E56C 300 ; SPRITE DATA 305 ; 310 TXT 224,000,000,176,000,000,152,000 320 TXT 000,140,000,000,134,000,000,131 330 TXT 000,000,129,128,000,128,192,000 340 TXT 128,064,000,147,192,000,185,000 350 TXT 000,233,000,000,009,128,000,012 360 TXT 128,000,004,128,000,004,128,000 370 TXT 007,128,000,000,000,000,000,000 380 TXT 000,000,000,000,000,000,000,153 385 ; 390 TXT 000,000,000,064,000,000,096,000 400 TXT 000,112,000,000,120,000,000,124 410 TXT 000,000,126,000,000,127,000,000 420 TXT 127,128,000,108,000,000,070,000 430 TXT 000,006,000,000,006,000,000,003 440 TXT 000,000,003,000,000,003,000,000 450 TXT 000,000,000,000,000,000,000,000 460 TXT 000,000,000,000,000,000,000,153 465 ; 470 TXT 255,192,000,129,064,000,128,064 480 TXT 000,129,064,000,066,128,000,064 490 TXT 128,000,051,000,000,012,000,000 500 TXT 055,000,000,065,128,000,066,128 510 TXT 000,129,064,000,130,192,000,133 520 TXT 064,000,255,192,000,000,000,000 530 TXT 000,000,000,000,000,000,000,000 540 TXT 000,000,000,000,000,000,000,197 545 ; 550 TXT 255,192,000,255,192,000,255,192 560 TXT 000,255,192,000,127,128,000,127 570 TXT 128,000,063,000,000,012,000,000 580 TXT 063,000,000,127,128,000,127,128 590 TXT 000,255,192,000,255,192,000,255 600 TXT 192,000,255,192,000,000,000,000 610 TXT 000,000,000,000,000,000,000,000 620 TXT 000,000,000,000,000,000,000,197 625 ; 630 TXT 168,000,000,000,000,000,128,000 640 TXT 000,000,000,000,128,000,000,000 650 TXT 000,000,000,000,000,000,000,000 660 TXT 000,000,000,000,000,000,000,000 670 TXT 000,000,000,000,000,000,000,000 680 TXT 000,000,000,000,000,000,000,000 690 TXT 000,000,000,000,000,000,000,000 700 TXT 000,000,000,000,000,000,000,197 705 ; 710 TXT 000,000,021,000,000,000,000,000 720 TXT 001,000,000,000,000,000,001,000 730 TXT 000,000,000,000,000,000,000,000 740 TXT 000,000,000,000,000,000,000,000 750 TXT 000,000,000,000,000,000,000,000 760 TXT 000,000,000,000,000,000,000,000 770 TXT 000,000,000,000,000,000,000,000 780 TXT 000,000,000,000,000,000,000,000 785 ; 790 TXT 000,000,000,000,000,000,000,000 800 TXT 000,000,000,000,000,000,000,000 810 TXT 000,000,000,000,000,000,000,000 820 TXT 000,000,000,000,000,000,000,000 830 TXT 000,000,000,000,000,000,000,000 840 TXT 000,000,000,000,000,000,000,000 850 TXT 128,000,000,000,000,000,128,000 860 TXT 000,000,000,000,168,000,000,000 865 ; 870 TXT 000,000,000,000,000,000,000,000 880 TXT 000,000,000,000,000,000,000,000 890 TXT 000,000,000,000,000,000,000,000 900 TXT 000,000,000,000,000,000,000,000 910 TXT 000,000,000,000,000,000,000,000 920 TXT 000,000,000,000,000,000,000,000 930 TXT 000,000,001,000,000,000,000,000 940 TXT 001,000,000,000,000,000,021,000 945 ; 10000 ; MAIN CONTROL ROUTINES 10010 JSR INIT 10020 COMEBACK JSR HIRESON 10030 CONTROLOP LDA CLICK 10040 BNE CONTROLOP 10050 CONTLOPB LDA CLICK 10060 BEQ CONTLOPB 10070 LDA XP 10080 CMP #$58 10090 BCC CONTCONT 10100 JMP BOX 10110 CONTCONT LDA YP 10112 CMP #$5A 10114 BCC CONTROLOP 10120 SEC 10130 SBC #$5A 10140 LSR A 10150 LSR A 10160 AND #$FE 10170 TAX 10180 LDA VECTORS,X 10190 STA $FB 10200 INX 10210 LDA VECTORS,X 10220 STA $FC 10230 JMP ($00FB) 10240 VECTORS TXT <ZOOMOUT,>ZOOMOUT,<CONTROLOP,>CONTROLOP,<ZOOMIN,>ZOOMIN 10250 TXT <CONTROLOP,>CONTROLOP,<POSITION,>POSITION,<CONTROLOP,>CONTROLOP 10260 TXT <CONTROLOP,>CONTROLOP,<COLS,>COLS,<CONTROLOP,>CONTROLOP 10270 TXT <COLCYCLE,>COLCYCLE,<CONTROLOP,>CONTROLOP,<MANDPLOT,>MANDPLOT 10280 TXT <CONTROLOP,>CONTROLOP,<CONTROLOP,>CONTROLOP,<EXIT,>EXIT 10290 TXT <CONTROLOP,>CONTROLOP,<BOX,>BOX,<CONTROLOP,>CONTROLOP,<SSHAPE,>SSHAPE 10300 TXT <CONTROLOP,>CONTROLOP,<CONTROLOP,>CONTROLOP,<CONTROLOP,>CONTROLOP 10500 EXIT JSR HIRESOFF 10510 LDA #$93 10520 JSR OUTDO 10530 LDA #$05 10540 JSR OUTDO 10550 LDA #$00 10560 STA $C6 10570 RTS 12000 ; WIMP ROUTINES 12020 ; WIMP - MOUSE 12030 IRQ LDA #$00 12040 STA CLICK 12050 LDA $C5 12060 CMP #$01 12070 BNE CONCHECK 12080 STA CLICK 12090 CONCHECK CMP #$0C 12100 BEQ LEFTK 12110 LKC CMP #$17 12120 BEQ RIGHTK 12130 RKC CMP #$32 12140 BEQ UPK 12150 UPKC CMP #$37 12160 BEQ DOWNK 12170 DKC LDA $DC00 12190 AND #$01 12200 BEQ UPJ 12210 UJC LDA $DC00 12220 AND #$02 12230 BEQ DOWNJ 12240 DJC LDA $DC00 12250 AND #$04 12260 BEQ LEFTJ 12270 LJC LDA $DC00 12280 AND #$08 12290 BEQ RIGHTJ 12300 RJC LDA $DC00 12310 AND #$10 12320 EOR #$10 12330 BEQ CJCH 12340 STA CLICK 12350 CJCH JMP BOXFLASH 12360 LEFTK JSR LEFT 12370 JMP LKC 12380 RIGHTK JSR RIGHT 12390 JMP RKC 12400 UPK JSR UP 12410 JMP UPKC 12420 DOWNK JSR DOWN 12430 JMP DKC 12440 UPJ JSR UP 12450 JMP UJC 12460 DOWNJ JSR DOWN 12470 JMP DJC 12480 LEFTJ JSR LEFT 12490 JMP LJC 12500 RIGHTJ JSR RIGHT 12510 JMP RJC 12520 LEFT DEC XP 12530 LDA XP 12540 CMP #$FF 12550 BNE NOTFF 12560 LDY #$00 12570 STY XPB 12580 NOTFF LDY XPB 12590 BNE FIN 12600 CMP #$18 12610 BNE FIN 12620 INC XP 12630 FIN JMP CONTROL 12640 RIGHT INC XP 12650 LDA XP 12660 BNE NOT00 12670 LDY #$01 12680 STY XPB 12690 NOT00 LDY XPB 12700 BEQ FIN 12710 CMP #$58 12720 BNE FIN 12730 DEC XP 12740 JMP CONTROL 12750 UP DEC YP 12760 LDA YP 12770 CMP #$32 12780 BNE FIN 12790 INC YP 12800 JMP CONTROL 12810 DOWN INC YP 12820 LDA YP 12830 CMP #$F8 12840 BNE FIN 12850 DEC YP 12860 JMP CONTROL 12870 ; WIMP - POINTER 12880 CONTROL LDA HOUR 12890 BEQ NHGLASS 13210 LDX #$3A 13220 STX $07F8 13230 INX 13240 STX $07F9 13250 NHGLASS LDA XP 13260 STA $D000 13270 STA $D002 13280 LDA YP 13290 STA $D001 13300 STA $D003 13310 LDA $D010 13320 AND #$FC 13330 LSR A 13340 CLC 13350 ADC XPB 13360 ASL A 13370 CLC 13380 ADC XPB 13390 STA $D010 13400 LDA #$00 13410 STA $D027 13420 LDA #$01 13430 STA $D028 13440 LDA $D015 13450 ORA #$03 13460 STA $D015 13470 LDA HOUR 13480 BNE QTRO 13490 LDX #$38 13500 STX $07F8 13510 INX 13520 STX $07F9 13530 QTRO RTS 13540 ; STARTUP ROUTINES 13550 INIT LDA #$00 13560 STA $D020 13570 STA $D021 13580 STA XP 13590 STA HOUR 13600 STA $D015 13610 LDA #$01 13620 STA XPB 13630 LDA #$80 13640 STA YP 13650 HIRESON LDA #$3B 13660 STA $D011 13670 LDA #$D8 13680 STA $D016 13690 LDA COL0S 13700 STA COL0 13710 LDA COL1S 13720 STA COL1 13730 LDA COL2S 13740 STA COL2 13750 LDA COL3S 13760 STA COL3 13770 JSR SCNCLRCOLS 13830 JSR LEFT 13840 SEI 13850 LDA #<IRQ 13860 STA $0314 13870 LDA #>IRQ 13880 STA $0315 13890 CLI 14010 LDA #$18 14020 STA $D018 14900 RTS 14930 HIRESOFF SEI 14940 LDA #$31 14950 STA $0314 14960 LDA #$EA 14970 STA $0315 14980 CLI 14990 LDA #$00 15000 STA $D015 15010 LDA #$9B 15020 STA $D011 15030 LDA #$C8 15040 STA $D016 15043 LDA #$15 15046 STA $D018 15050 RTS 20000 BOX JSR HIRESOFF 20010 LDA #$1C 20020 JSR OUTDO 20030 LDA #$93 20040 JSR OUTDO 20050 LDA #$00 20060 BOXLOOP PHA 20070 ASL A 20080 ASL A 20090 CLC 20100 ADC #$42 20110 STA $FC 20120 LDY #$00 20130 STY $FB 20140 STY $FD 20150 LDA #$04 20160 STA $FE 20170 BOXLOOPB LDA ($FB),Y 20180 STA ($FD),Y 20190 INY 20200 BNE BOXLOOPB 20210 INC $FC 20220 INC $FE 20230 LDA $FE 20240 CMP #$08 20250 BNE BOXLOOPB 20260 BOXAUTO LDA $C5 20270 CMP #$40 20280 BNE BOXAUTO 20290 BOXAUTOB LDA $C5 20300 CMP #$40 20310 BEQ BOXAUTOB 20320 TAX 20330 PLA 20340 CPX #$01 20350 BEQ HNOMORE 20360 CPX #$28 20370 BEQ NEXT 20380 CPX #$2B 20390 BEQ PREV 20400 BOXRET PHA 20410 JMP BOXAUTOB 20420 HNOMORE JMP COMEBACK 20430 NEXT CMP #$04 20440 BEQ BOXRET 20450 CLC 20460 ADC #$01 20470 JMP BOXLOOP 20480 PREV CMP #$00 20490 BEQ BOXRET 20500 SEC 20510 SBC #$01 20520 JMP BOXLOOP 25000 ; SAVE ROUTINES 25010 FNAME TXT 147,5 25020 TXT "FILENAME:",0 25030 TORD TXT 13,13,"(T)APE OR (D)ISK",0 25040 POST TXT 13,13,"POSITION TAPE <SPACE>",13,0 25050 INSD TXT 13,13,"INSERT DISK <SPACE>",13,0 25060 PSTRING LDY #$00 25070 PSTRLOP LDA ($FB),Y 25080 BEQ PSTRQUIT 25090 JSR OUTDO 25095 INY 25100 JMP PSTRLOP 25110 PSTRQUIT RTS 25120 ONOFF LDA $040A,Y 25130 EOR #$80 25140 STA $040A,Y 25150 RTS 25160 GETAUTO LDA $C5 25170 CMP #$40 25180 BNE GETAUTO 25190 GETAUTOB LDA $C5 25200 CMP #$40 25210 BEQ GETAUTOB 25220 TAX 25230 LDA AUTOINSTR,X 25240 BEQ GETAUTO 25250 RTS 25260 SSHAPE JSR HIRESOFF 25270 LDX #$00 25280 LDA #$20 25290 FNAMECLR STA $41F0,X 25300 INX 25310 CPX #$10 25320 BNE FNAMECLR 25330 LDA #<FNAME 25340 STA $FB 25350 LDA #>FNAME 25360 STA $FC 25370 JSR PSTRING 25380 LDA #$00 25390 PHA 25400 SSHAPELOOP TAY 25405 JSR ONOFF 25410 JSR GETAUTO 25415 PHA 25420 JSR ONOFF 25425 PLA 25430 CMP #$80 25440 BCS DECODE 25450 TAY 25460 PLA 25470 TAX 25480 TYA 25490 STA $040A,X 25500 CMP #$20 25510 BCS NOSPC 25520 CLC 25530 ADC #$40 25540 NOSPC STA $41F0,X 25550 INCPOS CPX #$0F 25560 BEQ SSHAPERELOP 25570 INX 25580 SSHAPERELOP TXA 25585 PHA 25590 JMP SSHAPELOOP 25600 DECODE CMP #$80 25610 BEQ SSHAPECONT 25620 CMP #$81 25630 BEQ DEC 25640 CMP #$82 25650 BNE SSHAPELOOP 25660 PLA 25670 TAX 25680 LDA $028D 25690 AND #$01 25700 BEQ INCPOS 25710 DECPOS CPX #$00 25720 BEQ SSHAPERELOP 25730 DEX 25740 JMP SSHAPERELOP 25750 DEC PLA 25760 TAX 25770 LDA #$20 25780 STA $040A,X 25790 STA $41F0,X 25800 JMP DECPOS 25810 SSHAPECONT PLA 25815 LDA #<TORD 25820 STA $FB 25830 LDA #>TORD 25840 STA $FC 25850 JSR PSTRING 25860 GSHAPE JSR GETAUTO 25870 CMP #$14 25880 BEQ TAPESSHAPE 25890 CMP #$04 25900 BEQ DISKSSHAPE 25910 JMP GSHAPE 25920 TAPESSHAPE LDA #<POST 25930 STA $FB 25940 LDA #>POST 25950 STA $FC 25960 JSR PSTRING 25970 LDX #$01 25980 JMP TAPECONT 25990 DISKSSHAPE LDA #<INSD 26000 STA $FB 26010 LDA #>INSD 26020 STA $FC 26030 JSR PSTRING 26040 LDX #$08 26050 TAPECONT LDA $C5 26060 CMP #$3C 26070 BNE TAPECONT 26080 LDA #$01 26090 TAY 26100 JSR SCNCLRLFS 26110 LDX #$10 26120 FNAMELEN LDA $41EF,X 26130 CMP #$20 26140 BNE FNAMEGOT 26150 DEX 26160 BEQ FNAMEGOT 26170 JMP FNAMELEN 26180 FNAMEGOT TXA 26190 LDX #$F0 26210 LDY #$41 26220 JSR SCNCLRNAM 26230 LDA #$20 26240 STA $FC 26250 LDX #$00 26260 STA $FB 26270 LDY #$40 26280 LDA #$FB 26290 JSR SSHAPEROM 26300 JMP COMEBACK 27000 ; KEYBOARD DECODE TABLE 27010 ; 27020 AUTOINSTR TXT $81,$80,$82 27030 TXT 0,0,0,0,$83,51,23,1,52,26 27040 TXT 19,5,0,53,18,4,54,3,6,20,24 27050 TXT 55,25,7,56,2,8,21,22,57,9,10 27060 TXT 48,13,11,15,14,43,16,12,45,46 27070 TXT 0,0,44,0,0,0,0,0,0,30,47,49 27080 TXT 31,0,50,32,0,17,0,0 30000 ; MANDLEBROT SET PLOTTER 30010 MANDLE SEI 30012 LDA #$01 30013 STA HOUR 30014 JSR LEFT 30015 LDA #$00 30020 STA YPIXEL 30030 LDA #$03 30040 STA $4100 30050 LDA #$06 30060 STA $4102 30070 JSR EQUAL 30080 MMAINL LDA #$00 30090 STA XPIXEL 30100 LDA #$01 30110 STA $4100 30120 LDA #$05 30130 STA $4102 30140 JSR EQUAL 30150 MMAINLB LDA #$05 30160 STA $4100 30170 LDA #$07 30180 STA $4102 30190 JSR EQUAL 30200 INC $4100 30210 INC $4102 30220 JSR EQUAL 30230 LDA #$00 30240 STA COLOUR 30250 LOOP LDA #$07 30260 STA $4100 30270 STA $4101 30280 LDA #$10 30290 STA $4102 30300 JSR MULTIPLY 30310 LDA #$08 30320 STA $4100 30330 STA $4101 30340 LDA #$11 30350 STA $4102 30360 JSR MULTIPLY 30370 LDX #$10 30380 STX $4100 30390 INX 30400 STX $4101 30410 INX 30420 STX $4102 30430 JSR ADDITION 30440 LDA $4091 30450 CMP #$04 30460 BCC FAIL 30470 CMP #$50 30480 BCS FAIL 30490 SUCPASS JMP SUCCESS 30500 FAIL INC COLOUR 30505 LDA COLOUR 30510 CMP MAXCOL 30520 BEQ SUCPASS 30530 JSR SUBTRACT 30540 LDA #$12 30550 STA $4100 30560 LDA #$05 30570 STA $4101 30580 LDA #$13 30590 STA $4102 30600 JSR ADDITION 30610 LDA #$07 30620 STA $4100 30630 LDA #$08 30640 STA $4101 30650 INC $4102 30660 JSR MULTIPLY 30670 LDA #$14 30680 STA $4100 30690 LDA #$1C 30700 STA $4101 30710 LDA #$15 30720 STA $4102 30730 JSR MULTIPLY 30740 LDA #$15 30750 STA $4100 30760 LDA #$06 30770 STA $4101 30780 LDA #$16 30790 STA $4102 30800 JSR ADDITION 30810 LDA #$13 30820 STA $4100 30830 LDA #$07 30840 STA $4102 30850 JSR EQUAL 30860 LDA #$16 30870 STA $4100 30880 LDA #$08 30890 STA $4102 30900 JSR EQUAL 30910 JMP LOOP 30920 SUCCESS JSR PLOT 30930 LDA #$05 30940 STA $4100 30950 STA $4102 30960 LDA #$02 30970 STA $4101 30980 JSR ADDITION 30990 LDA XPIXEL 31000 BNE XRELOP 31010 LDA #$06 31020 STA $4100 31030 STA $4102 31040 LDA #$04 31050 STA $4101 31060 JSR ADDITION 31070 INC YPIXEL 31080 LDA YPIXEL 31090 CMP #$C8 31100 BNE YRELOP 31102 LDA #$00 31103 STA HOUR 31104 JSR RIGHT 31105 CLI 31110 RTS 31120 XRELOP JMP MMAINLB 31130 YRELOP JMP MMAINL 31200 MANDPLOT JSR MANDLE 31210 JMP CONTROLOP 35000 ; COLOUR ROUTINES 35010 SCNCLRCOLS LDA COL0 35020 STA $D021 35030 LDY #$00 35040 STY $FB 35050 LDA #$D8 35060 STA $FC 35070 LDA COL3 35080 SCNCLRCLOPA STA ($FB),Y 35090 INY 35100 BNE SCNCLRCLOPA 35110 INC $FC 35120 LDX $FC 35130 CPX #$DC 35140 BNE SCNCLRCLOPA 35150 LDA #$04 35160 STA $FC 35170 LDA COL1 35180 ASL A 35190 ASL A 35200 ASL A 35210 ASL A 35220 ORA COL2 35230 SCNCLRCLOPB STA ($FB),Y 35240 INY 35250 BEQ SCNCLRCLOPC 35260 CPY #$F8 35270 BNE SCNCLRCLOPB 35280 LDX $FC 35290 CPX #$07 35300 BNE SCNCLRCLOPB 35310 RTS 35320 SCNCLRCLOPC INC $FC 35330 JMP SCNCLRCLOPB 35340 COLCWAIT LDA ELSETIME 35350 CLC 35360 ADC SPEED 35370 STA ELSETIME 35380 COLCLOP CMP $A2 35390 BNE COLCLOP 35400 RTS 35410 COLCAUTOS LDA $C5 35420 CMP #$28 35430 BEQ SPUP 35440 CMP #$2B 35450 BEQ SLDN 35460 CMP #$01 35470 BEQ COLCOFF 35480 NOAUTO RTS 35490 COLCOFF PLA 35500 PLA 35510 JMP COMEBACK 35520 SPUP LDA SPEED 35525 CMP #$03 35530 BEQ NOAUTO 35540 DEC SPEED 35550 RTS 35560 SLDN LDA SPEED 35570 CMP #$19 35580 BEQ NOAUTO 35590 INC SPEED 35600 RTS 35610 COLCYCLE LDA #$0A 35620 STA SPEED 35630 LDA $A2 35640 STA ELSETIME 35650 COLCYCLOP LDA COL0S 35660 STA COL0 35670 LDA COL1S 35680 STA COL1 35690 LDA COL2S 35700 STA COL2 35710 LDA COL3S 35720 STA COL3 35730 JSR SCNCLRCOLS 35740 JSR COLCAUTOS 35750 JSR COLCWAIT 35760 LDA COL3S 35770 STA COL0 35780 LDA COL0S 35790 STA COL1 35800 LDA COL1S 35810 STA COL2 35820 LDA COL2S 35830 STA COL3 35840 JSR SCNCLRCOLS 35850 JSR COLCAUTOS 35860 JSR COLCWAIT 35870 LDA COL2S 35880 STA COL0 35890 LDA COL3S 35900 STA COL1 35910 LDA COL0S 35920 STA COL2 35930 LDA COL1S 35940 STA COL3 35950 JSR SCNCLRCOLS 35960 JSR COLCAUTOS 35970 JSR COLCWAIT 35980 LDA COL1S 35990 STA COL0 36000 LDA COL2S 36010 STA COL1 36020 LDA COL3S 36030 STA COL2 36040 LDA COL0S 36050 STA COL3 36060 JSR SCNCLRCOLS 36070 JSR COLCAUTOS 36080 JSR COLCWAIT 36090 JMP COLCYCLOP 40000 ; ARITHMETIC ROUTINES 40010 GETDIGIT CLD 40020 ASL A 40030 ASL A 40040 ASL A 40050 STA $02 40060 TXA 40070 LSR A 40080 STA $24 40090 LDA #$07 40100 SEC 40110 SBC $24 40120 CLC 40130 ADC $02 40140 TAY 40150 LDA $4000,Y 40160 TAY 40170 TXA 40180 AND #$01 40190 BEQ LSNGD 40200 TYA 40210 AND #$F0 40220 LSR A 40230 LSR A 40240 LSR A 40250 LSR A 40260 RTS 40270 LSNGD TYA 40280 AND #$0F 40290 RTS 40300 MULTIPLYB JSR NEGATIVE 40305 LDA $4102 40310 ASL A 40320 ASL A 40330 ASL A 40340 TAX 40350 LDA #$00 40360 TAY 40370 MLOPA STA $4000,X 40380 INY 40390 INX 40400 CPY #$08 40410 BNE MLOPA 40420 LDA #$06 40430 STA $FC 40440 NEWDIGIT LDA $4101 40450 LDX $FC 40460 JSR GETDIGIT 40470 CMP #$00 40480 BEQ DMOVERB 40490 STA $FD 40500 LDA #$06 40510 STA $FB 40520 DMLOP LDA $4100 40530 LDX $FB 40540 JSR GETDIGIT 40550 CMP #$00 40560 BEQ DMOVER 40570 ASL A 40580 ASL A 40590 ASL A 40600 ASL A 40610 CLC 40620 ADC $FD 40630 TAY 40640 LDA MINSTR,Y 40650 STA $35 40660 AND #$0F 40670 TAY 40680 LDA $FB 40690 CLC 40700 ADC $FC 40710 SEC 40720 SBC #$0C 40730 TAX 40740 AND #$01 40750 BEQ MSKIP 40760 TYA 40770 ASL A 40780 ASL A 40790 ASL A 40800 ASL A 40810 TAY 40820 LDA $35 40830 AND #$F0 40840 LSR A 40850 LSR A 40860 LSR A 40870 LSR A 40880 STA $35 40890 JMP MCONT 40895 DMOVERB JMP DMOVER 40900 MSKIP LDY $35 40910 LDA #$00 40920 STA $35 40922 MCONT TXA 40924 LSR A 40926 STA $02 40928 LDA #$07 40930 SEC 40932 SBC $02 40934 STA $02 40936 LDA $4102 40938 ASL A 40940 ASL A 40942 ASL A 40944 ADC $02 40946 STY $25 40948 TAY 40950 SED 40952 LDA $4000,Y 40954 CLC 40956 ADC $25 40958 STA $4000,Y 40960 CLD 40962 DEY 40964 SED 40966 LDA $4000,Y 40968 ADC $35 40970 STA $4000,Y 40972 CLD 40974 MALP BCC DMOVER 40976 DEY 40978 SED 40980 LDA $4000,Y 40982 ADC #$00 40984 STA $4000,Y 40986 CLD 40988 JMP MALP 41050 DMOVER INC $FB 41060 LDA $FB 41070 CMP #$0E 41080 BCC DMLOPB 41090 INC $FC 41100 LDA $FC 41110 CMP #$0E 41120 BCC NEWDIGITB 41130 LDA YPIB 41140 BEQ QUIT 41150 LDA $4102 41160 STA $4101 41170 LDA #$1D 41180 STA $4100 41190 JSR SUBTRACT 41200 QUIT RTS 41210 DMLOPB JMP DMLOP 41220 NEWDIGITB JMP NEWDIGIT 41250 MSUP LDA $4100 41260 ASL A 41270 ASL A 41280 ASL A 41290 TAX 41300 DEX 41310 STX $FB 41320 LDA $4101 41330 ASL A 41340 ASL A 41350 ASL A 41360 TAX 41370 DEX 41380 STX $FD 41390 LDA $4102 41400 ASL A 41410 ASL A 41420 ASL A 41430 TAX 41440 DEX 41450 STX $22 41460 LDA #$40 41470 STA $FC 41480 STA $FE 41490 STA $23 41500 RTS 41510 EQUAL JSR MSUP 41520 LDY #$08 41530 ELOP LDA ($FB),Y 41540 STA ($22),Y 41550 DEY 41560 BNE ELOP 41570 RTS 41580 ADDITION JSR MSUP 41590 LDY #$08 41600 SED 41610 CLC 41620 ADLOP LDA ($FB),Y 41630 ADC ($FD),Y 41640 STA ($22),Y 41650 DEY 41660 BNE ADLOP 41670 CLD 41680 RTS 41690 SUBTRACT JSR MSUP 41700 LDY #$08 41710 SED 41720 SEC 41730 SULOP LDA ($FB),Y 41740 SBC ($FD),Y 41750 STA ($22),Y 41760 DEY 41770 BNE SULOP 41780 CLD 41790 RTS 41800 NEGATIVE LDA #$00 41810 PHA 41820 LDA $4100 41830 TAY 41840 ASL A 41850 ASL A 41860 ASL A 41870 TAX 41880 LDA $4001,X 41890 CMP #$50 41895 BCC NEGRMOVEAB 41900 PLA 41910 ADC #$00 41920 PHA 41930 JMP NEGRMOVEA 41940 NEGRMOVEAB LDA $4101 41950 TAY 41960 ASL A 41970 ASL A 41980 ASL A 41990 TAX 42000 LDA $4001,X 42010 CMP #$50 42020 PLA 42030 BCC NOEOR 42040 EOR #$01 42050 PHA 42060 BCS NEGRMOVEB 42070 NEGRMOVEBB PLA 42080 NOEOR STA YPIB 42090 RTS 42100 NEGRMOVE LDA $4100 42110 PHA 42120 LDA $4101 42130 PHA 42140 LDA $4102 42150 PHA 42160 TYA 42170 STA $4101 42180 STA $4102 42190 LDA #$1D 42200 STA $4100 42210 JSR SUBTRACT 42220 PLA 42230 STA $4102 42240 PLA 42250 STA $4101 42260 PLA 42270 STA $4100 42280 RTS 42290 NEGRMOVEA JSR NEGRMOVE 42300 JMP NEGRMOVEAB 42310 NEGRMOVEB JSR NEGRMOVE 42320 JMP NEGRMOVEBB 42330 MULTIPLY LDA $4102 42340 PHA 42350 LDA $4101 42360 PHA 42370 LDA #$18 42380 STA $4102 42390 JSR EQUAL 42400 INC $4102 42410 PLA 42420 STA $4100 42430 JSR EQUAL 42440 LDA #$18 42450 STA $4100 42460 LDA #$19 42470 STA $4101 42480 PLA 42490 STA $4102 42500 JMP MULTIPLYB 45000 ; MULTIPLICATION TABLES 45002 ; 45004 MINSTR TXT 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 45006 TXT 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0 45008 TXT 0,2,4,6,8,$10,$12,$14,$16,$18,0,0,0,0,0,0 45010 TXT 0,3,6,9,$12,$15,$18,$21,$24,$27,0,0,0,0,0,0 45012 TXT 0,4,8,$12,$16,$20,$24,$28,$32,$36,0,0,0,0,0,0 45014 TXT 0,5,$10,$15,$20,$25,$30,$35,$40,$45,0,0,0,0,0,0 45016 TXT 0,6,$12,$18,$24,$30,$36,$42,$48,$54,0,0,0,0,0,0 45018 TXT 0,7,$14,$21,$28,$35,$42,$49,$56,$63,0,0,0,0,0,0 45020 TXT 0,8,$16,$24,$32,$40,$48,$56,$64,$72,0,0,0,0,0,0 45022 TXT 0,9,$18,$27,$36,$45,$54,$63,$72,$81,0,0,0,0,0,0 46000 ; POSITION 46010 POSTEXT TXT 147,5," P O S I T I O N",13,13,13,"XMIN:",13 46020 TXT "XMAX:",13,"YMIN:",13,"YMAX:",0 46030 PNO PHA 46040 ASL A 46050 ASL A 46060 ASL A 46070 TAX 46080 LDA $4001,X 46090 CMP #$50 46100 BCS PNOVER 46110 LDA #$2B 46120 JSR OUTDO 46122 LDA #$00 46124 STA NEGREG 46130 JMP PNCONT 46140 PNOVER LDA #$2D 46150 JSR OUTDO 46151 LDA #$01 46152 STA NEGREG 46153 PLA 46154 PHA 46155 STA $4101 46156 STA $4102 46157 LDA #$1D 46158 STA $4100 46159 JSR SUBTRACT 46160 PNCONT LDX #$0C 46170 PNCB STX $22 46180 PLA 46190 PHA 46200 JSR GETDIGIT 46220 CLC 46230 ADC #$30 46235 JSR OUTDO 46240 LDX $22 46250 BEQ PNDQ 46260 CPX #$0C 46270 BEQ PNDOT 46280 DEX 46290 JMP PNCB 46300 PNDOT LDA #$2E 46310 JSR OUTDO 46320 DEX 46330 JMP PNCB 46340 PNDQ PLA 46341 LDX NEGREG 46342 BEQ NOGREG 46343 STA $4101 46344 STA $4102 46345 LDA #$1D 46346 STA $4100 46347 JSR SUBTRACT 46350 NOGREG RTS 46360 POSITION JSR HIRESOFF 46370 LDA #<POSTEXT 46380 STA $FB 46390 LDA #>POSTEXT 46400 STA $FC 46410 JSR PSTRING 46420 LDA #$07 46430 STA $D3 46440 LDA #$03 46450 STA $D6 46460 JSR PLOTRROM 46470 LDA #$01 46480 JSR PNO 46490 LDA #$07 46500 STA $D3 46510 LDA #$04 46520 STA $D6 46530 JSR PLOTRROM 46540 LDA #$1E 46550 JSR PNO 46560 LDA #$07 46570 STA $D3 46580 LDA #$05 46590 STA $D6 46600 JSR PLOTRROM 46610 LDA #$03 46620 JSR PNO 46630 LDA #$07 46640 STA $D3 46645 LDA #$06 46650 STA $D6 46660 JSR PLOTRROM 46670 LDA #$1F 46680 JSR PNO 46690 LDX #$01 46700 LDY #$00 46705 JSR POSONOFF 46710 POSLOP TXA 46720 PHA 46730 POSLOPB JSR GETAUTO 46740 CMP #$2B 46750 BEQ POSIPOS 46760 CMP #$2D 46770 BEQ POSINEG 46780 CMP #$82 46790 BEQ XPOSMOVE 46800 CMP #$83 46810 BEQ YPOSMOVE 46820 CMP #$80 46830 BEQ POSCALCT 46840 CMP #$30 46850 BCC POSLOPB 46860 CMP #$3A 46870 BCS POSLOPB 46875 STA $23 46880 PLA 46885 PHA 46890 TAX 46900 JSR GETMEMAD 46910 STX $22 46920 TAX 46930 LDA $23 46940 EOR #$80 46950 STA $047F,X 46960 JMP POSRIGHT 46970 POSCALCT JMP POSCALC 47000 POSIPOS LDX #$00 47010 JSR GETMEMAD 47020 TAX 47030 LDA #$2B 47040 STA $047F,X 47050 JMP POSLOPB 47060 POSINEG LDX #$00 47070 JSR GETMEMAD 47080 TAX 47090 LDA #$2D 47100 STA $047F,X 47110 JMP POSLOPB 47120 XPOSMOVE LDA $028D 47130 AND #$01 47140 BEQ POSRIGHT 47150 PLA 47160 TAX 47165 CPX #$01 47170 BEQ POSLOP 47180 LMISS JSR POSONOFF 47190 DEX 47200 JSR POSONOFF 47202 CPX #$02 47204 BEQ LMISS 47210 JMP POSLOP 47220 POSRIGHT PLA 47230 TAX 47240 CPX #$0E 47250 BEQ POSLOP 47260 RMISS JSR POSONOFF 47270 INX 47280 JSR POSONOFF 47282 CPX #$02 47284 BEQ RMISS 47290 JMP POSLOP 47300 YPOSMOVE PLA 47302 TAX 47304 LDA $028D 47310 AND #$01 47320 BEQ POSDOWN 47330 CPY #$00 47340 BEQ POSLOPT 47350 JSR POSONOFF 47360 DEY 47370 JSR POSONOFF 47380 JMP POSLOPT 47390 POSDOWN CPY #$03 47400 BEQ POSLOPT 47410 JSR POSONOFF 47420 INY 47430 JSR POSONOFF 47440 JMP POSLOPT 47450 POSLOPT JMP POSLOP 47500 POSSURE TXT 13,13,"REPOSITION: ARE YOU SURE (Y/N)",0 48000 POSCALC LDA #<POSSURE 48010 STA $FB 48020 LDA #>POSSURE 48030 STA $FC 48040 JSR PSTRING 48050 SURELOP JSR GETAUTO 48060 CMP #$19 48070 BEQ POSSCALE 48080 CMP #$0E 48090 BEQ NOSCALE 48100 JMP SURELOP 48110 NOSCALE JMP COMEBACK 48120 SCALEPOS LDA #$80 48130 STA $FB 48140 LDA #$04 48150 STA $FC 48160 LDA #$01 48170 JSR SCALEVAR 48180 LDA #$A8 48190 STA $FB 48193 LDA #$04 48196 STA $FC 48200 LDA #$1E 48210 JSR SCALEVAR 48220 LDA #$D0 48230 STA $FB 48233 LDA #$04 48236 STA $FC 48240 LDA #$03 48250 JSR SCALEVAR 48260 LDA #$F8 48270 STA $FB 48273 LDA #$04 48276 STA $FC 48280 LDA #$1F 48290 JSR SCALEVAR 48300 JSR HIRESON 48310 JMP CALCSTEP 48500 SCALEVAR STA $23 48505 ASL A 48510 ASL A 48520 ASL A 48530 STA $FD 48540 LDA #$40 48550 STA $FE 48560 LDA #$00 48570 TAX 48580 TAY 48590 STA ($FD),Y 48600 INY 48610 TYA 48620 PHA 48630 TXA 48640 TAY 48650 LDA ($FB),Y 48660 STA $22 48670 TYA 48680 TAX 48690 PLA 48700 TAY 48710 LDA $22 48720 SEC 48730 SBC #$30 48740 STA ($FD),Y 48750 INY 48760 INX 48770 INX 48780 SCALEVLOP TYA 48790 PHA 48800 TXA 48810 TAY 48820 LDA ($FB),Y 48830 SEC 48840 SBC #$30 48850 ASL A 48860 ASL A 48870 ASL A 48880 ASL A 48890 INY 48900 CLC 48910 ADC ($FB),Y 48920 SEC 48930 SBC #$30 48940 INY 48950 STA $22 48960 TYA 48970 TAX 48980 PLA 48990 TAY 49000 LDA $22 49010 STA ($FD),Y 49020 INY 49030 CPY #$08 49040 BNE SCALEVLOP 49050 DEC $FB 49060 LDY #$00 49070 LDA ($FB),Y 49080 CMP #$2D 49090 BEQ MAKENEG 49100 RTS 49110 MAKENEG LDA $23 49120 STA $4101 49130 STA $4102 49140 LDA #$1D 49150 STA $4100 49160 JMP SUBTRACT 49500 GETMEMAD TYA 49520 ASL A 49530 ASL A 49540 ASL A 49550 STA $22 49560 ASL A 49570 ASL A 49580 CLC 49590 ADC $22 49600 STX $22 49610 ADC $22 49620 CMP #$C8 49630 BCC GMMQUIT 49640 CLC 49650 ADC #$28 49660 GMMQUIT RTS 49700 POSONOFF JSR GETMEMAD 49710 STA $22 49720 TXA 49730 PHA 49740 LDX $22 49750 LDA $047F,X 49760 EOR #$80 49770 STA $047F,X 49780 PLA 49790 TAX 49800 RTS 50000 ; GRAPHIC POINT PLOTTER 50010 PLOTPC LDA #$47 50020 STA $FB 50030 LDA #$3F 50040 STA $FC 50050 LDA YPIXEL 50060 LSR A 50070 LSR A 50080 LSR A 50090 STA YPIB 50100 AND #$03 50110 ASL A 50120 ASL A 50130 ASL A 50140 ASL A 50150 ASL A 50160 ASL A 50170 STA $02 50180 LDA $FB 50190 SEC 50200 SBC $02 50210 STA $FB 50220 LDA $FC 50230 SBC #$00 50235 SBC YPIB 50240 PHA 50250 LDA YPIB 50260 LSR A 50270 LSR A 50280 STA $02 50290 PLA 50300 SEC 50310 SBC $02 50320 STA $FC 50330 LDA YPIXEL 50340 AND #$07 50350 STA YPIB 50360 LDA $FB 50370 SEC 50380 SBC YPIB 50390 PHA 50400 LDA XPIXEL 50410 AND #$F8 50420 STA YPIB 50430 PLA 50440 CLC 50450 ADC YPIB 50460 STA $FB 50470 LDA $FC 50480 SBC #$00 50490 STA $FC 50500 LDA XPIXEL 50510 AND #$07 50520 TAX 50530 LDA #$80 50540 GBITLP CPX #$00 50550 BEQ PPCONT 50560 LSR A 50570 DEX 50580 JMP GBITLP 50590 PPCONT STA $FD 50600 RTS 50610 PLOTON JSR PLOTPC 50620 LDY #$00 50630 LDA ($FB),Y 50640 ORA $FD 50650 STA ($FB),Y 50660 RTS 50670 PLOTOFF JSR PLOTPC 50680 LDA $FD 50690 EOR #$FF 50700 STA $FD 50710 LDY #$00 50720 LDA ($FB),Y 50730 AND $FD 50740 STA ($FB),Y 50750 RTS 50760 PLOT LDA COLOUR 50770 AND #$02 50780 BNE PPAON 50790 JSR PLOTOFF 50800 JMP PPACNT 50810 PPAON JSR PLOTON 50820 PPACNT INC XPIXEL 50830 LDA COLOUR 50840 AND #$01 50850 BNE PPBON 50860 JSR PLOTOFF 50870 JMP PPBCNT 50880 PPBON JSR PLOTON 50890 PPBCNT INC XPIXEL 50900 RTS 55000 ; ZOOM CALCULATION ROUTINES 55010 NOZOOM JMP CONTROLOP 55020 ZOOMIN LDA $D015 55030 AND #$F0 55040 CMP #$F0 55050 BNE NOZOOM 55060 LDA #$1E 55070 STA $4100 55080 LDA #$01 55090 STA $4101 55100 LDA #$10 55110 STA $4102 55120 JSR SUBTRACT 55130 LDA #$01 55140 STA $4100 55150 INC $4102 55160 JSR EQUAL 55170 LDA #$10 55180 STA $4100 55190 LDA #$1B 55200 STA $4101 55210 LDA #$12 55220 STA $4102 55230 JSR MULTIPLY 55240 LDA #$11 55250 STA $4100 55260 STA $4102 55270 LDA #$12 55280 STA $4101 55290 LDA $D008 55300 SEC 55310 SBC #$58 55320 CALCINLOPA CMP #$00 55330 BEQ CALCENDIA 55340 PHA 55350 JSR ADDITION 55360 PLA 55370 TAX 55380 DEX 55390 TXA 55400 JMP CALCINLOPA 55410 CALCENDIA LDA #$01 55420 STA $4100 55430 LDA #$13 55440 STA $4102 55450 JSR EQUAL 55460 LDA #$13 55470 STA $4100 55480 STA $4102 55490 LDA #$12 55500 STA $4101 55510 LDA $D00A 55520 SEC 55530 SBC #$40 55540 CALCINLOPB CMP #$00 55550 BEQ CALCENDIB 55560 PHA 55570 JSR ADDITION 55580 PLA 55590 TAX 55600 DEX 55610 TXA 55620 JMP CALCINLOPB 55630 CALCENDIB LDA #$11 55640 STA $4100 55650 LDA #$01 55660 STA $4102 55670 JSR EQUAL 55680 LDA #$13 55690 STA $4100 55700 LDA #$1E 55710 STA $4102 55720 JSR EQUAL 55730 LDA #$1F 55740 STA $4100 55750 LDA #$03 55760 STA $4101 55770 LDA #$10 55780 STA $4102 55790 JSR SUBTRACT 55800 LDA #$03 55810 STA $4100 55820 INC $4102 55830 JSR EQUAL 55840 LDA #$10 55850 STA $4100 55860 LDA #$12 55870 STA $4102 55880 LDA #$1A 55890 STA $4101 55900 JSR MULTIPLY 55910 LDA #$11 55920 STA $4100 55930 STA $4102 55940 LDA #$12 55950 STA $4101 55960 LDA #$E5 55970 SEC 55980 SBC $D00D 55990 CALCINYA CMP #$00 56000 BEQ CALCENDIC 56010 PHA 56020 JSR ADDITION 56030 PLA 56040 TAX 56050 DEX 56060 TXA 56070 JMP CALCINYA 56080 CALCENDIC LDA #$03 56090 STA $4100 56100 LDA #$13 56110 STA $4102 56120 JSR EQUAL 56130 LDA #$13 56140 STA $4100 56150 STA $4102 56160 LDA #$12 56170 STA $4101 56180 LDA #$FA 56190 SEC 56200 SBC $D009 56210 CALCINYB CMP #$00 56220 BEQ CALCENDID 56230 PHA 56240 JSR ADDITION 56250 PLA 56260 TAX 56270 DEX 56280 TXA 56290 JMP CALCINYB 56300 CALCENDID LDA #$11 56310 STA $4100 56320 LDA #$03 56330 STA $4102 56340 JSR EQUAL 56350 LDA #$13 56360 STA $4100 56370 LDA #$1F 56380 STA $4102 56390 JSR EQUAL 56400 CALCSTEP LDA #$1E 56410 STA $4100 56420 LDA #$01 56430 STA $4101 56440 LDA #$10 56450 STA $4102 56460 JSR SUBTRACT 56470 LDA #$10 56480 STA $4100 56490 LDA #$17 56500 STA $4101 56510 LDA #$02 56520 STA $4102 56530 JSR MULTIPLY 56540 LDA #$1F 56550 STA $4100 56560 LDA #$03 56570 STA $4101 56580 LDA #$10 56590 STA $4102 56600 JSR SUBTRACT 56610 LDA #$10 56620 STA $4100 56630 LDA #$1A 56640 STA $4101 56650 LDA #$04 56660 STA $4102 56670 JSR MULTIPLY 56680 JSR MANDLE 56690 JMP CONTROLOP 60000 ; ZOOM ROUTINES 60010 BOX LDA XP 60020 STA XPIB 60030 LDA YP 60040 STA YPIB 60050 LDA XPB 60060 STA XPBIB 60070 LDX #$3C 60080 STX $07FC 60090 INX 60100 STX $07FD 60110 INX 60120 STX $07FE 60130 INX 60140 STX $07FF 60150 LDA $D015 60160 ORA #$F0 60170 STA $D015 60180 BOXWAIT LDA CLICK 60190 BNE BOXWAIT 60280 BOXLOOP LDA XPBIB 60290 CMP XPB 60300 BEQ CHECKFINE 60310 BCS LESSTHAN 60320 JMP MORETHAN 60330 CHECKFINE LDA XPIB 60340 CMP XP 60350 BCS LESSTHAN 60360 MORETHAN LDA XPIB 60370 STA $D008 60380 STA $D00C 60390 LDX #$00 60400 LDA XPBIB 60410 BEQ NOXPBADD 60420 LDX #$50 60430 NOXPBADD LDA $D010 60440 AND #$AF 60450 STX $02 60460 CLC 60470 ADC $02 60480 STA $D010 60485 LDX #$00 60490 LDA XP 60500 SEC 60510 SBC #$18 60520 STA $D00A 60530 STA $D00E 60540 BCC MTSUB 60550 LDX XPB 60560 BEQ MTSUB 60570 LDX #$A0 60580 MTSUB LDA $D010 60590 AND #$5F 60600 STX $02 60610 CLC 60620 ADC $02 60630 STA $D010 60640 JMP BOXCONT 60650 LESSTHAN LDA XP 60660 LDX XPB 60670 BNE NOTOUT 60680 CMP #$58 60690 BCS NOTOUT 60700 LDA #$58 60710 NOTOUT STA $D008 60720 STA $D00C 60730 CPX #$00 60740 BEQ LTNOADD 60750 LDX #$50 60760 LTNOADD LDA $D010 60770 AND #$AF 60780 STX $02 60790 CLC 60800 ADC $02 60810 STA $D010 60815 LDX #$00 60820 LDA XPIB 60830 SEC 60840 SBC #$18 60850 STA $D00A 60860 STA $D00E 60870 BCC LTSUB 60880 LDX XPBIB 60890 BEQ LTSUB 60900 LDX #$A0 60910 LTSUB LDA $D010 60920 AND #$5F 60930 STX $02 60940 CLC 60950 ADC $02 60960 STA $D010 60970 BOXCONT LDA YP 60980 CMP YPIB 60990 BCC LESSY 61000 LDA YPIB 61010 STA $D009 61020 STA $D00B 61030 LDA YP 61040 SEC 61050 SBC #$15 61060 STA $D00D 61070 STA $D00F 61080 JMP BOXCONTII 61090 LESSY LDA YP 61100 STA $D009 61110 STA $D00B 61120 LDA YPIB 61130 SEC 61140 SBC #$15 61150 STA $D00D 61160 STA $D00F 61170 BOXCONTII LDA CLICK 61180 BNE BOXEND 61190 JMP BOXLOOP 61200 BOXEND JMP CONTROLOP 62000 BOXFLASH LDA $A2 62010 AND #$3C 62020 LSR A 62030 LSR A 62040 TAX 62050 LDA BOXCOLS,X 62060 STA $D02B 62070 STA $D02C 62080 STA $D02D 62090 STA $D02E 62100 JMP $EA31 62110 BOXCOLS TXT 0,9,2,8,10,7,13,1 62120 TXT 1,13,3,5,14,4,6,0 63000 ; DELETE THESE!! 63010 COLS JMP CONTROLOP 63060 ZOOMOUT JMP CONTROLOP
;MANDELPLOT " ;SOURCE CODE 0 ;22/10/95 6( ; Bd ��$0E00 ji ; VARIABLES {n XPIXEL�$4103 �x YPIXEL�$4104 �� COLOUR�$4105 �� YPIB�$4106 �� MAXCOL�$4107 �� XP�$4108 �� YP�$4109 �� XPB�$410A �� CLICK�$410B � HOUR�$410C � XPIB�$410D # � XPBIB�$410E 2 � COL0�$410F A � COL1�$4110 P � COL2�$4111 _ � COL3�$4112 o � COL0S�$4113 � COL1S�$4114 � � COL2S�$4115 � � COL3S�$4116 � � �TIME�$4117 � � SPEED�$4118 � � NEGREG�$4119 � ; ROM ROUTINES "OUTDO �$AB47 #�LFS�$FFBA ' $�NAM�$FFBD 6 %�ROM�$FFD8 I &PLOTRROM�$E56C q ,; SPRITE DATA w 1; � 6TXT 224,000,000,176,000,000,152,000 � @TXT 000,140,000,000,134,000,000,131 � JTXT 000,000,129,128,000,128,192,000 TTXT 128,064,000,147,192,000,185,000 ?^TXT 000,233,000,000,009,128,000,012 ghTXT 128,000,004,128,000,004,128,000 �rTXT 007,128,000,000,000,000,000,000 �|TXT 000,000,000,000,000,000,000,153 ��; ��TXT 000,000,000,064,000,000,096,000 �TXT 000,112,000,000,120,000,000,124 5�TXT 000,000,126,000,000,127,000,000 ]�TXT 127,128,000,108,000,000,070,000 ��TXT 000,006,000,000,006,000,000,003 ��TXT 000,000,003,000,000,003,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,153 �; + �TXT 255,192,000,129,064,000,128,064 S �TXT 000,129,064,000,066,128,000,064 { �TXT 128,000,051,000,000,012,000,000 � �TXT 055,000,000,065,128,000,066,128 � �TXT 000,129,064,000,130,192,000,133 � TXT 064,000,255,192,000,000,000,000 TXT 000,000,000,000,000,000,000,000 CTXT 000,000,000,000,000,000,000,197 I!; q&TXT 255,192,000,255,192,000,255,192 �0TXT 000,255,192,000,127,128,000,127 �:TXT 128,000,063,000,000,012,000,000 �DTXT 063,000,000,127,128,000,127,128 NTXT 000,255,192,000,255,192,000,255 9XTXT 192,000,255,192,000,000,000,000 abTXT 000,000,000,000,000,000,000,000 �lTXT 000,000,000,000,000,000,000,197 �q; �vTXT 168,000,000,000,000,000,128,000 ��TXT 000,000,000,000,128,000,000,000 �TXT 000,000,000,000,000,000,000,000 /�TXT 000,000,000,000,000,000,000,000 W�TXT 000,000,000,000,000,000,000,000 �TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,197 ��; ��TXT 000,000,021,000,000,000,000,000 %�TXT 001,000,000,000,000,000,001,000 M�TXT 000,000,000,000,000,000,000,000 u�TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 ��TXT 000,000,000,000,000,000,000,000 �TXT 000,000,000,000,000,000,000,000 TXT 000,000,000,000,000,000,000,000 ; CTXT 000,000,000,000,000,000,000,000 k TXT 000,000,000,000,000,000,000,000 �*TXT 000,000,000,000,000,000,000,000 �4TXT 000,000,000,000,000,000,000,000 �>TXT 000,000,000,000,000,000,000,000 HTXT 000,000,000,000,000,000,000,000 3RTXT 128,000,000,000,000,000,128,000 [\TXT 000,000,000,000,168,000,000,000 aa; �fTXT 000,000,000,000,000,000,000,000 �pTXT 000,000,000,000,000,000,000,000 �zTXT 000,000,000,000,000,000,000,000 �TXT 000,000,000,000,000,000,000,000 )�TXT 000,000,000,000,000,000,000,000 Q�TXT 000,000,000,000,000,000,000,000 y�TXT 000,000,001,000,000,000,000,000 ��TXT 001,000,000,000,000,000,021,000 ��; �'; MAIN �ROL ROUTINES �'JSR INIT �$'COMEBACK JSR HIRES� .'�ROLOP LDA CLICK 8'BNE �ROLOP 'B'�LOPB LDA CLICK 5L'BEQ �LOPB @V'LDA XP M`'CMP #$58 Xj'BCC �� dt'JMP BOX r~'�� LDA YP �'CMP #$5A ��'BCC �ROLOP ��'SEC ��'SBC #$5A ��'LSR A ��'LSR A ��'� #$FE ��'TAX ��'LDA VEC�RS,X ��'STA $FB ��'INX �'LDA VEC�RS,X �'STA $FC �'JMP ($00FB) ] (VEC�RS TXT �ZOOMOUT,�ZOOMOUT,��ROLOP,��ROLOP,�ZOOMIN,�ZOOMIN � (TXT ��ROLOP,��ROLOP,��ITI�,��ITI�,��ROLOP,��ROLOP �(TXT ��ROLOP,��ROLOP,�COLS,�COLS,��ROLOP,��ROLOP (TXT �COLCYCLE,�COLCYCLE,��ROLOP,��ROLOP,�M�PLOT,�M�PLOT 7((TXT ��ROLOP,��ROLOP,��ROLOP,��ROLOP,�EXIT,�EXIT k2(TXT ��ROLOP,��ROLOP,��,��,��ROLOP,��ROLOP,��,�� �<(TXT ��ROLOP,��ROLOP,��ROLOP,��ROLOP,��ROLOP,��ROLOP �)EXIT JSR HIRESOFF �)LDA #$93 �)JSR OUTDO �")LDA #$05 �,)JSR OUTDO �6)LDA #$00 @)STA $C6 J)RTS 6�.; WIMP ROUTINES I�.; WIMP - MOUSE Z�.IRQ LDA #$00 h/STA CLICK t/LDA $C5 �/CMP #$01 �&/BNE C�CHECK �0/STA CLICK �:/C�CHECK CMP #$0C �D/BEQ LEFTK �N/LKC CMP #$17 �X/BEQ RIGHTK �b/RKC CMP #$32 �l/BEQ UPK v/UPKC CMP #$37 �/BEQ DOWNK 1�/DKC LDA $DC00 <�/� #$01 H�/BEQ UPJ Z�/UJC LDA $DC00 e�/� #$02 s�/BEQ DOWNJ ��/DJC LDA $DC00 ��/� #$04 ��/BEQ LEFTJ ��/LJC LDA $DC00 ��/� #$08 �0BEQ RIGHTJ �0RJC LDA $DC00 �0� #$10 � 0E� #$10 *0BEQ CJCH 40STA CLICK $>0CJCH JMP BOXFLASH 7H0LEFTK JSR LEFT CR0JMP LKC X\0RIGHTK JSR RIGHT df0JMP RKC sp0UPK JSR UP �z0JMP UPKC ��0DOWNK JSR DOWN ��0JMP DKC ��0UPJ JSR UP ��0JMP UJC ��0DOWNJ JSR DOWN ��0JMP DJC ��0LEFTJ JSR LEFT ��0JMP LJC �0RIGHTJ JSR RIGHT �0JMP RJC )�0LEFT DEC XP 4�0LDA XP A�0CMP #$FF M1BNE �FF Z1LDY #$00 f1STY XPB v$1�FF LDY XPB �.1BNE FIN �81CMP #$18 �B1BNE FIN �L1INC XP �V1FIN JMP �ROL �`1RIGHT INC XP �j1LDA XP �t1BNE �00 �~1LDY #$01 ��1STY XPB �1�00 LDY XPB �1BEQ FIN !�1CMP #$58 -�1BNE FIN 8�1DEC XP E�1JMP �ROL S�1UP DEC YP ^�1LDA YP k�1CMP #$32 w�1BNE FIN ��1INC YP � 2JMP �ROL � 2DOWN INC YP �2LDA YP �2CMP #$F8 �(2BNE FIN �22DEC YP �<2JMP �ROL �F2; WIMP � PO�ER P2�ROL LDA HOUR Z2BEQ NHGLASS �3LDX #$3A +�3STX $07F8 3�3INX A�3STX $07F9 T�3NHGLASS LDA XP b�3STA $D000 p�3STA $D002 {�3LDA YP ��3STA $D001 ��3STA $D003 ��3LDA $D010 �4� #$FC �4LSR A �4CLC �&4ADC XPB �04ASL A �:4CLC �D4ADC XPB �N4STA $D010 X4LDA #$00 b4STA $D027 "l4LDA #$01 0v4STA $D028 >�4LDA $D015 J�4�A #$03 X�4STA $D015 e�4LDA HOUR r�4BNE QTRO �4LDX #$38 ��4STX $07F8 ��4INX ��4STX $07F9 ��4QTRO RTS ��4; STARTUP ROUTINES ��4INIT LDA #$00 ��4STA $D020 �5STA $D021 5STA XP 5STA HOUR 5STA $D015 (*5LDA #$01 445STA XPB A>5LDA #$80 LH5STA YP `R5HIRES� LDA #$3B n\5STA $D011 {f5LDA #$D8 �p5STA $D016 �z5LDA COL0S ��5STA COL0 ��5LDA COL1S ��5STA COL1 ��5LDA COL2S ��5STA COL2 ��5LDA COL3S ��5STA COL3 �5JSR �COLS 6JSR LEFT 6SEI & 6LDA #�IRQ 4 $6STA $0314 B .6LDA #�IRQ P 86STA $0315 X B6CLI e �6LDA #$18 s �6STA $D018 { 4:RTS � R:HIRESOFF SEI � \:LDA #$31 � f:STA $0314 � p:LDA #$EA � z:STA $0315 � �:CLI � �:LDA #$00 � �:STA $D015 � �:LDA #$9B !�:STA $D011 !�:LDA #$C8 !�:STA $D016 (!�:LDA #$15 6!�:STA $D018 >!�:RTS Q! N� JSR HIRESOFF ^!*NLDA #$1C l!4NJSR OUTDO y!>NLDA #$93 �!HNJSR OUTDO �!RNLDA #$00 �!\N�LOOP PHA �!fNASL A �!pNASL A �!zNCLC �!�NADC #$42 �!�NSTA $FC �!�NLDY #$00 �!�NSTY $FB �!�NSTY $FD "�NLDA #$04 "�NSTA $FE ,"�N�LOOPB LDA ($FB),Y <"�NSTA ($FD),Y D"�NINY S"�NBNE �LOOPB _"�NINC $FC k"�NINC $FE w"OLDA $FE �"OCMP #$08 �"OBNE �LOOPB �"$O�� LDA $C5 �".OCMP #$40 �"8OBNE �� �"BO��B LDA $C5 �"LOCMP #$40 �"VOBEQ ��B �"`OTAX �"jOPLA #tOCPX #$01 #~OBEQ HNOM�E #�OCPX #$28 &#�OBEQ � 3#�OCPX #$2B @#�OBEQ PREV M#�O�RET PHA Y#�OJMP ��B q#�OHNOM�E JMP COMEBACK �#�O� CMP #$04 �#�OBEQ �RET �#�OCLC �#�OADC #$01 �#�OJMP �LOOP �# PPREV CMP #$00 �# PBEQ �RET �#PSEC �#PSBC #$01 �#(PJMP �LOOP $�a; SAVE ROUTINES +$�a�AME TXT 147,5 A$�aTXT "FILENAME:",0 h$�a�RD TXT 13,13,"(T)APE OR (D)ISK",0 �$�a�T TXT 13,13,"POSITION TAPE <SPACE>",13,0 �$�aINSD TXT 13,13,"INSERT DISK <SPACE>",13,0 �$�aPSTRING LDY #$00 �$�aPSTRLOP LDA ($FB),Y %�aBEQ PSTRQUIT %bJSR OUTDO %bINY (%bJMP PSTRLOP 9%bPSTRQUIT RTS N% b�OFF LDA $040A,Y Z%*bE� #$80 j%4bSTA $040A,Y r%>bRTS �%Hb�� LDA $C5 �%RbCMP #$40 �%\bBNE �� �%fb��B LDA $C5 �%pbCMP #$40 �%zbBEQ ��B �%�bTAX �%�bLDA ��,X �%�bBEQ �� �%�bRTS �%�b� JSR HIRESOFF &�bLDX #$00 &�bLDA #$20 -&�b�AME� STA $41F0,X 5&�bINX B&�bCPX #$10 P&�bBNE �AME� _&�bLDA #��AME k&�bSTA $FB z&cLDA #��AME �&cSTA $FC �&cJSR PSTRING �&$cLDA #$00 �&.cPHA �&8c�LOOP TAY �&=cJSR �OFF �&BcJSR �� �&GcPHA �&LcJSR �OFF �&QcPLA �&VcCMP #$80 '`cBCS DECODE 'jcTAY 'tcPLA "'~cTAX *'�cTYA :'�cSTA $040A,X G'�cCMP #$20 U'�cBCS NOSPC ]'�cCLC j'�cADC #$40 �'�cNOSPC STA $41F0,X �'�cINC� CPX #$0F �'�cBEQ �RELOP �'�cINX �'�c�RELOP TXA �'�cPHA �'�cJMP �LOOP �'