diff options
Diffstat (limited to 'src/core/hle/function_wrappers.h')
-rw-r--r-- | src/core/hle/function_wrappers.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index 1ac6032a6..9294789ec 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h @@ -99,6 +99,18 @@ template<ResultCode func(MemoryInfo*, PageInfo*, u32)> void Wrap() { FuncReturn(retval); } +template<ResultCode func(MemoryInfo*, PageInfo*, Handle, u32)> void Wrap() { + MemoryInfo memory_info = {}; + PageInfo page_info = {}; + u32 retval = func(&memory_info, &page_info, PARAM(2), PARAM(3)).raw; + Core::g_app_core->SetReg(1, memory_info.base_address); + Core::g_app_core->SetReg(2, memory_info.size); + Core::g_app_core->SetReg(3, memory_info.permission); + Core::g_app_core->SetReg(4, memory_info.state); + Core::g_app_core->SetReg(5, page_info.flags); + FuncReturn(retval); +} + template<ResultCode func(s32*, u32)> void Wrap(){ s32 param_1 = 0; u32 retval = func(¶m_1, PARAM(1)).raw; |