From: kub Date: Thu, 3 Jun 2021 19:55:17 +0000 (+0200) Subject: sound, increase output level a bit X-Git-Tag: v2.00~516 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5a230e0d83807f82727cc7d3bb6ce37507606e6;p=picodrive.git sound, increase output level a bit --- diff --git a/pico/sound/mix.c b/pico/sound/mix.c index 099b8c97..51882f70 100644 --- a/pico/sound/mix.c +++ b/pico/sound/mix.c @@ -14,7 +14,7 @@ /* limitter */ #define Limit16(val) \ - val -= val >> 2; /* reduce level to avoid clipping */ \ + val -= val >> 3; /* reduce level to avoid clipping */ \ if ((short)val != val) val = (val < 0 ? MINOUT : MAXOUT) int mix_32_to_16l_level; diff --git a/pico/sound/mix_arm.S b/pico/sound/mix_arm.S index 60438988..20a19118 100644 --- a/pico/sound/mix_arm.S +++ b/pico/sound/mix_arm.S @@ -156,7 +156,7 @@ m16_32_s2_no_unal2: @ limit @ reg=int_sample, r12=1, r8=tmp, kills flags .macro Limit reg - sub \reg, \reg, \reg, asr #2 @ reduce audio lvl some to avoid clipping + sub \reg, \reg, \reg, asr #3 @ reduce audio lvl some to avoid clipping add r8, r12, \reg, asr #15 bics r8, r8, #1 @ in non-overflow conditions r8 is 0 or 1 movne \reg, #0x8000 @@ -166,7 +166,7 @@ m16_32_s2_no_unal2: @ limit and shift up by 16 @ reg=int_sample, r12=1, r8=tmp, kills flags .macro Limitsh reg - sub \reg, \reg, \reg, asr #2 @ reduce audio lvl some to avoid clipping + sub \reg, \reg, \reg, asr #3 @ reduce audio lvl some to avoid clipping add r8, r12,\reg, asr #15 bics r8, r8, #1 @ in non-overflow conditions r8 is 0 or 1 moveq \reg, \reg, lsl #16