mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 08:23:01 +00:00
YM2612: new pitch slide formula
finally nailed it (almost)
This commit is contained in:
parent
8db53faf72
commit
943e013cb4
2 changed files with 16 additions and 15 deletions
|
@ -632,21 +632,26 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
}
|
||||
}
|
||||
// check for octave boundary
|
||||
// what the heck!
|
||||
if (!chan[c.chan].portaPause) {
|
||||
chan[c.chan].freqChanged=true;
|
||||
if ((newFreq&0x7ff)>1288) {
|
||||
newFreq=((newFreq&0x7ff)>>1)|((newFreq+0x800)&0xf800);
|
||||
/*chan[c.chan].portaPause=true;
|
||||
break;*/
|
||||
newFreq=(644)|((newFreq+0x800)&0xf800);
|
||||
chan[c.chan].portaPause=true;
|
||||
chan[c.chan].freqChanged=false;
|
||||
return2=false;
|
||||
}
|
||||
if ((newFreq&0x7ff)<644) {
|
||||
newFreq=(newFreq&0x7ff)<<1|((newFreq-0x800)&0xf800);
|
||||
/*chan[c.chan].portaPause=true;
|
||||
break;*/
|
||||
newFreq=(1287)|((newFreq-0x800)&0xf800);
|
||||
chan[c.chan].portaPause=true;
|
||||
chan[c.chan].freqChanged=false;
|
||||
return2=false;
|
||||
}
|
||||
}
|
||||
chan[c.chan].baseFreq=newFreq;
|
||||
} else {
|
||||
chan[c.chan].portaPause=false;
|
||||
chan[c.chan].freqChanged=true;
|
||||
}
|
||||
chan[c.chan].baseFreq=newFreq;
|
||||
if (return2) {
|
||||
chan[c.chan].inPorta=false;
|
||||
return 2;
|
||||
|
|
|
@ -143,29 +143,25 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
|
|||
return2=true;
|
||||
}
|
||||
}
|
||||
// what the heck!
|
||||
if (!opChan[ch].portaPause) {
|
||||
opChan[ch].freqChanged=true;
|
||||
if ((newFreq&0x7ff)>1288) {
|
||||
newFreq=((newFreq&0x7ff)>>1)|((newFreq+0x800)&0xf800);
|
||||
newFreq=(644)|((newFreq+0x800)&0xf800);
|
||||
opChan[ch].portaPause=true;
|
||||
opChan[ch].freqChanged=false;
|
||||
return2=false;
|
||||
if (ch==3) printf("%d: upper bound\n",ch);
|
||||
//break;
|
||||
}
|
||||
if ((newFreq&0x7ff)<644) {
|
||||
newFreq=(newFreq&0x7ff)<<1|((newFreq-0x800)&0xf800);
|
||||
newFreq=(1287)|((newFreq-0x800)&0xf800);
|
||||
opChan[ch].portaPause=true;
|
||||
opChan[ch].freqChanged=false;
|
||||
return2=false;
|
||||
if (ch==3) printf("%d: lower bound\n",ch);
|
||||
//break;
|
||||
}
|
||||
} else {
|
||||
opChan[ch].portaPause=false;
|
||||
opChan[ch].freqChanged=true;
|
||||
}
|
||||
if (ch==3) printf("%d: writing %.4x to freq\n",ch,newFreq);
|
||||
opChan[ch].baseFreq=newFreq;
|
||||
if (return2) return 2;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue