diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index b10ae364..4bc3328f 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -68,6 +68,20 @@ void DivPlatformAY8910::tick() { rWrite(0x08+i,(chan[i].outVol&15)|((chan[i].psgMode&4)<<2)); } } + if (chan[i].std.hadEx2) { + ayEnvMode=chan[i].std.ex2; + rWrite(0x0d,ayEnvMode); + } + if (chan[i].std.hadEx3) { + chan[i].autoEnvNum=chan[i].std.ex3; + chan[i].freqChanged=true; + if (!chan[i].std.willAlg) chan[i].autoEnvDen=1; + } + if (chan[i].std.hadAlg) { + chan[i].autoEnvDen=chan[i].std.alg; + chan[i].freqChanged=true; + if (!chan[i].std.willEx3) chan[i].autoEnvNum=1; + } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true); if (chan[i].freq>4095) chan[i].freq=4095; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index c0f1c65e..5641c7a5 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -92,6 +92,20 @@ void DivPlatformAY8930::tick() { if (chan[i].std.hadEx1) { // duty rWrite(0x16+i,chan[i].std.ex1); } + if (chan[i].std.hadEx2) { + ayEnvMode[i]=chan[i].std.ex2; + rWrite(regMode[i],ayEnvMode[i]); + } + if (chan[i].std.hadEx3) { + chan[i].autoEnvNum=chan[i].std.ex3; + chan[i].freqChanged=true; + if (!chan[i].std.willAlg) chan[i].autoEnvDen=1; + } + if (chan[i].std.hadAlg) { + chan[i].autoEnvDen=chan[i].std.alg; + chan[i].freqChanged=true; + if (!chan[i].std.willEx3) chan[i].autoEnvNum=1; + } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true); if (chan[i].freq>4095) chan[i].freq=4095; diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index 754f01c7..0ffd4775 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -81,6 +81,20 @@ void DivPlatformYM2610::tick() { rWrite(0x04+i,(chan[i].outVol&15)|((chan[i].psgMode&4)<<2)); } } + if (chan[i].std.hadEx2) { + ayEnvMode=chan[i].std.ex2; + rWrite(0x0d,ayEnvMode); + } + if (chan[i].std.hadEx3) { + chan[i].autoEnvNum=chan[i].std.ex3; + chan[i].freqChanged=true; + if (!chan[i].std.willAlg) chan[i].autoEnvDen=1; + } + if (chan[i].std.hadAlg) { + chan[i].autoEnvDen=chan[i].std.alg; + chan[i].freqChanged=true; + if (!chan[i].std.willEx3) chan[i].autoEnvNum=1; + } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true); if (chan[i].freq>4095) chan[i].freq=4095; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 04348136..1c3b64c5 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -910,9 +910,9 @@ const char* ayShapeBits[4]={ "tone", "noise", "envelope", NULL }; -/*const char* ayEnvBits[4]={ +const char* ayEnvBits[4]={ "hold", "alternate", "direction", "enable" -};*/ +}; const char* ssgEnvBits[5]={ "0", "1", "2", "enabled", NULL @@ -1001,7 +1001,7 @@ const int orderedOps[4]={ } \ ImGui::SetNextItemWidth(availableWidth); \ if (ImGui::InputText("##IMacroMML_" macroName,&mmlStr)) { \ - decodeMMLStr(mmlStr,macro,macroLen,macroLoop,macroAMin,macroAMax); \ + decodeMMLStr(mmlStr,macro,macroLen,macroLoop,macroAMin,(bitfield)?((1<type==DIV_INS_C64) waveNames=c64ShapeBits; int ex1Max=(ins->type==DIV_INS_AY8930)?8:0; + int ex2Max=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?4:0; if (settings.macroView==0) { // modern view MACRO_BEGIN(28*dpiScale); @@ -1402,6 +1403,13 @@ void FurnaceGUI::drawInsEdit() { if (ex1Max>0) { NORMAL_MACRO(ins->std.ex1Macro,ins->std.ex1MacroLen,ins->std.ex1MacroLoop,0,ex1Max,"ex1","Duty",160,ins->std.ex1MacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[4],0,ex1Max); } + if (ex2Max>0) { + NORMAL_MACRO(ins->std.ex2Macro,ins->std.ex2MacroLen,ins->std.ex2MacroLoop,0,ex2Max,"ex2","Envelope",64,ins->std.ex2MacroOpen,true,ayEnvBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[5],0,ex2Max); + } + if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930) { + NORMAL_MACRO(ins->std.ex3Macro,ins->std.ex3MacroLen,ins->std.ex3MacroLoop,0,15,"ex3","AutoEnv Num",96,ins->std.ex3MacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[6],0,15); + NORMAL_MACRO(ins->std.algMacro,ins->std.algMacroLen,ins->std.algMacroLoop,0,15,"alg","AutoEnv Den",96,ins->std.algMacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[7],0,15); + } MACRO_END; } else { // classic view