1000        ;
1010        ; ==============
1020        ; TCL Music Demo
1030        ; ==============
1040        ;
1050        INCLUDE #H1:PEEK.FUN
1060        INCLUDE #H1:DPEEK.FUN
1070        VARIABLE 20=RTCLOCK
1080        VARIABLE 53274=COLBK
1090        VARIABLE 54282=WSYNC
1100        VARIABLE 54283=VCOUNT
1110        VARIABLE TMP
1120        BEGIN
1130          POKE (TIMER,1)
1140          POKE (TIMER+1,1)
1150          POKE (TIMER+2,1)
1160          POKE (TIMER+3,1)
1170          DPOKE (TABLE,DATA1)
1180          DPOKE (TABLE+2,DATA2)
1190          DPOKE (TABLE+4,DATA3)
1200          DPOKE (TABLE+6,DATA4)
1210          POKE (53768,0)
1220          POKE (562,3)
1230          POKE (53775,3)
1240          EVERY (1,MUSIC)
1250          REPEAT
1260            TMP=[VCOUNT+RTCLOCK]
1270            <WSYNC=0
1280            <COLBK=TMP
1290          UNTIL 0
1300        END
1310        ;
1320        ; =======================
1330        ; Music Interrupt handler
1340        ; =======================
1350        ;
1360        POINTER TIMER
1370        RESERVE 4
1380        VARIABLE CHANNEL,TIME,BASE
1390        POINTER MUSIC
1400        DO CHANNEL=0,3,1
1410          TIME=PEEK([TIMER+CHANNEL])
1420          IF TIME>0 THEN
1430            TIME=[TIME-1]
1440            IF TIME=0 THEN
1450              BASE=DPEEK([TABLE+CHANNEL+CHANNEL])
1460              SOUND (CHANNEL,PEEK(BASE),10,10)
1470              TIME=PEEK([BASE+1])
1480              DPOKE ([TABLE+CHANNEL+CHANNEL],[BASE+2])
1490            END IF
1500            POKE ([TIMER+CHANNEL],TIME)
1510          END IF
1520        END DO
1530        RETURN
1540        POINTER TABLE
1550        RESERVE 8
1560        POINTER DATA1
1570        CODE 3506400648065106
1580        CODE 3506400648065106
1590        CODE 5524000C35063C06
1600        CODE 4006480635063C06
1610        CODE 40064806510C350B
1620        CODE 0002350B000C3506
1630        CODE 2F062A0628063506
1640        CODE 2F062A0628062A0C
1650        CODE 3C18000C3C063506
1660        CODE 2F062A063C063506
1670        CODE 2F062A062F0C4018
1680        CODE 000C350640064806
1690        CODE 51063506400648065106
1700        CODE 5524000C35063C06
1710        CODE 4006480635063C06
1720        CODE 40064806510C350B
1730        CODE 0002350B000C3506
1740        CODE 2F062A0628063506
1750        CODE 2F062A0628062F06
1760        CODE 2A06280623062F06
1770        CODE 2A06280623062808
1780        CODE 2A082D082A081F08
1790        CODE 23082824000C
1800        CODE 0000
1810        POINTER DATA2
1820        CODE 0030000C350B0002
1830        CODE 350B000C0030000C
1840        CODE 4018000C00300030
1850        CODE 003000300030000C
1860        CODE 350B0002350B000C
1870        CODE 0030000C4018000C
1880        CODE 0030003000300030
1890        CODE 0000
1900        POINTER DATA3
1910        CODE A20C6C060006A20C6C060006
1920        CODE 900C6C0C900C6C0C
1930        CODE AD0C6C060006AD0C6C060006
1940        CODE A20C6C0CA20C6C0C
1950        CODE A20C6C060006A20C6C060006
1960        CODE D90C790CD90C790C
1970        CODE D90C79060006D90C79060006
1980        CODE A20C6C0CA20C6C0C
1990        CODE A20C6C060006A20C6C060006
2000        CODE 900C6C0C900C6C0C
2010        CODE AD0C6C060006AD0C6C060006
2020        CODE A20C6C0CA20C6C0C
2030        CODE A20C6C060006A20C6C060006
2040        CODE F30C90060006F30C90060006
2050        CODE D91079080008D9087908
2060        CODE A20C6C0B00026C0B000C
2070        CODE 0000
2080        POINTER DATA4
2090        CODE 000C8006001280060006
2100        CODE 000C790C000C790C
2110        CODE 000C79060012790C
2120        CODE 000C800C000C800C
2130        CODE 000C8006001280060006
2140        CODE 000CAD0C000CAD0C
2150        CODE 000CAD060012AD060006
2160        CODE 000C800C000C800C
2170        CODE 000C8006001280060006
2180        CODE 000C790C000C790C
2190        CODE 000C79060012790C
2200        CODE 000C800C000C800C
2210        CODE 000C8006001280060006
2220        CODE 000CC1060012C1060006
2230        CODE 0010AD080010AD08
2240        CODE 000C8018000C
2250        CODE 0000
