More Mockingboard code - still not complete.

This commit is contained in:
Bobbi Webber-Manners 2022-11-18 18:29:36 -05:00
parent 1afcae2025
commit b9612ce1b3
5 changed files with 41 additions and 47 deletions

Binary file not shown.

View File

@ -121,7 +121,7 @@ ENSQNOTE PHA
* Adjust frequency of note already playing
* On entry: Y - frequency to set
* On entry: X - oscillator number 0-3, Y - frequency to set
* Preserves X & Y
ENSQFREQ PHX
PHY ; Gonna need it again
@ -143,7 +143,7 @@ ENSQFREQ PHX
* Adjust amplitude of note already playing
* On entry: Y - amplitude to set
* On entry: X - oscillator number 0-3, Y - amplitude to set
* Preserves X & Y
ENSQAMP PHX
PHY ; Gonna need it again
@ -155,7 +155,8 @@ ENSQAMP PHX
RTS
* Ensoniq interrupt service routine - just calls generic audio ISR
ENSQISR JMP AUDIOISR
ENSQISR CLD
JMP AUDIOISR
**

View File

@ -37,6 +37,7 @@ FBATTR EQU FILEBLK+14 ; Attributes
FBEND EQU FILEBLK+14 ; End address for SAVE
* ProDOS MLI command numbers
ALLOCCMD EQU $40
QUITCMD EQU $65
GTIMECMD EQU $82
CREATCMD EQU $C0

View File

@ -110,33 +110,7 @@ QUITPL HEX 04 ; Number of parameters
DB $00
DW $0000
ALLOCPL HEX 02 ; Number of parameters
DB $00 ; Interrupt number returned here
DW $0000 ; Pointer to ISR

View File

@ -57,10 +57,13 @@ MOCKINIT LDA #$FF ; All VIA pins output
LDA #MOCK_AY_INACTIVE
STA MOCK_6522_ORB2
LDA #<MOCKISR ; Setup interrupt handler
STA A2IRQV+0 ; TODO: Should chain existing handler
LDA #<MOCKISR ; Set up ISR with ALLOC_INTERRUPT
STA ALLOCPL+2
LDA #>MOCKISR
STA A2IRQV+1
STA ALLOCPL+3
JSR MLI
DB ALLOCCMD
DW ALLOCPL
PHP
SEI
@ -87,32 +90,47 @@ MOCKSILENT LDX #13 ; Clear all 14 AY-3 regs
* Configure a Mockingboard oscillator to play a note
* On entry: X - oscillator number 0-3 , A - frequency, Y - amplitude
* On entry: X - oscillator number 0-3, A - frequency, Y - amplitude
* Preserves all registers
MOCKNOTE ; TODO
RTS
* Adjust frequency of note already playing
* On entry: Y - frequency to set
* On entry: X - oscillator number 0-3, Y - frequency to set
* Preserves X & Y
MOCKFREQ ; TODO
RTS
* Adjust amplitude of note already playing
* On entry: Y - amplitude to set
* Preserves X & Y
MOCKAMP PHX
PHY ; Gonna need it again
MOCKFREQ PHX
PHY
; TODO
PLY
PLX
RTS
* Adjust amplitude of note already playing
* On entry: X - oscillator number 0-3, Y - amplitude to set
* Preserves X & Y
MOCKAMP PHX
PHY
CPX #$00 ; Noise channel
BEQ :DONE ; Has no amplitude
TXA ; Add 7 to get register
CLC
ADC #7
TAX
TYA ; Amplitude 0..127
LSR ; Divide by 8
LSR
LSR ; Now 0..15
JSR MOCKWRT ; Write value to AY-3 register
PLY
PLX
:DONE RTS
* Mockingboard interrupt service routine - just calls generic audio ISR
MOCKISR JMP AUDIOISR
MOCKISR CLD
JMP AUDIOISR
**