VGM: experimental direct stream mode for YM2612

This commit is contained in:
tildearrow 2022-10-17 14:25:30 -05:00
parent 684b5a928b
commit 4723ed3972
5 changed files with 71 additions and 11 deletions

View file

@ -66,6 +66,7 @@ bool consoleMode=true;
bool displayEngineFailError=false;
bool cmdOutBinary=false;
bool vgmOutDirect=false;
std::vector<TAParam> params;
@ -122,6 +123,11 @@ TAParamResult pBinary(String val) {
return TA_PARAM_SUCCESS;
}
TAParamResult pDirect(String val) {
vgmOutDirect=true;
return TA_PARAM_SUCCESS;
}
TAParamResult pLogLevel(String val) {
if (val=="trace") {
logLevel=LOGLEVEL_TRACE;
@ -289,6 +295,7 @@ void initParams() {
params.push_back(TAParam("a","audio",true,pAudio,"jack|sdl","set audio engine (SDL by default)"));
params.push_back(TAParam("o","output",true,pOutput,"<filename>","output audio to file"));
params.push_back(TAParam("O","vgmout",true,pVGMOut,"<filename>","output .vgm data"));
params.push_back(TAParam("D","direct",false,pDirect,"","set VGM export direct stream mode"));
params.push_back(TAParam("Z","zsmout",true,pZSMOut,"<filename>","output .zsm data for Commander X16 Zsound"));
params.push_back(TAParam("C","cmdout",true,pCmdOut,"<filename>","output command stream"));
params.push_back(TAParam("b","binary",false,pBinary,"","set command stream output format to binary"));
@ -490,7 +497,7 @@ int main(int argc, char** argv) {
}
}
if (vgmOutName!="") {
SafeWriter* w=e.saveVGM();
SafeWriter* w=e.saveVGM(NULL,true,0x171,false,vgmOutDirect);
if (w!=NULL) {
FILE* f=fopen(vgmOutName.c_str(),"wb");
if (f!=NULL) {