POKEY: implement two-tone mode effect
This commit is contained in:
parent
4521cbfb4f
commit
c777d699d2
|
@ -32,3 +32,6 @@ a sound and input chip developed by Atari for their 8-bit computers (Atari 400,
|
|||
- filtered output on channel 2 (I suggest you to set channel 4 volume to 0).
|
||||
- use for PWM effects (not automatic!).
|
||||
- bit 0: 15KHz mode.
|
||||
- 12xx: toggle two-tone mode.
|
||||
- when enabled, channel 2 modulates channel 1. I don't know how, but it does.
|
||||
- only on ASAP core.
|
||||
|
|
|
@ -35,6 +35,7 @@ const char* regCheatSheetPOKEY[]={
|
|||
"AUDF4", "6",
|
||||
"AUDC4", "7",
|
||||
"AUDCTL", "8",
|
||||
"SKCTL", "F",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -154,6 +155,11 @@ void DivPlatformPOKEY::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
|
||||
if (skctlChanged) {
|
||||
skctlChanged=false;
|
||||
rWrite(15,skctl);
|
||||
}
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,parent->song.linearPitch?chan[i].pitch:0,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,parent->song.linearPitch?chan[i].pitch2:0,chipClock,CHIP_DIVIDER);
|
||||
|
@ -320,6 +326,10 @@ int DivPlatformPOKEY::dispatch(DivCommand c) {
|
|||
audctl=c.value&0xff;
|
||||
audctlChanged=true;
|
||||
break;
|
||||
case DIV_CMD_STD_NOISE_FREQ:
|
||||
skctl=c.value?0x8b:0x03;
|
||||
skctlChanged=true;
|
||||
break;
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
int destFreq=NOTE_PERIODIC(c.value2);
|
||||
bool return2=false;
|
||||
|
@ -385,6 +395,7 @@ void DivPlatformPOKEY::forceIns() {
|
|||
chan[i].freqChanged=true;
|
||||
}
|
||||
audctlChanged=true;
|
||||
skctlChanged=true;
|
||||
}
|
||||
|
||||
void* DivPlatformPOKEY::getChanState(int ch) {
|
||||
|
@ -408,7 +419,7 @@ unsigned char* DivPlatformPOKEY::getRegisterPool() {
|
|||
}
|
||||
|
||||
int DivPlatformPOKEY::getRegisterPoolSize() {
|
||||
return 9;
|
||||
return 16;
|
||||
}
|
||||
|
||||
void DivPlatformPOKEY::reset() {
|
||||
|
@ -430,6 +441,8 @@ void DivPlatformPOKEY::reset() {
|
|||
|
||||
audctl=0;
|
||||
audctlChanged=true;
|
||||
skctl=3;
|
||||
skctlChanged=true;
|
||||
}
|
||||
|
||||
bool DivPlatformPOKEY::keyOffAffectsArp(int ch) {
|
||||
|
|
|
@ -48,8 +48,8 @@ class DivPlatformPOKEY: public DivDispatch {
|
|||
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
|
||||
};
|
||||
std::queue<QueuedWrite> writes;
|
||||
unsigned char audctl;
|
||||
bool audctlChanged;
|
||||
unsigned char audctl, skctl;
|
||||
bool audctlChanged, skctlChanged;
|
||||
unsigned char oscBufDelay;
|
||||
PokeyState pokey;
|
||||
AltASAP::Pokey altASAP;
|
||||
|
|
|
@ -1169,6 +1169,7 @@ void DivEngine::registerSystems() {
|
|||
{
|
||||
{0x10, {DIV_CMD_WAVE, "10xx: Set waveform (0 to 7)"}},
|
||||
{0x11, {DIV_CMD_STD_NOISE_MODE, "11xx: Set AUDCTL"}},
|
||||
{0x12, {DIV_CMD_STD_NOISE_FREQ, "12xx: Toggle two-tone mode"}},
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue