Implemented OSWORD &08 (ENVELOPE). No back end yet.

This commit is contained in:
Bobbi Webber-Manners 2022-10-14 22:33:52 -04:00
parent b65d7ff0e7
commit 34d28c4256
3 changed files with 30 additions and 3 deletions

Binary file not shown.

View File

@ -56,9 +56,30 @@ WORD07 LDA (OSCTRL),Y ; Get channel number/flush byte
* OSWORD &08 - Envelope
* On entry: (OSCTRL),Y points to 14 byte parameter block
WORD08
* TODO: IMPLEMENT THIS!!!
RTS
* Supports 4 envelopes for now, could be extended for more
WORD08 LDA (OSCTRL),Y ; Get envelope number
DEC A ; Make it zero-based
CMP #$03 ; Check in range
BPL :RTS ; Ignore if out of range
TAX
LDA #$00
:L0 CPX #$00 ; Calculate EnvNum * 13
BEQ :S1
CLC
ADC #13
DEX
BRA :L0
:S1 TAX ; Dest offset in X
INY ; Skip over env number parm
:L1 LDA (OSCTRL),Y ; Copy CB to mainmem
>>> WRTMAIN
STA ENVBUF0,X
>>> WRTAUX
INY
INX
CPY #14
BNE :L1
:RTS RTS
* Insert value into buffer (INSV)

View File

@ -20,6 +20,12 @@ SND2STARTIDX DB $00
SND3STARTIDX DB $00
STARTINDICES EQU SND0STARTIDX - 4
* Envelope buffers
ENVBUF0 DS 13 ; 13 bytes not including env num
ENVBUF1 DS 13
ENVBUF2 DS 13
ENVBUF3 DS 13
SND0ENDIDX DB $00 ; End indices for sound bufs
SND1ENDIDX DB $00
SND2ENDIDX DB $00