Fix 1701 command for AYPCM

This commit is contained in:
cam900 2022-10-03 11:02:34 +09:00
parent 02e87236ce
commit 3761383f8d
3 changed files with 12 additions and 4 deletions

View File

@ -441,12 +441,14 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
}
chan[c.chan].dac.pos=0;
chan[c.chan].dac.period=0;
chan[c.chan].dac.rate=parent->getSample(chan[c.chan].dac.sample)->rate*2048;
chan[c.chan].dac.rate=parent->getSample(chan[c.chan].dac.sample)->rate;
if (dumpWrites) {
rWrite(0x08+c.chan,0);
addWrite(0xffff0001+(c.chan<<8),chan[c.chan].dac.rate);
}
chan[c.chan].dac.furnaceDAC=false;
chan[c.chan].active=true;
//chan[c.chan].keyOn=true;
}
chan[c.chan].curPSGMode.dac=chan[c.chan].nextPSGMode.dac;
break;

View File

@ -442,12 +442,14 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
}
chan[c.chan].dac.pos=0;
chan[c.chan].dac.period=0;
chan[c.chan].dac.rate=parent->getSample(chan[c.chan].dac.sample)->rate*4096;
chan[c.chan].dac.rate=parent->getSample(chan[c.chan].dac.sample)->rate;
if (dumpWrites) {
rWrite(0x08+c.chan,0);
addWrite(0xffff0001+(c.chan<<8),chan[c.chan].dac.rate);
}
chan[c.chan].dac.furnaceDAC=false;
chan[c.chan].active=true;
//chan[c.chan].keyOn=true;
}
chan[c.chan].curPSGMode.dac=chan[c.chan].nextPSGMode.dac;
break;

View File

@ -422,6 +422,10 @@ void DivEngine::registerSystems() {
// Common effect handler maps
EffectHandlerMap ayPreEffectHandlerMap={
{0x17, {DIV_CMD_SAMPLE_MODE, "17xx: Toggle PCM mode"}},
};
EffectHandlerMap ayPostEffectHandlerMap={
{0x20, {DIV_CMD_STD_NOISE_MODE, "20xx: Set channel mode (bit 0: square; bit 1: noise; bit 2: envelope)"}},
{0x21, {DIV_CMD_STD_NOISE_FREQ, "21xx: Set noise frequency (0 to 1F)"}},
@ -771,7 +775,7 @@ void DivEngine::registerSystems() {
{DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE},
{DIV_INS_AY, DIV_INS_AY, DIV_INS_AY},
{},
{},
ayPreEffectHandlerMap,
ayPostEffectHandlerMap
);
@ -851,7 +855,7 @@ void DivEngine::registerSystems() {
{DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE},
{DIV_INS_AY8930, DIV_INS_AY8930, DIV_INS_AY8930},
{},
{},
ayPreEffectHandlerMap,
ay8930PostEffectHandlerMap
);