Automatic-Pause at specified function calls, can be set up using "pause.bin" with rpcs3.

You would need to find the function ids you wanna play with and write them reversed with Hex Editor.
That's quite pity i have no knowledge about wxWidgets so there is no GUI to set up this.
This commit is contained in:
luxsie 2014-08-12 04:15:20 +08:00
parent bbb7435041
commit e9ee084231
2 changed files with 49 additions and 1 deletions

View File

@ -263,6 +263,7 @@ void ModuleManager::init()
m_mod_init.emplace_back(0x000e, sys_fs_init);
initialized = true;
}
LoadFuncPauses(); //Load the list of pause functions
}
ModuleManager::ModuleManager() :
@ -293,6 +294,17 @@ bool ModuleManager::IsLoadedFunc(u32 id)
bool ModuleManager::CallFunc(u32 num)
{
//Pause at specified function calls
for (u32 i = 0; i < m_funcs_pause_funcs.size(); ++i)
{
//Add Call Pause Here. This call is from BLJS10157
if (num == m_funcs_pause_funcs[i])
{
Emu.Pause(); //So it is now pause, yep.
LOG_ERROR(HLE, "TEST PAUSE AT %x", num); //Used Error
}
}
func_caller* func = nullptr;
{
std::lock_guard<std::mutex> lock(m_funcs_lock);
@ -306,6 +318,7 @@ bool ModuleManager::CallFunc(u32 num)
}
}
}
if (func)
{
(*func)();
@ -362,6 +375,9 @@ void ModuleManager::UnloadModules()
std::lock_guard<std::mutex> lock(m_funcs_lock);
m_modules_funcs_list.clear();
//unload pause list
m_funcs_pause_funcs.clear();
}
Module* ModuleManager::GetModuleByName(const std::string& name)
@ -463,3 +479,34 @@ void ModuleManager::AddFunc(ModuleFunc *func)
}
}
//read pause.bin to get some function id that should auto-pause at call.
//you can make this file with Hex Editors, such as MadEdit..
//you can find the function ids in \rpcs3\rpcs3\Emu\SysCalls\FuncList.cpp
//or just by searching the function name with grep within repo.
//Example if i want it to pause at 0x1051d134, i create the file with 34D15110(Hex, start from 00).
void ModuleManager::LoadFuncPauses(void)
{
if (rExists("pause.bin"))
{
m_funcs_pause_funcs.reserve(16);
rFile list;
list.Open("pause.bin", rFile::read);
u32 num;
size_t fmax = list.Length();
size_t fcur = 0;
list.Seek(0);
while (fcur <= fmax - sizeof(u32))
{
list.Read(&num, sizeof(u32));
fcur += sizeof(u32);
if (num == 0xFFFFFFFF) break;
m_funcs_pause_funcs.push_back(num);
LOG_WARNING(HLE, "Read Pause Function ID: %x", num);
}
list.Close();
}
else
{
LOG_WARNING(HLE, "No Pause Function ID specified in pause.bin");
}
}

View File

@ -10,6 +10,7 @@ class ModuleManager
std::vector<ModuleFunc *> m_modules_funcs_list;
std::vector<Module> m_mod_init;
bool initialized;
std::vector<u32> m_funcs_pause_funcs;
public:
ModuleManager();
~ModuleManager();
@ -24,5 +25,5 @@ public:
u32 GetFuncNumById(u32 id);
Module* GetModuleByName(const std::string& name);
Module* GetModuleById(u16 id);
void LoadFuncPauses(void);
};