Merge branch 'master' into es5506_alt
This commit is contained in:
commit
ff937604c7
50 changed files with 626 additions and 536 deletions
|
|
@ -154,7 +154,7 @@ class DivPlatformOPN: public DivPlatformFMBase {
|
|||
unsigned int ayDiv;
|
||||
unsigned char csmChan;
|
||||
unsigned char lfoValue;
|
||||
bool extSys, useCombo;
|
||||
bool extSys, useCombo, fbAllOps;
|
||||
|
||||
DivConfig ayFlags;
|
||||
|
||||
|
|
@ -173,7 +173,8 @@ class DivPlatformOPN: public DivPlatformFMBase {
|
|||
csmChan(cc),
|
||||
lfoValue(0),
|
||||
extSys(isExtSys),
|
||||
useCombo(false) {}
|
||||
useCombo(false),
|
||||
fbAllOps(false) {}
|
||||
public:
|
||||
void setCombo(bool combo) {
|
||||
useCombo=combo;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ void DivPlatformGenesis::tick(bool sysTick) {
|
|||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(chan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
}
|
||||
|
|
@ -575,6 +575,8 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
} else if (chan[c.chan].furnaceDac) {
|
||||
chan[c.chan].dacMode=0;
|
||||
rWrite(0x2b,0<<7);
|
||||
} else if (!chan[c.chan].dacMode) {
|
||||
rWrite(0x2b,0<<7);
|
||||
}
|
||||
}
|
||||
if (c.chan>=5 && chan[c.chan].dacMode) {
|
||||
|
|
@ -1253,6 +1255,7 @@ void DivPlatformGenesis::setFlags(const DivConfig& flags) {
|
|||
}
|
||||
ladder=flags.getBool("ladderEffect",false);
|
||||
noExtMacros=flags.getBool("noExtMacros",false);
|
||||
fbAllOps=flags.getBool("fbAllOps",false);
|
||||
OPN2_SetChipType(&fm,ladder?ym3438_mode_ym2612:0);
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
if (useYMFM) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
|
|||
|
||||
if (opChan[ch].insChanged) {
|
||||
chan[2].state.alg=ins->fm.alg;
|
||||
chan[2].state.fb=ins->fm.fb;
|
||||
if (ch==0 || fbAllOps) {
|
||||
chan[2].state.fb=ins->fm.fb;
|
||||
}
|
||||
chan[2].state.fms=ins->fm.fms;
|
||||
chan[2].state.ams=ins->fm.ams;
|
||||
chan[2].state.op[ordch]=ins->fm.op[ordch];
|
||||
|
|
@ -491,7 +493,7 @@ void DivPlatformGenesisExt::tick(bool sysTick) {
|
|||
if (opChan[i].std.pitch.had) {
|
||||
if (opChan[i].std.pitch.mode) {
|
||||
opChan[i].pitch2+=opChan[i].std.pitch.val;
|
||||
CLAMP_VAR(opChan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(opChan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
opChan[i].pitch2=opChan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,13 @@ void DivPlatformMSM5232::tick(bool sysTick) {
|
|||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||
//DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_PCE);
|
||||
chan[i].freq=chan[i].baseFreq+chan[i].pitch+chan[i].pitch2-(12<<7);
|
||||
if (!parent->song.oldArpStrategy) {
|
||||
if (chan[i].fixedArp) {
|
||||
chan[i].freq=(chan[i].baseNoteOverride<<7)+(chan[i].pitch)-(12<<7);
|
||||
} else {
|
||||
chan[i].freq+=chan[i].arpOff<<7;
|
||||
}
|
||||
}
|
||||
if (chan[i].freq<0) chan[i].freq=0;
|
||||
if (chan[i].freq>0x2aff) chan[i].freq=0x2aff;
|
||||
if (chan[i].keyOn) {
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ void DivPlatformNES::tick(bool sysTick) {
|
|||
rWrite(0x4000+i*4,(chan[i].envMode<<4)|chan[i].outVol|((chan[i].duty&3)<<6));
|
||||
}
|
||||
}
|
||||
if (NEW_ARP_STRAT && i!=3) {
|
||||
if (NEW_ARP_STRAT) {
|
||||
chan[i].handleArp();
|
||||
} else if (chan[i].std.arp.had) {
|
||||
if (i==3) { // noise
|
||||
|
|
@ -271,9 +271,20 @@ void DivPlatformNES::tick(bool sysTick) {
|
|||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||
if (i==3) { // noise
|
||||
int ntPos=chan[i].baseFreq;
|
||||
if (ntPos<0) ntPos=0;
|
||||
if (ntPos>252) ntPos=252;
|
||||
chan[i].freq=(parent->song.properNoiseLayout)?(15-(chan[i].baseFreq&15)):(noiseTable[ntPos]);
|
||||
if (NEW_ARP_STRAT) {
|
||||
if (chan[i].fixedArp) {
|
||||
ntPos=chan[i].baseNoteOverride;
|
||||
} else {
|
||||
ntPos+=chan[i].arpOff;
|
||||
}
|
||||
}
|
||||
if (parent->song.properNoiseLayout) {
|
||||
chan[i].freq=15-(ntPos&15);
|
||||
} else {
|
||||
if (ntPos<0) ntPos=0;
|
||||
if (ntPos>252) ntPos=252;
|
||||
chan[i].freq=noiseTable[ntPos];
|
||||
}
|
||||
} else {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER)-1;
|
||||
if (chan[i].freq>2047) chan[i].freq=2047;
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ void DivPlatformOPLL::tick(bool sysTick) {
|
|||
if (chan[i].freq<0) chan[i].freq=0;
|
||||
if (chan[i].freq>65535) chan[i].freq=65535;
|
||||
int freqt=toFreq(chan[i].freq);
|
||||
if (freqt>2047) freqt=2047;
|
||||
if (freqt>4095) freqt=4095;
|
||||
chan[i].freqL=freqt&0xff;
|
||||
if (i>=6 && properDrums && (i<9 || !noTopHatFreq)) {
|
||||
immWrite(0x10+drumSlot[i],freqt&0xff);
|
||||
|
|
@ -456,12 +456,14 @@ int DivPlatformOPLL::dispatch(DivCommand c) {
|
|||
if (c.chan>=9 && !properDrums) return 0;
|
||||
chan[c.chan].keyOff=true;
|
||||
chan[c.chan].keyOn=false;
|
||||
chan[c.chan].freqChanged=true;
|
||||
chan[c.chan].active=false;
|
||||
break;
|
||||
case DIV_CMD_NOTE_OFF_ENV:
|
||||
if (c.chan>=9 && !properDrums) return 0;
|
||||
chan[c.chan].keyOff=true;
|
||||
chan[c.chan].keyOn=false;
|
||||
chan[c.chan].freqChanged=true;
|
||||
chan[c.chan].active=false;
|
||||
chan[c.chan].std.release();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ void DivPlatformPCE::tick(bool sysTick) {
|
|||
}
|
||||
if (NEW_ARP_STRAT) {
|
||||
chan[i].handleArp();
|
||||
int noiseSeek=chan[i].fixedArp?chan[i].baseNoteOverride:(chan[i].note+chan[i].arpOff);
|
||||
if (noiseSeek<0) noiseSeek=0;
|
||||
chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0);
|
||||
} else if (chan[i].std.arp.had) {
|
||||
if (!chan[i].inPorta) {
|
||||
int noiseSeek=parent->calcArp(chan[i].note,chan[i].std.arp.val);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ void DivPlatformSegaPCM::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
oscBuf[i]->data[oscBuf[i]->needle++]=s->data8[chan[i].pcm.pos>>8]*(chan[i].chVolL+chan[i].chVolR)>>1;
|
||||
pcmL+=(s->data8[chan[i].pcm.pos>>8]*chan[i].chVolL);
|
||||
pcmR+=(s->data8[chan[i].pcm.pos>>8]*chan[i].chVolR);
|
||||
} else {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=0;
|
||||
}
|
||||
chan[i].pcm.pos+=chan[i].pcm.freq;
|
||||
if (s->isLoopable() && chan[i].pcm.pos>=((unsigned int)s->loopEnd<<8)) {
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ void SPC_DSP::run( int clocks_remain )
|
|||
{
|
||||
loop:
|
||||
// GCC, why
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#if (defined(__GNUC__) && (__GNUC__ >= 7)) && !defined(__clang__)
|
||||
#define PHASE( n ) if ( n && !--clocks_remain ) break; __attribute__ ((fallthrough)); case n:
|
||||
#else
|
||||
#define PHASE( n ) if ( n && !--clocks_remain ) break; case n:
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ void DivPlatformYM2203::tick(bool sysTick) {
|
|||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(chan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
}
|
||||
|
|
@ -449,7 +449,7 @@ void DivPlatformYM2203::tick(bool sysTick) {
|
|||
if (parent->song.linearPitch==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,4,chan[i].pitch2,chipClock,CHIP_FREQBASE,11);
|
||||
} 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);
|
||||
int fNum=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);
|
||||
int block=(chan[i].baseFreq&0xf800)>>11;
|
||||
if (fNum<0) fNum=0;
|
||||
if (fNum>2047) {
|
||||
|
|
@ -1041,6 +1041,7 @@ void DivPlatformYM2203::setFlags(const DivConfig& flags) {
|
|||
}
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
noExtMacros=flags.getBool("noExtMacros",false);
|
||||
fbAllOps=flags.getBool("fbAllOps",false);
|
||||
rate=fm->sample_rate(chipClock);
|
||||
for (int i=0; i<6; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) {
|
|||
|
||||
if (opChan[ch].insChanged) {
|
||||
chan[2].state.alg=ins->fm.alg;
|
||||
chan[2].state.fb=ins->fm.fb;
|
||||
if (ch==0 || fbAllOps) {
|
||||
chan[2].state.fb=ins->fm.fb;
|
||||
}
|
||||
chan[2].state.op[ordch]=ins->fm.op[ordch];
|
||||
}
|
||||
|
||||
|
|
@ -412,7 +414,7 @@ void DivPlatformYM2203Ext::tick(bool sysTick) {
|
|||
if (opChan[i].std.pitch.had) {
|
||||
if (opChan[i].std.pitch.mode) {
|
||||
opChan[i].pitch2+=opChan[i].std.pitch.val;
|
||||
CLAMP_VAR(opChan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(opChan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
opChan[i].pitch2=opChan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ void DivPlatformYM2608::acquire_combo(short* bufL, short* bufR, size_t start, si
|
|||
if (--delay<1 && !(fm->read(0)&0x80)) {
|
||||
QueuedWrite& w=writes.front();
|
||||
|
||||
if (w.addr<=0x1c || w.addr==0x2d || w.addr==0x2e || w.addr==0x2f || (w.addr>=0x100 && w.addr<=0x12d)) {
|
||||
if (w.addr<=0x1d || w.addr==0x2d || w.addr==0x2e || w.addr==0x2f || (w.addr>=0x100 && w.addr<=0x12d)) {
|
||||
// ymfm write
|
||||
fm->write(0x0+((w.addr>>8)<<1),w.addr);
|
||||
fm->write(0x1+((w.addr>>8)<<1),w.val);
|
||||
|
|
@ -503,7 +503,7 @@ void DivPlatformYM2608::tick(bool sysTick) {
|
|||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(chan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
}
|
||||
|
|
@ -1538,6 +1538,7 @@ void DivPlatformYM2608::setFlags(const DivConfig& flags) {
|
|||
}
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
noExtMacros=flags.getBool("noExtMacros",false);
|
||||
fbAllOps=flags.getBool("fbAllOps",false);
|
||||
rate=fm->sample_rate(chipClock);
|
||||
for (int i=0; i<16; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) {
|
|||
|
||||
if (opChan[ch].insChanged) {
|
||||
chan[2].state.alg=ins->fm.alg;
|
||||
chan[2].state.fb=ins->fm.fb;
|
||||
if (ch==0 || fbAllOps) {
|
||||
chan[2].state.fb=ins->fm.fb;
|
||||
}
|
||||
chan[2].state.fms=ins->fm.fms;
|
||||
chan[2].state.ams=ins->fm.ams;
|
||||
chan[2].state.op[ordch]=ins->fm.op[ordch];
|
||||
|
|
@ -435,7 +437,7 @@ void DivPlatformYM2608Ext::tick(bool sysTick) {
|
|||
if (opChan[i].std.pitch.had) {
|
||||
if (opChan[i].std.pitch.mode) {
|
||||
opChan[i].pitch2+=opChan[i].std.pitch.val;
|
||||
CLAMP_VAR(opChan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(opChan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
opChan[i].pitch2=opChan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ void DivPlatformYM2610::tick(bool sysTick) {
|
|||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(chan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ void DivPlatformYM2610B::tick(bool sysTick) {
|
|||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(chan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) {
|
|||
|
||||
if (opChan[ch].insChanged) {
|
||||
chan[extChanOffs].state.alg=ins->fm.alg;
|
||||
chan[extChanOffs].state.fb=ins->fm.fb;
|
||||
if (ch==0 || fbAllOps) {
|
||||
chan[extChanOffs].state.fb=ins->fm.fb;
|
||||
}
|
||||
chan[extChanOffs].state.fms=ins->fm.fms;
|
||||
chan[extChanOffs].state.ams=ins->fm.ams;
|
||||
chan[extChanOffs].state.op[ordch]=ins->fm.op[ordch];
|
||||
|
|
@ -431,7 +433,7 @@ void DivPlatformYM2610BExt::tick(bool sysTick) {
|
|||
if (opChan[i].std.pitch.had) {
|
||||
if (opChan[i].std.pitch.mode) {
|
||||
opChan[i].pitch2+=opChan[i].std.pitch.val;
|
||||
CLAMP_VAR(opChan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(opChan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
opChan[i].pitch2=opChan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
|
|||
|
||||
if (opChan[ch].insChanged) {
|
||||
chan[extChanOffs].state.alg=ins->fm.alg;
|
||||
chan[extChanOffs].state.fb=ins->fm.fb;
|
||||
if (ch==0 || fbAllOps) {
|
||||
chan[extChanOffs].state.fb=ins->fm.fb;
|
||||
}
|
||||
chan[extChanOffs].state.fms=ins->fm.fms;
|
||||
chan[extChanOffs].state.ams=ins->fm.ams;
|
||||
chan[extChanOffs].state.op[ordch]=ins->fm.op[ordch];
|
||||
|
|
@ -431,7 +433,7 @@ void DivPlatformYM2610Ext::tick(bool sysTick) {
|
|||
if (opChan[i].std.pitch.had) {
|
||||
if (opChan[i].std.pitch.mode) {
|
||||
opChan[i].pitch2+=opChan[i].std.pitch.val;
|
||||
CLAMP_VAR(opChan[i].pitch2,-32768,32767);
|
||||
CLAMP_VAR(opChan[i].pitch2,-1048576,1048575);
|
||||
} else {
|
||||
opChan[i].pitch2=opChan[i].std.pitch.val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ class DivPlatformYM2610Base: public DivPlatformOPN {
|
|||
}
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
noExtMacros=flags.getBool("noExtMacros",false);
|
||||
fbAllOps=flags.getBool("fbAllOps",false);
|
||||
rate=fm->sample_rate(chipClock);
|
||||
for (int i=0; i<16; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue