remove partial pitch linearity
the hacky mode is no more
This commit is contained in:
parent
af2e06976e
commit
29929beeac
39 changed files with 86 additions and 111 deletions
|
|
@ -23,7 +23,7 @@
|
|||
#include <math.h>
|
||||
|
||||
#define PITCH_OFFSET ((double)(16*2048*(chanMax+1)))
|
||||
#define NOTE_ES5506(c,note) ((amigaPitch && parent->song.linearPitch!=2)?parent->calcBaseFreq(COLOR_NTSC*16,chan[c].pcm.freqOffs,note,true):parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false))
|
||||
#define NOTE_ES5506(c,note) ((amigaPitch && !parent->song.linearPitch)?parent->calcBaseFreq(COLOR_NTSC*16,chan[c].pcm.freqOffs,note,true):parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false))
|
||||
|
||||
#define rWrite(a,...) {if(!skipRegisterWrites) {hostIntf32.push_back(QueuedHostIntf(4,(a),__VA_ARGS__)); }}
|
||||
#define immWrite(a,...) {hostIntf32.push_back(QueuedHostIntf(4,(a),__VA_ARGS__));}
|
||||
|
|
@ -603,7 +603,7 @@ void DivPlatformES5506::tick(bool sysTick) {
|
|||
const unsigned int length=s->samples-1;
|
||||
const unsigned int end=start+(length<<11);
|
||||
const unsigned int nextBank=(offES5506>>22)&3;
|
||||
const double nextFreqOffs=((amigaPitch && parent->song.linearPitch!=2)?16:PITCH_OFFSET)*off;
|
||||
const double nextFreqOffs=((amigaPitch && !parent->song.linearPitch)?16:PITCH_OFFSET)*off;
|
||||
chan[i].pcm.loopMode=loopMode;
|
||||
chan[i].pcm.bank=nextBank;
|
||||
chan[i].pcm.start=start;
|
||||
|
|
@ -746,7 +746,7 @@ void DivPlatformES5506::tick(bool sysTick) {
|
|||
chan[i].pcm.nextPos=0;
|
||||
}
|
||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||
if (amigaPitch && parent->song.linearPitch!=2) {
|
||||
if (amigaPitch && !parent->song.linearPitch) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch*16,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,2,chan[i].pitch2*16,16*COLOR_NTSC,chan[i].pcm.freqOffs);
|
||||
chan[i].freq=PITCH_OFFSET*(COLOR_NTSC/chan[i].freq)/(chipClock/16.0);
|
||||
chan[i].freq=CLAMP(chan[i].freq,0,0x1ffff);
|
||||
|
|
@ -767,7 +767,7 @@ void DivPlatformES5506::tick(bool sysTick) {
|
|||
}
|
||||
chan[i].pcm.loopStart=(chan[i].pcm.start+(s->loopStart<<11))&0xfffff800;
|
||||
chan[i].pcm.loopEnd=(chan[i].pcm.start+((s->loopEnd)<<11))&0xffffff80;
|
||||
chan[i].pcm.freqOffs=((amigaPitch && parent->song.linearPitch!=2)?16:PITCH_OFFSET)*off;
|
||||
chan[i].pcm.freqOffs=((amigaPitch && !parent->song.linearPitch)?16:PITCH_OFFSET)*off;
|
||||
unsigned int startPos=chan[i].pcm.direction?chan[i].pcm.end:chan[i].pcm.start;
|
||||
if (chan[i].pcm.nextPos) {
|
||||
const unsigned int start=chan[i].pcm.start;
|
||||
|
|
@ -1212,7 +1212,7 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
int nextFreq=chan[c.chan].baseFreq;
|
||||
int destFreq=NOTE_ES5506(c.chan,c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
if (amigaPitch && parent->song.linearPitch!=2) {
|
||||
if (amigaPitch && !parent->song.linearPitch) {
|
||||
c.value*=16;
|
||||
}
|
||||
if (destFreq>nextFreq) {
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ void DivPlatformESFM::tick(bool sysTick) {
|
|||
if (chan[i].freqChanged) {
|
||||
int mul=2;
|
||||
int fixedBlock=chan[i].state.fm.block;
|
||||
if (parent->song.linearPitch!=2) {
|
||||
if (!parent->song.linearPitch) {
|
||||
mul=octave(chan[i].baseFreq,fixedBlock)*2;
|
||||
}
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,mul,chan[i].pitch2,chipClock,CHIP_FREQBASE);
|
||||
|
|
@ -569,7 +569,7 @@ int DivPlatformESFM::dispatch(DivCommand c) {
|
|||
bool return2=false;
|
||||
int mul=1;
|
||||
int fixedBlock=0;
|
||||
if (parent->song.linearPitch!=2) {
|
||||
if (!parent->song.linearPitch) {
|
||||
fixedBlock=chan[c.chan].state.fm.block;
|
||||
mul=octave(chan[c.chan].baseFreq,fixedBlock);
|
||||
}
|
||||
|
|
@ -586,7 +586,7 @@ int DivPlatformESFM::dispatch(DivCommand c) {
|
|||
return2=true;
|
||||
}
|
||||
}
|
||||
if (!chan[c.chan].portaPause && parent->song.linearPitch!=2) {
|
||||
if (!chan[c.chan].portaPause && !parent->song.linearPitch) {
|
||||
if (mul!=octave(newFreq,fixedBlock)) {
|
||||
chan[c.chan].portaPause=true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -894,7 +894,7 @@ void DivPlatformGenesis::tick(bool sysTick) {
|
|||
for (int i=0; i<csmChan; i++) {
|
||||
if (i==2 && extMode) continue;
|
||||
if (chan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE,11);
|
||||
|
|
@ -1223,7 +1223,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>opChan[ch].baseFreq) {
|
||||
|
|
@ -656,7 +656,7 @@ void DivPlatformGenesisExt::tick(bool sysTick) {
|
|||
unsigned char hardResetMask=0;
|
||||
if (extMode) for (int i=0; i<4; i++) {
|
||||
if (opChan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,2,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,2,opChan[i].pitch2);
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ int DivPlatformLynx::dispatch(DivCommand c) {
|
|||
}
|
||||
}
|
||||
chan[c.chan].freqChanged=true;
|
||||
if (chan[c.chan].pcm && parent->song.linearPitch==2) {
|
||||
if (chan[c.chan].pcm && parent->song.linearPitch) {
|
||||
chan[c.chan].sampleBaseFreq=chan[c.chan].baseFreq;
|
||||
}
|
||||
if (return2) {
|
||||
|
|
|
|||
|
|
@ -386,13 +386,13 @@ int DivPlatformN163::dispatch(DivCommand c) {
|
|||
int destFreq=destFreqD;
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:16);
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:16);
|
||||
if (chan[c.chan].baseFreq>=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:16);
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:16);
|
||||
if (chan[c.chan].baseFreq<=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
|
|||
|
|
@ -406,13 +406,13 @@ int DivPlatformNamcoWSG::dispatch(DivCommand c) {
|
|||
int destFreq=NOTE_FREQUENCY(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:8);
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:8);
|
||||
if (chan[c.chan].baseFreq>=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:8);
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:8);
|
||||
if (chan[c.chan].baseFreq<=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
|
|||
|
|
@ -1510,7 +1510,7 @@ void DivPlatformOPL::tick(bool sysTick) {
|
|||
if (chan[i].freqChanged) {
|
||||
int mul=2;
|
||||
int fixedBlock=chan[i].state.block;
|
||||
if (parent->song.linearPitch!=2) {
|
||||
if (!parent->song.linearPitch) {
|
||||
mul=octave(chan[i].baseFreq,fixedBlock)*2;
|
||||
}
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,mul,chan[i].pitch2,chipClock,CHIP_FREQBASE);
|
||||
|
|
@ -2116,7 +2116,7 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
|||
bool return2=false;
|
||||
int mul=1;
|
||||
int fixedBlock=0;
|
||||
if (parent->song.linearPitch!=2) {
|
||||
if (!parent->song.linearPitch) {
|
||||
fixedBlock=chan[c.chan].state.block;
|
||||
mul=octave(chan[c.chan].baseFreq,fixedBlock);
|
||||
}
|
||||
|
|
@ -2133,7 +2133,7 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
|||
return2=true;
|
||||
}
|
||||
}
|
||||
if (!chan[c.chan].portaPause && parent->song.linearPitch!=2) {
|
||||
if (!chan[c.chan].portaPause && !parent->song.linearPitch) {
|
||||
if (mul!=octave(newFreq,fixedBlock)) {
|
||||
chan[c.chan].portaPause=true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ void DivPlatformOPLL::tick(bool sysTick) {
|
|||
if (chan[i].freqChanged) {
|
||||
int mul=2;
|
||||
int fixedBlock=chan[i].state.block;
|
||||
if (parent->song.linearPitch!=2) {
|
||||
if (!parent->song.linearPitch) {
|
||||
mul=octave(chan[i].baseFreq,fixedBlock)*2;
|
||||
}
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,mul,chan[i].pitch2,chipClock,CHIP_FREQBASE);
|
||||
|
|
@ -684,7 +684,7 @@ int DivPlatformOPLL::dispatch(DivCommand c) {
|
|||
bool return2=false;
|
||||
int mul=1;
|
||||
int fixedBlock=0;
|
||||
if (parent->song.linearPitch!=2) {
|
||||
if (!parent->song.linearPitch) {
|
||||
fixedBlock=chan[c.chan].state.block;
|
||||
mul=octave(chan[c.chan].baseFreq,fixedBlock);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ void DivPlatformPOKEY::tick(bool sysTick) {
|
|||
}
|
||||
|
||||
// non-linear pitch
|
||||
if (parent->song.linearPitch==0) {
|
||||
if (!parent->song.linearPitch) {
|
||||
chan[i].freq-=chan[i].pitch;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,13 +261,13 @@ int DivPlatformSAA1099::dispatch(DivCommand c) {
|
|||
int destFreq=NOTE_PERIODIC(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:(8-chan[c.chan].freqH));
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:(8-chan[c.chan].freqH));
|
||||
if (chan[c.chan].baseFreq>=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:(8-chan[c.chan].freqH));
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:(8-chan[c.chan].freqH));
|
||||
if (chan[c.chan].baseFreq<=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ int DivPlatformSegaPCM::dispatch(DivCommand c) {
|
|||
case DIV_CMD_NOTE_PORTA: {
|
||||
int destFreq=((c.value2+chan[c.chan].sampleNoteDelta)<<7);
|
||||
int newFreq;
|
||||
int mul=(oldSlides || parent->song.linearPitch!=2)?8:1;
|
||||
int mul=(oldSlides || !parent->song.linearPitch)?8:1;
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
newFreq=chan[c.chan].baseFreq+c.value*mul;
|
||||
|
|
|
|||
|
|
@ -267,13 +267,13 @@ int DivPlatformSM8521::dispatch(DivCommand c) {
|
|||
int destFreq=NOTE_PERIODIC(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:8);
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:8);
|
||||
if (chan[c.chan].baseFreq>=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:8);
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:8);
|
||||
if (chan[c.chan].baseFreq<=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ void DivPlatformSMS::acquireDirect(blip_buffer_t** bb, size_t len) {
|
|||
double DivPlatformSMS::NOTE_SN(int ch, int note) {
|
||||
double CHIP_DIVIDER=toneDivider;
|
||||
if (ch==3) CHIP_DIVIDER=noiseDivider;
|
||||
if (parent->song.linearPitch==2 || !easyNoise) {
|
||||
if (parent->song.linearPitch || !easyNoise) {
|
||||
return NOTE_PERIODIC(note);
|
||||
}
|
||||
int easyStartingPeriod=16;
|
||||
|
|
@ -209,7 +209,7 @@ int DivPlatformSMS::snCalcFreq(int ch) {
|
|||
if (chan[ch].fixedArp) {
|
||||
curFreq=chan[ch].baseNoteOverride<<7;
|
||||
}
|
||||
if (parent->song.linearPitch==2 && easyNoise && curFreq>easyThreshold) {
|
||||
if (parent->song.linearPitch && easyNoise && curFreq>easyThreshold) {
|
||||
int ret=(((easyStartingPeriod<<7))-(curFreq-(easyThreshold)))>>7;
|
||||
if (ret<0) ret=0;
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -484,13 +484,13 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
|
|||
int destFreq=NOTE_SU(c.chan,c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:(1+(chan[c.chan].baseFreq>>9)));
|
||||
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch)?1:(1+(chan[c.chan].baseFreq>>9)));
|
||||
if (chan[c.chan].baseFreq>=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:(1+(chan[c.chan].baseFreq>>9)));
|
||||
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch)?1:(1+(chan[c.chan].baseFreq>>9)));
|
||||
if (chan[c.chan].baseFreq<=destFreq) {
|
||||
chan[c.chan].baseFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void DivPlatformT6W28::writeOutVol(int ch) {
|
|||
double DivPlatformT6W28::NOTE_SN(int ch, int note) {
|
||||
double CHIP_DIVIDER=16;
|
||||
if (ch==3) CHIP_DIVIDER=15;
|
||||
if (parent->song.linearPitch==2 || !easyNoise) {
|
||||
if (parent->song.linearPitch || !easyNoise) {
|
||||
return NOTE_PERIODIC(note);
|
||||
}
|
||||
if (note>107) {
|
||||
|
|
@ -105,7 +105,7 @@ double DivPlatformT6W28::NOTE_SN(int ch, int note) {
|
|||
}
|
||||
|
||||
int DivPlatformT6W28::snCalcFreq(int ch) {
|
||||
if (parent->song.linearPitch==2 && easyNoise && chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2>(107<<7)) {
|
||||
if (parent->song.linearPitch && easyNoise && chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2>(107<<7)) {
|
||||
int ret=(((13<<7)+0x40)-(chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2-(107<<7)))>>7;
|
||||
if (ret<0) ret=0;
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ void DivPlatformTX81Z::tick(bool sysTick) {
|
|||
}
|
||||
|
||||
// fixed pitch
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
bool freqChangeOp=false;
|
||||
|
||||
if (op.egt) {
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ void DivPlatformYM2203::tick(bool sysTick) {
|
|||
for (int i=0; i<3; i++) {
|
||||
if (i==2 && extMode) continue;
|
||||
if (chan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2);
|
||||
|
|
@ -867,7 +867,7 @@ int DivPlatformYM2203::dispatch(DivCommand c) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
if (c.chan>(psgChanOffs-1) || parent->song.linearPitch==2) { // PSG
|
||||
if (c.chan>(psgChanOffs-1) || parent->song.linearPitch) { // PSG
|
||||
int destFreq=NOTE_FNUM_BLOCK(c.value2,11,chan[c.chan].state.block);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>opChan[ch].baseFreq) {
|
||||
|
|
@ -551,7 +551,7 @@ void DivPlatformYM2203Ext::tick(bool sysTick) {
|
|||
unsigned char hardResetMask=0;
|
||||
if (extMode) for (int i=0; i<4; i++) {
|
||||
if (opChan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2);
|
||||
|
|
|
|||
|
|
@ -916,7 +916,7 @@ void DivPlatformYM2608::tick(bool sysTick) {
|
|||
for (int i=0; i<6; i++) {
|
||||
if (i==2 && extMode) continue;
|
||||
if (chan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2);
|
||||
|
|
@ -1395,7 +1395,7 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
if (c.chan>(5+isCSM) || parent->song.linearPitch==2) { // PSG, ADPCM-B
|
||||
if (c.chan>(5+isCSM) || parent->song.linearPitch) { // PSG, ADPCM-B
|
||||
int destFreq=NOTE_OPNB(c.chan,c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>opChan[ch].baseFreq) {
|
||||
|
|
@ -612,7 +612,7 @@ void DivPlatformYM2608Ext::tick(bool sysTick) {
|
|||
unsigned char hardResetMask=0;
|
||||
if (extMode) for (int i=0; i<4; i++) {
|
||||
if (opChan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2);
|
||||
|
|
|
|||
|
|
@ -836,7 +836,7 @@ void DivPlatformYM2610::tick(bool sysTick) {
|
|||
for (int i=0; i<(psgChanOffs-isCSM); i++) {
|
||||
if (i==1 && extMode) continue;
|
||||
if (chan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11);
|
||||
|
|
@ -1354,7 +1354,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
if (c.chan>=psgChanOffs || parent->song.linearPitch==2) { // PSG, ADPCM-B
|
||||
if (c.chan>=psgChanOffs || parent->song.linearPitch) { // PSG, ADPCM-B
|
||||
int destFreq=NOTE_OPNB(c.chan,c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
|
|
|
|||
|
|
@ -905,7 +905,7 @@ void DivPlatformYM2610B::tick(bool sysTick) {
|
|||
for (int i=0; i<(psgChanOffs-isCSM); i++) {
|
||||
if (i==2 && extMode) continue;
|
||||
if (chan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[i].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(chan[i].baseFreq&0x7ff,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,4,chan[i].pitch2);
|
||||
|
|
@ -1423,7 +1423,7 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
if (c.chan>=psgChanOffs || parent->song.linearPitch==2) { // PSG, ADPCM-B
|
||||
if (c.chan>=psgChanOffs || parent->song.linearPitch) { // PSG, ADPCM-B
|
||||
int destFreq=NOTE_OPNB(c.chan,c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>opChan[ch].baseFreq) {
|
||||
|
|
@ -604,7 +604,7 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
|
|||
unsigned char hardResetMask=0;
|
||||
if (extMode) for (int i=0; i<4; i++) {
|
||||
if (opChan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2);
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_PORTA: {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2);
|
||||
bool return2=false;
|
||||
if (destFreq>opChan[ch].baseFreq) {
|
||||
|
|
@ -604,7 +604,7 @@ void DivPlatformYM2610Ext::tick(bool sysTick) {
|
|||
unsigned char hardResetMask=0;
|
||||
if (extMode) for (int i=0; i<4; i++) {
|
||||
if (opChan[i].freqChanged) {
|
||||
if (parent->song.linearPitch==2) {
|
||||
if (parent->song.linearPitch) {
|
||||
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2,chipClock,CHIP_FREQBASE,11,chan[extChanOffs].state.block);
|
||||
} else {
|
||||
int fNum=parent->calcFreq(opChan[i].baseFreq&0x7ff,opChan[i].pitch,opChan[i].fixedArp?opChan[i].baseNoteOverride:opChan[i].arpOff,opChan[i].fixedArp,false,4,opChan[i].pitch2);
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ int DivPlatformYMZ280B::dispatch(DivCommand c) {
|
|||
case DIV_CMD_NOTE_PORTA: {
|
||||
int destFreq=NOTE_FREQUENCY(c.value2+chan[c.chan].sampleNoteDelta);
|
||||
bool return2=false;
|
||||
int multiplier=(parent->song.linearPitch==2)?1:256;
|
||||
int multiplier=(parent->song.linearPitch)?1:256;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
chan[c.chan].baseFreq+=c.value*multiplier;
|
||||
if (chan[c.chan].baseFreq>=destFreq) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue