1000 ;
1010 ;
1020 ;********************
1030 ;** **
1040 ;** MUSIC PLAYER **
1050 ;** **
1060 ;** COPYRIGHT 1984 **
1070 ;** BY C. WEBER **
1080 ;** **
1090 ;********************
1100 ;
1110 ;
1120 ;
1130 ORG 20000
1140 ;
1150 SID EQU 54272
1160 LO EQU SID
1170 HI EQU SID+1
1180 ;
1190 W EQU SID+4
1200 ;
1210 ;
1220 SPEED EQU 56325
1230 VECTOR EQU 32768
1240 CNT EQU 32770
1250 PTR EQU 247
1260 WF EQU 64
1270 ;
1280 ;
1290 INIT SEI
1300 LDA #56
1310 STA SPEED
1320 LDA 788
1330 STA VECTOR
1340 LDA 789
1350 STA VECTOR+1
1360 LDA #<IRQ
1370 STA 788
1380 LDA #>IRQ
1390 STA 789
1400 LDX #27
1410 INIT1 LDA INITTAB,X
1420 STA SID,X
1430 DEX
1440 BNE INIT1
1450 INIT2 LDA #<STI1
1460 STA PTR
1470 LDA #>STI1
1480 STA PTR+1
1490 LDA #<STI2
1500 STA PTR+2
1510 LDA #>STI2
1520 STA PTR+3
1530 LDA #<STI3
1540 STA PTR+4
1550 LDA #>STI3
1560 STA PTR+5
1570 LDA #1
1580 STA CNT
1590 STA CNT+1
1600 STA CNT+2
1610 CLI
1620 RTS
1630 ;
1640 INITTAB DFB 0,0,10,5,64,8,250
1650 DFB 0,0,10,5,64,8,250
1660 DFB 0,0,10,5,64,8,250
1670 DFB 0,0,0,15,0,0,0
1680 ;
1690 ;
1700 IRQ DEC CNT
1710 BNE IRQ1
1720 LDX #0
1730 JSR TON
1740 IRQ1 DEC CNT+1
1750 BNE IRQ2
1760 LDX #2
1770 JSR TON
1780 IRQ2 DEC CNT+2
1790 BNE IRQ3
1800 LDX #4
1810 JSR TON
1820 IRQ3 JMP (VECTOR)
1830 ;
1840 ;
1850 ;
1860 TON LDA (PTR,X)
1870 PHA
1880 BPL TON3
1890 PLA
1900 JMP INIT2
1910 TON3 BNE TON1
1920 LDY IND2,X
1930 LDA #WF
1940 STA W,Y
1950 PLA
1960 JMP TON2
1970 TON1 PLA
1980 CLC
1990 ASL
2000 TAY
2010 LDA TONTAB,Y
2020 PHA
2030 LDA TONTAB+1,Y
2040 LDY IND2,X
2050 STA LO,Y
2060 PLA
2070 STA HI,Y
2080 LDY IND2,X
2090 LDA #WF
2100 ORA #1
2110 STA W,Y
2120 TON2 JSR INKPTR
2130 LDA (PTR,X)
2140 LDY IND1,X
2150 STA CNT,Y
2160 JMP INKPTR
2170 ;
2180 INKPTR INC PTR,X
2190 BNE INKPTR1
2200 INC PTR+1,X
2210 INKPTR1 RTS
2220 ;
2230 IND1 DFB 0,0,1,0,2,0
2240 IND2 DFB 0,0,7,0,14,0
2250 ;
2260 TONTAB DFB 0,0 ; C-0 BIS A#-7
2270 DFB 1,22,1,39,1,57,1,75
2280 DFB 1,95,1,116,1,138,1,161
2290 DFB 1,186,1,212,1,240,2,14
2300 DFB 2,45,2,78,2,113,2,150
2310 DFB 2,190,2,231,3,20,3,66
2320 DFB 3,116,3,169,3,224,4,27
2330 DFB 4,90,4,156,4,226,5,45
2340 DFB 5,123,5,207,6,39,6,133
2350 DFB 6,232,7,81,7,193,8,55
2360 DFB 8,180,9,56,9,196,10,89
2370 DFB 10,247,11,158,12,78,13,10
2380 DFB 13,208,14,162,15,129,16,109
2390 DFB 17,103,18,112,19,137,20,178
2400 DFB 21,237,23,59,24,157,26,20
2410 DFB 27,160,29,69,31,3,32,219
2420 DFB 34,207,36,225,39,18,41,101
2430 DFB 43,219,46,118,49,58,52,39
2440 DFB 55,65,58,138,62,5,65,181
2450 DFB 69,157,73,193,78,36,82,201
2460 DFB 87,182,92,237,98,115,104,78
2470 DFB 110,130,117,20,124,10,131,106
2480 DFB 139,59,147,130,156,72,165,147
2490 DFB 175,107,185,218,196,231,208,156
2500 DFB 221,4,234,40,248,20
2510 ;
2520 ;
2530 ;
2540 ;
2550 STI1 DFB 55,16,0,32,55,8,0,8,55,8,0,8,55,64,0,32
2560 DFB 56,32,55,32,56,32,55,32,56,32,55,16,0,32
2570 DFB 55,8,0,8,55,8,0,8,55,16,0,16,55,16,0,16
2580 DFB 55,16,0,16,55,16,0,16,55,16,0,16,55,16,0,16
2590 DFB 55,16,0,16,52,16,0,16,53,16,0,16,55,16,0,16
2600 ;
2610 ;
2620 STI2 DFB 52,16,0,32,52,8,0,8,52,8,0,8,52,64,0,32
2630 DFB 53,32,52,32,53,32,52,32,53,32,52,16,0,32
2640 DFB 52,8,0,8,52,8,0,8,52,16,0,16,52,16,0,16
2650 DFB 52,16,0,16,52,16,0,16,52,16,0,16,52,16,0,16
2660 DFB 52,16,0,16,48,16,0,16,50,16,0,16,52,16,0,16
2670 ;
2680 ;
2690 STI3 DFB 48,16,0,32,48,8,0,8,48,8,0,8,48,64,0,32
2700 DFB 49,32,48,32,49,32,48,32,49,32,48,16,0,32
2710 DFB 48,8,0,8,48,8,0,8,48,16,0,16,48,16,0,16
2720 DFB 48,16,0,16,48,16,0,16,48,16,0,16,48,16,0,16
2730 DFB 48,16,0,16,43,16,0,16,43,16,0,16,48,16,0,16
READY.