--- np2/sound/psggeng.c 2003/10/26 08:59:53 1.5 +++ np2/sound/psggeng.c 2003/12/24 14:01:56 1.7 @@ -15,7 +15,7 @@ void SOUNDCALL psggen_getpcm(PSGGEN psg, PSGTONE *tone; PSGTONE *toneterm; SINT32 samp; - UINT psgvol; +// UINT psgvol; SINT32 vol; UINT i; UINT noise; @@ -50,6 +50,7 @@ void SOUNDCALL psggen_getpcm(PSGGEN psg, psg->envcnt = psg->envmax; psg->envvol = (psg->envvolcnt ^ psg->envmode) & 0x0f; } + psg->evol = psggencfg.volume[psg->envvol]; } } mixer = psg->mixer; @@ -68,11 +69,10 @@ void SOUNDCALL psggen_getpcm(PSGGEN psg, } tone = psg->tone; toneterm = tone + 3; - samp = 0; do { - psgvol = (*(tone->pvol)) & 15; - if (psgvol) { - vol = psggencfg.volume[psgvol]; + vol = *(tone->pvol); + if (vol) { + samp = 0; switch(mixer & 9) { case 0: // no mix if (tone->puchi) { @@ -110,11 +110,15 @@ void SOUNDCALL psggen_getpcm(PSGGEN psg, } break; } + if (!(tone->pan & 1)) { + pcm[0] += samp; + } + if (!(tone->pan & 2)) { + pcm[1] += samp; + } } mixer >>= 1; } while(++tone < toneterm); - pcm[0] += samp; - pcm[1] += samp; pcm += 2; } while(--count); }