X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fsound.c;h=6e0db26ca7ccd700a11ebc0c9e4ca3953bd7b37d;hb=000f53350cb0d6540310d8c4b02eb034c9662f0d;hp=7f3fd8dfb58e35c2d886ec838735a301a94f2eb9;hpb=2ec9bec58b89831cdead4cdec8f593c5b99d2715;p=picodrive.git diff --git a/pico/sound/sound.c b/pico/sound/sound.c index 7f3fd8d..6e0db26 100644 --- a/pico/sound/sound.c +++ b/pico/sound/sound.c @@ -107,14 +107,9 @@ static void dac_recalculate(void) PICO_INTERNAL void PsndReset(void) { - void *ym2612_regs; - - // also clear the internal registers+addr line - ym2612_regs = YM2612GetRegs(); - memset(ym2612_regs, 0, 0x200+4); - timers_reset(); - + // PsndRerate calls YM2612Init, which also resets PsndRerate(0); + timers_reset(); } @@ -398,7 +393,6 @@ PICO_INTERNAL void PsndGetSamples(int y) PICO_INTERNAL void PsndGetSamplesMS(void) { - int *buf32 = PsndBuffer; int stereo = (PicoOpt & 8) >> 3; int length = PsndLen; @@ -415,8 +409,12 @@ PICO_INTERNAL void PsndGetSamplesMS(void) if (PicoOpt & POPT_EN_PSG) SN76496Update(PsndOut, length, stereo); - // convert + limit to normal 16bit output - PsndMix_32_to_16l(PsndOut, buf32, length); + // upmix to "stereo" if needed + if (stereo) { + int i, *p; + for (i = length, p = (void *)PsndOut; i > 0; i--, p++) + *p |= *p << 16; + } if (PicoWriteSound != NULL) PicoWriteSound(length);