Updated ft2play to version 0.43a, which optimizes the RelocateTon function used by glissando tone slides and arpeggio effects
parent
efcfa5bdb5
commit
1737f4021d
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** FT2PLAY v0.42a
|
** FT2PLAY v0.43a
|
||||||
** ==============
|
** ==============
|
||||||
**
|
**
|
||||||
** C port of FastTracker II's replayer, by 8bitbubsy (Olav Sørensen)
|
** C port of FastTracker II's replayer, by 8bitbubsy (Olav Sørensen)
|
||||||
|
@ -973,7 +973,7 @@ CheckEffects:
|
||||||
// E7x - set tremolo waveform
|
// E7x - set tremolo waveform
|
||||||
else if ((ch->Eff & 0xF0) == 0x70) ch->WaveCtrl = ((ch->Eff & 0x0F) << 4) | (ch->WaveCtrl & 0x0F);
|
else if ((ch->Eff & 0xF0) == 0x70) ch->WaveCtrl = ((ch->Eff & 0x0F) << 4) | (ch->WaveCtrl & 0x0F);
|
||||||
|
|
||||||
// E8x - set panning *non-FT2*
|
// E8x - set 4-bit panning (NON-FT2)
|
||||||
else if ((ch->Eff & 0xF0) == 0x80)
|
else if ((ch->Eff & 0xF0) == 0x80)
|
||||||
{
|
{
|
||||||
ch->OutPan = (ch->Eff & 0x0F) << 4;
|
ch->OutPan = (ch->Eff & 0x0F) << 4;
|
||||||
|
@ -1520,44 +1520,31 @@ static int16_t RelocateTon(PLAYER *p, int16_t inPeriod, int8_t addNote, StmTyp *
|
||||||
int8_t i;
|
int8_t i;
|
||||||
int8_t fineTune;
|
int8_t fineTune;
|
||||||
|
|
||||||
int32_t outPeriod; // is 32-bit for testing bit 17, for carry (adc/sbb)
|
uint16_t lower;
|
||||||
int32_t lookUp;
|
uint16_t middle;
|
||||||
int16_t oldPeriod;
|
uint16_t upper;
|
||||||
int16_t addPeriod;
|
|
||||||
|
|
||||||
oldPeriod = 0;
|
fineTune = ch->FineTune / 8; // -16..15
|
||||||
addPeriod = (8 * 12 * 16) * 2; // *2, make 16-bit look-up
|
lower = 0;
|
||||||
fineTune = ((ch->FineTune / 8) + 16) * 2; // *2, make 16-bit look-up
|
upper = 8 * 12 * 16;
|
||||||
|
|
||||||
for (i = 0; i < 8; ++i)
|
for (i = 0; i < 8; ++i)
|
||||||
{
|
{
|
||||||
outPeriod = (((oldPeriod + addPeriod) >> 1) & 0xFFE0) + fineTune;
|
middle = ((lower + upper) >> 1) & 0xFFF0;
|
||||||
if (outPeriod < fineTune) outPeriod += (1 << 8);
|
|
||||||
|
|
||||||
lookUp = (outPeriod - 16) >> 1; // 16-bit look-up, shift it down
|
if (inPeriod >= p->Note2Period[middle + fineTune])
|
||||||
if (lookUp < ((12 * 10 * 16) + 16)) // non-FT2 security fix, may or may not happen
|
upper = middle;
|
||||||
{
|
|
||||||
if (inPeriod >= p->Note2Period[lookUp])
|
|
||||||
{
|
|
||||||
outPeriod -= fineTune;
|
|
||||||
if (outPeriod & 0x00010000) outPeriod = (outPeriod - (1 << 8)) & 0x0000FFE0;
|
|
||||||
addPeriod = (int16_t)(outPeriod);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
lower = middle;
|
||||||
outPeriod -= fineTune;
|
|
||||||
if (outPeriod & 0x00010000) outPeriod = (outPeriod - (1 << 8)) & 0x0000FFE0;
|
|
||||||
oldPeriod = (int16_t)(outPeriod);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outPeriod = oldPeriod + fineTune;
|
fineTune += 16; // make unsigned (0..31)
|
||||||
if (outPeriod < fineTune) outPeriod += (1 << 8);
|
middle = lower + fineTune + (addNote << 4);
|
||||||
outPeriod += ((int16_t)(addNote) << 5);
|
|
||||||
|
|
||||||
if (outPeriod >= ((((8 * 12 * 16) + 15) * 2) - 1)) outPeriod = ((8 * 12 * 16) + 15) * 2;
|
if (middle >= ((8 * 12 * 16) + 15) - 1)
|
||||||
return (p->Note2Period[outPeriod >> 1]); // 16-bit look-up, shift it down
|
middle = (8 * 12 * 16) + 15;
|
||||||
|
|
||||||
|
return (p->Note2Period[middle]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TonePorta(PLAYER *p, StmTyp *ch)
|
static void TonePorta(PLAYER *p, StmTyp *ch)
|
||||||
|
|
Loading…
Reference in New Issue