aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/uxn/devices/apu.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/uxn/devices/apu.c b/src/uxn/devices/apu.c
index 0b502f8..47151a6 100644
--- a/src/uxn/devices/apu.c
+++ b/src/uxn/devices/apu.c
@@ -230,13 +230,13 @@ void sound_mix() {
230 } 230 }
231 231
232 // Downsample and copy to the playing buffer (Vectorized). 232 // Downsample and copy to the playing buffer (Vectorized).
233 u64 *mix = mix_buffer; 233 u64 *mix_ptr = mix_buffer;
234 u32 *buf = audio.current_buffer; 234 u32 *buf_ptr = audio.current_buffer;
235 for (size_t i = 0, k = 0; i < AUDIO_BUF_LEN; i += 4, k++) { 235 for (size_t i = 0; i < AUDIO_BUF_LEN / 4; i++) {
236 u64 x = mix[k]; 236 u64 mix = mix_ptr[i];
237 buf[k] = (x >> 8) & 0xFF 237 buf_ptr[i] = (mix >> 8) & 0xFF
238 | (x >> 16) & 0xFF00 238 | (mix >> 16) & 0xFF00
239 | (x >> 24) & 0xFF0000 239 | (mix >> 24) & 0xFF0000
240 | (x >> 32) & 0xFF000000; 240 | (mix >> 32) & 0xFF000000;
241 } 241 }
242} 242}