mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 13:25:45 +00:00
hle: kernel: Migrate KSharedMemory to KAutoObject.
This commit is contained in:
parent
7a6bfbde24
commit
11f9080d2e
16 changed files with 128 additions and 114 deletions
|
@ -53,9 +53,6 @@ IAppletResource::IAppletResource(Core::System& system_)
|
|||
};
|
||||
RegisterHandlers(functions);
|
||||
|
||||
auto& kernel = system.Kernel();
|
||||
shared_mem = SharedFrom(&kernel.GetHidSharedMem());
|
||||
|
||||
MakeController<Controller_DebugPad>(HidController::DebugPad);
|
||||
MakeController<Controller_Touchscreen>(HidController::Touchscreen);
|
||||
MakeController<Controller_Mouse>(HidController::Mouse);
|
||||
|
@ -118,7 +115,7 @@ void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
|
|||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushCopyObjects(shared_mem.get());
|
||||
rb.PushCopyObjects(&system.Kernel().GetHidSharedMem());
|
||||
}
|
||||
|
||||
void IAppletResource::UpdateControllers(std::uintptr_t user_data,
|
||||
|
@ -130,7 +127,8 @@ void IAppletResource::UpdateControllers(std::uintptr_t user_data,
|
|||
if (should_reload) {
|
||||
controller->OnLoadInputDevices();
|
||||
}
|
||||
controller->OnUpdate(core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
|
||||
controller->OnUpdate(core_timing, system.Kernel().GetHidSharedMem().GetPointer(),
|
||||
SHARED_MEMORY_SIZE);
|
||||
}
|
||||
|
||||
// If ns_late is higher than the update rate ignore the delay
|
||||
|
@ -145,7 +143,7 @@ void IAppletResource::UpdateMotion(std::uintptr_t user_data, std::chrono::nanose
|
|||
auto& core_timing = system.CoreTiming();
|
||||
|
||||
controllers[static_cast<size_t>(HidController::NPad)]->OnMotionUpdate(
|
||||
core_timing, shared_mem->GetPointer(), SHARED_MEMORY_SIZE);
|
||||
core_timing, system.Kernel().GetHidSharedMem().GetPointer(), SHARED_MEMORY_SIZE);
|
||||
|
||||
// If ns_late is higher than the update rate ignore the delay
|
||||
if (ns_late > motion_update_ns) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue