X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fsound.c;h=615e324dc9dc92c1199111774db002e6e19c6980;hb=a4edca53b489370b0814a74579acbcc183578355;hp=5bb8e9d89fc216358958c98572e5ce1dae3db880;hpb=d40231e29a3e492b19612d7b6e9c7b9c2f9885a9;p=picodrive.git diff --git a/pico/sound/sound.c b/pico/sound/sound.c index 5bb8e9d..615e324 100644 --- a/pico/sound/sound.c +++ b/pico/sound/sound.c @@ -375,7 +375,8 @@ PICO_INTERNAL void PsndGetSamples(int y) #if SIMPLE_WRITE_SOUND if (y != 224) return; PsndRender(0, PsndLen); - if (PicoWriteSound) PicoWriteSound(PsndLen); + if (PicoWriteSound) + PicoWriteSound(PsndLen * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2)); PsndClear(); #else static int curr_pos = 0; @@ -385,8 +386,11 @@ PICO_INTERNAL void PsndGetSamples(int y) if (emustatus & 2) curr_pos += PsndRender(curr_pos, PsndLen-PsndLen/2); else curr_pos = PsndRender(0, PsndLen); - if (emustatus&1) emustatus|=2; else emustatus&=~2; - if (PicoWriteSound) PicoWriteSound(curr_pos); + if (emustatus & 1) + emustatus |= 2; + else emustatus &= ~2; + if (PicoWriteSound) + PicoWriteSound(curr_pos * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2)); // clear sound buffer PsndClear(); } @@ -424,7 +428,7 @@ PICO_INTERNAL void PsndGetSamplesMS(void) } if (PicoWriteSound != NULL) - PicoWriteSound(length); + PicoWriteSound(length * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2)); PsndClear(); }