Project64: Provide ability for alternate identifier game settings
This commit is contained in:
parent
7e503dc192
commit
373df2a912
|
@ -5872,6 +5872,9 @@ SMM-TLB=0
|
|||
Self Texture=1
|
||||
RDRAM Size=8
|
||||
|
||||
[THE LEGEND OF ZELDA-C:45]
|
||||
Alt Identifier=EC7011B7-7616D72B-C:45
|
||||
|
||||
[EC7011B7-7616D72B-C:45]
|
||||
Good Name=The Legend of Zelda - Ocarina of Time (U) (V1.0)
|
||||
Internal Name=THE LEGEND OF ZELDA
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <Common/Platform.h>
|
||||
#include <Common/MemoryManagement.h>
|
||||
#include <Common/SmartPointer.h>
|
||||
#include <Common/IniFileClass.h>
|
||||
#include <memory>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -654,6 +655,25 @@ bool CN64Rom::LoadN64Image(const char * FileLoc, bool LoadBootCodeOnly)
|
|||
}
|
||||
|
||||
m_RomIdent = stdstr_f("%08X-%08X-C:%X", CRC1, CRC2, m_ROMImage[0x3D]);
|
||||
{
|
||||
CIniFileBase::SectionList GameIdentifiers;
|
||||
CIniFile RomDatabase(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
|
||||
RomDatabase.GetVectorOfSections(GameIdentifiers);
|
||||
|
||||
if (GameIdentifiers.find(m_RomIdent.c_str()) == GameIdentifiers.end())
|
||||
{
|
||||
char InternalName[22] = { 0 };
|
||||
memcpy(InternalName, (void *)(m_ROMImage + 0x20), 20);
|
||||
CN64Rom::CleanRomName(InternalName);
|
||||
|
||||
std::string AltIdentifier = stdstr_f("%s-C:%X", stdstr(InternalName).Trim().ToUpper().c_str(), m_Country);
|
||||
AltIdentifier = RomDatabase.GetString(AltIdentifier.c_str(), "Alt Identifier", "");
|
||||
if (!AltIdentifier.empty())
|
||||
{
|
||||
m_RomIdent = AltIdentifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
WriteTrace(TraceN64System, TraceDebug, "Ident: %s", m_RomIdent.c_str());
|
||||
|
||||
if (!LoadBootCodeOnly && g_Rom == this)
|
||||
|
|
|
@ -59,6 +59,10 @@ CRomList::CRomList() :
|
|||
#endif
|
||||
g_Settings->RegisterChangeCB(RomList_GameDir, this, (CSettings::SettingChangedFunc)RefreshSettings);
|
||||
}
|
||||
if (m_RomIniFile)
|
||||
{
|
||||
m_RomIniFile->GetVectorOfSections(m_GameIdentifiers);
|
||||
}
|
||||
WriteTrace(TraceRomList, TraceVerbose, "Done");
|
||||
}
|
||||
|
||||
|
@ -582,9 +586,17 @@ void CRomList::FillRomExtensionInfo(ROM_INFO * pRomInfo)
|
|||
strcpy(pRomInfo->Name, "#321#");
|
||||
strcpy(pRomInfo->Status, "Unknown");
|
||||
|
||||
//Get File Identifier
|
||||
char Identifier[100];
|
||||
sprintf(Identifier, "%08X-%08X-C:%X", pRomInfo->CRC1, pRomInfo->CRC2, pRomInfo->Country);
|
||||
if (m_GameIdentifiers.find(Identifier) == m_GameIdentifiers.end())
|
||||
{
|
||||
std::string AltIdentifier = stdstr_f("%s-C:%X", stdstr(pRomInfo->InternalName).Trim().ToUpper().c_str(), pRomInfo->Country);
|
||||
AltIdentifier = m_RomIniFile->GetString(AltIdentifier.c_str(), "Alt Identifier", "");
|
||||
if (!AltIdentifier.empty())
|
||||
{
|
||||
strcpy(Identifier, AltIdentifier.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
//Rom Notes
|
||||
strncpy(pRomInfo->UserNotes, m_NotesIniFile->GetString(Identifier, "Note", "").c_str(), sizeof(pRomInfo->UserNotes) / sizeof(char));
|
||||
|
|
|
@ -95,6 +95,7 @@ private:
|
|||
CIniFile * m_ZipIniFile;
|
||||
#endif
|
||||
CThread m_RefreshThread;
|
||||
CIniFileBase::SectionList m_GameIdentifiers;
|
||||
|
||||
#define DISKSIZE_MAME 0x0435B0C0
|
||||
#define DISKSIZE_SDK 0x03DEC800
|
||||
|
|
Loading…
Reference in New Issue