mraudio.s: first pass at the Mr Audio Play function

This commit is contained in:
dwsJason 2018-11-25 15:32:18 -05:00
parent 97302ea065
commit 2b1fc5ea08
1 changed files with 66 additions and 1 deletions

View File

@ -165,17 +165,81 @@ iSize equ 3
phd
lda #$C000
tcd
xba ; Zero out the high byte
rep #$20
rep #$21
longa off
longi 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
lda >$E100CA ; BEEP Volume
and #$0F
ora #$10 ; Auto Increment
sta <$3C ; ACCESS to DOC registers
* 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
pld
@ -192,6 +256,7 @@ iSize equ 3
plb
rtl
channelNo dc i'16'
*-------------------------------------------------------------------------------
end