Merge pull request #1093 from LuigiBlood/64dd_2
[64DD] Disk dump loading from command line / drag 'n' drop to EXE file
This commit is contained in:
commit
d5c10d6775
|
@ -24,7 +24,42 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
|
|||
if (g_Settings->LoadStringVal(Cmd_RomFile).length() > 0)
|
||||
{
|
||||
MainWindow.Show(true); //Show the main window
|
||||
CN64System::RunFileImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str());
|
||||
//N64 ROM or 64DD Disk
|
||||
stdstr ext = CPath(g_Settings->LoadStringVal(Cmd_RomFile)).GetExtension();
|
||||
if (!(_stricmp(ext.c_str(), "ndd") == 0))
|
||||
{
|
||||
//File Extension is not *.ndd so it should be a N64 ROM
|
||||
CN64System::RunFileImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
//Ext is *.ndd, so it should be a disk file.
|
||||
if (CN64System::RunDiskImage(g_Settings->LoadStringVal(Cmd_RomFile).c_str()))
|
||||
{
|
||||
stdstr IPLROM = g_Settings->LoadStringVal(File_DiskIPLPath);
|
||||
if ((IPLROM.length() <= 0) || (!CN64System::RunFileImage(IPLROM.c_str())))
|
||||
{
|
||||
// Open DDROM
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
//openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
{
|
||||
CN64System::RunFileImage(FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue