summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2014-12-09 19:02:07 +0100
committertwinaphex2014-12-09 19:02:07 +0100
commita6905d9da21e16b1b89e2fcbdea64ce23b90b43d (patch)
treedf25ea990b2107289fc62aff1c023dada689ba7c
parent5fc2752771ae9f6b7ce7793e767872c4168d7a09 (diff)
downloadpicogpsp-a6905d9da21e16b1b89e2fcbdea64ce23b90b43d.tar.gz
picogpsp-a6905d9da21e16b1b89e2fcbdea64ce23b90b43d.tar.bz2
picogpsp-a6905d9da21e16b1b89e2fcbdea64ce23b90b43d.zip
Simplify sound_timer function
-rw-r--r--sound.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sound.c b/sound.c
index cef1b8d..918b9d3 100644
--- a/sound.c
+++ b/sound.c
@@ -100,6 +100,7 @@ void sound_timer_queue32(u32 channel, u32 value)
void sound_timer(fixed8_24 frequency_step, u32 channel)
{
+ unsigned sample_status = DIRECT_SOUND_INACTIVE;
direct_sound_struct *ds = direct_sound_channel + channel;
fixed8_24 fifo_fractional = ds->fifo_fractional;
@@ -118,28 +119,27 @@ void sound_timer(fixed8_24 frequency_step, u32 channel)
next_sample >>= 1;
}
- switch(ds->status)
- {
- case DIRECT_SOUND_INACTIVE:
+ sample_status = ds->status;
+
+ }
+
+ switch(sample_status)
+ {
+ case DIRECT_SOUND_INACTIVE:
render_samples(null);
break;
- case DIRECT_SOUND_RIGHT:
+ case DIRECT_SOUND_RIGHT:
render_samples(right);
break;
- case DIRECT_SOUND_LEFT:
+ case DIRECT_SOUND_LEFT:
render_samples(left);
break;
- case DIRECT_SOUND_LEFTRIGHT:
+ case DIRECT_SOUND_LEFTRIGHT:
render_samples(both);
break;
- }
- }
- else
- {
- render_samples(null);
}
ds->buffer_index = buffer_index;