C64 Software  <  SCA: The C64 Software Collection / SP.2

  Run
1000              ;
1010              ;SOUNDPLAYER
1020              ;
1030              ORG $5000
1040              ;
1050 SOUND        EQU $4002
1051 SOUNDINIT    EQU $4022
1052 SOUNDFLAG    EQU 1024
1060              ;
1070 ANFANG       SEI
1080              LDA #<MAIN
1090              STA 788
1100              LDA #>MAIN
1110              STA 789
1120              LDA #127
1130              STA 56333
1140              LDA #100 ; RASTER
1150              STA 53266
1160              LDA #27
1170              STA 53265
1180              LDA #129
1190              STA 53274
1200              JSR SOUNDINIT
1210              CLI
1220              ;
1230 NEUSOUND     JSR 65508
1240              BEQ END
1250              SEC
1260              SBC #49 ; '1' -> #0
1270              CMP #7
1280              BPL END
1290              JSR COPYSOUND
1300 END          JMP NEUSOUND
1310              ;
1320              ;
1330 COPYSOUND    LDX #1
1340              STX SOUNDFLAG
1350              ASL
1360              ASL
1370              ASL
1380              ASL
1390              CLC
1400              ADC #$90 ; 1.SOUND
1410              STA 253
1420              LDY #0
1430              STY 252
1440              STY 254
1450              LDX #$40
1460              STX 255
1470              LDX #16
1480 COPY         LDA (252),Y
1490              STA (254),Y
1500              INY
1510              BNE COPY
1520              INC 253
1530              INC 255
1540              DEX
1550              BNE COPY
1560              STX SOUNDFLAG
1561              JSR SOUNDINIT
1570              RTS
1580              ;
1590              ;
1600              ;
1610 MAIN         LDA #1
1620              STA 53273
1630              INC 53280
1640              LDA SOUNDFLAG
1650              BNE NOSOUND
1660              JSR SOUND
1670 NOSOUND      DEC 53280
1680              JMP $EA31
1690              PLA
1700              TAY
1710              PLA
1720              TAX
1730              PLA
1740              RTI
1750              ;
1760              ;
1770              ;
READY.