From 3047c5512133930587c55910fc5160355b0d4ffb Mon Sep 17 00:00:00 2001 From: bmaupin Date: Fri, 6 Sep 2019 21:02:37 -0400 Subject: [PATCH] Fix PSP audio conversion code Fixes https://github.com/libretro/QuickNES_Core/issues/72 --- libretro-common/audio/conversion/s16_to_float.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libretro-common/audio/conversion/s16_to_float.c b/libretro-common/audio/conversion/s16_to_float.c index c8042ea817..d65afa48be 100644 --- a/libretro-common/audio/conversion/s16_to_float.c +++ b/libretro-common/audio/conversion/s16_to_float.c @@ -113,7 +113,11 @@ void convert_s16_to_float(float *out, i = 0; } -#elif defined(_MIPS_ARCH_ALLEGREX) +#endif + + gain = gain / 0x8000; + +#if defined(_MIPS_ARCH_ALLEGREX) #ifdef DEBUG /* Make sure the buffer is 16 byte aligned, this should be the * default behaviour of malloc in the PSPSDK. @@ -121,7 +125,6 @@ void convert_s16_to_float(float *out, retro_assert(((uintptr_t)out & 0xf) == 0); #endif - gain = gain / 0x8000; __asm__ ( ".set push \n" ".set noreorder \n" @@ -166,7 +169,6 @@ void convert_s16_to_float(float *out, } #endif - gain = gain / 0x8000; for (; i < samples; i++) out[i] = (float)in[i] * gain;