mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 14:37:08 +00:00
Static hle implementation
This commit is contained in:
parent
a22297f205
commit
de5379a69f
7 changed files with 263 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/VirtualMemory.h"
|
||||
#include "Utilities/bin_patch.h"
|
||||
#include "Crypto/sha1.h"
|
||||
|
|
@ -14,6 +14,8 @@
|
|||
#include "Emu/Cell/lv2/sys_prx.h"
|
||||
#include "Emu/Cell/lv2/sys_memory.h"
|
||||
|
||||
#include "Emu/Cell/Modules/StaticHLE.h"
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
|
@ -255,6 +257,7 @@ static void ppu_initialize_modules(const std::shared_ptr<ppu_linkage_info>& link
|
|||
&ppu_module_manager::sysPrxForUser,
|
||||
&ppu_module_manager::sys_libc,
|
||||
&ppu_module_manager::sys_lv2dbg,
|
||||
&ppu_module_manager::static_hle,
|
||||
};
|
||||
|
||||
// Initialize double-purpose fake OPD array for HLE functions
|
||||
|
|
@ -1136,6 +1139,18 @@ void ppu_load_exec(const ppu_exec_object& elf)
|
|||
// Initialize HLE modules
|
||||
ppu_initialize_modules(link);
|
||||
|
||||
// Static HLE patching
|
||||
if (g_cfg.core.hook_functions)
|
||||
{
|
||||
auto shle = fxm::get_always<statichle_handler>();
|
||||
|
||||
for (u32 i = _main->segs[0].addr; i < (_main->segs[0].addr + _main->segs[0].size); i += 4)
|
||||
{
|
||||
vm::cptr<u8> _ptr = vm::cast(i);
|
||||
shle->check_against_patterns(_ptr, (_main->segs[0].addr + _main->segs[0].size) - i, i);
|
||||
}
|
||||
}
|
||||
|
||||
// Load other programs
|
||||
for (auto& prog : elf.progs)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue