C64 Software  <  SCA: The C64 Software Collection / H #5.4

  Run
1000              ; *******************
1010              ; HIRES CBM 8032 V5.4
1020              ; *******************
1030              ;
1040              ORG 24576
1050              ;
1060 X1           EQU 17
1070 Y1           EQU 18
1080 X2           EQU 88
1090 Y2           EQU 89
1100 T1           EQU 90
1110 T2           EQU 91
1120 T3           EQU 92
1130 T4           EQU 93
1140 T5           EQU 94
1150 T6           EQU 95
1160 T7           EQU 96
1170 T8           EQU 97
1180              ;
1190 TMP1         EQU 199
1200 TMP2         EQU 201
1210 PAR1         EQU 826
1220 PAR2         EQU 827
1230 PAR3         EQU 828
1240 PAR4         EQU 829
1250 PAR5         EQU 830
1260 PAR6         EQU 831
1270 TMPH1        EQU 832
1280 TMPH2        EQU 833
1290 WIPTR1       EQU 834
1300 WIPTR2       EQU 835
1310 WIPTR3       EQU 836
1320 WIPTR4       EQU 837
1330 CODE         EQU 0
1340              ;
1350 CRT          EQU 59520
1360              ;
1370 CHRGET       EQU 112
1380 OUTCHR       EQU 65490
1390 GETPAR       EQU 51412
1400 CKOM         EQU 48885
1410 CKCHAR       EQU 48887
1420 ERRPRINT     EQU 46031
1430              ;
1440              ;
1450              ;
1460              ;
1470 INIT         LDX 120
1480              CPX #2
1490              BNE INIT1
1500              JSR WRITETEXT
1510              DFB "",13,13
1520              DFB "",13,13
1530              DFB "",13,0
1540 INIT1        LDA #<INIT
1550              STA 52
1560              LDA #>INIT
1570              STA 53
1580              LDA #76 ; JMP
1590              STA 121
1600              LDA #<DEKODE
1610              STA 122
1620              LDA #>DEKODE
1630              STA 123
1640              RTS
1650              ;
1660              ;
1670 DEKODE       CMP #64 ; '@'
1680              BEQ DEKODE2
1690              CMP #58
1700              BCS DEKODE1
1710              JMP 125
1720 DEKODE1      RTS
1730 DEKODE2      LDX 120
1740              CPX #2
1750              BEQ DEKODE1 ; DIREKTMODUS
1760              LDX #0
1770              STX TMP1
1780 DEKODE3      LDY #1
1790 DEKODE4      LDA COMTAB,X
1800              BEQ DEKODE8
1810              PHP
1820              AND #127
1830              CMP (119),Y
1840              BNE DEKODE6
1850              INX
1860              INY
1870              PLP
1880              BPL DEKODE4
1890 DEKODE5      JSR CHRGET
1900              DEY
1910              BNE DEKODE5
1920              LDX TMP1
1930              LDA SPRUNGTAB,X
1940              STA TMP1
1950              LDA SPRUNGTAB+1,X
1960              STA TMP1+1
1970              JMP (TMP1)
1980              ;
1990 DEKODE6      PLP
2000 DEKODE7      INX
2010              LDA COMTAB,X
2020              BPL DEKODE7
2030              INC TMP1
2040              INC TMP1
2050              INX
2060              BNE DEKODE3
2070 DEKODE8      JMP SNERR
2080              ;
2090 COMTAB       DFB "",0
2100              ;
2110 SPRUNGTAB    DFB <EXIT,>EXIT
2120              DFB <HIRES,>HIRES
2130              DFB <OFF,>OFF
2140              DFB <TRANSFER,>TRANSFER
2150              DFB <CLEAR,>CLEAR
2160              DFB <WINDOW,>WINDOW
2170              DFB <PLOT,>PLOT
2180              DFB <TEXT,>TEXT
2190              DFB <LINE,>LINE
2200              ;
2210              ;
2220              ;
2230 EXIT         LDA #201
2240              STA 121
2250              LDA #58
2260              STA 122
2270              LDA #176
2280              STA 123
2290              RTS
2300              ;
2310              ;
2320 HIRES        LDA 59468
2330              STA TMPH1
2340              LDA #142
2350              JSR OUTCHR
2360              LDX #12
2370              LDA #48
2380              STX CRT
2390              STA CRT+1
2400              RTS
2410              ;
2420              ;
2430 OFF          LDA TMPH1
2440              AND #2
2450              BEQ OFF1
2460              LDA #14
2470              DFB $2C
2480 OFF1         LDA #142
2490              JMP OUTCHR
2500              ;
2510              ;
2520 TRANSFER     JSR GETPAR1
2530              JSR CKTO
2540              JSR GETPAR
2550              STX PAR2
2560              LDX PAR1
2570              BEQ TRANSFER1
2580              CPX #5
2590              BCS TRANSFER1
2600              LDY PAR2
2610              BEQ TRANSFER1
2620              CPY #5
2630              BCS TRANSFER1
2640              LDA #0
2650              STA TMP1
2660              STA TMP2
2670              LDA SCREENMSB-1,X
2680              STA TMP1+1
2690              LDA SCREENMSB-1,Y
2700              STA TMP2+1
2710              LDX #8
2720              LDY #0
2730 TR1          LDA (TMP1),Y
2740              STA (TMP2),Y
2750              INY
2760              BNE TR1
2770              INC TMP1+1
2780              INC TMP2+1
2790              DEX
2800              BNE TR1
2810              TYA
2820              RTS
2830 TRANSFER1    JMP IQERR
2840              ;
2850              ;
2860 CLEAR        JSR GETPAR2
2870              LDX PAR1
2880              BEQ TRANSFER1
2890              CPX #5
2900              BCS TRANSFER1
2910              LDY #0
2920              STY TMP1
2930              LDA SCREENMSB-1,X
2940              STA TMP1+1
2950              LDX #8
2960              LDA PAR2
2970              BPL CLEAR1
2980              EOR #127
2990 CLEAR1       STA (TMP1),Y
3000              INY
3010              BNE CLEAR1
3020              INC TMP1+1
3030              DEX
3040              BNE CLEAR1
3050              TYA
3060              RTS
3070              ;
3080              ;
3090 WINDOW       JSR GETPAR3
3100              LDA PAR1
3110              BEQ WI3
3120              CMP #25
3130              BCC WI1
3140 WIERR        JMP IQERR
3150 WI1          LDX PAR2
3160              BEQ WIERR
3170              CPX #5
3180              BCS WIERR
3190              DEX
3200              LDY WITAB1,X
3210              STY WIPTR1
3220              LDX PAR3
3230              BEQ WIERR
3240              CPX #5
3250              BCS WIERR
3260              DEX
3270              LDY WITAB1,X
3280              STY WIPTR2
3290              CLC
3300              ASL
3310              TAX
3320              LDA WITAB2,X
3330              STA WIPTR3
3340              LDA WITAB2+1,X
3350              STA WIPTR4
3360              SEI
3370              LDA #<WIIRQ
3380              STA 144
3390              LDA #>WIIRQ
3400              STA 145
3410              CLI
3420              RTS
3430              ;
3440 WI3          SEI
3450              LDA #<58453
3460              STA 144
3470              LDA #>58453
3480              STA 145
3490              CLI
3500              RTS
3510              ;
3520              ;
3530 WITAB1       DFB 12,14,12,14
3540 WITAB2       DFB 1,1,5,79,1,1,1,1,1,1,6,147
3550              DFB 1,1,1,1,1,1,1,1,1,1
3560              DFB 1,1,1,1,1,1,1,1,1,1
3570              DFB 1,1,1,1,1,1,1,1,11,58
3580              DFB 1,1,11,218,12,42,12,121
3590 WIIRQ        LDA WIPTR1
3600              STA 59468
3610              LDX WIPTR3
3620 WIIRQ1       LDY WIPTR4
3630 WIIRQ2       DEY
3640              BNE WIIRQ2
3650              DEX
3660              BNE WIIRQ2
3670              LDA WIPTR2
3680              STA 59468
3690              JMP 58453
3700              ;
3710              ;
3720 PLOT         JSR GETPAR4
3730              JSR CHECKPAR
3740              LDA PAR1
3750              STA X1
3760              LDA PAR2
3770              STA Y1
3780 PLOTDIRECT   JSR GETADR
3790              JSR GETDOT
3800              STA TMPH2
3810              LDY #0
3820              LDA (TMP1),Y
3830              BPL PLOT2
3840              EOR #127
3850 PLOT2        LDX PAR4
3860              BNE PLOT3
3870              PHA        ; LOESCHEN
3880              LDA TMPH2
3890              EOR #255
3900              STA TMPH2
3910              PLA
3920              AND TMPH2
3930              JMP PLOT5
3940              ;
3950 PLOT3        CPX #1
3960              BNE PLOT4
3970              ORA TMPH2  ; SETZEN
3980              JMP PLOT5
3990              ;
4000 PLOT4        EOR TMPH2  ; INVERTIEREN
4010 PLOT5        BPL PLOT6
4020              EOR #127
4030 PLOT6        STA (TMP1),Y
4040              TYA
4050              RTS
4060              ;
4070              ;
4080 LINE         JSR GETPAR6
4090              JSR CHECKPAR
4100              LDA PAR1
4110              STA X1
4120              LDA PAR2
4130              STA Y1
4140              LDA PAR5
4150              STA X2
4160              LDA PAR6
4170              STA Y2
4180              ;
4190 LINEDIRECT   LDY #1
4200              STY T8
4210              STY T5
4220              STY T3
4230              DEY
4240              STY T4
4250              STY T7
4260              STY T6
4270              DEY
4280              LDA X2
4290              CMP X1
4300              BCS D2
4310 D1           SEC
4320              LDA X1
4330              SBC X2
4340              STA T2
4350              STY T8
4360              JMP L1
4370 D2           SEC
4380              LDA X2
4390              SBC X1
4400              STA T2
4410 L1           LDA Y2
4420              CMP Y1
4430              BCS D3
4440              SEC
4450              LDA Y1
4460              SBC Y2
4470              STA T1
4480              STY T5
4490              JMP L2
4500 D3           SBC Y1
4510              STA T1
4520 L2           LDA T2
4530              CMP T1
4540              BCS D4
4550              LDX T1
4560              STA T1
4570              STX T2
4580              LDA T8
4590              STA T6
4600              LDA T5
4610              STA T7
4620              INY
4630              STY T8
4640              STY T5
4650 D4           LDA T2
4660              ROR
4670              STA X2
4680              JMP D11
4690 L3           LDA T8
4700              BMI D5
4710              CLC
4720              ADC X1
4730              STA X1
4740              BCC D6
4750              BRK
4760 D5           CLC
4770              ADC X1
4780              STA X1
4790              BCS D6
4800              BRK
4810 D6           CLC
4820              LDA Y1
4830              ADC T7
4840              STA Y1
4850              CLC
4860              LDA X2
4870              ADC T1
4880              STA X2
4890              INC T3
4900              BNE D7
4910              INC T4
4920 D7           LDA T2
4930              CMP X2
4940              BCS D11
4950 D8           SEC
4960              LDA X2
4970              SBC T2
4980              STA X2
4990              LDA T6
5000              BMI D9
5010              CLC
5020              ADC X1
5030              STA X1
5040              BCC D10
5050              BRK
5060 D9           CLC
5070              ADC X1
5080              STA X1
5090              BCS D10
5100              BRK
5110 D10          CLC
5120              LDA Y1
5130              ADC T5
5140              STA Y1
5150 D11          JSR PLOTDIRECT
5160              LDA T2
5170              CMP T3
5180              BCS D12
5190              RTS
5200 D12          JMP L3
5210              ;
5220              ;
5230              ;
10000 TEXT         ;JSR GETPAR2
10010              ;JSR CKOM
10020 TEXT1        ;JSR CHRGET
10030              ;CMP #32
10040              ;BEQ TEXT1
10050              ;LDY #0
10060              ;CMP #34
10070              ;BEQ TEXT2
10080              ;JMP SNERR
10090 TEXT2        ;LDA (119),Y
10100              ;CMP #34
10110              ;BEQ TEXT3
10120              ;STA BUFFER,Y
10130              ;INY
10140              ;CPY #80
10150              ;BCC TEXT2
10160              ;JMP STRINGTOOLONG
10170 TEXT3 ...    BRK
10180              ;
10190              ;
10200              ;
10210 WRITETEXT    LDY #0
10220              PLA
10230              STA TMP1
10240              PLA
10250              STA TMP1+1
10260 WRITETEXT1   INC TMP1
10270              BNE WRITETEXT2
10280              INC TMP1+1
10290 WRITETEXT2   LDA (TMP1),Y
10300              BEQ WRITETEXT3
10310              EOR #CODE
10320              JSR OUTCHR
10330              JMP WRITETEXT1
10340 WRITETEXT3   LDA TMP1+1
10350              PHA
10360              LDA TMP1
10370              PHA
10380              RTS
10390              ;
10400              ;
10410 GETPAR1      JSR GETPAR
10420              STX PAR1
10430              LDA #0
10440              STA PAR5
10450              STA PAR6
10460              RTS
10470              ;
10480 GETPAR2      JSR GETPAR1
10490              JSR CKOM
10500              JSR GETPAR
10510              STX PAR2
10520              RTS
10530              ;
10540 GETPAR3      JSR GETPAR2
10550              JSR CKOM
10560              JSR GETPAR
10570              STX PAR3
10580              RTS
10590              ;
10600 GETPAR4      JSR GETPAR3
10610              JSR CKOM
10620              JSR GETPAR
10630              STX PAR4
10640              RTS
10650              ;
10660 GETPAR5      JSR GETPAR4
10670              JSR CKOM
10680              JSR GETPAR
10690              STX PAR5
10700              RTS
10710              ;
10720 GETPAR6      JSR GETPAR5
10730              JSR CKOM
10740              JSR GETPAR
10750              STX PAR6
10760              ;
10770              LDA PAR3
10780              LDX PAR5
10790              STA PAR5
10800              STX PAR3
10810              LDA PAR4
10820              LDX PAR6
10830              STA PAR6
10840              STX PAR4
10850              RTS
10860              ;
10870              ;
10880              ;
10890 CHECKPAR     LDX PAR1
10900              CPX #160
10910              BCS CHECKPAR1
10920              LDX PAR2
10930              CPX #100
10940              BCS CHECKPAR1
10950              LDX PAR5
10960              CPX #160
10970              BCS CHECKPAR1
10980              LDX PAR6
10990              CPX #100
11000              BCS CHECKPAR1
11010              LDA PAR3
11020              BEQ CHECKPAR2
11030              CMP #5
11040              BCS CHECKPAR2
11050              LDA PAR4
11060              CMP #3
11070              BCS CHECKPAR2
11080              RTS
11090 CHECKPAR1    PLA
11100              PLA
11110 CHECKPAR2    JMP IQERR
11120              ;
11130              ;
11140 GETADR       LDA Y1
11150              LSR
11160              AND #254
11170              TAX
11180              LDA ZEILE,X
11190              STA TMP1
11200              LDA ZEILE+1,X
11210              LDX PAR3
11220              CLC
11230              ADC SCREENMSB-1,X
11240              STA TMP1+1
11250              LDA X1
11260              LSR
11270              CLC
11280              ADC TMP1
11290              STA TMP1
11300              BCC GETADR1
11310              INC TMP1+1
11320 GETADR1      RTS
11330              ;
11340 SCREENMSB    DFB 128,104,112,120
11350              ;
11360              ;
11370 ZEILE        DFB 128,7,48,7,224,6,144,6
11380              DFB 64,6,240,5,160,5,80,5
11390              DFB 0,5,176,4,96,4,16,4
11400              DFB 192,3,112,3,32,3,208,2
11410              DFB 128,2,48,2,224,1,144,1
11420              DFB 64,1,240,0,160,0,80,0
11430              DFB 0,0
11440              ;
11450              ;
11460 GETDOT       LDA Y1
11470              AND #3
11480              ASL
11490              STA TMPH2
11500              LDA X1
11510              AND #1
11520              CLC
11530              ADC TMPH2
11540              TAX
11550              LDA ZWEIHOCH,X
11560              RTS
11570              ;
11580 ZWEIHOCH     DFB 1,2,4,8,16,32,64,128
11590              ;
11600              ;
11610 CKTO         LDA #164 ; 'TO'
11620              JMP CKCHAR
11630              ;
11640              ;
11650 SNERR        JSR OFF
11660              LDX #16
11670              JMP ERRPRINT
11680              ;
11690 IQERR        JSR OFF
11700              LDX #53
11710              JMP ERRPRINT
11720              ;
11730              ;
11740              ;
11750              ;
READY.