diff --git a/applecorn.po b/applecorn.po index 1570116..b72f590 100644 Binary files a/applecorn.po and b/applecorn.po differ diff --git a/mainmem.audio.s b/mainmem.audio.s index d52f845..b2592e9 100644 --- a/mainmem.audio.s +++ b/mainmem.audio.s @@ -444,7 +444,7 @@ AUDIOISR INC SYSCLOCK+0 ; Increment system clock PLA ; Recover frequency STA CURRPITCH,X ; Store for pitch envelope PLY ; Recover amplitude - JSR ENSQNOTE ; Start note playing + JSR AUDIONOTE ; Start note playing :NEXT DEX BPL :L1 ; Next audio queue @@ -459,7 +459,7 @@ AUDIOISR INC SYSCLOCK+0 ; Increment system clock :NOENV DEX BPL :L2 ; Next audio queue CLC - RTL + RTS :HOLDSET JSR REMAUDIO ; Dequeue amplitude/env (ignored) JSR REMAUDIO ; Dequeue frequency (ignored) JSR REMAUDIO ; Dequeue duration @@ -471,7 +471,7 @@ AUDIOISR INC SYSCLOCK+0 ; Increment system clock :CNT DB $05 ; Used to determine 20Hz cycles -* Helper function for ENSQISR - called when no note playing +* Helper function for AUDIOISR - called when no note playing * On entry: X is audio channel # NONOTE LDA CHANENV,X ; See if envelope is in effect CMP #$FF @@ -479,14 +479,14 @@ NONOTE LDA CHANENV,X ; See if envelope is in effect STZ CURRAMP,X ; Next env will start at zero vol LDY #$00 ; Zero volume LDA #$00 ; Zero freq - JSR ENSQNOTE ; Silence channel Y + JSR AUDIONOTE ; Silence channel Y RTS :RELEASE LDA #3 ; Phase 3 is release phase STA AMPSECT,X ; Force release phase RTS -* Helper function for ENSQISR +* Helper function for AUDIOISR * On entry: X is audio channel # * On return: CS if there are <= 4 bytes in queue, CC otherwise * X is preserved @@ -508,6 +508,30 @@ CHECK4BYTES PHX RTS +* Configure an oscillator to play a note +* On entry: X - oscillator number 0-3 , A - frequency, Y - amplitude +* Preserves all registers +AUDIONOTE + JMP ENSQNOTE +* JMP MOCKNOTE + + +* Adjust frequency of oscillator +* On entry: X - oscillator number 0-3 , Y - frequency to set +* Preserves X & Y +AUDIOFREQ + JMP ENSQFREQ +* JMP MOCKFREQ + + +* Adjust amplitude of oscillator +* On entry: X - oscillator number 0-3 , Y - amplitude to set +* Preserves X & Y +AUDIOAMP + JMP ENSQAMP +* JMP MOCKAMP + + * Handle envelope tick counter * On entry: X is audio channel # * On return: CS if this cycle is an envelope tick, CC otherwise. @@ -618,7 +642,7 @@ UPDPITCH STX OSCNUM ADC CURRPITCH,X ; Add change to current STA CURRPITCH,X ; Update TAY - JSR ENSQFREQ ; Update Ensoniq regs + JSR AUDIOFREQ ; Update Ensoniq regs RTS @@ -706,7 +730,7 @@ ADSRPHASE STX OSCNUM :CLAMP LDA :TARGET ; Recover target level :UPDATE STA CURRAMP,X ; Store updated amplitude TAY ; Tell the Ensoniq - JSR ENSQAMP + JSR AUDIOAMP :DONE CLC ; CC to indicate phase continues RTS :TARGET DB $00 diff --git a/mainmem.ensq.s b/mainmem.ensq.s index cb1407f..0ee9fbb 100644 --- a/mainmem.ensq.s +++ b/mainmem.ensq.s @@ -156,7 +156,8 @@ ENSQAMP PHX * Ensoniq interrupt service routine - just calls generic audio ISR ENSQISR CLD - JMP AUDIOISR + JSR AUDIOISR + RTL ** diff --git a/mainmem.init.s b/mainmem.init.s index 15dfe40..d43ea49 100644 --- a/mainmem.init.s +++ b/mainmem.init.s @@ -37,5 +37,7 @@ RESETHW SEC JSR IDROUTINE ; See if this is a GS BCS :NOTGS JSR ENSQINIT ; Initialize Ensoniq -:NOTGS RTS +:NOTGS +* JSR MOCKINIT ; Initialize Mockingboard (sl4) + RTS diff --git a/mainmem.mock.s b/mainmem.mock.s index dbc10ac..e922366 100644 --- a/mainmem.mock.s +++ b/mainmem.mock.s @@ -130,7 +130,11 @@ MOCKAMP PHX * Mockingboard interrupt service routine - just calls generic audio ISR MOCKISR CLD - JMP AUDIOISR +* TODO: Check whether interrupt is from Mockingboard or not + BIT MOCK_6522_T1CL ; Clear interrupt +* JSR AUDIOISR + CLC ; CC indicates we serviced irq + RTS **