diff --git a/applecorn.po b/applecorn.po index 6a20974..c84f0d3 100644 Binary files a/applecorn.po and b/applecorn.po differ diff --git a/auxmem.init.s b/auxmem.init.s index c193116..3e43e3b 100644 --- a/auxmem.init.s +++ b/auxmem.init.s @@ -290,7 +290,7 @@ BYTE00 BEQ BYTE00A ; OSBYTE 0,0 - generate error RTS ; %000x1xxx host type, 'A'pple BYTE00A BRK DB $F7 -HELLO ASC 'Applecorn MOS 2022-11-21' +HELLO ASC 'Applecorn MOS 2022-11-22' DB $00 ; Unify MOS messages * TO DO: Move into RAM GSSPEED DB $00 ; $80 if GS is fast, $00 for slow diff --git a/mainmem.audio.s b/mainmem.audio.s index f2e2cca..26e59d0 100644 --- a/mainmem.audio.s +++ b/mainmem.audio.s @@ -510,6 +510,13 @@ CHECK4BYTES PHX RTS +* Stop the sound device (no more interrupts) +AUDIOSTOP LDA AUDIOCARD + BEQ :MOCK + JMP ENSQSTOP +:MOCK JMP MOCKSTOP + + * Configure an oscillator to play a note * On entry: X - oscillator number 0-3 , A - frequency, Y - amplitude * Preserves all registers @@ -525,8 +532,7 @@ AUDIONOTE PHA * Adjust frequency of oscillator * On entry: X - oscillator number 0-3 , Y - frequency to set * Preserves X & Y -AUDIOFREQ - LDA AUDIOCARD +AUDIOFREQ LDA AUDIOCARD BEQ :MOCK JMP ENSQFREQ :MOCK JMP MOCKFREQ @@ -535,8 +541,7 @@ AUDIOFREQ * Adjust amplitude of oscillator * On entry: X - oscillator number 0-3 , Y - amplitude to set * Preserves X & Y -AUDIOAMP - LDA AUDIOCARD +AUDIOAMP LDA AUDIOCARD BEQ :MOCK JMP ENSQAMP :MOCK JMP MOCKAMP diff --git a/mainmem.ensq.s b/mainmem.ensq.s index 197f8ba..c05b7a6 100644 --- a/mainmem.ensq.s +++ b/mainmem.ensq.s @@ -69,6 +69,14 @@ ENSQSILENT LDY #$00 ; Amplitude RTS +* Stop Ensoniq interrupt +ENSQSTOP JSR ENSQSILENT + LDX #$A4 ; Control register for osc #4 + LDY #$00 ; Free run, no IRQ, start + JSR ENSQWRTDOC + RTS + + * Configure an Ensoniq oscillator to play a note * On entry: X - oscillator number 0-3 , A - frequency, Y - amplitude * Preserves all registers diff --git a/mainmem.fsequ.s b/mainmem.fsequ.s index c1c4f13..fd6595a 100644 --- a/mainmem.fsequ.s +++ b/mainmem.fsequ.s @@ -38,6 +38,7 @@ FBEND EQU FILEBLK+14 ; End address for SAVE * ProDOS MLI command numbers ALLOCCMD EQU $40 +DEALLOCCMD EQU $41 QUITCMD EQU $65 GTIMECMD EQU $82 CREATCMD EQU $C0 diff --git a/mainmem.lists.s b/mainmem.lists.s index c7a0b76..9156741 100644 --- a/mainmem.lists.s +++ b/mainmem.lists.s @@ -114,3 +114,6 @@ ALLOCPL HEX 02 ; Number of parameters DB $00 ; Interrupt number returned here DW $0000 ; Pointer to ISR +DEALLOCPL HEX 01 ; Number of parameters + DB $01 ; Interrupt number + diff --git a/mainmem.mock.s b/mainmem.mock.s index 30cea38..3093b3a 100644 --- a/mainmem.mock.s +++ b/mainmem.mock.s @@ -71,9 +71,9 @@ MOCKINIT LDA #$FF ; All VIA pins output SEI LDA #$40 ; Configure VIA interrupt STA MOCK_6522_ACR - LDA #$7F + LDA #$7F ; Clear all bits STA MOCK_6522_IER - LDA #$C0 + LDA #$C0 ; Set bit 6 STA MOCK_6522_IFR STA MOCK_6522_IER LDA #$F4 ; $27F4 => 100Hz @@ -94,6 +94,18 @@ MOCKSILENT LDX #13 ; Clear all 14 AY-3 regs RTS +* Stop Mockingboard interrupt +MOCKSTOP JSR MOCKSILENT + LDA #$7F ; Clear all bits + STA MOCK_6522_IER + LDA ALLOCPL+1 ; Interrupt number + STA DEALLOCPL+1 + JSR MLI ; Deallocate ISR + DB DEALLOCCMD + DW DEALLOCPL + RTS + + * Configure a Mockingboard oscillator to play a note * On entry: X - oscillator number 0-3, A - frequency, Y - amplitude * Preserves all registers diff --git a/mainmem.svc.s b/mainmem.svc.s index efc2306..987e136 100644 --- a/mainmem.svc.s +++ b/mainmem.svc.s @@ -939,7 +939,8 @@ CHKNOTFND CMP #$44 ; Convert ProDOS 'not found' * Quit to ProDOS -QUIT INC PWRDUP ; Invalidate powerup byte +QUIT JSR AUDIOSTOP ; Shut down audio, dereg ISR + INC PWRDUP ; Invalidate powerup byte STA PAGE1 ; PAGE2 off STA CLRALTCHAR ; Alt font off JSR MLI