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 * 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 * Preserves X & Y
ENSQFREQ PHX ENSQFREQ PHX
PHY ; Gonna need it again PHY ; Gonna need it again
@ -143,7 +143,7 @@ ENSQFREQ PHX
* Adjust amplitude of note already playing * 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 * Preserves X & Y
ENSQAMP PHX ENSQAMP PHX
PHY ; Gonna need it again PHY ; Gonna need it again
@ -155,7 +155,8 @@ ENSQAMP PHX
RTS RTS
* Ensoniq interrupt service routine - just calls generic audio ISR * 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 FBEND EQU FILEBLK+14 ; End address for SAVE
* ProDOS MLI command numbers * ProDOS MLI command numbers
ALLOCCMD EQU $40
QUITCMD EQU $65 QUITCMD EQU $65
GTIMECMD EQU $82 GTIMECMD EQU $82
CREATCMD EQU $C0 CREATCMD EQU $C0

View File

@ -110,33 +110,7 @@ QUITPL HEX 04 ; Number of parameters
DB $00 DB $00
DW $0000 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 LDA #MOCK_AY_INACTIVE
STA MOCK_6522_ORB2 STA MOCK_6522_ORB2
LDA #<MOCKISR ; Setup interrupt handler LDA #<MOCKISR ; Set up ISR with ALLOC_INTERRUPT
STA A2IRQV+0 ; TODO: Should chain existing handler STA ALLOCPL+2
LDA #>MOCKISR LDA #>MOCKISR
STA A2IRQV+1 STA ALLOCPL+3
JSR MLI
DB ALLOCCMD
DW ALLOCPL
PHP PHP
SEI SEI
@ -87,32 +90,47 @@ MOCKSILENT LDX #13 ; Clear all 14 AY-3 regs
* Configure a Mockingboard oscillator to play a note * 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 * Preserves all registers
MOCKNOTE ; TODO MOCKNOTE ; TODO
RTS RTS
* Adjust frequency of note already playing * 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 * Preserves X & Y
MOCKFREQ ; TODO MOCKFREQ PHX
RTS PHY
* Adjust amplitude of note already playing
* On entry: Y - amplitude to set
* Preserves X & Y
MOCKAMP PHX
PHY ; Gonna need it again
; TODO ; TODO
PLY PLY
PLX PLX
RTS 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 * Mockingboard interrupt service routine - just calls generic audio ISR
MOCKISR JMP AUDIOISR MOCKISR CLD
JMP AUDIOISR
** **