1
0
Fork 0
forked from len0rd/rockbox

Revert some changes that broke looping in midiplayer

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15631 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2007-11-15 21:20:29 +00:00
parent 7aa4ae6e45
commit 65331f1749
3 changed files with 26 additions and 21 deletions

View file

@ -109,7 +109,7 @@ struct SynthObject
int delta;
int decay;
unsigned int cp; /* unsigned int */
int state;
int state, loopState;
int note, vol, ch;
int curRate, curOffset, targetOffset;
int curPoint;

View file

@ -227,6 +227,7 @@ inline void pressNote(int ch, int note, int vol)
setVolScale(a);
voices[a].loopState=STATE_NONLOOPING;
/*
* OKAY. Gt = Gus Table value
* rf = Root Frequency of wave

View file

@ -316,19 +316,10 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
s2 = getSample((cp_temp >> FRACTSIZE)+1, wf);
if(mode_mask28 && cp_temp >= end_loop)
if(mode_mask28)
{
if(!mode_mask24)
{
cp_temp -= diff_loop;
s2=getSample((cp_temp >> FRACTSIZE), wf);
}
else
{
so->delta = -so->delta;
/* LOOP_REVERSE|LOOP_PINGPONG = 24 */
if(cp_temp < start_loop) /* this appears to never be true in here */
if(mode_mask24 && so->loopState == STATE_LOOPING && (cp_temp < start_loop))
{
if(mode_mask_looprev)
{
@ -340,6 +331,19 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
so->delta = -so->delta; /* At this point cp_temp is wrong. We need to take a step */
}
}
if(cp_temp >= end_loop)
{
so->loopState = STATE_LOOPING;
if(!mode_mask24)
{
cp_temp -= diff_loop;
s2=getSample((cp_temp >> FRACTSIZE), wf);
}
else
{
so->delta = -so->delta;
}
}
}