and this finally does it

the last thing to do is a compatibility flag
This commit is contained in:
tildearrow 2022-04-23 18:02:43 -05:00
parent a7828d6ad6
commit dd9bb8327a
2 changed files with 11 additions and 11 deletions

View File

@ -618,6 +618,9 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
int destFreq=NOTE_FNUM_BLOCK(c.value2,11);
int newFreq;
bool return2=false;
if (chan[c.chan].portaPause) {
chan[c.chan].baseFreq=chan[c.chan].portaPauseFreq;
}
if (destFreq>chan[c.chan].baseFreq) {
newFreq=chan[c.chan].baseFreq+c.value;
if (newFreq>=destFreq) {
@ -634,23 +637,19 @@ 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=(644)|((newFreq+0x800)&0xf800);
chan[c.chan].portaPauseFreq=(644)|((newFreq+0x800)&0xf800);
chan[c.chan].portaPause=true;
chan[c.chan].freqChanged=false;
return2=false;
break;
}
if ((newFreq&0x7ff)<644) {
newFreq=(1287)|((newFreq-0x800)&0xf800);
chan[c.chan].portaPauseFreq=newFreq=(1287)|((newFreq-0x800)&0xf800);
chan[c.chan].portaPause=true;
chan[c.chan].freqChanged=false;
return2=false;
break;
}
} else {
chan[c.chan].portaPause=false;
chan[c.chan].freqChanged=true;
}
chan[c.chan].portaPause=false;
chan[c.chan].freqChanged=true;
chan[c.chan].baseFreq=newFreq;
if (return2) {
chan[c.chan].inPorta=false;

View File

@ -36,7 +36,7 @@ class DivPlatformGenesis: public DivDispatch {
DivInstrumentFM state;
DivMacroInt std;
unsigned char freqH, freqL;
int freq, baseFreq, pitch, note;
int freq, baseFreq, pitch, portaPauseFreq, note;
unsigned char ins;
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta, hardReset;
int vol, outVol;
@ -47,6 +47,7 @@ class DivPlatformGenesis: public DivDispatch {
freq(0),
baseFreq(0),
pitch(0),
portaPauseFreq(0),
note(0),
ins(-1),
active(false),