From 8e38ba1986ab0a3c2d8546167ea6fdf8c344c458 Mon Sep 17 00:00:00 2001 From: liberodark Date: Sat, 6 Dec 2025 01:13:59 +0100 Subject: [PATCH] Fix Metroid --- .../hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp | 11 +++++++++++ src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 0f9bb5490..e0b17b0bd 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -44,6 +44,8 @@ NvResult nvhost_ctrl_gpu::Ioctl1(DeviceFD fd, Ioctl command, std::span return WrapFixed(this, &nvhost_ctrl_gpu::GetTPCMasks1, input, output); case 0x7: return WrapFixed(this, &nvhost_ctrl_gpu::FlushL2, input, output); + case 0x13: + return WrapFixed(this, &nvhost_ctrl_gpu::GetGpuLoad, input, output); case 0x14: return WrapFixed(this, &nvhost_ctrl_gpu::GetActiveSlotMask, input, output); case 0x1c: @@ -74,6 +76,8 @@ NvResult nvhost_ctrl_gpu::Ioctl3(DeviceFD fd, Ioctl command, std::span case 0x6: return WrapFixedInlOut(this, &nvhost_ctrl_gpu::GetTPCMasks3, input, output, inline_output); + case 0x13: + return WrapFixed(this, &nvhost_ctrl_gpu::GetGpuLoad, input, output); default: break; } @@ -247,6 +251,13 @@ NvResult nvhost_ctrl_gpu::GetGpuTime(IoctlGetGpuTime& params) { return NvResult::Success; } +NvResult nvhost_ctrl_gpu::GetGpuLoad(IoctlGetGpuLoad& params) { + LOG_DEBUG(Service_NVDRV, "called"); + params.load = 0; + params.padding = 0; + return NvResult::Success; +} + Kernel::KEvent* nvhost_ctrl_gpu::QueryEvent(u32 event_id) { switch (event_id) { case 1: diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h index d2ab05b21..f3de6fedf 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.h @@ -151,6 +151,12 @@ private: }; static_assert(sizeof(IoctlGetGpuTime) == 0x10, "IoctlGetGpuTime is incorrect size"); + struct IoctlGetGpuLoad { + u32_le load; + u32_le padding; + }; + static_assert(sizeof(IoctlGetGpuLoad) == 8, "IoctlGetGpuLoad is incorrect size"); + NvResult GetCharacteristics1(IoctlCharacteristics& params); NvResult GetCharacteristics3(IoctlCharacteristics& params, std::span gpu_characteristics); @@ -165,6 +171,7 @@ private: NvResult ZBCQueryTable(IoctlZbcQueryTable& params); NvResult FlushL2(IoctlFlushL2& params); NvResult GetGpuTime(IoctlGetGpuTime& params); + NvResult GetGpuLoad(IoctlGetGpuLoad& params); EventInterface& events_interface;