mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-06-25 00:31:11 +00:00
Adds support for Mockingboard noise channel. WIP!
This commit is contained in:
parent
6b9ab9af0f
commit
1c3d849cc3
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
|
@ -83,12 +83,15 @@ MOCKINIT LDA #$FF ; All VIA pins output
|
||||||
* Silence all channels
|
* Silence all channels
|
||||||
MOCKSILENT LDX #13 ; Clear all 14 AY-3 regs
|
MOCKSILENT LDX #13 ; Clear all 14 AY-3 regs
|
||||||
LDA #$00
|
LDA #$00
|
||||||
:L0 JSR MOCKWRT
|
:L0 JSR MOCKWRT1
|
||||||
|
JSR MOCKWRT2
|
||||||
DEX
|
DEX
|
||||||
BPL :L0
|
BPL :L0
|
||||||
LDA #$38 ; Turn off noise
|
LDA #$38 ; Turn off noise
|
||||||
LDX #07
|
LDX #07
|
||||||
JSR MOCKWRT
|
JSR MOCKWRT1 ; First AY-3
|
||||||
|
LDA #$14 ; A,B=tone; C=noise
|
||||||
|
JSR MOCKWRT2 ; Second AY-3
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,17 +125,22 @@ MOCKNOTE PHA
|
||||||
* Preserves X & Y
|
* Preserves X & Y
|
||||||
MOCKFREQ PHX
|
MOCKFREQ PHX
|
||||||
CPX #$00 ; Noise channel
|
CPX #$00 ; Noise channel
|
||||||
BEQ :DONE ; TODO: IGNORE NOISE FOR NOW
|
BEQ :NOISE
|
||||||
TXA
|
TXA
|
||||||
DEC A ; Subtract 1
|
DEC A ; Subtract 1
|
||||||
ASL ; Double to get fine register
|
ASL ; Double to get fine register
|
||||||
TAX
|
TAX
|
||||||
LDA MFREQLOW,Y ; LSB of divider
|
LDA MFREQLOW,Y ; LSB of divider
|
||||||
JSR MOCKWRT ; Write value to AY-3 register
|
JSR MOCKWRT1 ; Write value to AY-3 register
|
||||||
INX ; Add one for course register
|
INX ; Add one for course register
|
||||||
LDA MFREQHIGH,Y ; MSB of divider
|
LDA MFREQHIGH,Y ; MSB of divider
|
||||||
JSR MOCKWRT ; Write value to AY-3 register
|
JSR MOCKWRT1 ; Write value to AY-3 register
|
||||||
:DONE PLX
|
PLX
|
||||||
|
RTS
|
||||||
|
:NOISE LDX #6 ; Noise period register
|
||||||
|
TYA ; TODO TEMPORARY HACK
|
||||||
|
JSR MOCKWRT2 ; Write value to AY-3 register
|
||||||
|
PLX
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,7 +149,7 @@ MOCKFREQ PHX
|
||||||
* Preserves X & Y
|
* Preserves X & Y
|
||||||
MOCKAMP PHX
|
MOCKAMP PHX
|
||||||
CPX #$00 ; Noise channel
|
CPX #$00 ; Noise channel
|
||||||
BEQ :DONE ; Has no amplitude
|
BEQ :NOISE
|
||||||
TXA ; Add 7 to get register
|
TXA ; Add 7 to get register
|
||||||
CLC
|
CLC
|
||||||
ADC #7
|
ADC #7
|
||||||
|
@ -151,18 +159,24 @@ MOCKAMP PHX
|
||||||
LSR
|
LSR
|
||||||
LSR
|
LSR
|
||||||
LSR ; Now 0..15
|
LSR ; Now 0..15
|
||||||
JSR MOCKWRT ; Write value to AY-3 register
|
JSR MOCKWRT1 ; Write value to AY-3 register
|
||||||
:DONE PLX
|
PLX
|
||||||
|
RTS
|
||||||
|
:NOISE LDX #10 ; Chan C
|
||||||
|
TYA ; Amplitude 0..255
|
||||||
|
LSR ; Divide by 16
|
||||||
|
LSR
|
||||||
|
LSR
|
||||||
|
LSR ; Now 0..15
|
||||||
|
JSR MOCKWRT2 ; Write value to AY-3 register
|
||||||
|
PLX
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
* Mockingboard interrupt service routine - just calls generic audio ISR
|
* Mockingboard interrupt service routine - just calls generic audio ISR
|
||||||
MOCKISR CLD
|
MOCKISR CLD
|
||||||
BIT MOCK_6522_IFR ; See if interrupt was from MB
|
* TODO: Check whether interrupt is from Mockingboard or not
|
||||||
BMI :MOCK ; Yes
|
BIT MOCK_6522_T1CL ; Clear interrupt
|
||||||
SEC ; We did not service irc
|
|
||||||
RTS
|
|
||||||
:MOCK BIT MOCK_6522_T1CL ; Clear interrupt
|
|
||||||
JSR AUDIOISR
|
JSR AUDIOISR
|
||||||
CLC ; CC indicates we serviced irq
|
CLC ; CC indicates we serviced irq
|
||||||
RTS
|
RTS
|
||||||
|
@ -172,28 +186,43 @@ MOCKISR CLD
|
||||||
** Private functions follow (ie: not part of driver API)
|
** Private functions follow (ie: not part of driver API)
|
||||||
**
|
**
|
||||||
|
|
||||||
* Write to both AY-3s
|
* Write to first AY-3
|
||||||
* On entry: A - value, X - register
|
* On entry: A - value, X - register
|
||||||
* On exit: All regs preserved.
|
* On exit: All regs preserved.
|
||||||
MOCKWRT PHY
|
MOCKWRT1 PHY
|
||||||
STX MOCK_6522_ORA1 ; Latch the address
|
STX MOCK_6522_ORA1 ; Latch the address
|
||||||
STX MOCK_6522_ORA2
|
|
||||||
LDY #MOCK_AY_LATCH_ADDR
|
LDY #MOCK_AY_LATCH_ADDR
|
||||||
STY MOCK_6522_ORB1
|
STY MOCK_6522_ORB1
|
||||||
STY MOCK_6522_ORB2
|
|
||||||
|
|
||||||
LDY #MOCK_AY_INACTIVE ; Go inactive
|
LDY #MOCK_AY_INACTIVE ; Go inactive
|
||||||
STY MOCK_6522_ORB1
|
STY MOCK_6522_ORB1
|
||||||
STY MOCK_6522_ORB2
|
|
||||||
|
|
||||||
STA MOCK_6522_ORA1 ; Write data
|
STA MOCK_6522_ORA1 ; Write data
|
||||||
STA MOCK_6522_ORA2
|
|
||||||
LDY #MOCK_AY_WRITE
|
LDY #MOCK_AY_WRITE
|
||||||
STY MOCK_6522_ORB1
|
STY MOCK_6522_ORB1
|
||||||
STY MOCK_6522_ORB2
|
|
||||||
|
|
||||||
LDY #MOCK_AY_INACTIVE ; Go inactive
|
LDY #MOCK_AY_INACTIVE ; Go inactive
|
||||||
STY MOCK_6522_ORB1
|
STY MOCK_6522_ORB1
|
||||||
|
PLY
|
||||||
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
* Write to second AY-3
|
||||||
|
* On entry: A - value, X - register
|
||||||
|
* On exit: All regs preserved.
|
||||||
|
MOCKWRT2 PHY
|
||||||
|
STX MOCK_6522_ORA2 ; Latch the address
|
||||||
|
LDY #MOCK_AY_LATCH_ADDR
|
||||||
|
STY MOCK_6522_ORB2
|
||||||
|
|
||||||
|
LDY #MOCK_AY_INACTIVE ; Go inactive
|
||||||
|
STY MOCK_6522_ORB2
|
||||||
|
|
||||||
|
STA MOCK_6522_ORA2 ; Write data
|
||||||
|
LDY #MOCK_AY_WRITE
|
||||||
|
STY MOCK_6522_ORB2
|
||||||
|
|
||||||
|
LDY #MOCK_AY_INACTIVE ; Go inactive
|
||||||
STY MOCK_6522_ORB2
|
STY MOCK_6522_ORB2
|
||||||
PLY
|
PLY
|
||||||
RTS
|
RTS
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#mame -w apple2ee -debug -sl5 mouse -sl7 cffa2 -harddisk1 ~/Personal/Development/Applecorn/applecorn.po
|
mame -w apple2ee -debug -sl5 mouse -sl7 cffa2 -harddisk1 ~/Personal/Development/Applecorn/applecorn.po
|
||||||
mame -w apple2gs -debug -sl7 cffa2 -harddisk1 ~/Personal/Development/Applecorn/applecorn.po -harddisk2 tests/JGHMusic2.po
|
#mame -w apple2gs -debug -sl7 cffa2 -harddisk1 ~/Personal/Development/Applecorn/applecorn.po -harddisk2 tests/JGHMusic2.po
|
||||||
|
|
Loading…
Reference in New Issue
Block a user