mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Enable function replacements by default.
So things like Star Ocean work, and game memcpy()'s to GPU work. This will make game start on mobile a bit slower, though. And there could still be bugs so leaving as an option, but seems pretty stable. Didn't realize it wasn't enabled by default.
This commit is contained in:
parent
986d54039c
commit
a7b9ce205b
5 changed files with 16 additions and 9 deletions
|
@ -305,6 +305,7 @@ static ConfigSetting cpuSettings[] = {
|
|||
|
||||
ReportedConfigSetting("SeparateIOThread", &g_Config.bSeparateIOThread, true),
|
||||
ConfigSetting("FastMemoryAccess", &g_Config.bFastMemory, true),
|
||||
ReportedConfigSetting("FuncReplacements", &g_Config.bFuncReplacements, true),
|
||||
ReportedConfigSetting("CPUSpeed", &g_Config.iLockedCPUSpeed, 0),
|
||||
|
||||
ConfigSetting(false),
|
||||
|
|
|
@ -84,6 +84,7 @@ public:
|
|||
bool bJit;
|
||||
bool bCheckForNewVersion;
|
||||
bool bForceLagSync;
|
||||
bool bFuncReplacements;
|
||||
|
||||
// Definitely cannot be changed while game is running.
|
||||
bool bSeparateCPUThread;
|
||||
|
|
|
@ -447,7 +447,7 @@ void __KernelModuleDoState(PointerWrap &p)
|
|||
p.Do(loadedModules);
|
||||
}
|
||||
|
||||
if (g_Config.bFuncHashMap) {
|
||||
if (g_Config.bFuncReplacements) {
|
||||
MIPSAnalyst::ReplaceFunctions();
|
||||
}
|
||||
}
|
||||
|
@ -973,7 +973,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
|||
bool gotSymbols = reader.LoadSymbols();
|
||||
MIPSAnalyst::ScanForFunctions(module->textStart, module->textEnd, !gotSymbols);
|
||||
#else
|
||||
if (g_Config.bFuncHashMap) {
|
||||
if (g_Config.bFuncReplacements) {
|
||||
bool gotSymbols = reader.LoadSymbols();
|
||||
MIPSAnalyst::ScanForFunctions(module->textStart, module->textEnd, !gotSymbols);
|
||||
}
|
||||
|
@ -1137,7 +1137,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
|||
bool gotSymbols = reader.LoadSymbols();
|
||||
MIPSAnalyst::ScanForFunctions(module->textStart, module->textEnd, !gotSymbols);
|
||||
#else
|
||||
if (g_Config.bFuncHashMap) {
|
||||
if (g_Config.bFuncReplacements) {
|
||||
bool gotSymbols = reader.LoadSymbols();
|
||||
MIPSAnalyst::ScanForFunctions(module->textStart, module->textEnd, !gotSymbols);
|
||||
}
|
||||
|
|
|
@ -886,13 +886,16 @@ skip:
|
|||
HashFunctions();
|
||||
|
||||
std::string hashMapFilename = GetSysDirectory(DIRECTORY_SYSTEM) + "knownfuncs.ini";
|
||||
if (g_Config.bFuncHashMap) {
|
||||
LoadHashMap(hashMapFilename);
|
||||
StoreHashMap(hashMapFilename);
|
||||
if (g_Config.bFuncHashMap || g_Config.bFuncReplacements) {
|
||||
LoadBuiltinHashMap();
|
||||
if (g_Config.bFuncHashMap) {
|
||||
LoadHashMap(hashMapFilename);
|
||||
StoreHashMap(hashMapFilename);
|
||||
}
|
||||
if (insertSymbols) {
|
||||
ApplyHashMap();
|
||||
}
|
||||
if (g_Config.bFuncHashMap) {
|
||||
if (g_Config.bFuncReplacements) {
|
||||
ReplaceFunctions();
|
||||
}
|
||||
}
|
||||
|
@ -1052,8 +1055,7 @@ skip:
|
|||
}
|
||||
}
|
||||
|
||||
void LoadHashMap(std::string filename) {
|
||||
// First insert the hardcoded entries.
|
||||
void LoadBuiltinHashMap() {
|
||||
HashMapFunc mf;
|
||||
for (size_t i = 0; i < ARRAY_SIZE(hardcodedHashes); i++) {
|
||||
mf.hash = hardcodedHashes[i].hash;
|
||||
|
@ -1063,7 +1065,9 @@ skip:
|
|||
mf.hardcoded = true;
|
||||
hashMap.insert(mf);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadHashMap(std::string filename) {
|
||||
FILE *file = File::OpenCFile(filename, "rt");
|
||||
if (!file) {
|
||||
WARN_LOG(LOADER, "Could not load hash map: %s", filename.c_str());
|
||||
|
|
|
@ -107,6 +107,7 @@ namespace MIPSAnalyst
|
|||
void CompileLeafs();
|
||||
|
||||
void SetHashMapFilename(std::string filename = "");
|
||||
void LoadBuiltinHashMap();
|
||||
void LoadHashMap(std::string filename);
|
||||
void StoreHashMap(std::string filename = "");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue