Merge branch 'master' of https://github.com/LTVA1/furnace into c64improve
This commit is contained in:
commit
ecec1acd24
|
@ -3008,11 +3008,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// C64 1Exy compat
|
// C64 1Exy and old version test bit macro compat
|
||||||
if (ds.version<186) {
|
if (ds.version<186) {
|
||||||
for (int i=0; i<ds.systemLen; i++) {
|
for (int i=0; i<ds.systemLen; i++) {
|
||||||
if (ds.system[i]==DIV_SYSTEM_C64_8580 || ds.system[i]==DIV_SYSTEM_C64_6581) {
|
if (ds.system[i]==DIV_SYSTEM_C64_8580 || ds.system[i]==DIV_SYSTEM_C64_6581) {
|
||||||
ds.systemFlags[i].set("no1EUpdate",true);
|
ds.systemFlags[i].set("no1EUpdate",true);
|
||||||
|
ds.systemFlags[i].set("newTestBitMacro",true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,19 @@ void DivPlatformC64::tick(bool sysTick) {
|
||||||
willUpdateFilter=true;
|
willUpdateFilter=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.alg.had) { //new cutoff macro!
|
||||||
|
DivInstrument* ins = parent->getIns(chan[i].ins, DIV_INS_C64);
|
||||||
|
if (ins->c64.filterIsAbs) {
|
||||||
|
filtCut = MIN(2047, chan[i].std.alg.val);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
filtCut += ((signed char)chan[i].std.alg.val) * 7; //new macro should not be executed in inverted way when in relative mode jesus
|
||||||
|
if (filtCut > 2047) filtCut = 2047;
|
||||||
|
if (filtCut < 0) filtCut = 0;
|
||||||
|
}
|
||||||
|
willUpdateFilter = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (NEW_ARP_STRAT) {
|
if (NEW_ARP_STRAT) {
|
||||||
chan[i].handleArp();
|
chan[i].handleArp();
|
||||||
} else if (chan[i].std.arp.had) {
|
} else if (chan[i].std.arp.had) {
|
||||||
|
@ -220,9 +233,40 @@ void DivPlatformC64::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.ex4.had) {
|
if (chan[i].std.ex4.had) {
|
||||||
chan[i].test=chan[i].std.ex4.val&1;
|
chan[i].test=chan[i].std.ex4.val&1;
|
||||||
|
|
||||||
|
if (newTestBitMacro)
|
||||||
|
{
|
||||||
|
chan[i].active = chan[i].std.ex4.val & 2;
|
||||||
|
if (!chan[i].active)
|
||||||
|
{
|
||||||
|
chan[i].keyOff = true;
|
||||||
|
chan[i].keyOn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rWrite(i*7+4,(chan[i].wave<<4)|(chan[i].test<<3)|(chan[i].ring<<2)|(chan[i].sync<<1)|(int)(chan[i].active));
|
rWrite(i*7+4,(chan[i].wave<<4)|(chan[i].test<<3)|(chan[i].ring<<2)|(chan[i].sync<<1)|(int)(chan[i].active));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.ex5.had) {
|
||||||
|
chan[i].attack = chan[i].std.ex5.val & 15;
|
||||||
|
rWrite(i * 7 + 5, (chan[i].attack << 4) | (chan[i].decay));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.ex6.had) {
|
||||||
|
chan[i].decay = chan[i].std.ex6.val & 15;
|
||||||
|
rWrite(i * 7 + 5, (chan[i].attack << 4) | (chan[i].decay));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.ex7.had) {
|
||||||
|
chan[i].sustain = chan[i].std.ex7.val & 15;
|
||||||
|
rWrite(i * 7 + 6, (chan[i].sustain << 4) | (chan[i].release));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.ex8.had) {
|
||||||
|
chan[i].release = chan[i].std.ex8.val & 15;
|
||||||
|
rWrite(i * 7 + 6, (chan[i].sustain << 4) | (chan[i].release));
|
||||||
|
}
|
||||||
|
|
||||||
if (sysTick) {
|
if (sysTick) {
|
||||||
if (chan[i].testWhen>0) {
|
if (chan[i].testWhen>0) {
|
||||||
if (--chan[i].testWhen<1) {
|
if (--chan[i].testWhen<1) {
|
||||||
|
@ -396,7 +440,7 @@ int DivPlatformC64::dispatch(DivCommand c) {
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PRE_PORTA:
|
case DIV_CMD_PRE_PORTA:
|
||||||
if (chan[c.chan].active && c.value2) {
|
if (chan[c.chan].active && c.value2) {
|
||||||
if (parent->song.resetMacroOnPorta || !chan[c.chan].inPorta) {
|
if (parent->song.resetMacroOnPorta) {// || !chan[c.chan].inPorta) {
|
||||||
chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_C64));
|
chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_C64));
|
||||||
chan[c.chan].keyOn=true;
|
chan[c.chan].keyOn=true;
|
||||||
}
|
}
|
||||||
|
@ -686,6 +730,7 @@ void DivPlatformC64::setFlags(const DivConfig& flags) {
|
||||||
}
|
}
|
||||||
keyPriority=flags.getBool("keyPriority",true);
|
keyPriority=flags.getBool("keyPriority",true);
|
||||||
no1EUpdate=flags.getBool("no1EUpdate",false);
|
no1EUpdate=flags.getBool("no1EUpdate",false);
|
||||||
|
newTestBitMacro = flags.getBool("newTestBitMacro", false);
|
||||||
testAD=((flags.getInt("testAttack",0)&15)<<4)|(flags.getInt("testDecay",0)&15);
|
testAD=((flags.getInt("testAttack",0)&15)<<4)|(flags.getInt("testDecay",0)&15);
|
||||||
testSR=((flags.getInt("testSustain",0)&15)<<4)|(flags.getInt("testRelease",0)&15);
|
testSR=((flags.getInt("testSustain",0)&15)<<4)|(flags.getInt("testRelease",0)&15);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class DivPlatformC64: public DivDispatch {
|
||||||
unsigned char sidCore;
|
unsigned char sidCore;
|
||||||
int filtCut, resetTime;
|
int filtCut, resetTime;
|
||||||
|
|
||||||
bool keyPriority, sidIs6581, needInitTables, no1EUpdate;
|
bool keyPriority, sidIs6581, needInitTables, no1EUpdate, newTestBitMacro;
|
||||||
unsigned char chanOrder[3];
|
unsigned char chanOrder[3];
|
||||||
unsigned char testAD, testSR;
|
unsigned char testAD, testSR;
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,10 @@ const char* c64SpecialBits[3]={
|
||||||
"sync", "ring", NULL
|
"sync", "ring", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char* c64TestGateBits[3]={
|
||||||
|
"test", "gate", NULL
|
||||||
|
};
|
||||||
|
|
||||||
const char* pokeyCtlBits[9]={
|
const char* pokeyCtlBits[9]={
|
||||||
"15KHz", "filter 2+4", "filter 1+3", "16-bit 3+4", "16-bit 1+2", "high3", "high1", "poly9", NULL
|
"15KHz", "filter 2+4", "filter 1+3", "16-bit 3+4", "16-bit 1+2", "high3", "high1", "poly9", NULL
|
||||||
};
|
};
|
||||||
|
@ -6434,6 +6438,15 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
}
|
}
|
||||||
if (ex1Max>0) {
|
if (ex1Max>0) {
|
||||||
if (ins->type==DIV_INS_C64) {
|
if (ins->type==DIV_INS_C64) {
|
||||||
|
int cutoffmin = -64;
|
||||||
|
int cutoffmax = 64;
|
||||||
|
|
||||||
|
if (ins->c64.filterIsAbs) {
|
||||||
|
ins->std.algMacro.vZoom = -1;
|
||||||
|
cutoffmin = 0;
|
||||||
|
cutoffmax = 2047;
|
||||||
|
}
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc("Filter Cutoff", &ins->std.algMacro, cutoffmin, cutoffmax, 160, uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc("Filter Mode",&ins->std.ex1Macro,0,ex1Max,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,filtModeBits));
|
macroList.push_back(FurnaceGUIMacroDesc("Filter Mode",&ins->std.ex1Macro,0,ex1Max,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,filtModeBits));
|
||||||
} else if (ins->type==DIV_INS_SAA1099) {
|
} else if (ins->type==DIV_INS_SAA1099) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc("Envelope",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,saaEnvBits));
|
macroList.push_back(FurnaceGUIMacroDesc("Envelope",&ins->std.ex1Macro,0,ex1Max,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,saaEnvBits));
|
||||||
|
@ -6480,7 +6493,12 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
}
|
}
|
||||||
if (ins->type==DIV_INS_C64) {
|
if (ins->type==DIV_INS_C64) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc("Special",&ins->std.ex3Macro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,c64SpecialBits));
|
macroList.push_back(FurnaceGUIMacroDesc("Special",&ins->std.ex3Macro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,c64SpecialBits));
|
||||||
macroList.push_back(FurnaceGUIMacroDesc("Test/Gate",&ins->std.ex4Macro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
//macroList.push_back(FurnaceGUIMacroDesc("Test/Gate",&ins->std.ex4Macro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc("Test/Gate",&ins->std.ex4Macro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL, true, c64TestGateBits));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc("Attack", &ins->std.ex5Macro, 0, 15, 128, uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc("Decay", &ins->std.ex6Macro, 0, 15, 128, uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc("Sustain", &ins->std.ex7Macro, 0, 15, 128, uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
|
macroList.push_back(FurnaceGUIMacroDesc("Release", &ins->std.ex8Macro, 0, 15, 128, uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
}
|
}
|
||||||
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || (ins->type==DIV_INS_X1_010 && !ins->amiga.useSample)) {
|
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || (ins->type==DIV_INS_X1_010 && !ins->amiga.useSample)) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc("AutoEnv Num",&ins->std.ex3Macro,0,15,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
macroList.push_back(FurnaceGUIMacroDesc("AutoEnv Num",&ins->std.ex3Macro,0,15,160,uiColors[GUI_COLOR_MACRO_OTHER]));
|
||||||
|
|
|
@ -587,6 +587,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
||||||
int clockSel=flags.getInt("clockSel",0);
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
bool keyPriority=flags.getBool("keyPriority",true);
|
bool keyPriority=flags.getBool("keyPriority",true);
|
||||||
bool no1EUpdate=flags.getBool("no1EUpdate",false);
|
bool no1EUpdate=flags.getBool("no1EUpdate",false);
|
||||||
|
bool newTestBitMacro = flags.getBool("newTestBitMacro", false);
|
||||||
int testAttack=flags.getInt("testAttack",0);
|
int testAttack=flags.getInt("testAttack",0);
|
||||||
int testDecay=flags.getInt("testDecay",0);
|
int testDecay=flags.getInt("testDecay",0);
|
||||||
int testSustain=flags.getInt("testSustain",0);
|
int testSustain=flags.getInt("testSustain",0);
|
||||||
|
@ -649,11 +650,16 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
||||||
altered=true;
|
altered=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::Checkbox("New test bit macro behaviour (with gate bit) (compatibility)", &newTestBitMacro)) {
|
||||||
|
altered = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (altered) {
|
if (altered) {
|
||||||
e->lockSave([&]() {
|
e->lockSave([&]() {
|
||||||
flags.set("clockSel",clockSel);
|
flags.set("clockSel",clockSel);
|
||||||
flags.set("keyPriority",keyPriority);
|
flags.set("keyPriority",keyPriority);
|
||||||
flags.set("no1EUpdate",no1EUpdate);
|
flags.set("no1EUpdate",no1EUpdate);
|
||||||
|
flags.set("newTestBitMacro", newTestBitMacro);
|
||||||
flags.set("testAttack",testAttack);
|
flags.set("testAttack",testAttack);
|
||||||
flags.set("testDecay",testDecay);
|
flags.set("testDecay",testDecay);
|
||||||
flags.set("testSustain",testSustain);
|
flags.set("testSustain",testSustain);
|
||||||
|
|
Loading…
Reference in a new issue