Skip to content

Commit

Permalink
fix broken config argument command line search
Browse files Browse the repository at this point in the history
fix play time log
remove nsfplay.ini from log
set appveyor to VS2019 (will this fix log not appearing?)
  • Loading branch information
bbbradsmith committed Jun 23, 2023
1 parent e05f76e commit d5f06d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
1 change: 0 additions & 1 deletion artifact.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions distribute/nsfplay.ini

This file was deleted.

23 changes: 10 additions & 13 deletions nsfplay/nsfplayDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

0 comments on commit d5f06d5

Please sign in to comment.