From 9f0ff64398ddd0d0206cca55a2a648f96de0e3cb Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Tue, 15 Sep 2009 05:38:49 +0000 Subject: [PATCH] Fixes issue 1356. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4271 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/FrameTools.cpp | 54 ++++++++++++---------- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 4 +- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 54971dcf53..51cd40b58d 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -440,40 +440,44 @@ void CFrame::InitBitmaps() void CFrame::BootGame() { // Rerecording - #ifdef RERECORDING - Core::RerecordingStart(); - #endif +#ifdef RERECORDING + Core::RerecordingStart(); +#endif if (Core::GetState() != Core::CORE_UNINITIALIZED) { if (Core::GetState() == Core::CORE_RUN) - { Core::SetState(Core::CORE_PAUSE); + else + Core::SetState(Core::CORE_RUN); + UpdateGUI(); + } + // Start the selected ISO, or try one of the saved paths. + // If all that fails, ask to add a dir and don't boot + else if (m_GameListCtrl->GetSelectedISO() != NULL) + { + if (m_GameListCtrl->GetSelectedISO()->IsValid()) + BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName()); + } + else + { + SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter; + + if (!StartUp.m_strDefaultGCM.empty() + && wxFileExists(wxString(StartUp.m_strDefaultGCM.c_str(), wxConvUTF8))) + { + BootManager::BootCore(StartUp.m_strDefaultGCM); + } + else if (!SConfig::GetInstance().m_LastFilename.empty() + && wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) + { + BootManager::BootCore(SConfig::GetInstance().m_LastFilename); } else { - Core::SetState(Core::CORE_RUN); + m_GameListCtrl->BrowseForDirectory(); + return; } - UpdateGUI(); - } - // Start the selected ISO, return if gamelist is empty - else if (m_GameListCtrl->GetSelectedISO() == 0) return; - else if (m_GameListCtrl->GetSelectedISO()->IsValid()) - { - BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName()); - } - // Start the default ISO, or if we don't have a default ISO, start the last - // started ISO - else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() && - wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter. - m_strDefaultGCM.c_str(), wxConvUTF8))) - { - BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM); - } - else if (!SConfig::GetInstance().m_LastFilename.empty() && - wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) - { - BootManager::BootCore(SConfig::GetInstance().m_LastFilename); } } diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 4727842ecd..962da621f5 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -735,9 +735,7 @@ const GameListItem * CGameListCtrl::GetSelectedISO() { if (m_ISOFiles.size() == 0) { - // There are no detected games, so add a GCMPath - BrowseForDirectory(); - return 0; + return NULL; } else {