diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index b01d6a9f..eeeb5485 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -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; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 821fa4fe..3d658e03 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -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; diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index cb2a3da4..e97a2b89 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -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 );