mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-11 22:17:56 -05:00
SVC: Implement 32-bits wrappers and update Dynarmic.
This commit is contained in:
@ -350,17 +350,48 @@ void SvcWrap64(Core::System& system) {
|
||||
func(system, static_cast<u32>(Param(system, 0)), Param(system, 1), Param(system, 2));
|
||||
}
|
||||
|
||||
// Used by QueryMemory32
|
||||
// Used by QueryMemory32, ArbitrateLock32
|
||||
template <ResultCode func(Core::System&, u32, u32, u32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
FuncReturn32(system,
|
||||
func(system, Param32(system, 0), Param32(system, 1), Param32(system, 2)).raw);
|
||||
}
|
||||
|
||||
// Used by Break32
|
||||
template <void func(Core::System&, u32, u32, u32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
func(system, Param32(system, 0), Param32(system, 1), Param32(system, 2));
|
||||
}
|
||||
|
||||
// Used by ExitProcess32, ExitThread32
|
||||
template <void func(Core::System&)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
func(system);
|
||||
}
|
||||
|
||||
// Used by GetCurrentProcessorNumber32
|
||||
template <u32 func(Core::System&)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
FuncReturn(system, func(system));
|
||||
FuncReturn32(system, func(system));
|
||||
}
|
||||
|
||||
// Used by SleepThread32
|
||||
template <void func(Core::System&, u32, u32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
func(system, Param32(system, 0), Param32(system, 1));
|
||||
}
|
||||
|
||||
// Used by CreateThread32
|
||||
template <ResultCode func(Core::System&, Handle*, u32, u32, u32, u32, s32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
Handle param_1 = 0;
|
||||
|
||||
const u32 retval = func(system, ¶m_1, Param32(system, 0), Param32(system, 1),
|
||||
Param32(system, 2), Param32(system, 3), Param32(system, 4))
|
||||
.raw;
|
||||
|
||||
system.CurrentArmInterface().SetReg(1, param_1);
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by GetInfo32
|
||||
@ -399,6 +430,43 @@ void SvcWrap32(Core::System& system) {
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by GetSystemTick32
|
||||
template <void func(Core::System&, u32*, u32*)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
u32 param_1 = 0;
|
||||
u32 param_2 = 0;
|
||||
|
||||
func(system, ¶m_1, ¶m_2);
|
||||
system.CurrentArmInterface().SetReg(0, param_1);
|
||||
system.CurrentArmInterface().SetReg(1, param_2);
|
||||
}
|
||||
|
||||
// Used by CreateEvent32
|
||||
template <ResultCode func(Core::System&, Handle*, Handle*)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
Handle param_1 = 0;
|
||||
Handle param_2 = 0;
|
||||
|
||||
const u32 retval = func(system, ¶m_1, ¶m_2).raw;
|
||||
system.CurrentArmInterface().SetReg(1, param_1);
|
||||
system.CurrentArmInterface().SetReg(2, param_2);
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by GetThreadId32
|
||||
template <ResultCode func(Core::System&, Handle, u32*, u32*, u32*)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
u32 param_1 = 0;
|
||||
u32 param_2 = 0;
|
||||
u32 param_3 = 0;
|
||||
|
||||
const u32 retval = func(system, Param32(system, 2), ¶m_1, ¶m_2, ¶m_3).raw;
|
||||
system.CurrentArmInterface().SetReg(1, param_1);
|
||||
system.CurrentArmInterface().SetReg(2, param_2);
|
||||
system.CurrentArmInterface().SetReg(3, param_3);
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by SignalProcessWideKey32
|
||||
template <void func(Core::System&, u32, s32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
@ -423,7 +491,38 @@ void SvcWrap32(Core::System& system) {
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by SendSyncRequest32
|
||||
// Used by WaitProcessWideKeyAtomic32
|
||||
template <ResultCode func(Core::System&, u32, u32, Handle, u32, u32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
const u32 retval =
|
||||
func(system, static_cast<u32>(Param(system, 0)), static_cast<u32>(Param(system, 1)),
|
||||
static_cast<Handle>(Param(system, 2)), static_cast<u32>(Param(system, 3)),
|
||||
static_cast<u32>(Param(system, 4)))
|
||||
.raw;
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by WaitForAddress32
|
||||
template <ResultCode func(Core::System&, u32, u32, s32, u32, u32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
const u32 retval = func(system, static_cast<u32>(Param(system, 0)),
|
||||
static_cast<u32>(Param(system, 1)), static_cast<s32>(Param(system, 2)),
|
||||
static_cast<u32>(Param(system, 3)), static_cast<u32>(Param(system, 4)))
|
||||
.raw;
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by SignalToAddress32
|
||||
template <ResultCode func(Core::System&, u32, u32, s32, s32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
const u32 retval =
|
||||
func(system, static_cast<u32>(Param(system, 0)), static_cast<u32>(Param(system, 1)),
|
||||
static_cast<s32>(Param(system, 2)), static_cast<s32>(Param(system, 3)))
|
||||
.raw;
|
||||
FuncReturn(system, retval);
|
||||
}
|
||||
|
||||
// Used by SendSyncRequest32, ArbitrateUnlock32
|
||||
template <ResultCode func(Core::System&, u32)>
|
||||
void SvcWrap32(Core::System& system) {
|
||||
FuncReturn(system, func(system, static_cast<u32>(Param(system, 0))).raw);
|
||||
|
Reference in New Issue
Block a user