Open ROM/Drag&Drop Error fixed, delete g_DDRom if normal N64 ROM play

This commit is contained in:
luigiblood 2016-01-26 16:43:44 +01:00
parent 7c468bd624
commit 4bf95e61f1
3 changed files with 20 additions and 2 deletions

View File

@ -1142,7 +1142,14 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
DragQueryFile(hDrop, 0, filename, sizeof(filename));
DragFinish(hDrop);
if (!CN64System::RunFileImage(filename))
stdstr ext = CPath(filename).GetExtension();
if (!(_stricmp(ext.c_str(), "ndd") == 0))
{
delete g_DDRom;
g_DDRom = NULL;
CN64System::RunFileImage(filename);
}
else
{
// Open Disk
if (CN64System::RunDiskImage(filename))

View File

@ -119,7 +119,14 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
stdstr File = ChooseFileToOpen(hWnd);
if (File.length() > 0)
{
if (!g_BaseSystem->RunFileImage(File.c_str()))
stdstr ext = CPath(File).GetExtension();
if (!(_stricmp(ext.c_str(), "ndd") == 0))
{
delete g_DDRom;
g_DDRom = NULL;
g_BaseSystem->RunFileImage(File.c_str());
}
else
{
// Open Disk
if (g_BaseSystem->RunDiskImage(File.c_str()))

View File

@ -1472,6 +1472,10 @@ void CRomBrowser::RomList_OpenRom(uint32_t /*pnmh*/)
if (!pRomInfo) { return; }
m_StopRefresh = true;
delete g_DDRom;
g_DDRom = NULL;
CN64System::RunFileImage(pRomInfo->szFullFileName);
}