home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Magazine 5
/
Mega_Magazine_05_19xx___nl_Side_B.atr
/
sampling.lzh
/
PLAY6BIT.SRC
< prev
next >
Wrap
Text File
|
1988-09-01
|
3KB
|
172 lines
*************************************
* *
* - SAMPLE PLAYER - *
* *
* >>>> 6-BITS <<<< *
* USES THE TABLE FROM SOUNDTRACKER! *
* THANX TO THE MAKERS FOR THE TABLE *
* *
* (C)1992 FRANKENSTEIN *
* *
*************************************
SPBEG EQU $0700
SPEND EQU $B7FF
SPL EQU $F2 (AND $F3)
END EQU $F4 (AND $F5)
ZPAGE EQU $F6
SPEED EQU $0600
ORG $B800
LDA #SPBEG:L
STA SPL
LDA #SPBEG:H
STA SPL+1
LDA #SPEND:L
STA END
LDA #SPEND:H
STA END+1
*------------------------------------
* MAIN LOOP
*------------------------------------
JSR INTOFF
LDA #0
STA $D400
JSR PLAY
JSR INTON
RTS
*------------------------------------
* INTERRUPTS OFF
*------------------------------------
INTOFF LDA #0
STA $D20E
STA $D40E
RTS
*------------------------------------
* INTERRUPTS ON
*------------------------------------
INTON LDA 16
STA $D20E
LDA #$C0
STA $D40E
RTS
*------------------------------------
* THIS ROUTINE PLAYS 8-BIT SAMPLES
* (IT PLAYS THE UPPER 6-BITS ONLY!)
*------------------------------------
PLAY LDY #0
RUN LDA (SPL),Y
LSR
LSR
TAX
LDA VOL0,X
STA ZPAGE
LDA VOL1,X
TAY
LDA VOL2,X
TAX
LDA ZPAGE
STA $D201
STY $D203
STX $D205
LDX SPEED
DELAY DEX
BNE DELAY
INC SPL
BNE SKIPHI
INC SPL+1
SKIPHI LDA SPL+1
CMP END+1
BNE PLAY
LDA SPL
CMP END
BNE PLAY
RTS
* VOLUME LOOKUP TABLE
VOL0 DFB $10,$10,$11,$11
DFB $11,$12,$11,$12
DFB $13,$12,$14,$13
DFB $14,$13,$15,$14
DFB $15,$13,$16,$14
DFB $15,$15,$18,$16
DFB $18,$16,$19,$17
DFB $1A,$15,$1C,$17
DFB $1D,$17,$19,$17
DFB $1C,$1B,$18,$1E
DFB $1A,$19,$1B,$1C
DFB $1C,$1B,$1F,$1D
DFB $1C,$1C,$1C,$1B
DFB $1D,$1C,$1D,$1C
DFB $1B,$1D,$1F,$1E
DFB $1E,$1F,$1F,$1F
DFB $00
VOL1 DFB $10,$10,$10,$10
DFB $11,$10,$11,$11
DFB $11,$11,$10,$11
DFB $11,$12,$11,$12
DFB $11,$13,$11,$12
DFB $13,$14,$11,$12
DFB $12,$13,$12,$14
DFB $12,$15,$11,$14
DFB $11,$15,$15,$16
DFB $12,$15,$15,$12
DFB $18,$16,$16,$18
DFB $15,$17,$15,$1A
DFB $1A,$1B,$1B,$1A
DFB $18,$1A,$1D,$1B
DFB $1B,$1B,$1E,$1E
DFB $1E,$1D,$1E,$1F
DFB $00
VOL2 DFB $10,$10,$10,$10
DFB $10,$10,$11,$10
DFB $10,$11,$10,$11
DFB $10,$11,$10,$10
DFB $11,$12,$11,$12
DFB $11,$10,$10,$12
DFB $10,$12,$10,$11
DFB $10,$13,$10,$13
DFB $10,$13,$11,$13
DFB $12,$11,$14,$12
DFB $10,$14,$13,$10
DFB $14,$14,$13,$10
DFB $12,$12,$13,$16
DFB $17,$17,$14,$18
DFB $1B,$1A,$17,$19
DFB $1B,$1D,$1E,$1F
DFB $00¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯