1000 ORG 20000
1010 ;
1020 SID EQU 54272
1030 LO EQU SID
1040 HI EQU SID+1
1050 ;
1060 T1 EQU SID+2
1070 T2 EQU SID+9
1080 T3 EQU SID+16
1090 W EQU SID+4
1100 AD1 EQU SID+5
1110 AD2 EQU SID+12
1120 AD3 EQU SID+19
1130 SR1 EQU SID+6
1140 SR2 EQU SID+13
1150 SR3 EQU SID+20
1160 ;
1170 VOL EQU SID+24
1180 ;
1190 SPEED EQU 56325
1200 VECTOR EQU 32768
1210 CNT EQU 32770
1220 PTR EQU 247
1230 WF EQU 64
1240 ;
1250 ;
1260 INIT SEI
1270 LDA #56
1280 STA SPEED
1290 LDA 788
1300 STA VECTOR
1310 LDA 789
1320 STA VECTOR+1
1330 LDA #<IRQ
1340 STA 788
1350 LDA #>IRQ
1360 STA 789
1370 LDX #27
1380 INIT1 LDA INITTAB,X
1390 STA SID,X
1400 DEX
1410 BNE INIT1
1420 INIT2 LDA #<STI1
1430 STA PTR
1440 LDA #>STI1
1450 STA PTR+1
1460 LDA #<STI2
1470 STA PTR+2
1480 LDA #>STI2
1490 STA PTR+3
1500 LDA #<STI3
1510 STA PTR+4
1520 LDA #>STI3
1530 STA PTR+5
1540 LDA #1
1550 STA CNT
1560 STA CNT+1
1570 STA CNT+2
1580 CLI
1590 RTS
1600 ;
1610 INITTAB DFB 0,0,10,5,64,8,250
1620 DFB 0,0,10,5,64,8,250
1630 DFB 0,0,10,5,64,8,250
1640 DFB 0,0,0,15,0,0,0
1650 ;
1660 ;
1670 IRQ DEC CNT
1680 BNE IRQ1
1690 LDX #0
1700 JSR TON
1710 IRQ1 DEC CNT+1
1720 BNE IRQ2
1730 LDX #2
1740 JSR TON
1750 IRQ2 DEC CNT+2
1760 BNE IRQ3
1770 LDX #4
1780 JSR TON
1790 IRQ3 JMP (VECTOR)
1800 ;
1810 ;
1820 ;
1830 TON LDA (PTR,X)
1840 PHA
1850 BPL TON3
1860 PLA
1870 JMP INIT2
1880 TON3 BNE TON1
1890 LDY IND2,X
1900 LDA #WF
1910 STA W,Y
1920 PLA
1930 JMP TON2
1940 TON1 PLA
1950 CLC
1960 ASL
1970 TAY
1980 LDA TONTAB,Y
1990 PHA
2000 LDA TONTAB+1,Y
2010 LDY IND2,X
2020 STA LO,Y
2030 PLA
2040 STA HI,Y
2050 LDY IND2,X
2060 LDA #WF
2070 ORA #1
2080 STA W,Y
2090 TON2 JSR INKPTR
2100 LDA (PTR,X)
2110 LDY IND1,X
2120 STA CNT,Y
2130 JMP INKPTR
2140 ;
2150 INKPTR INC PTR,X
2160 BNE INKPTR1
2170 INC PTR+1,X
2180 INKPTR1 RTS
2190 ;
2200 IND1 DFB 0,0,1,0,2,0
2210 IND2 DFB 0,0,7,0,14,0
2220 ;
2230 TONTAB DFB 0,0 ; C-0 BIS A#-7
2240 DFB 1,22,1,39,1,57,1,75
2250 DFB 1,95,1,116,1,138,1,161
2260 DFB 1,186,1,212,1,240,2,14
2270 DFB 2,45,2,78,2,113,2,150
2280 DFB 2,190,2,231,3,20,3,66
2290 DFB 3,116,3,169,3,224,4,27
2300 DFB 4,90,4,156,4,226,5,45
2310 DFB 5,123,5,207,6,39,6,133
2320 DFB 6,232,7,81,7,193,8,55
2330 DFB 8,180,9,56,9,196,10,89
2340 DFB 10,247,11,158,12,78,13,10
2350 DFB 13,208,14,162,15,129,16,109
2360 DFB 17,103,18,112,19,137,20,178
2370 DFB 21,237,23,59,24,157,26,20
2380 DFB 27,160,29,69,31,3,32,219
2390 DFB 34,207,36,225,39,18,41,101
2400 DFB 43,219,46,118,49,58,52,39
2410 DFB 55,65,58,138,62,5,65,181
2420 DFB 69,157,73,193,78,36,82,201
2430 DFB 87,182,92,237,98,115,104,78
2440 DFB 110,130,117,20,124,10,131,106
2450 DFB 139,59,147,130,156,72,165,147
2460 DFB 175,107,185,218,196,231,208,156
2470 DFB 221,4,234,40,248,20
2480 ;
2490 ;
2500 ;
2510 ;
2520 STI1 DFB 0,128
2530 DFB 81,8,69,8,81,16,0,107
2540 DFB 79,10,77,11,76,11,74,10,73,11,74,32,0,32
2550 ;
2560 DFB 69,8,57,8,69,16,0,112,64,16,65,16,61,16,62,32,0,32
2570 ;
2580 ;
2590 DFB 57,8,45,8,57,16,0,107
2600 DFB 55,10,53,11,52,11,50,10,49,11,50,32,0,32
2610 ;
2620 DFB 0,128,26,8,31,8,34,8,37,8,40,8,43,8,46,8,49,8
2630 DFB 26,8,34,8,37,8,40,8,43,8,46,8,49,8,52,8
2640 ;
2650 ;
2660 DFB 26,8,37,8,40,8,43,8,46,8,49,8,52,8,55,8
2670 DFB 26,8,40,8,43,8,46,8,49,8,52,8,55,8,58,8
2680 DFB 26,8,40,8,43,8,46,8,49,8,52,8,55,8,58,8,61,8
2690 DFB 26,8,38,8,43,8,46,8,49,8,52,8,55,8,58,8,61,8,64,8
2700 ;
2710 DFB 0,64,55,32,52,32,54,32,0,80,49,16
2720 ;
2730 ;
2740 DFB 50,11,52,10,49,11,50,11,52,10,49,11,50,11,52,10,49,11
2750 DFB 50,16,52,16,53,11,55,10,52,11,53,11,55,10,52,11,53,11
2760 DFB 55,10,52,11,53,16,55,16
2770 ;
2780 DFB 57,11,58,10,55,11,57,11,58,10,55,11,57,11,58,10,55,11
2790 DFB 57,16,0,128,73,16
2800 ;
2810 ;
2820 ;
2830 DFB 74,11,76,10,73,11,74,11,76,10,73,11,74,11,76,10,73,11
2840 DFB 74,16,76,16,77,11,79,10,76,11,77,11,79,10,76,11,77,11
2850 DFB 79,10,76,11,77,16,79,16
2860 ;
2870 DFB 81,11,82,10,79,11,81,11,82,10,79,11,81,11,82,10,79,11
2880 DFB 81,16,0,128,81,16
2890 ;
2900 ;
2910 DFB 79,11,82,10,0,11,79,11,82,10,0,11,77,11,81,10,0,11
2920 DFB 77,11,81,10,0,11,76,11,79,10,0,11,76,11,79,10,0,11
2930 DFB 74,11,77,10,0,11,74,11,77,10,0,11
2940 ;
2950 ;
2960 DFB 72,11,76,10,0,11,72,11,76,10,0,11,70,11,74,10,0,11
2970 DFB 70,11,74,10,0,11,69,11,72,10,0,11,69,11,72,10,0,11
2980 DFB 67,11,70,10,0,11,67,11,70,10,0,11
2990 ;
3000 DFB 65,11,69,10,0,11,65,11,69,10,0,11,64,11,67,10,0,11
3010 DFB 64,11,67,10,0,11,38,8,43,8,46,8,49,8,52,8
3020 DFB 55,8,58,8,61,8,64,8,67,8,70,64
3030 ;
3040 ;
3050 DFB 70,48,69,16,67,11,65,10,64,11,62,11,61,10,59,11
3060 DFB 61,16,57,16,61,11,64,10,67,11,65,8,67,8
3070 DFB 65,8,67,8,65,8,67,8,65,8,67,8,65,16,0,8,64,8
3080 ;
3090 DFB 57,64,0,48,57,16,62,8,57,8,64,8,57,8,65,8,57,8
3100 DFB 62,8,57,8,64,8,57,8,65,8,57,8,67,8,57,8,64,8,57,8
3110 ;
3120 ;
3130 DFB 65,8,57,8,67,8,57,8,69,8,57,8,65,8,57,8
3140 DFB 67,8,57,8,69,8,57,8,70,8,57,8,67,8,57,8
3150 DFB 69,8,57,8,65,8,57,8,67,8,57,8,64,8,57,8
3160 DFB 65,8,57,8,62,8,57,8,64,8,57,8,61,8,57,8
3170 ;
3180 ;
3190 ;
3200 DFB 62,8,57,3,0,5,57,8,45,8,58,8,45,8,55,8,45,8,57,8,45,8
3210 DFB 57,8,45,8,57,8,45,8,57,8,45,8,57,8,45,8,57,8,45,8,57,8
3220 DFB 45,8,57,8,45,8,57,8,45,8,57,8,45,8,57,8,45,8,57,8,45,8
3230 ;
3240 ;
3250 DFB 50,8,45,8,0,8,45,8,0,8,45,8,0,8,45,8,0,8,45,8,0,8
3260 DFB 45,8,0,8,45,8,0,8,45,8,0,8,45,8,0,8,45,8,0,8,45,8,0,8
3270 DFB 45,8,0,8,45,8,0,8,45,8,0,8,45,8,0,8,45,8,255
3280 ;
3290 ;
3300 ;
3310 STI2 DFB 0,128
3320 DFB 0,0
3330 ;
3340 DFB 0,160,53,16,0,16,50,32,0,32
3350 ;
3360 ;
3370 DFB 0,139,43,10,0,107
3380 ;
3390 DFB 0,0
3400 ;
3410 ;
3420 DFB 0,0,0,24
3430 ;
3440 DFB 0,64,43,32,40,32,45,32,0,80,61,16
3450 ;
3460 ;
3470 DFB 62,11,64,10,61,11,62,11,64,10,61,11,62,11,64,10,61,11
3480 DFB 62,16,64,16,65,11,67,10,64,11,65,11,67,10,64,11,65,11
3490 DFB 67,10,64,11,65,16,67,16
3500 ;
3510 DFB 69,11,70,10,67,11,69,11,70,10,67,11,69,11,70,10,67,11
3520 DFB 69,16,0,128,61,16
3530 ;
3540 ;
3550 ;
3560 DFB 0,11,64,10,0,22,64,10,0,22,64,10,0,27,64,16
3570 DFB 0,11,67,10,0,22,67,10,0,22,67,10,0,27,67,16
3580 ;
3590 DFB 0,11,70,10,0,22,70,10,0,22,70,10,0,11,69,16,0,128,69,16
3600 ;
3610 ;
3620 DFB 67,11,70,10,64,11,67,11,70,10,64,11,65,11,69,10,62,11
3630 DFB 65,11,69,10,62,11,64,11,67,10,60,11,64,11,67,10,60,11
3640 DFB 62,11,65,10,58,11,62,11,65,10,58,11
3650 ;
3660 ;
3670 DFB 60,11,64,10,57,11,60,11,64,10,57,11,58,11,62,10,55,11
3680 DFB 58,11,62,10,55,11,57,11,60,10,53,11,57,11,60,10,53,11
3690 DFB 55,11,58,10,52,11,55,11,58,10,52,11
3700 ;
3710 DFB 53,11,57,10,50,11,53,11,57,10,50,11,52,11,55,10,49,11
3720 DFB 52,11,55,10,49,11,38,40,52,104
3730 ;
3740 ;
3750 DFB 52,32,0,16,57,16,55,11,53,10,52,11,50,11,49,10,47,11
3760 DFB 49,16,45,16,49,11,52,10,55,11,53,8,55,8
3770 DFB 53,8,55,8,53,8,55,8,53,8,55,8,53,16,0,8,52,8
3780 ;
3790 DFB 53,64,0,192
3800 ;
3810 ;
3820 DFB 0,0
3830 ;
3840 ;
3850 ;
3860 DFB 0,64,57,16,53,16,55,16,52,16,53,16,50,16
3870 DFB 55,16,52,16,53,16,50,16,52,16,49,16
3880 ;
3890 ;
3900 DFB 38,16,45,16,46,16,43,16,45,16,41,16,43,16,40,16
3910 DFB 41,16,0,8,38,8,0,8,43,8,0,8,40,8,0,8,41,8,0,8
3920 DFB 38,8,0,8,40,8,0,8,37,8
3930 ;
3940 ;
3950 ;
3960 STI3 DFB 0,128
3970 DFB 57,8,55,8,57,16,0,107
3980 DFB 55,10,53,11,52,11,50,10,49,11,50,32,0,32
3990 ;
4000 DFB 45,8,43,8,45,16,0,112,40,16,41,16,37,16,38,32,0,32
4010 ;
4020 ;
4030 DFB 33,8,31,8,33,16,0,107,31,10,29,11,28,11,26,10,25,11,26,32,0,32
4040 ;
4050 DFB 14,0
4060 ;
4070 ;
4080 DFB 14,0,14,24
4090 ;
4100 DFB 14,192,0,64
4110 ;
4120 ;
4130 DFB 0,0
4140 ;
4150 DFB 0,240,49,16
4160 ;
4170 ;
4180 ;
4190 DFB 50,11,52,10,49,11,50,11,52,10,49,11,50,11,52,10,49,11
4200 DFB 50,16,52,16,53,11,55,10,52,11,53,11,55,10,52,11,53,11
4210 DFB 55,10,52,11,53,16,55,16
4220 ;
4230 DFB 57,11,58,10,55,11,57,11,58,10,55,11,57,11,58,10,55,11
4240 DFB 57,16,0,128,57,16
4250 ;
4260 ;
4270 DFB 55,11,58,10,52,11,55,11,58,10,52,11,53,11,57,10,50,11
4280 DFB 53,11,57,10,50,11,52,11,55,10,48,11,52,11,55,10,48,11
4290 DFB 50,11,53,10,46,11,50,11,53,10,46,11
4300 ;
4310 ;
4320 DFB 48,11,52,10,45,11,48,11,52,10,45,11,46,11,50,10,43,11
4330 DFB 46,11,50,10,43,11,45,11,48,10,41,11,45,11,48,10,41,11
4340 DFB 43,11,46,10,40,11,43,11,46,10,40,11
4350 ;
4360 DFB 41,11,45,10,38,11,41,11,45,10,38,11,40,11,43,10,37,11
4370 DFB 40,11,43,10,37,11,14,144
4380 ;
4390 ;
4400 DFB 14,32,0,0
4410 ;
4420 DFB 14,16,38,48,0,48,45,16,50,8,45,8,52,8,45,8,53,8,45,8
4430 DFB 50,8,45,8,52,8,45,8,53,8,45,8,55,8,45,8,52,8,45,8
4440 ;
4450 ;
4460 DFB 53,8,45,8,55,8,45,8,57,8,45,8,53,8,45,8
4470 DFB 55,8,45,8,57,8,45,8,58,8,45,8,55,8,45,8
4480 DFB 57,8,45,8,53,8,45,8,55,8,45,8,52,8,45,8
4490 DFB 53,8,45,8,50,8,45,8,52,8,45,8,49,8,45,8
4500 ;
4510 ;
4520 ;
4530 DFB 50,16,45,16,46,16,43,16,45,16,41,16,43,16,40,16
4540 DFB 41,16,38,16,43,16,40,16,41,16,38,16,40,16,37,16
4550 ;
4560 ;
4570 DFB 0,16,33,16,34,16,31,16,33,16,29,16,31,16,28,16
4580 DFB 29,16,26,16,31,16,28,16,29,16,26,16,28,16,25,16
READY.