summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-10-05 11:15:04 +0000
committerNils Wallménius <nils@rockbox.org>2007-10-05 11:15:04 +0000
commit8219f2801a9484aed0c35143ab9b2d2c8b6dee15 (patch)
treed1ba59ceeffdbaca98e6c0841ecdafc799a400d1
parentbd4aea376957742158646f219f91c38a55d30d3a (diff)
downloadrockbox-8219f2801a9484aed0c35143ab9b2d2c8b6dee15.tar.gz
rockbox-8219f2801a9484aed0c35143ab9b2d2c8b6dee15.zip
Make synthVoice return int instead of short, gives a nice speed up also add a comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14988 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/midi/synth.c4
-rw-r--r--apps/plugins/midi/synth.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c
index 322d0f792d..327f32e288 100644
--- a/apps/plugins/midi/synth.c
+++ b/apps/plugins/midi/synth.c
@@ -255,8 +255,8 @@ inline void stopVoice(struct SynthObject * so)
255 so->decay = 0; 255 so->decay = 0;
256} 256}
257 257
258signed short int synthVoice(struct SynthObject * so) ICODE_ATTR; 258int synthVoice(struct SynthObject * so) ICODE_ATTR;
259signed short int synthVoice(struct SynthObject * so) 259int synthVoice(struct SynthObject * so)
260{ 260{
261 struct GWaveform * wf; 261 struct GWaveform * wf;
262 register int s; 262 register int s;
diff --git a/apps/plugins/midi/synth.h b/apps/plugins/midi/synth.h
index 2b7187e819..dd52c40a7d 100644
--- a/apps/plugins/midi/synth.h
+++ b/apps/plugins/midi/synth.h
@@ -17,7 +17,7 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig); 19int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig);
20signed short int synthVoice(struct SynthObject * so); 20int synthVoice(struct SynthObject * so);
21void setPoint(struct SynthObject * so, int pt); 21void setPoint(struct SynthObject * so, int pt);
22 22
23static inline void synthSample(int * mixL, int * mixR) 23static inline void synthSample(int * mixL, int * mixR)
@@ -48,6 +48,8 @@ static inline void synthSample(int * mixL, int * mixR)
48 voicept++; 48 voicept++;
49 } 49 }
50 50
51 /* if max voices is an even number gcc is smart enough to not
52 include this loop */
51 for(i=MAX_VOICES%2; i > 0; i--) 53 for(i=MAX_VOICES%2; i > 0; i--)
52 { 54 {
53 if(voicept->isUsed==1) 55 if(voicept->isUsed==1)