mirror of
https://github.com/dwsJason/xrick2gs.git
synced 2024-09-27 14:55:06 +00:00
mraudio.s: first pass at the Mr Audio Play function
This commit is contained in:
parent
97302ea065
commit
2b1fc5ea08
@ -165,17 +165,81 @@ iSize equ 3
|
|||||||
phd
|
phd
|
||||||
lda #$C000
|
lda #$C000
|
||||||
tcd
|
tcd
|
||||||
|
xba ; Zero out the high byte
|
||||||
|
|
||||||
rep #$20
|
rep #$21
|
||||||
longa off
|
longa off
|
||||||
longi on
|
longi on
|
||||||
|
|
||||||
* Incrememnt the channel we're going to play on
|
* Incrememnt the channel we're going to play on
|
||||||
|
* Just Round Robin
|
||||||
|
|
||||||
|
lda |channelNo
|
||||||
|
adc #2
|
||||||
|
cmp #30
|
||||||
|
blt channelGood
|
||||||
|
lda #16
|
||||||
|
channelGood ANOP
|
||||||
|
sta |channelNo
|
||||||
|
|
||||||
* Setup Doc for Register Stores on the Appropriate channel
|
* Setup Doc for Register Stores on the Appropriate channel
|
||||||
|
|
||||||
|
lda >$E100CA ; BEEP Volume
|
||||||
|
and #$0F
|
||||||
|
ora #$10 ; Auto Increment
|
||||||
|
sta <$3C ; ACCESS to DOC registers
|
||||||
|
|
||||||
* copy Register Values from the play table
|
* copy Register Values from the play table
|
||||||
|
|
||||||
|
lda |channelNo
|
||||||
|
sta <$3E ; oscillator freq low Register
|
||||||
|
|
||||||
|
lda |iFreq,x
|
||||||
|
sta <$3D
|
||||||
|
sta <$3D
|
||||||
|
|
||||||
|
lda |channelNo
|
||||||
|
ora #$20
|
||||||
|
sta <$3E ; Freq High Register
|
||||||
|
lda |iFreq+1,x
|
||||||
|
sta <$3D
|
||||||
|
sta <$3D
|
||||||
|
|
||||||
|
lda |channelNo
|
||||||
|
ora #$40 ; Volume Register
|
||||||
|
sta <$3E
|
||||||
|
|
||||||
|
lda #$FF ; Volume
|
||||||
|
sta <$3D
|
||||||
|
sta <$3D
|
||||||
|
|
||||||
|
lda |channleNo
|
||||||
|
ora #$80 ; Address Register
|
||||||
|
sta <$3E
|
||||||
|
|
||||||
|
lda |iAddress,x
|
||||||
|
sta <$3D
|
||||||
|
sta <$3D
|
||||||
|
|
||||||
|
lda |channelNo
|
||||||
|
ora #$C0 ; Size Register
|
||||||
|
sta <$3E
|
||||||
|
|
||||||
|
lda |iSize,x
|
||||||
|
sta <$3D
|
||||||
|
sta <$3D
|
||||||
|
|
||||||
|
lda |channelNo
|
||||||
|
ora #$A0 ; Oscillator Control Register
|
||||||
|
sta <$3E
|
||||||
|
|
||||||
|
* Store the Controls to make the Osciallors go
|
||||||
|
|
||||||
|
lda #$02 ; left single shot
|
||||||
|
sta <$3D
|
||||||
|
ora #$12 ; right single shot
|
||||||
|
sta <$3D
|
||||||
|
|
||||||
* play the audio
|
* play the audio
|
||||||
|
|
||||||
pld
|
pld
|
||||||
@ -192,6 +256,7 @@ iSize equ 3
|
|||||||
plb
|
plb
|
||||||
|
|
||||||
rtl
|
rtl
|
||||||
|
channelNo dc i'16'
|
||||||
*-------------------------------------------------------------------------------
|
*-------------------------------------------------------------------------------
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user