mirror of
https://github.com/holub/mame
synced 2025-10-07 17:27:06 +03:00
Windows debugger: image menu: Mount File/Create default to swpath instead of randomness.
This commit is contained in:
parent
889fff01a2
commit
cc9a0e699f
@ -258,7 +258,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam)
|
|||||||
std::string opt_name = img->instance_name();
|
std::string opt_name = img->instance_name();
|
||||||
std::string as = slmap.find(opt_name)->second;
|
std::string as = slmap.find(opt_name)->second;
|
||||||
|
|
||||||
/* Make sure a folder was specified in the tab, and that it exists */
|
/* Make sure a folder was specified, and that it exists */
|
||||||
if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos))
|
if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos))
|
||||||
{
|
{
|
||||||
/* Default to emu directory */
|
/* Default to emu directory */
|
||||||
@ -318,6 +318,24 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam)
|
|||||||
t_filter[i] = '\0';
|
t_filter[i] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char buf[400];
|
||||||
|
std::string as;
|
||||||
|
strcpy(buf, machine().options().emu_options::sw_path());
|
||||||
|
// This pulls out the first path from a multipath field
|
||||||
|
const char* t1 = strtok(buf, ";");
|
||||||
|
if (t1)
|
||||||
|
as = t1; // the first path of many
|
||||||
|
else
|
||||||
|
as = buf; // the only path
|
||||||
|
|
||||||
|
/* Make sure a folder was specified, and that it exists */
|
||||||
|
if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos))
|
||||||
|
{
|
||||||
|
/* Default to emu directory */
|
||||||
|
osd_get_full_path(as, ".");
|
||||||
|
}
|
||||||
|
osd::text::tstring t_dir = osd::text::to_tstring(as);
|
||||||
|
|
||||||
TCHAR selectedFilename[MAX_PATH];
|
TCHAR selectedFilename[MAX_PATH];
|
||||||
selectedFilename[0] = '\0';
|
selectedFilename[0] = '\0';
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
@ -331,7 +349,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam)
|
|||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = nullptr;
|
ofn.lpstrFileTitle = nullptr;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = nullptr;
|
ofn.lpstrInitialDir = t_dir.c_str();
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||||
|
|
||||||
if (GetOpenFileName(&ofn))
|
if (GetOpenFileName(&ofn))
|
||||||
@ -355,6 +373,24 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam)
|
|||||||
t_filter[i] = '\0';
|
t_filter[i] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char buf[400];
|
||||||
|
std::string as;
|
||||||
|
strcpy(buf, machine().options().emu_options::sw_path());
|
||||||
|
// This pulls out the first path from a multipath field
|
||||||
|
const char* t1 = strtok(buf, ";");
|
||||||
|
if (t1)
|
||||||
|
as = t1; // the first path of many
|
||||||
|
else
|
||||||
|
as = buf; // the only path
|
||||||
|
|
||||||
|
/* Make sure a folder was specified, and that it exists */
|
||||||
|
if ((!osd::directory::open(as.c_str())) || (as.find(':') == std::string::npos))
|
||||||
|
{
|
||||||
|
/* Default to emu directory */
|
||||||
|
osd_get_full_path(as, ".");
|
||||||
|
}
|
||||||
|
osd::text::tstring t_dir = osd::text::to_tstring(as);
|
||||||
|
|
||||||
TCHAR selectedFilename[MAX_PATH];
|
TCHAR selectedFilename[MAX_PATH];
|
||||||
selectedFilename[0] = '\0';
|
selectedFilename[0] = '\0';
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
@ -368,7 +404,7 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam)
|
|||||||
ofn.nFilterIndex = 1;
|
ofn.nFilterIndex = 1;
|
||||||
ofn.lpstrFileTitle = nullptr;
|
ofn.lpstrFileTitle = nullptr;
|
||||||
ofn.nMaxFileTitle = 0;
|
ofn.nMaxFileTitle = 0;
|
||||||
ofn.lpstrInitialDir = nullptr;
|
ofn.lpstrInitialDir = t_dir.c_str();
|
||||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||||
|
|
||||||
if (GetSaveFileName(&ofn))
|
if (GetSaveFileName(&ofn))
|
||||||
|
Loading…
Reference in New Issue
Block a user