Fix build, Transwave Checkpoint
This commit is contained in:
parent
0ab1f69c7c
commit
ab1ac51d68
4 changed files with 68 additions and 35 deletions
|
|
@ -302,7 +302,7 @@ struct DivInstrumentAmiga {
|
|||
struct NoteMap {
|
||||
int freq;
|
||||
short ind;
|
||||
bool reversed;
|
||||
unsigned char reversed;
|
||||
|
||||
NoteMap():
|
||||
freq(0),
|
||||
|
|
@ -316,16 +316,38 @@ struct DivInstrumentAmiga {
|
|||
int ind;
|
||||
unsigned short slice;
|
||||
|
||||
// states
|
||||
double sliceSize;
|
||||
double sliceBound;
|
||||
double sliceStart;
|
||||
double sliceEnd;
|
||||
|
||||
// inlines
|
||||
inline double slicePos(double slice) {
|
||||
double pos=sliceBound*slice;
|
||||
if (sliceStart!=pos) {
|
||||
sliceStart=pos;
|
||||
}
|
||||
if (sliceEnd!=(sliceSize+pos))
|
||||
sliceEnd=(sliceSize+pos);
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
TransWave():
|
||||
enable(false),
|
||||
sliceEnable(false),
|
||||
ind(0),
|
||||
slice(0) {}
|
||||
slice(0),
|
||||
sliceSize(0),
|
||||
sliceBound(0),
|
||||
sliceStart(0),
|
||||
sliceEnd(0) {}
|
||||
};
|
||||
|
||||
struct TransWaveMap {
|
||||
short ind;
|
||||
bool reversed;
|
||||
unsigned char reversed;
|
||||
int loopStart, loopEnd;
|
||||
DivSampleLoopMode loopMode;
|
||||
|
||||
|
|
@ -334,7 +356,7 @@ struct DivInstrumentAmiga {
|
|||
reversed(0),
|
||||
loopStart(-1),
|
||||
loopEnd(-1),
|
||||
loopMode(DIV_SAMPLE_LOOPMODE_FORWARD) {}
|
||||
loopMode(DIV_SAMPLE_LOOPMODE_ONESHOT) {}
|
||||
};
|
||||
|
||||
short initSample;
|
||||
|
|
|
|||
|
|
@ -622,7 +622,9 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
switch (c.cmd) {
|
||||
case DIV_CMD_NOTE_ON: {
|
||||
DivInstrument* ins=parent->getIns(chan[c.chan].ins);
|
||||
chan[c.chan].sample=ins->amiga.useNoteMap?ins->amiga.noteMap[c.value].ind:ins->amiga.initSample;
|
||||
DivInstrumentAmiga::TransWaveMap& transWaveInd=ins->amiga.transWaveMap[ins->amiga.transWave.ind];
|
||||
chan[c.chan].sample=ins->amiga.useTransWave?transWaveInd.ind:
|
||||
(ins->amiga.useNoteMap?ins->amiga.noteMap[c.value].ind:ins->amiga.initSample);
|
||||
double off=1.0;
|
||||
if (chan[c.chan].sample>=0 && chan[c.chan].sample<parent->song.sampleLen) {
|
||||
chan[c.chan].pcm.index=chan[c.chan].sample;
|
||||
|
|
@ -635,31 +637,22 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
const unsigned int start=s->offES5506<<10;
|
||||
const unsigned int length=s->samples-1;
|
||||
const unsigned int end=start+(length<<11);
|
||||
chan[c.chan].pcm.loopMode=s->isLoopable()?s->loopMode:DIV_SAMPLE_LOOPMODE_ONESHOT;
|
||||
chan[c.chan].pcm.loopMode=(ins->amiga.useTransWave&&transWaveInd.loopMode!=DIV_SAMPLE_LOOPMODE_ONESHOT)?transWaveInd.loopMode:(s->isLoopable()?s->loopMode:DIV_SAMPLE_LOOPMODE_ONESHOT);
|
||||
chan[c.chan].pcm.freqOffs=off;
|
||||
chan[c.chan].pcm.reversed=ins->amiga.useNoteMap?ins->amiga.noteMap[c.value].reversed:ins->amiga.reversed;
|
||||
chan[c.chan].pcm.reversed=(ins->amiga.useTransWave&&transWaveInd.reversed!=2)?transWaveInd.reversed:ins->amiga.useNoteMap?ins->amiga.noteMap[c.value].reversed:ins->amiga.reversed;
|
||||
chan[c.chan].pcm.bank=(s->offES5506>>22)&3;
|
||||
chan[c.chan].pcm.start=start;
|
||||
chan[c.chan].pcm.end=end;
|
||||
chan[c.chan].pcm.length=length;
|
||||
chan[c.chan].pcm.loopStart=(start+(s->loopStart<<11))&0xfffff800;
|
||||
chan[c.chan].pcm.loopEnd=(start+((s->loopEnd-1)<<11))&0xffffff80;
|
||||
if (ins->type==DIV_INS_ES5506) { // Native format
|
||||
chan[c.chan].volMacroMax=0xffff;
|
||||
chan[c.chan].panMacroMax=0xffff;
|
||||
chan[c.chan].filter=ins->es5506.filter;
|
||||
chan[c.chan].envelope=ins->es5506.envelope;
|
||||
} else { // Amiga format
|
||||
chan[c.chan].volMacroMax=64;
|
||||
chan[c.chan].panMacroMax=127;
|
||||
chan[c.chan].filter=DivInstrumentES5506::Filter();
|
||||
chan[c.chan].envelope=DivInstrumentES5506::Envelope();
|
||||
}
|
||||
chan[c.chan].volMacroMax=ins->type==DIV_INS_AMIGA?64:0xffff;
|
||||
chan[c.chan].panMacroMax=ins->type==DIV_INS_AMIGA?127:0xffff;
|
||||
chan[c.chan].filter=ins->es5506.filter;
|
||||
chan[c.chan].envelope=ins->es5506.envelope;
|
||||
} else {
|
||||
chan[c.chan].sample=-1;
|
||||
chan[c.chan].pcm.index=-1;
|
||||
chan[c.chan].volMacroMax=0xffff;
|
||||
chan[c.chan].panMacroMax=0xffff;
|
||||
chan[c.chan].filter=DivInstrumentES5506::Filter();
|
||||
chan[c.chan].envelope=DivInstrumentES5506::Envelope();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1755,8 +1755,9 @@ void DivEngine::registerSystems() {
|
|||
} else {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue