Fix 4039 titles with false positive not finding DSOUND library version.

This commit is contained in:
RadWolfie 2018-06-11 10:14:58 -05:00
parent 7bb26a9790
commit 1ed96cf553
1 changed files with 11 additions and 0 deletions

View File

@ -358,6 +358,8 @@ void EmuHLEIntercept(Xbe::Header *pXbeHeader)
// NOTE: We need to check if title has library header to optimize verification process.
if (pLibraryVersion != nullptr) {
uint32 dwLibraryVersions = pXbeHeader->dwLibraryVersions;
const char* SectionName = nullptr;
Xbe::SectionHeader* pSectionHeaders = (Xbe::SectionHeader*)pXbeHeader->dwSectionHeadersAddr;
// Get the highest revision build and prefix library to scan.
for (uint32 v = 0; v < dwLibraryVersions; v++) {
@ -369,6 +371,15 @@ void EmuHLEIntercept(Xbe::Header *pXbeHeader)
}
XbLibScan |= XbSymbolLibrayToFlag(std::string(pLibraryVersion[v].szName, pLibraryVersion[v].szName + 8).c_str());
}
// Since XDK 4039 title does not have library version for DSOUND, let's check section header if it exists or not.
for (unsigned int v = 0; v < pXbeHeader->dwSections; v++) {
SectionName = (const char*)pSectionHeaders[v].dwSectionNameAddr;
if (strncmp(SectionName, "DSOUND", 8) == 0) {
XbLibScan |= XbSymbolLib_DSOUND;
break;
}
}
}
EmuUpdateLLEStatus(XbLibScan);