C64 Software  <  SCA: The C64 Software Collection / SCA METAL 17

  Run
1000              ;SAVE"",8
1010              ;
1020              ; 3/31/86
1030              ;
1040              ;
1050              ORG 20000
1060              ;
1070 T1           EQU 87
1080 T2           EQU 88
1090 T3           EQU 89
1100 T4           EQU 90
1110 R1           EQU 91
1120 R2           EQU 92
1130 TMP1         EQU 93
1140 FLAG         EQU 158
1150 JOBCNTR      EQU 159
1160 TEXTTIME     EQU 160
1170 SCLOLLOF1    EQU 161
1180 SCLOLLOF2    EQU 162
1190 TEXTPTR      EQU 163
1200 BUCHSTCNTR   EQU 165
1210 BATEXT       EQU 166
1220              ;
1230 COLOR        EQU 253
1240 X            EQU 254
1250 Y            EQU 255
1260              ;
1270 AZS          EQU 20 ; ANZAHL STARS
1280 ANZAHLJOBS   EQU 10
1290 V            EQU 53248
1300 SOUNDINIT    EQU $B000
1310 SOUND        EQU $B012
1320              ;
1330 BA           EQU 8192
1340 RB           EQU 3000
1350 ZS           EQU 40960
1360 TEXTBASIS    EQU BA+6104
1370              ;
1380 SD1          EQU 16384
1390 SD2          EQU SD1+128
1400 SD3          EQU SD2+128
1410 SD4          EQU SD3+128
1420 SD5          EQU SD4+128
1430              ;
1440              ;
1450              ;
1460              ;
1470 INIT         SEI
1480              LDY #0
1490              LDA #54
1500              STA 1
1510              ;
1520              LDA #1
1530              STA 56333 ; TIMER AUS
1540              LDA #151
1550              STA 56576
1560              LDX #33
1570 VICINIT      LDA VICTAB,X
1580              STA V,X
1590              DEX
1600              BPL VICINIT
1610              ;
1620              LDA #<ISR
1630              STA 788
1640              LDA #>ISR
1650              STA 789
1660              STY JOBCNTR
1670              STY FLAG
1680              ;
1690              ;
1700 CLS          LDX #32
1710              LDA #>BA
1720              STA TMP1+1
1730              LDY #0
1740              TYA
1750              STA TMP1
1760              ;
1770 CLS1         STA (TMP1),Y
1780              INY
1790              BNE CLS1
1800              INC TMP1+1
1810              DEX
1820              BNE CLS1
1830              ;
1840              ;
1850 SETCOL       LDA #16
1860              STA $0400,Y
1870              STA $0500,Y
1880              STA $0600,Y
1890              STA $0700,Y
1900              INY
1910              BNE SETCOL
1920              ;
1930              LDX #5
1940              LDA #43
1950 SPRITEINIT   STA 2040,X
1960              SEC
1970              SBC #2
1980              DEX
1990              BPL SPRITEINIT
2000              ;
2010              ;
2020              LDA #0
2030              JSR SOUNDINIT
2040              ;
2050              LDA #255
2060              STA TEXTTIME
2070              LDA #0
2080              STA SCLOLLOF1
2090              STA SCLOLLOF2
2100              LDA #<TEXTTAB
2110              STA TEXTPTR
2120              LDA #>TEXTTAB
2130              STA TEXTPTR+1
2140              ;
2150              LDA #59
2160              STA 53265
2170              CLI
2180              ;
2190              ;
2200 JOY          LDA 56320
2210              AND #31
2220              CMP #31
2230              BEQ JOY
2240              SEI
2250              LDA #55
2260              STA 1
2270              BRK
2280              ;
2290              ;
2300              ;
2310 ISR          LDA #1
2320              STA 53273
2330              CLI
2340              ;
2350              LDX JOBCNTR
2360              DEC JOBCNTR
2370              LDA RASTERTAB,X
2380              STA 53266
2390              ;
2400              LDA FARBTAB,X
2410              NOP
2420              NOP
2430              STA V+39
2440              STA V+40
2450              STA V+41
2460              STA V+42
2470              NOP
2480              STA V+43
2490              STA V+44
2500              ;
2510              CPX #8
2520              BNE ISR1
2530              ;
2540              LDA #149 ; UNTEN
2550              JSR YPOS
2560              BNE ISRAUS
2570              ;
2580 ISR1         CPX #3
2590              BNE ISR2
2600              ;
2610              INC 2040
2620              INC 2041
2630              INC 2042
2640              INC 2043
2650              INC 2044
2660              INC 2045
2670              BNE ISRAUS
2680              ;
2690 ISR2         CPX #0
2700              BEQ ISR3
2710              ;
2720 ISRAUS       PLA
2730              TAY
2740              PLA
2750              TAX
2760              PLA
2770              RTI
2780              ;
2790              ;
2800 ISR3         LDX #ANZAHLJOBS
2810              STX JOBCNTR
2820              ;
2830              DEC 2040
2840              DEC 2041
2850              DEC 2042
2860              DEC 2043
2870              DEC 2044
2880              DEC 2045
2890              LDA #128 ; OBEN
2900              JSR YPOS
2910              ;
2920              JSR SOUND
2930              LDA FLAG
2940              EOR #164
2950              STA FLAG
2960              BNE ISRAUS
2970              ;
2980              ;
2990 NEXPIC       LDX #AZS
3000              LDA #5
3010              STA T1
3020              ;
3030 LOOP         STX T2
3040              LDA SD1,X
3050              ORA SD2,X
3060              BNE M4
3070              LDA T1
3080              BEQ M5
3090              DEC T1
3100              JSR CALC
3110              AND #7
3120              STA T3
3130              LDY #0
3140              JSR CALC
3150              BMI M1
3160              LDY #7
3170 M1           TYA
3180              SEC
3190              SBC T3
3200              STA SD1,X
3210              JSR CALC
3220              AND #7
3230              STA T3
3240              LDY #0
3250              JSR CALC
3260              BMI M2
3270              LDY #7
3280 M2           TYA
3290              SEC
3300              SBC T3
3310              STA SD2,X
3320 M3           JSR CALC
3330              AND #3
3340              CMP #3
3350              BEQ M3
3360              STA SD5,X
3370 M4           LDA #3
3380              STA COLOR
3390              LDY SD4,X
3400              LDA SD3,X
3410              TAX
3420              JSR SETP
3430              LDX T2
3440              LDA SD1,X
3450              CLC
3460              ADC SD3,X
3470              STA SD3,X
3480              CLC
3490              LDA SD2,X
3500              ADC SD4,X
3510              STA SD4,X
3520 M5           LDY SD4,X
3530              LDA SD5,X
3540              STA COLOR
3550              LDA SD3,X
3560              TAX
3570              JSR SETP
3580              BPL M8
3590              LDX T2
3600              JSR CALC
3610              BMI M6
3620              SEC
3630 M6           AND #7
3640              ADC #76
3650              STA SD3,X
3660              JSR CALC
3670              BMI M7
3680              SEC
3690 M7           AND #7
3700              ADC #88
3710              STA SD4,X
3720              LDA #0
3730              STA SD1,X
3740              STA SD2,X
3750 M8           LDX T2
3760              DEX
3770              BMI RAHMEN
3780              JMP LOOP
3790              ;
3800 RAHMEN       INX
3810 RAHMEN1      LDA RB+   0,X
3820              LDY RB+ 432,X
3830              STA BA+2952,Y
3840              LDA RB+  72,X
3850              LDY RB+ 504,X
3860              STA BA+3272,Y
3870              LDA RB+ 144,X
3880              LDY RB+ 576,X
3890              STA BA+3592,Y
3900              LDA RB+ 216,X
3910              LDY RB+ 648,X
3920              STA BA+3912,Y
3930              LDA RB+ 288,X
3940              LDY RB+ 720,X
3950              STA BA+4232,Y
3960              LDA RB+ 360,X
3970              LDY RB+ 792,X
3980              STA BA+4552,Y
3990              INX
4000              CPX #72
4010              BNE RAHMEN1
4020              ;
4030              ;
4040 TEXT         LDA TEXTTIME
4050              BEQ TEXT1    ;SCROLL
4060              ;
4070              DEC TEXTTIME
4080              BNE DRAWTEXT
4090              ;
4100              LDA #1       ;TASK2
4110              STA SCLOLLOF1
4120              BNE DRAWTEXT
4130              ;
4140 TEXT1        LDA SCLOLLOF1
4150              BEQ TEXT2
4160              INC SCLOLLOF1
4170              CMP #7
4180              BNE DRAWTEXT
4190              ;
4200              LDA #0
4210              STA SCLOLLOF1
4220              LDA #8       ;TASK3
4230              STA SCLOLLOF2
4240              LDA TEXTPTR
4250              CLC
4260              ADC #32
4270              STA TEXTPTR
4280              BCC TEXT2
4290              INC TEXTPTR+1
4300              ;
4310 TEXT2        DEC SCLOLLOF2
4320              BNE DRAWTEXT
4330              ;
4340              LDA #100
4350              STA TEXTTIME
4360              ;
4370              ;
4380 DRAWTEXT     LDA #<TEXTBASIS
4390              STA BATEXT
4400              LDA #>TEXTBASIS
4410              STA BATEXT+1
4420              ;
4430              LDY #0
4440 DRAWTEXT1    LDA (TEXTPTR),Y
4450              ASL
4460              ASL
4470              ASL
4480              ORA SCLOLLOF1
4490              TAX
4500              ;
4510              STY 2
4520              LDY SCLOLLOF2
4530 DRAWTEXT2    LDA ZS,X
4540              STA (BATEXT),Y
4550              INX
4560              INY
4570              CPY #8
4580              BCS DRAWTEXT3
4590              TXA
4600              AND #7
4610              BNE DRAWTEXT2
4620              ;
4630 DRAWTEXT3    LDA BATEXT
4640              CLC
4650              ADC #8
4660              STA BATEXT
4670              BCC DRAWTEXT4
4680              INC BATEXT+1
4690              ;
4700 DRAWTEXT4    LDY 2
4710              INY
4720              CPY #32
4730              BCC DRAWTEXT1
4740              ;
4750              JMP ISRAUS
4760              ;
4770              ;
4780              ;
4790 YPOS         STA V+1
4800              STA V+3
4810              STA V+5
4820              STA V+7
4830              STA V+9
4840              STA V+11
4850              RTS
4860              ;
4870 SETP         STX X
4880              STY Y
4890              LDA X
4900              CMP #160
4910              BCC SETP1
4920              LDA #128
4930              RTS
4940              ;
4950 SETP1        LDA Y
4960              CMP #192
4970              BCC SETP2
4980              LDA #128
4990              RTS
5000              ;
5010 SETP2        LDX Y
5020              LDA OFL,X
5030              STA TMP1
5040              LDA OFH,X
5050              STA TMP1+1
5060              LDA X
5070              LSR
5080              LSR
5090              TAX
5100              LDA OF1L,X
5110              CLC
5120              ADC TMP1
5130              STA TMP1
5140              LDA OF1H,X
5150              ADC TMP1+1
5160              STA TMP1+1
5170              LDA X
5180              AND #3
5190              TAX
5200              LDY COLOR
5210              LDA SETTAB1,Y
5220              AND SETTAB2,X
5230              STA SETP3+1
5240              LDY #0
5250              LDA (TMP1),Y
5260              AND SETTAB3,X
5270 SETP3        ORA #0
5280              STA (TMP1),Y
5290              TYA
5300              RTS
5310              ;
5320              ;
5330 CALC         LDA R1
5340              ROL R1
5350              EOR R1
5360              ROR R1
5370              INC R2
5380              ADC R2
5390              BVC CALC1
5400              INC R2
5410 CALC1        STA R1
5420              RTS
5430              ;
5440              ;
5450              ;
5460              ;
5470 SETTAB1      DFB $FF,$55,$AA,$00
5480 SETTAB2      DFB $C0,$30,$0C,$03
5490 SETTAB3      DFB $3F,$CF,$F3,$FC
5500              ;
5510              ;
5520 OFL          DFB $00,$01,$02,$03,$04,$05,$06,$07
5530              DFB $40,$41,$42,$43,$44,$45,$46,$47
5540              DFB $80,$81,$82,$83,$84,$85,$86,$87
5550              DFB $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
5560              DFB $00,$01,$02,$03,$04,$05,$06,$07
5570              DFB $40,$41,$42,$43,$44,$45,$46,$47
5580              DFB $80,$81,$82,$83,$84,$85,$86,$87
5590              DFB $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
5600              DFB $00,$01,$02,$03,$04,$05,$06,$07
5610              DFB $40,$41,$42,$43,$44,$45,$46,$47
5620              DFB $80,$81,$82,$83,$84,$85,$86,$87
5630              DFB $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
5640              DFB $00,$01,$02,$03,$04,$05,$06,$07
5650              DFB $40,$41,$42,$43,$44,$45,$46,$47
5660              DFB $80,$81,$82,$83,$84,$85,$86,$87
5670              DFB $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
5680              DFB $00,$01,$02,$03,$04,$05,$06,$07
5690              DFB $40,$41,$42,$43,$44,$45,$46,$47
5700              DFB $80,$81,$82,$83,$84,$85,$86,$87
5710              DFB $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
5720              DFB $00,$01,$02,$03,$04,$05,$06,$07
5730              DFB $40,$41,$42,$43,$44,$45,$46,$47
5740              DFB $80,$81,$82,$83,$84,$85,$86,$87
5750              DFB $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7
5760              DFB $00,$01,$02,$03,$04,$05,$06,$07
5770              ;
5780              ;
5790 OFH          DFB $20,$20,$20,$20,$20,$20,$20,$20
5800              DFB $21,$21,$21,$21,$21,$21,$21,$21
5810              DFB $22,$22,$22,$22,$22,$22,$22,$22
5820              DFB $23,$23,$23,$23,$23,$23,$23,$23
5830              DFB $25,$25,$25,$25,$25,$25,$25,$25
5840              DFB $26,$26,$26,$26,$26,$26,$26,$26
5850              DFB $27,$27,$27,$27,$27,$27,$27,$27
5860              DFB $28,$28,$28,$28,$28,$28,$28,$28
5870              DFB $2A,$2A,$2A,$2A,$2A,$2A,$2A,$2A
5880              DFB $2B,$2B,$2B,$2B,$2B,$2B,$2B,$2B
5890              DFB $2C,$2C,$2C,$2C,$2C,$2C,$2C,$2C
5900              DFB $2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D
5910              DFB $2F,$2F,$2F,$2F,$2F,$2F,$2F,$2F
5920              DFB $30,$30,$30,$30,$30,$30,$30,$30
5930              DFB $31,$31,$31,$31,$31,$31,$31,$31
5940              DFB $32,$32,$32,$32,$32,$32,$32,$32
5950              DFB $34,$34,$34,$34,$34,$34,$34,$34
5960              DFB $35,$35,$35,$35,$35,$35,$35,$35
5970              DFB $36,$36,$36,$36,$36,$36,$36,$36
5980              DFB $37,$37,$37,$37,$37,$37,$37,$37
5990              DFB $39,$39,$39,$39,$39,$39,$39,$39
6000              DFB $3A,$3A,$3A,$3A,$3A,$3A,$3A,$3A
6010              DFB $3B,$3B,$3B,$3B,$3B,$3B,$3B,$3B
6020              DFB $3C,$3C,$3C,$3C,$3C,$3C,$3C,$3C
6030              DFB $3D,$3D,$3D,$3D,$3D,$3D,$3D,$3D
6040              ;
6050              ;
6060 OF1L         DFB $00,$08,$10,$18,$20,$28,$30,$38
6070              DFB $40,$48,$50,$58,$60,$68,$70,$78
6080              DFB $80,$88,$90,$98,$A0,$A8,$B0,$B8
6090              DFB $C0,$C8,$D0,$D8,$E0,$E8,$F0,$F8
6100              DFB $00,$08,$10,$18,$20,$28,$30,$38
6110              ;
6120 OF1H         DFB $00,$00,$00,$00,$00,$00,$00,$00
6130              DFB $00,$00,$00,$00,$00,$00,$00,$00
6140              DFB $00,$00,$00,$00,$00,$00,$00,$00
6150              DFB $00,$00,$00,$00,$00,$00,$00,$00
6160              DFB $01,$01,$01,$01,$01,$01,$01,$01
6170              ;
6180              ;
6190 VICTAB       DFB 106,0,130,0,160,0,184,0
6200              DFB 214,0,238,0,  0,0,  0,0,0
6210              DFB 11,20,0,0,255,8,0,24
6220              DFB 0,129,0,0,0,0,0,0,0
6230              ;
6240 RASTERTAB    DFB 124,180,161,152,146,144,142,140,133,129,127
6250 FARBTAB      DFB 0,4,15,12,11,0,11,1,12,14
6260              ;
6270              ;
6280 TEXTTAB      DFB ""
6290              DFB ""
6300              DFB ""
6310              DFB ""
6320              DFB ""
6330              DFB ""
6340              DFB ""
6350              DFB ""
6360              DFB ""
READY.