diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 07c5ff5d3..96f03704e 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -722,6 +722,18 @@ void Module::APTInterface::ReceiveCaptureBufferInfo(Kernel::HLERequestContext& c rb.PushStaticBuffer(std::move(apt->screen_capture_buffer), 0); } +void Module::APTInterface::GetCaptureInfo(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx, 0x4A, 1, 0); // 0x004A0040 + const u32 size = rp.Pop(); + ASSERT(size == 0x20); + + IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); + rb.Push(RESULT_SUCCESS); + rb.Push(static_cast(apt->screen_capture_buffer.size())); + // This service function does not clear the capture buffer. + rb.PushStaticBuffer(apt->screen_capture_buffer, 0); +} + void Module::APTInterface::SetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x55, 1, 0); // 0x00550040 diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 25cac1357..b413715b1 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -576,6 +576,20 @@ public: */ void ReceiveCaptureBufferInfo(Kernel::HLERequestContext& ctx); + /** + * APT::GetCaptureInfo service function + * Inputs: + * 0 : Command header [0x004A0040] + * 1 : Size + * 64 : Size << 14 | 2 + * 65 : void*, CaptureBufferInfo + * Outputs: + * 0 : Header code + * 1 : Result code + * 2 : Actual Size + */ + void GetCaptureInfo(Kernel::HLERequestContext& ctx); + /** * APT::GetStartupArgument service function * Inputs: diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index f66c67af8..b0824628d 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp @@ -83,7 +83,7 @@ APT_S::APT_S(std::shared_ptr apt) {0x00470104, &APT_S::Unwrap, "Unwrap"}, {0x00480100, nullptr, "GetProgramInfo"}, {0x00490180, nullptr, "Reboot"}, - {0x004A0040, nullptr, "GetCaptureInfo"}, + {0x004A0040, &APT_S::GetCaptureInfo, "GetCaptureInfo"}, {0x004B00C2, &APT_S::AppletUtility, "AppletUtility"}, {0x004C0000, nullptr, "SetFatalErrDispMode"}, {0x004D0080, nullptr, "GetAppletProgramInfo"}, diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 03795c94c..f36da98e5 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -83,7 +83,7 @@ APT_U::APT_U(std::shared_ptr apt) {0x00470104, &APT_U::Unwrap, "Unwrap"}, {0x00480100, nullptr, "GetProgramInfo"}, {0x00490180, nullptr, "Reboot"}, - {0x004A0040, nullptr, "GetCaptureInfo"}, + {0x004A0040, &APT_U::GetCaptureInfo, "GetCaptureInfo"}, {0x004B00C2, &APT_U::AppletUtility, "AppletUtility"}, {0x004C0000, nullptr, "SetFatalErrDispMode"}, {0x004D0080, nullptr, "GetAppletProgramInfo"},