X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fsound%2Fmix.c;h=e929da7f2489fa57f6ff1ce4d4fe0f961b202a85;hb=4b167c12c7ebb23223c347793a2b4d5e9712e384;hp=4d68f1d7cd84fa1a84c1a17a81212ed3bf88833d;hpb=b5e5172d049a83251874fb33e65a53c9654dc0bc;p=picodrive.git diff --git a/Pico/sound/mix.c b/Pico/sound/mix.c index 4d68f1d..e929da7 100644 --- a/Pico/sound/mix.c +++ b/Pico/sound/mix.c @@ -39,16 +39,33 @@ void mix_32_to_16_mono(short *dest, int *src, int count) } -/* unimplemented... */ void mix_16h_to_32(int *dest_buf, short *mp3_buf, int count) { + while (count--) + { + *dest_buf++ += *mp3_buf++ >> 1; + } } void mix_16h_to_32_s1(int *dest_buf, short *mp3_buf, int count) { + count >>= 1; + while (count--) + { + *dest_buf++ += *mp3_buf++ >> 1; + *dest_buf++ += *mp3_buf++ >> 1; + mp3_buf += 1*2; + } } void mix_16h_to_32_s2(int *dest_buf, short *mp3_buf, int count) { + count >>= 1; + while (count--) + { + *dest_buf++ += *mp3_buf++ >> 1; + *dest_buf++ += *mp3_buf++ >> 1; + mp3_buf += 3*2; + } }