Implemented/stubbed PrepareToCloseApplication

I implemented/stubbed this function in hopes of fixing the crash to desktop issue that homebrew causes when it tries to exit back to the homemenu
This commit is contained in:
noah the goodra 2017-02-08 14:31:23 -06:00
parent c04062cb0f
commit 90fc6dabf7
3 changed files with 16 additions and 3 deletions

View File

@ -395,7 +395,11 @@ void StartLibraryApplet(Service::Interface* self) {
cmd_buff[1] = applet->Start(parameter).raw; cmd_buff[1] = applet->Start(parameter).raw;
} }
void PrepareToCloseApplication(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_APT, "(STUBBED) called");
}
void CancelLibraryApplet(Service::Interface* self) { void CancelLibraryApplet(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
u32 exiting = cmd_buff[1] & 0xFF; u32 exiting = cmd_buff[1] & 0xFF;

View File

@ -321,7 +321,16 @@ void PrepareToStartApplication(Service::Interface* self);
* 1 : Result of function, 0 on success, otherwise error code * 1 : Result of function, 0 on success, otherwise error code
*/ */
void StartApplication(Service::Interface* self); void StartApplication(Service::Interface* self);
/**
* APT::PrepareToCloseApplication service function
* Inputs:
* 0 : Command header [0x00180040]
* 1 : u8, Cancel Preload (0 = don't cancel, 1 = cancel)
* Outputs:
* 0 : Return header
* 1 : Result of function, 0 on success, otherwise error code
*/
void PrepareToCloseApplication(Service::Interface* self);
/** /**
* APT::AppletUtility service function * APT::AppletUtility service function
* Inputs: * Inputs:

View File

@ -42,7 +42,7 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x001F0084, nullptr, "StartSystemApplet"}, {0x001F0084, nullptr, "StartSystemApplet"},
{0x00200044, nullptr, "StartNewestHomeMenu"}, {0x00200044, nullptr, "StartNewestHomeMenu"},
{0x00210000, nullptr, "OrderToCloseApplication"}, {0x00210000, nullptr, "OrderToCloseApplication"},
{0x00220040, nullptr, "PrepareToCloseApplication"}, {0x00220040, PrepareToCloseApplication, "PrepareToCloseApplication"},
{0x00230040, nullptr, "PrepareToJumpToApplication"}, {0x00230040, nullptr, "PrepareToJumpToApplication"},
{0x00240044, nullptr, "JumpToApplication"}, {0x00240044, nullptr, "JumpToApplication"},
{0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"},