C64 Software  <  SCA: The C64 Software Collection / NEWLINE 3.7

  Run
1000              ; SAVE"",8
1010              ; ROUTINE Z. ZEICHNEN
1020              ; UND LOESCHEN VON
1030              ; GERADEN LINIEN IM
1040              ; MULTICOLOR-MODUS
1050              ;
1060              ; PLOT:
1070              ; COL : FARBE (0..3)
1080              ; X: X (0..159)
1090              ; Y: Y (0..199)
1100              ;
1110              ; HLINE:
1120              ; AKKU: FARBE (0..3)
1130              ; Y: Y (0..199)
1140              ;
1150              ;
1160              ;
1170              ORG 20000
1180              ;
1190              ;
1200 MAP          EQU 8192
1210 COLOR1       EQU 1024
1220 COLOR2       EQU 55296
1230              ;
1240 BASIS        EQU 16384
1250 XLTAB        EQU BASIS
1260 XHTAB        EQU BASIS+256
1270 YLTAB        EQU BASIS+512
1280 YHTAB        EQU BASIS+768
1290              ;
1300 X1           EQU 87
1310 X2           EQU 88
1320 Y1           EQU 89
1330 Y2           EQU 90
1340 DELTX        EQU 91
1350 DELTY        EQU 92
1360 DL           EQU 93
1370 DH           EQU 94
1380 ANZAHL       EQU 95
1390              ;
1400 COL          EQU 253
1410 PTR1         EQU 254
1420              ;
1430              ;
1440              ;
1450 INITHRG      LDA #59
1460              STA 53265
1470              LDA #24
1480              STA 53272
1490              STA 53270
1500              ;
1510              LDA #12
1520              STA 53280
1530              LDA #6  ; FARBE 0
1540              STA 53281
1550              ;
1560              ;
1570 HRGCLR       LDY #0
1580              STY PTR1
1590              LDA #>MAP
1600              STA PTR1+1
1610              ;
1620              LDX #32
1630              TYA
1640 HRGCLR1      STA (PTR1),Y
1650              INY
1660              BNE HRGCLR1
1670              INC PTR1+1
1680              DEX
1690              BNE HRGCLR1
1700              ;
1710              ;
1720 SETCOLOR     LDY #0
1730              ;
1740 SETCOLOR1    LDA #131 ; FARBEN 1+2
1750              STA COLOR1    ,Y
1760              STA COLOR1+256,Y
1770              STA COLOR1+512,Y
1780              STA COLOR1+768,Y
1790              ;
1800              LDA #14  ; FARBE 3
1810              STA COLOR2    ,Y
1820              STA COLOR2+256,Y
1830              STA COLOR2+512,Y
1840              STA COLOR2+768,Y
1850              ;
1860              INY
1870              BNE SETCOLOR1
1880              JMP GRID
1890              ;
1900              ;
1910              ;
1920              ;
1930 PLOT         CPX #160
1940              BCS PLOT1
1950              CPY #200
1960              BCS PLOT1
1970              ;
1980              LDA XLTAB,X
1990              CLC
2000              ADC YLTAB,Y
2010              STA PTR1
2020              LDA #>MAP
2030              ADC XHTAB,X
2040              ADC YHTAB,Y
2050              STA PTR1+1
2060              TXA
2070              AND #3
2080              TAX
2090              LDY #0
2100              LDA COL
2110              AND PTAB,X
2120              EOR (PTR1),Y
2130              STA (PTR1),Y
2140 PLOT1        RTS
2150              ;
2160              ;
2170              ;
2180              ;
2190 HLINE        AND #3
2200              TAX
2210              LDA COLTAB,X
2220              STA COL
2230              LDA YLTAB,Y
2240              STA PTR1
2250              LDA #>MAP
2260              CLC
2270              ADC YHTAB,Y
2280              STA PTR1+1
2290              ;
2300              LDX #40
2310              LDY #0
2320 HLINE1       LDA COL
2330              STA (PTR1),Y
2340              TYA
2350              CLC
2360              ADC #8
2370              TAY
2380              BCC HLINE2
2390              INC PTR1+1
2400 HLINE2       DEX
2410              BNE HLINE1
2420              ;
2430              RTS
2440              ;
2450              ;
2460              ;
2470 PTAB         DFB %11000000
2480              DFB %00110000
2490              DFB %00001100
2500              DFB %00000011
2510              ;
2520              ;
2530 COLTAB       DFB %00000000
2540              DFB %01010101
2550              DFB %10101010
2560              DFB %11111111
2570              ;
2580              ;
2590              ;
2600 LINE         LDA X2
2610              SEC
2620              SBC X1
2630              STA DELTX
2640              STA ANZAHL
2650              BCC ERRR
2660              ;
2670              LDX #$E6   ; INC
2680              LDA Y2
2690              SEC
2700              SBC Y1
2710              BCS LINE1
2720              LDX #$C6   ; DEC
2730              EOR #255   ; KOMPLEM.
2740 LINE1        STA DELTY
2750              STX LINE3
2760              ;
2770              INC ANZAHL
2780              LDA #0
2790              STA DH
2800              ;
2810              SEC
2820              SBC DELTY
2830              STA DL
2840              BCS LINELOOP1
2850              DEC DH
2860              ;
2870 LINELOOP1    LDX X1
2880              LDY Y1
2890              JSR PLOT
2900              ;
2910 LINELOOP2    LDA DH
2920              BMI YSCHRITT
2930              LDA DL
2940              SEC
2950              SBC DELTY
2960              STA DL
2970              BCS LINE2
2980              DEC DH
2990 LINE2        INC X1
3000              DEC ANZAHL
3010              BNE LINELOOP1
3020 ERRR         RTS
3030              ;
3040 YSCHRITT     LDA DL
3050              CLC
3060              ADC DELTX
3070              STA DL
3080              BCC LINE3
3090              INC DH
3100 LINE3        INC Y1
3110              JMP LINELOOP2
3120              ;
3130              ;
3140              ;
3150 GRID         LDA #1
3160              AND #3
3170              TAX
3180              LDA COLTAB,X
3190              STA COL
3200              ;
3210 GRID1        JSR MAKELINE
3220 GRID2        ;JSR 65508
3230              ;BEQ GRID2
3240              ;
3250 GRID3        LDA 53265
3260              BPL GRID3
3270              ;
3280              ;JSR MAKELINE
3290              INC ML1+1
3300              INC ML1+1
3310              INC ML1+1
3320              DEC ML2+1
3330              DEC ML2+1
3340              JMP GRID1
3350              ;
3360 MAKELINE     LDA #0
3370              STA X1
3380 ML1          LDA #0
3390              STA Y1
3400              LDA #159
3410              STA X2
3420 ML2          LDA #159
3430              STA Y2
3440              JMP LINE
READY.