diff --git a/src/main.cpp b/src/main.cpp index 1890349d3..d87456a24 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,6 +90,7 @@ String romOutName; String txtOutName; int benchMode=0; int subsong=-1; +int cmdDisableOpt=0; DivAudioExportOptions exportOptions; DivConfig romExportConfig; @@ -441,6 +442,17 @@ TAParamResult pCmdOut(String val) { return TA_PARAM_SUCCESS; } +TAParamResult pCmdOpt(String val) { + try { + int v=std::stoi(val); + cmdDisableOpt=v; + } catch (std::exception& e) { + logE("command stream export optimization disable bitmask shall be a number."); + return TA_PARAM_ERROR; + } + return TA_PARAM_SUCCESS; +} + TAParamResult pROMOut(String val) { romOutName=val; e.setAudio(DIV_AUDIO_DUMMY); @@ -482,6 +494,7 @@ void initParams() { params.push_back(TAParam("O","vgmout",true,pVGMOut,"","output .vgm data")); params.push_back(TAParam("D","direct",false,pDirect,"","set VGM export direct stream mode")); params.push_back(TAParam("C","cmdout",true,pCmdOut,"","output command stream")); + params.push_back(TAParam("","cmdopt",true,pCmdOpt,"","disable command stream optimization passes (+1 command, +2 delay, +4 sub-block)")); params.push_back(TAParam("r","romout",true,pROMOut,"","export ROM file, or path for multi-file export")); params.push_back(TAParam("R","romconf",true,pROMConf,"=","set configuration parameter for ROM export")); params.push_back(TAParam("t","txtout",true,pTxtOut,"","export as text file")); @@ -708,7 +721,7 @@ int main(int argc, char** argv) { arg=arg.substr(0,eqSplit); } for (size_t j=0; j