mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-12-29 05:29:28 +00:00
SOUND commands now enqueue stuff. Proof of principle.
This commit is contained in:
parent
67b2972dcf
commit
aeda12e9af
@ -4,7 +4,12 @@
|
||||
* Applecorn audio code
|
||||
*
|
||||
|
||||
SNDBUFSZ EQU 16 ; All audio buffers are 16 bytes
|
||||
* Sound buffers in aux LC for now
|
||||
* Not sure where to move them to
|
||||
SNDBUF0 DS 16
|
||||
SNDBUF1 DS 16
|
||||
SNDBUF2 DS 16
|
||||
SNDBUF3 DS 16
|
||||
|
||||
* Get address of sound buffer
|
||||
* On entry: X is buffer number
|
||||
@ -43,7 +48,7 @@ INSHND PHP ; Save flags, turn off interrupts
|
||||
PHA
|
||||
LDY ENDINDICES,X ; Get input pointer
|
||||
INY ; Next byte
|
||||
CPY #SNDBUFSZ
|
||||
CPY #16
|
||||
BNE :NOTEND ; See if it's the end
|
||||
LDY #0 ; If so, wraparound
|
||||
:NOTEND TYA
|
||||
@ -62,3 +67,31 @@ INSHND PHP ; Save flags, turn off interrupts
|
||||
SEC ; Exit with carry set
|
||||
RTS
|
||||
|
||||
|
||||
* OSBYTE &07 - Make a sound
|
||||
* On entry: (OSCTRL),Y points to eight byte parameter block (2 bytes each for
|
||||
* channel, amplitude, pitch, duration)
|
||||
WORD07 INY
|
||||
LDA (OSCTRL),Y ; Get channel number 0-3
|
||||
ORA #$04 ; Convert to buffer number 4-7
|
||||
TAX ; Into X
|
||||
INY ; Point to amplitude LSB
|
||||
LDA (OSCTRL),Y
|
||||
JMP INSHND ; SHOULD CALL THIS THRU VECTOR INSV
|
||||
INY ; Point to amplitude MSB
|
||||
LDA (OSCTRL),Y
|
||||
JMP INSHND ; SHOULD CALL THIS THRU VECTOR INSV
|
||||
INY ; Point to pitch LSB
|
||||
LDA (OSCTRL),Y
|
||||
JMP INSHND ; SHOULD CALL THIS THRU VECTOR INSV
|
||||
INY ; Point to pitch MSB
|
||||
LDA (OSCTRL),Y
|
||||
JMP INSHND ; SHOULD CALL THIS THRU VECTOR INSV
|
||||
INY ; Point to duration LSB
|
||||
LDA (OSCTRL),Y
|
||||
JMP INSHND ; SHOULD CALL THIS THRU VECTOR INSV
|
||||
INY ; Point to duration MSB
|
||||
LDA (OSCTRL),Y
|
||||
JMP INSHND ; SHOULD CALL THIS THRU VECTOR INSV
|
||||
RTS
|
||||
|
||||
|
@ -94,7 +94,7 @@ OSWBASE DW WORD00 ; OSWORD 0 - Read input line
|
||||
DW WORD04 ; OSWORD 4 - Write interval timer
|
||||
DW WORD05 ; OSWORD 5 - Read I/O memory
|
||||
DW WORD06 ; OSWORD 6 - Write I/O memory
|
||||
* DW WORD07 ; OSWORD 7 - SOUND
|
||||
DW WORD07 ; OSWORD 7 - SOUND
|
||||
* DW WORD08 ; OSWORD 8 - ENVELOPE
|
||||
* DW WORD09 ; OSWORD 9 - POINT
|
||||
* DW WORD0A ; OSWORD 10 - Read character bitmap
|
||||
|
@ -92,13 +92,4 @@ OSGBPBCB EQU OSFILECB+1 ; OSGBPB control block
|
||||
* $0300-$03DF
|
||||
* $03E0-$03FF Used for interfacing with ProDOS XFER
|
||||
|
||||
* $0800-$08FF
|
||||
SNDBUF0 EQU $840 ; Sound buffers (16 bytes each)
|
||||
SNDBUF1 EQU $850
|
||||
SNDBUF2 EQU $860
|
||||
SNDBUF3 EQU $870
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user