forked from len0rd/rockbox
static/inline/iram raid gives nice speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14915 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e108964ec0
commit
6386dbe861
5 changed files with 21 additions and 24 deletions
|
@ -97,6 +97,8 @@ int32_t gmbuf[BUF_SIZE*NBUF];
|
||||||
int quit=0;
|
int quit=0;
|
||||||
struct plugin_api * rb;
|
struct plugin_api * rb;
|
||||||
|
|
||||||
|
static int midimain(void * filename);
|
||||||
|
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
@ -134,7 +136,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
#if defined(HAVE_ADJUSTABLE_CPU_FREQ)
|
#if defined(HAVE_ADJUSTABLE_CPU_FREQ)
|
||||||
rb->cpu_boost(false);
|
rb->cpu_boost(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rb->splash(HZ, "FINISHED PLAYING");
|
rb->splash(HZ, "FINISHED PLAYING");
|
||||||
|
|
||||||
if(retval == -1)
|
if(retval == -1)
|
||||||
|
@ -196,7 +197,7 @@ void get_more(unsigned char** start, size_t* size)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int midimain(void * filename)
|
static int midimain(void * filename)
|
||||||
{
|
{
|
||||||
int notesUsed = 0;
|
int notesUsed = 0;
|
||||||
int a=0;
|
int a=0;
|
||||||
|
|
|
@ -138,9 +138,7 @@ struct Track
|
||||||
};
|
};
|
||||||
|
|
||||||
int printf(const char *fmt, ...);
|
int printf(const char *fmt, ...);
|
||||||
int midimain(void * filename);
|
|
||||||
unsigned char readChar(int file);
|
unsigned char readChar(int file);
|
||||||
inline void setPoint(struct SynthObject * so, int pt);
|
|
||||||
int readTwoBytes(int file);
|
int readTwoBytes(int file);
|
||||||
int readFourBytes(int file);
|
int readFourBytes(int file);
|
||||||
int readVarData(int file);
|
int readVarData(int file);
|
||||||
|
|
|
@ -21,13 +21,20 @@
|
||||||
#include "guspat.h"
|
#include "guspat.h"
|
||||||
#include "synth.h"
|
#include "synth.h"
|
||||||
|
|
||||||
void setVolScale(int a);
|
|
||||||
|
|
||||||
extern struct plugin_api * rb;
|
extern struct plugin_api * rb;
|
||||||
|
|
||||||
long tempo=375000;
|
long tempo=375000;
|
||||||
|
|
||||||
inline void setVol(int ch, int vol)
|
/* Sets the volume scaling by channel volume and note volume */
|
||||||
|
/* This way we can do the multiplication/indexing once per */
|
||||||
|
/* MIDI event at the most, instead of once per sample. */
|
||||||
|
static inline void setVolScale(int a)
|
||||||
|
{
|
||||||
|
struct SynthObject * so = &voices[a];
|
||||||
|
so->volscale = ((signed short int)so->vol*(signed short int)chVol[so->ch]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void setVol(int ch, int vol)
|
||||||
{
|
{
|
||||||
int a=0;
|
int a=0;
|
||||||
chVol[ch]=vol;
|
chVol[ch]=vol;
|
||||||
|
@ -39,7 +46,7 @@ inline void setVol(int ch, int vol)
|
||||||
setVolScale(a);
|
setVolScale(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setPan(int ch, int pan)
|
static inline void setPan(int ch, int pan)
|
||||||
{
|
{
|
||||||
// printf("\npanning[%d] %d ==> %d", ch, chPanRight[ch], pan);
|
// printf("\npanning[%d] %d ==> %d", ch, chPanRight[ch], pan);
|
||||||
|
|
||||||
|
@ -48,7 +55,7 @@ inline void setPan(int ch, int pan)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void setPatch(int ch, int pat)
|
static inline void setPatch(int ch, int pat)
|
||||||
{
|
{
|
||||||
chPat[ch]=pat;
|
chPat[ch]=pat;
|
||||||
}
|
}
|
||||||
|
@ -123,7 +130,7 @@ const uint32_t pitchTbl[] ICONST_ATTR={
|
||||||
73297,73330,73363,73396,73429,73462,73495,73528
|
73297,73330,73363,73396,73429,73462,73495,73528
|
||||||
};
|
};
|
||||||
|
|
||||||
void findDelta(struct SynthObject * so, int ch, int note)
|
static void findDelta(struct SynthObject * so, int ch, int note)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct GWaveform * wf = patchSet[chPat[ch]]->waveforms[patchSet[chPat[ch]]->noteTable[note]];
|
struct GWaveform * wf = patchSet[chPat[ch]]->waveforms[patchSet[chPat[ch]]->noteTable[note]];
|
||||||
|
@ -136,7 +143,7 @@ void findDelta(struct SynthObject * so, int ch, int note)
|
||||||
so->delta = delta;
|
so->delta = delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void setPW(int ch, int msb, int lsb)
|
static inline void setPW(int ch, int msb, int lsb)
|
||||||
{
|
{
|
||||||
chPW[ch] = msb<<2|lsb>>5;
|
chPW[ch] = msb<<2|lsb>>5;
|
||||||
|
|
||||||
|
@ -150,16 +157,7 @@ inline void setPW(int ch, int msb, int lsb)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sets the volume scaling by channel volume and note volume */
|
static void pressNote(int ch, int note, int vol)
|
||||||
/* This way we can do the multiplication/indexing once per */
|
|
||||||
/* MIDI event at the most, instead of once per sample. */
|
|
||||||
void setVolScale(int a)
|
|
||||||
{
|
|
||||||
struct SynthObject * so = &voices[a];
|
|
||||||
so->volscale = ((signed short int)so->vol*(signed short int)chVol[so->ch]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pressNote(int ch, int note, int vol)
|
|
||||||
{
|
{
|
||||||
static int lastKill = 0;
|
static int lastKill = 0;
|
||||||
/* Silences all channels but one, for easy debugging, for me. */
|
/* Silences all channels but one, for easy debugging, for me. */
|
||||||
|
@ -251,9 +249,8 @@ void pressNote(int ch, int note, int vol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline void stopVoice(struct SynthObject * so);
|
|
||||||
|
|
||||||
void releaseNote(int ch, int note)
|
static void releaseNote(int ch, int note)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(ch==9)
|
if(ch==9)
|
||||||
|
|
|
@ -191,6 +191,7 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig)
|
||||||
|
|
||||||
#define getSample(s,wf) ((short *)(wf)->data)[s]
|
#define getSample(s,wf) ((short *)(wf)->data)[s]
|
||||||
|
|
||||||
|
void setPoint(struct SynthObject * so, int pt) ICODE_ATTR;
|
||||||
void setPoint(struct SynthObject * so, int pt)
|
void setPoint(struct SynthObject * so, int pt)
|
||||||
{
|
{
|
||||||
if(so->ch==9) /* Drums, no ADSR */
|
if(so->ch==9) /* Drums, no ADSR */
|
||||||
|
@ -247,7 +248,6 @@ void setPoint(struct SynthObject * so, int pt)
|
||||||
so->curOffset = 0;
|
so->curOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void stopVoice(struct SynthObject * so)
|
inline void stopVoice(struct SynthObject * so)
|
||||||
{
|
{
|
||||||
if(so->state == STATE_RAMPDOWN)
|
if(so->state == STATE_RAMPDOWN)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig);
|
int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig);
|
||||||
signed short int synthVoice(struct SynthObject * so);
|
signed short int synthVoice(struct SynthObject * so);
|
||||||
|
void setPoint(struct SynthObject * so, int pt);
|
||||||
|
|
||||||
static inline void synthSample(int * mixL, int * mixR)
|
static inline void synthSample(int * mixL, int * mixR)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue