Namco WSG: fix noise mode

This commit is contained in:
tildearrow 2023-09-26 12:23:38 -05:00
parent de2beb794f
commit 08a93f9c4d
3 changed files with 8 additions and 3 deletions

View file

@ -11,7 +11,7 @@ this allows you to enable and configure the Furnace wavetable synthesizer. see [
- **Volume**: volume sequence. - **Volume**: volume sequence.
- **Arpeggio**: pitch sequence. - **Arpeggio**: pitch sequence.
- **Noise**: specifies noise pitch. - **Noise**: specifies noise pitch.
- only applicable for Namco C30, and even so, only on the last 4 channels. - only applicable for Namco C30.
- **Waveform**: specifies wavetable sequence. - **Waveform**: specifies wavetable sequence.
- **Panning (left)**: output level of left channel. - **Panning (left)**: output level of left channel.
- Namco C30 only. - Namco C30 only.

View file

@ -201,7 +201,7 @@ void DivPlatformNamcoWSG::tick(bool sysTick) {
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
chan[i].outVol=((chan[i].vol&15)*MIN(15,chan[i].std.vol.val))>>4; chan[i].outVol=((chan[i].vol&15)*MIN(15,chan[i].std.vol.val))>>4;
} }
if (chan[i].std.duty.had && i>=4) { if (chan[i].std.duty.had) {
chan[i].noise=chan[i].std.duty.val; chan[i].noise=chan[i].std.duty.val;
chan[i].freqChanged=true; chan[i].freqChanged=true;
} }
@ -418,6 +418,7 @@ int DivPlatformNamcoWSG::dispatch(DivCommand c) {
} }
case DIV_CMD_STD_NOISE_MODE: case DIV_CMD_STD_NOISE_MODE:
chan[c.chan].noise=c.value; chan[c.chan].noise=c.value;
chan[c.chan].freqChanged=true;
break; break;
case DIV_CMD_PANNING: { case DIV_CMD_PANNING: {
chan[c.chan].pan=(c.value&0xf0)|(c.value2>>4); chan[c.chan].pan=(c.value&0xf0)|(c.value2>>4);

View file

@ -1708,6 +1708,10 @@ void DivEngine::registerSystems() {
EffectHandlerMap namcoEffectHandlerMap={ EffectHandlerMap namcoEffectHandlerMap={
{0x10, {DIV_CMD_WAVE, "10xx: Set waveform"}}, {0x10, {DIV_CMD_WAVE, "10xx: Set waveform"}},
};
EffectHandlerMap namcoC30EffectHandlerMap={
{0x10, {DIV_CMD_WAVE, "10xx: Set waveform"}},
{0x11, {DIV_CMD_STD_NOISE_MODE, "11xx: Toggle noise mode"}}, {0x11, {DIV_CMD_STD_NOISE_MODE, "11xx: Toggle noise mode"}},
}; };
@ -1741,7 +1745,7 @@ void DivEngine::registerSystems() {
{DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE}, {DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE, DIV_CH_WAVE},
{DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO}, {DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO, DIV_INS_NAMCO},
{}, {},
namcoEffectHandlerMap namcoC30EffectHandlerMap
); );
sysDefs[DIV_SYSTEM_MSM5232]=new DivSysDef( sysDefs[DIV_SYSTEM_MSM5232]=new DivSysDef(