mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-27 16:23:35 +01:00
Identify remasters based on UMD_DATA hash.
This commit is contained in:
1 parent
84216ba3c3
commit
cf1b8e5384
3 files changed
+38
-22
No files matched your search
+18
-8
@@ -98,6 +98,7 @@ void InitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
//pspFileSystem.Mount("host0:", fileSystem);
|
||||
|
||||
std::string gameID;
|
||||
std::string umdData;
|
||||
|
||||
std::string sfoPath("disc0:/PSP_GAME/PARAM.SFO");
|
||||
PSPFileInfo fileInfo = pspFileSystem.GetFileInfo(sfoPath.c_str());
|
||||
@@ -107,19 +108,28 @@ void InitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
pspFileSystem.ReadEntireFile(sfoPath, paramsfo);
|
||||
if (g_paramSFO.ReadSFO(paramsfo)) {
|
||||
UseLargeMem(g_paramSFO.GetValueInt("MEMSIZE"));
|
||||
// TODO: Check the SFO for other parameters that might be useful for identifying?
|
||||
gameID = g_paramSFO.GetValueString("DISC_ID");
|
||||
}
|
||||
|
||||
std::vector<u8> umdDataBin;
|
||||
if (pspFileSystem.ReadEntireFile("disc0:/UMD_DATA.BIN", umdDataBin) >= 0) {
|
||||
umdData = std::string((const char *)&umdDataBin[0], umdDataBin.size());
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(g_HDRemasters); i++) {
|
||||
if (g_HDRemasters[i].gameID == gameID) {
|
||||
g_RemasterMode = true;
|
||||
Memory::g_MemorySize = g_HDRemasters[i].MemorySize;
|
||||
if (g_HDRemasters[i].DoubleTextureCoordinates)
|
||||
g_DoubleTextureCoordinates = true;
|
||||
break;
|
||||
for (size_t i = 0; i < g_HDRemastersCount; i++) {
|
||||
const auto &entry = g_HDRemasters[i];
|
||||
if (entry.gameID != gameID) {
|
||||
continue;
|
||||
}
|
||||
if (entry.umdDataValue && umdData.find(entry.umdDataValue) != umdData.npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
g_RemasterMode = true;
|
||||
Memory::g_MemorySize = entry.memorySize;
|
||||
g_DoubleTextureCoordinates = entry.doubleTextureCoordinates;
|
||||
break;
|
||||
}
|
||||
if (g_RemasterMode) {
|
||||
INFO_LOG(LOADER, "HDRemaster found, using increased memory");
|
||||
|
||||
Reference in new issue
Block a user