more game boy playback fixes
including fixing the arp+slide thing
This commit is contained in:
parent
23dc645ced
commit
09371f9205
|
@ -71,12 +71,14 @@ void DivPlatformGB::tick() {
|
||||||
if (chan[i].baseFreq>255) chan[i].baseFreq=255;
|
if (chan[i].baseFreq>255) chan[i].baseFreq=255;
|
||||||
if (chan[i].baseFreq<0) chan[i].baseFreq=0;
|
if (chan[i].baseFreq<0) chan[i].baseFreq=0;
|
||||||
} else {
|
} else {
|
||||||
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arpMode) {
|
if (chan[i].std.arpMode) {
|
||||||
chan[i].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(chan[i].std.arp+24)/12.0f)));
|
chan[i].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(chan[i].std.arp+24)/12.0f)));
|
||||||
} else {
|
} else {
|
||||||
chan[i].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(chan[i].note+chan[i].std.arp-12)/12.0f)));
|
chan[i].baseFreq=round(FREQ_BASE/pow(2.0f,((float)(chan[i].note+chan[i].std.arp-12)/12.0f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
} else {
|
||||||
if (chan[i].std.arpMode && chan[i].std.finishedArp) {
|
if (chan[i].std.arpMode && chan[i].std.finishedArp) {
|
||||||
|
@ -211,7 +213,10 @@ int DivPlatformGB::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chan[c.chan].freqChanged=true;
|
chan[c.chan].freqChanged=true;
|
||||||
if (return2) return 2;
|
if (return2) {
|
||||||
|
chan[c.chan].inPorta=false;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_CMD_STD_NOISE_MODE:
|
case DIV_CMD_STD_NOISE_MODE:
|
||||||
|
@ -235,6 +240,7 @@ int DivPlatformGB::dispatch(DivCommand c) {
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PRE_PORTA:
|
case DIV_CMD_PRE_PORTA:
|
||||||
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
|
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
|
||||||
|
chan[c.chan].inPorta=c.value;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_GB_SWEEP_DIR:
|
case DIV_CMD_GB_SWEEP_DIR:
|
||||||
chan[c.chan].sweep&=0xf7;
|
chan[c.chan].sweep&=0xf7;
|
||||||
|
|
|
@ -9,7 +9,7 @@ class DivPlatformGB: public DivDispatch {
|
||||||
struct Channel {
|
struct Channel {
|
||||||
int freq, baseFreq, pitch;
|
int freq, baseFreq, pitch;
|
||||||
unsigned char ins, note, duty, sweep;
|
unsigned char ins, note, duty, sweep;
|
||||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff;
|
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta;
|
||||||
signed char vol, outVol, wave;
|
signed char vol, outVol, wave;
|
||||||
DivMacroInt std;
|
DivMacroInt std;
|
||||||
Channel():
|
Channel():
|
||||||
|
@ -26,6 +26,7 @@ class DivPlatformGB: public DivDispatch {
|
||||||
sweepChanged(false),
|
sweepChanged(false),
|
||||||
keyOn(false),
|
keyOn(false),
|
||||||
keyOff(false),
|
keyOff(false),
|
||||||
|
inPorta(false),
|
||||||
vol(15),
|
vol(15),
|
||||||
wave(-1) {}
|
wave(-1) {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -274,7 +274,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
chan[i].portaStop=true;
|
chan[i].portaStop=true;
|
||||||
chan[i].doNote=false;
|
chan[i].doNote=false;
|
||||||
chan[i].stopOnOff=true;
|
chan[i].stopOnOff=true;
|
||||||
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i));
|
dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x04: // vibrato
|
case 0x04: // vibrato
|
||||||
|
@ -493,6 +493,8 @@ void DivEngine::nextTick() {
|
||||||
if (chan[i].portaSpeed>0) {
|
if (chan[i].portaSpeed>0) {
|
||||||
if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed,chan[i].portaNote))==2 && chan[i].portaStop) {
|
if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed,chan[i].portaNote))==2 && chan[i].portaStop) {
|
||||||
chan[i].portaSpeed=0;
|
chan[i].portaSpeed=0;
|
||||||
|
chan[i].note=chan[i].portaNote;
|
||||||
|
dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[i].cut>0) {
|
if (chan[i].cut>0) {
|
||||||
|
|
Loading…
Reference in a new issue