summaryrefslogtreecommitdiff
path: root/sound.c
diff options
context:
space:
mode:
authorDavid Guillen Fandos2021-06-30 00:29:21 +0200
committerDavid Guillen Fandos2021-07-01 12:06:57 +0200
commit836e51b694f33d864cf4962d1dd3718bb56803c6 (patch)
treed49064abd60e6e2575ed433be8c038a65058f259 /sound.c
parent48f1a71fb7b1d551295aec7ea44f5529c87bff93 (diff)
downloadpicogpsp-836e51b694f33d864cf4962d1dd3718bb56803c6.tar.gz
picogpsp-836e51b694f33d864cf4962d1dd3718bb56803c6.tar.bz2
picogpsp-836e51b694f33d864cf4962d1dd3718bb56803c6.zip
Fix some UB behaviour
Diffstat (limited to 'sound.c')
-rw-r--r--sound.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound.c b/sound.c
index bc88fff..76c3525 100644
--- a/sound.c
+++ b/sound.c
@@ -85,9 +85,9 @@ void sound_timer(fixed8_24 frequency_step, u32 channel)
u32 buffer_index = ds->buffer_index;
s16 current_sample, next_sample;
- current_sample = ds->fifo[ds->fifo_base] << 4;
+ current_sample = ds->fifo[ds->fifo_base] * 16;
ds->fifo_base = (ds->fifo_base + 1) % 32;
- next_sample = ds->fifo[ds->fifo_base] << 4;
+ next_sample = ds->fifo[ds->fifo_base] * 16;
if(sound_on == 1)
{
@@ -655,7 +655,7 @@ void render_audio(void)
current_sample = 2047;
if(current_sample < -2048)
current_sample = -2048;
- stream_base[i] = current_sample << 4;
+ stream_base[i] = current_sample * 16;
source[i] = 0;
}
audio_batch_cb(stream_base, 256);