Services/APT: Implemented the GetCaptureInfo function. (#5194)

This one is similar to the ReceiveCaptureBufferInfo function except it doesn't clear the capture buffer, according to 3dbrew.

This function is used by the Home Menu
This commit is contained in:
Sebastian Valle 2020-04-18 13:48:09 -05:00 committed by GitHub
parent c8a503b10f
commit 75c9784239
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 2 deletions

View file

@ -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<u32>();
ASSERT(size == 0x20);
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
rb.Push(RESULT_SUCCESS);
rb.Push(static_cast<u32>(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

View file

@ -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:

View file

@ -83,7 +83,7 @@ APT_S::APT_S(std::shared_ptr<Module> 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"},

View file

@ -83,7 +83,7 @@ APT_U::APT_U(std::shared_ptr<Module> 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"},