--- np2/sound/psggeng.c 2003/10/22 14:13:25 1.3 +++ np2/sound/psggeng.c 2003/11/14 05:26:53 1.6 @@ -1,4 +1,5 @@ #include "compiler.h" +#include "parts.h" #include "sound.h" #include "psggen.h" @@ -58,7 +59,8 @@ void SOUNDCALL psggen_getpcm(PSGGEN psg, countbak = psg->noise.count; psg->noise.count -= psg->noise.freq; if (psg->noise.count > countbak) { - psg->noise.base = GETRAND() & (1 << (1 << PSGADDEDBIT)); +// psg->noise.base = GETRAND() & (1 << (1 << PSGADDEDBIT)); + psg->noise.base = rand_get() & (1 << (1 << PSGADDEDBIT)); } noisetbl += psg->noise.base; noisetbl >>= 1; @@ -66,10 +68,10 @@ void SOUNDCALL psggen_getpcm(PSGGEN psg, } tone = psg->tone; toneterm = tone + 3; - samp = 0; do { psgvol = (*(tone->pvol)) & 15; if (psgvol) { + samp = 0; vol = psggencfg.volume[psgvol]; switch(mixer & 9) { case 0: // no mix @@ -108,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); }