aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-05-28 17:31:23 +0200
committerBad Diode <bd@badd10de.dev>2021-05-28 17:31:23 +0200
commit4ea00e4dcbb390f9fec53034ac1a62cc6fb308d0 (patch)
tree0210276b38cbe3160f57c911a7791d2b26eca97b /src
parentb619d807953aa14f500a9b0ea6e55e0dbdb3ee6f (diff)
downloaduxngba-4ea00e4dcbb390f9fec53034ac1a62cc6fb308d0.tar.gz
uxngba-4ea00e4dcbb390f9fec53034ac1a62cc6fb308d0.zip
Clean mixdown loop
Diffstat (limited to 'src')
-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}