diff --git a/artifact.bat b/artifact.bat index 30f1d12..0f6194d 100644 --- a/artifact.bat +++ b/artifact.bat @@ -2,6 +2,5 @@ mkdir artifact mkdir artifact\plugins copy Release\nsfplay.exe artifact\nsfplay.exe copy distribute\nsfplay.txt artifact\nsfplay.txt -copy distribute\nsfplay.ini artifact\nsfplay.ini copy Release\plugins\in_yansf.dll artifact\plugins\in_yansf.dll copy Release\plugins\nsfplug_ui.dll artifact\plugins\nsfplug_ui.dll \ No newline at end of file diff --git a/distribute/nsfplay.ini b/distribute/nsfplay.ini deleted file mode 100644 index 84dbc25..0000000 --- a/distribute/nsfplay.ini +++ /dev/null @@ -1,4 +0,0 @@ -[NSFPLAY] -VOLUME=255 -SAVEVOLUME=1 -PLUGIN=plugins\in_yansf.dll diff --git a/nsfplay/nsfplayDlg.cpp b/nsfplay/nsfplayDlg.cpp index c5395df..2329ee0 100644 --- a/nsfplay/nsfplayDlg.cpp +++ b/nsfplay/nsfplayDlg.cpp @@ -581,19 +581,16 @@ int CnsfplayDlg::ParseArgs(int wargc, const wchar_t* const * wargv, bool prepass } std::string key(arg+1,split-(arg+1)); const char* val = split+1; - if (prepass) + // special values + if (key == "INI") if (prepass) { m_yansf_ini_path = val; } + else if (key == "NSFPLAYINI") if (prepass) { m_nsfplay_ini_path = val; } + // check NSFPlay ini values + else if (key == "VOLUME") if (prepass) { m_volume_init = atoi(val); m_ini_save = false; } + else if (key == "SAVEVOLUME") if (prepass) { m_volume_save = (atoi(val) != 0); m_ini_save = false; } + else if (key == "PLUGIN") if (prepass) { m_plugin_path = val; m_ini_save = false; } + else if (!prepass) // after prepass, only affects plugin, warn if invalid arguments { - // special values - if (key == "INI") { m_yansf_ini_path = val; } - else if (key == "NSFPLAYINI") { m_nsfplay_ini_path = val; } - // check NSFPlay ini values - else if (key == "VOLUME") { m_volume_init = atoi(val); m_ini_save = false; } - else if (key == "SAVEVOLUME") { m_volume_save = (atoi(val) != 0); m_ini_save = false; } - else if (key == "PLUGIN") { m_plugin_path = val; m_ini_save = false; } - } - else // after prepass, only affects plugin, warn if invalid arguments - { - if((in_yansf && in_yansf->npm->cf->HasValue(val))) + if((in_yansf && in_yansf->npm->cf->HasValue(key))) { (*(in_yansf->npm->cf))[key] = val; in_yansf->npm->no_save_config = true; // changes are temporary unless explicitly saved by user @@ -669,8 +666,8 @@ int CnsfplayDlg::WriteSingleWave(char* nsf_file, char* wave_file, int track, int last_pos = iot; } while (true); - m_emu->Stop(); printf("Play time: %d ms\n",m_emu->GetOutputTime()); + m_emu->Stop(); return 0; }