properly open/close the file to avoid rapid open/close cycles

ES_OPENCONTENT and ES_CLOSECONTENT now call Open and Close respectively,
as the old code did.
This commit is contained in:
BhaaL committed 2016-03-20 13:10:51 +01:00
1 parent 8a6d9e1e0b
commit a449ef4e11
3 files changed
+40 -10

No files matched your search

@@ -220,7 +220,7 @@ u32 CWII_IPC_HLE_Device_es::OpenTitleContent(u32 CFD, u64 TitleID, u16 Index)
Access.m_Size = pContent->m_Size;
Access.m_TitleID = TitleID;
pContent->m_Data->Open();
m_ContentAccessMap[CFD] = Access;
return CFD;
@@ -425,6 +425,14 @@ IPCCommandResult CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
return GetDefaultReply();
}
const DiscIO::CNANDContentLoader& ContentLoader = AccessContentDevice(itr->second.m_TitleID);
// ContentLoader should never be invalid; we shouldn't be here if ES_OPENCONTENT failed before.
if (ContentLoader.IsValid())
{
const DiscIO::SNANDContent* pContent = ContentLoader.GetContentByIndex(itr->second.m_Index);
pContent->m_Data->Close();
}
m_ContentAccessMap.erase(itr);
Memory::Write_U32(0, _CommandAddress + 0x4);