8-Bit Software Online Conversion
:0.$.peak - Listing
10ENVELOPE1,129,0,0,0,2,5,10,40,-5,-2
,-3,80,60
20ENVELOPE2,129,0,0,0,1,5,5,126,-2,-4
,-3,60,40
30ENVELOPE3,129,0,0,0,10,5,10,15,-2,-
5,-3,100,90
40:
50DEFFNN="Peak"
60:
70CopperPointer=&72
80fade=&74
90sindex=&76
100must=&78
110ch0roll=&7A:ch1roll=&7B:ch2roll=&7C
120musik=&1200
130:
140FOR pass=0 TO 2 STEP 2
150I%=0
160P%=&A00
170[OPT pass
180:
260.CopperWare
270SEI
280LDA &206
290STA oldvector+1
300LDA &207
310STA oldvector+2
320LDA #CopperCore MOD256
330STA &206
340LDA #CopperCore DIV256
350STA &207
360LDA #Flyback MOD256
370STA &220
380LDA #Flyback DIV256
390STA &221
400CLI
410RTS
420:
430.CopperCore
440LDA &FC
450PHA
460TXA
470PHA
480TYA
490PHA
500LDA &FE6D
510AND #32
520BEQ exit
530LDY CopperPointer
540LDA CopperList,Y
550STA jumpadr+1
560INY
570ORA CopperList,Y
580BEQ exit
590LDA #&DF
600AND &FE6B
610STA &FE6B
620LDA #&A0
630STA &FE6D
640STA &FE6E
650LDA CopperList,Y
660STA jumpadr+2
670INY
680LDA CopperList,Y
690STA &FE68
700INY
710LDA CopperList,Y
720STA &FE69
730INC CopperPointer
740INC CopperPointer
750INC CopperPointer
760INC CopperPointer
770SEI
780.jumpadr
790JSR &FFFF
800CLI
810.exit
820PLA
830TAY
840PLA
850TAX
860PLA
870STA &FC
880.oldvector
890JMP &FFFF
900:
910.Flyback
920PHA
930CMP #4
940BNE out
950LDA #0
960STA CopperPointer
970LDA CopperList
980ORA CopperList+1
990BEQ out
1000LDA #2
1010STA CopperPointer
1020LDA #&DF
1030AND &FE6B
1040STA &FE6B
1050LDA #&A0
1060STA &FE6D
1070STA &FE6E
1080LDA CopperList
1090STA &FE68
1100LDA CopperList+1
1110STA &FE69
1120.out
1130PLA
1140RTS
1150:
1160.Black LDA#7:STA&FE21:RTS
1170.Red LDA#6:STA&FE21:RTS
1180.Green LDA#5:STA&FE21:LDA#1:STA&FE0
0:LDA#80:STA&FE01:RTS
1190.Blank LDA#7:STA&FE21:LDA#1:STA&FE0
0:LDA#0:STA&FE01:RTS
1200.Full LDA#1:STA&FE00:LDA#80:STA&FE0
1:LDA#7:STA&FE21:RTS
1210.ch0 LDA#6:STA&FE21:LDA#1:STA&FE00:
LDAch0roll:STA&FE01:BEQch0end:DECch0roll
:.ch0end RTS
1220.ch1 LDA#5:STA&FE21:LDA#1:STA&FE00:
LDAch1roll:STA&FE01:BEQch1end:DECch1roll
:.ch1end RTS
1230.ch2 LDA#4:STA&FE21:LDA#1:STA&FE00:
LDAch2roll:STA&FE01:BEQch2end:DECch2roll
:.ch2end RTS
1240:
1250.musicon
1260LDA#musik MOD256
1270STAsindex:STAmust
1280LDA#musik DIV256
1290STAsindex+1:STAmust+1
1300RTS
1310:
1320.music
1330LDAfade
1340BEQplayit
1350RTS
1360.playit
1370LDY#0
1380LDA(sindex),Y:CMP#255:BNEokkk:STAfa
de:LDAmust:STAsindex:LDAmust+1:STAsindex
+1:.okkk
1390LDA#128:LDX#248:JSR&FFF4:CPX#&F:BCC
noev
1400LDA#&02:STAblock+1:.dur LDA#4:STAbl
ock+6:LDA#0:STAblock+7:STAblock+5:STAblo
ck+3
1410STAblock:TAY
1420LDA(sindex),Y:STAblock+4
1430INY:LDA(sindex),Y:STAblock+2
1440JSRbip
1450LDY#2
1460TYA:STAblock
1470LDA(sindex),Y:STAblock+4
1480INY:LDA(sindex),Y:STAblock+2
1490JSRbip
1500LDY#4
1510LDA#3:STAblock
1520LDA(sindex),Y:STAblock+4
1530INY:LDA(sindex),Y:STAblock+2
1540JSRbip
1550CLC:LDAsindex:ADC#6:STAsindex:LDAsi
ndex+1:ADC#0:STAsindex+1
1560.noev
1570RTS
1580:
1590.bip
1600LDAblock:BEQchk0:CMP#2:BEQchk1:LDAb
lock+2:BEQbip2:LDA#80:STAch2roll:BNEbip2
1610.chk0 LDAblock+2:BEQbip2:LDA#80:STA
ch0roll:BNEbip2
1620.chk1 LDAblock+2:BEQbip2:LDA#80:STA
ch1roll
1630.bip2
1640LDX#block MOD256
1650LDY#block DIV256
1660LDA#7
1670JMP&FFF1
1680:
1690.block EQUW 0:EQUW 0:EQUW 0:EQUW 0
1700:
1710:
1720:
1730:
1740:
1750:
1760:
1770.CopperList
1775OPT FNScanIRQ(music,10)
1790OPT FNScanIRQ(Blank,90)
1800OPT FNScanIRQ(ch0,100)
1810OPT FNScanIRQ(Blank,110)
1820OPT FNScanIRQ(ch1,120)
1830OPT FNScanIRQ(Blank,130)
1840OPT FNScanIRQ(ch2,140)
1850OPT FNScanIRQ(Blank,150)
1860OPT FNScanIRQ(Full,170)
1880OPT FNLoop
1890:
1900]
1910NEXT
1920*L.music 1200
1930?fade=1:?ch0roll=0:?ch1roll=0:?ch2r
oll=0
1940CALL musicon
1950CALL CopperWare
1960*FX14,4
1970MODE1
1980VDU28,0,11,39,0
1990CHAIN"ANYM"
2000END
2010:
2020DEFFNLoop
2030!P%=&00001000
2040P%=P%+4
2050=pass
2060:
2070DEFFNScanIRQ(a%,v%)
2080w%=v%
2090v%=(v%-I%)*78.125
2100I%=w%
2110?P%=v% MOD256
2120?(P%+1)=v% DIV256
2130?(P%+2)=a% MOD256
2140?(P%+3)=a% DIV256
2150P%=P%+4
2160=pass