X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fsound%2Fsn76496.c;h=8474c7036991c01b58fe0943a79b31e73d315b5f;hb=d0ae0cb4bb73e6e2fc10e7b19a5a72a012db6d6a;hp=1afd3beff7cbde90d1f8c34fcf49b19d19bfa906;hpb=cc68a136aa179a5f32fe40208371eb9c2b0aadae;p=picodrive.git diff --git a/Pico/sound/sn76496.c b/Pico/sound/sn76496.c index 1afd3be..8474c70 100644 --- a/Pico/sound/sn76496.c +++ b/Pico/sound/sn76496.c @@ -175,7 +175,7 @@ WRITE8_HANDLER( SN76496_4_w ) { SN76496Write(4,data); } */ //static -void SN76496Update(short *buffer,int length,int stereo) +void SN76496Update(short *buffer, int length, int stereo) { int i; struct SN76496 *R = &ono_sn; @@ -258,13 +258,10 @@ void SN76496Update(short *buffer,int length,int stereo) if (out > MAX_OUTPUT * STEP) out = MAX_OUTPUT * STEP; - out /= STEP; // will be optimized to shift - if(stereo) { - // only left channel for stereo (will be copied to right by ym2612 mixing code) + if ((out /= STEP)) // will be optimized to shift; max 0x47ff = 18431 *buffer += out; - buffer+=2; - } else - *buffer++ += out; + if(stereo) buffer+=2; // only left for stereo, to be mixed to right later + else buffer++; length--; }