From 51cd032af3168aed08e50a37d7d5582dcf554016 Mon Sep 17 00:00:00 2001 From: "j4ck.fr0st" Date: Sat, 11 Sep 2010 10:41:57 +0000 Subject: [PATCH] Clear m_TitleIDs when opening Device_ES (Fixes Issue 3205) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6200 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 2d2fa61259..65229d666c 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -81,8 +81,10 @@ bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode) { m_TitleID = m_pContentLoader->GetTitleID(); + m_TitleIDs.clear(); DiscIO::cUIDsys::AccessInstance().GetTitleIDs(m_TitleIDs); // uncomment if ES_GetOwnedTitlesCount / ES_GetOwnedTitles is implemented + // m_TitleIDsOwned.clear(); // DiscIO::cUIDsys::AccessInstance().GetTitleIDs(m_TitleIDsOwned, true); } else if (VolumeHandler::IsValid()) @@ -100,6 +102,8 @@ bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode) INFO_LOG(WII_IPC_ES, "Set default title to %08x/%08x", (u32)(m_TitleID>>32), (u32)m_TitleID); Memory::Write_U32(GetDeviceID(), _CommandAddress+4); + if (m_Active) + INFO_LOG(WII_IPC_ES, "Device was ReOpened"); m_Active = true; return true; } @@ -523,7 +527,7 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); const DiscIO::INANDContentLoader& Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TitleID); - _dbg_assert_(WII_IPC_ES, Loader.IsValid()); + _dbg_assert_msg_(WII_IPC_ES, Loader.IsValid(), "Loader not valid for TitleID %08x/%08x", (u32)(TitleID >> 32), (u32)TitleID); u32 TMDViewCnt = 0; if (Loader.IsValid()) { @@ -783,7 +787,7 @@ const DiscIO::INANDContentLoader& CWII_IPC_HLE_Device_es::AccessContentDevice(u6 m_NANDContent[_TitleID] = &DiscIO::CNANDContentManager::Access().GetNANDLoader(_TitleID); - _dbg_assert_(WII_IPC_ES, m_NANDContent[_TitleID]->IsValid()); + _dbg_assert_msg_(WII_IPC_ES, m_NANDContent[_TitleID]->IsValid(), "NandContent not valid for TitleID %08x/%08x", (u32)(_TitleID >> 32), (u32)_TitleID); return *m_NANDContent[_TitleID]; }