Added more code to aptAppletUtility_Exit_RetToApp() for when a library applet is closing, but this still doesn't fix the broken applet process termination.

This commit is contained in:
yellows8 2014-11-28 02:12:49 -05:00
parent 56b1c2755c
commit 8dbe9d9128

View File

@ -103,7 +103,7 @@ void aptWaitStatusEvent()
svcClearEvent(aptStatusEvent); svcClearEvent(aptStatusEvent);
} }
void aptAppletUtility_Exit_RetToApp() void aptAppletUtility_Exit_RetToApp(u32 type)
{ {
u8 buf1[4], buf2[4]; u8 buf1[4], buf2[4];
@ -132,6 +132,13 @@ void aptAppletUtility_Exit_RetToApp()
aptOpenSession(); aptOpenSession();
APT_AppletUtility(NULL, NULL, 0x4, 0x1, buf1, 0x1, buf2); APT_AppletUtility(NULL, NULL, 0x4, 0x1, buf1, 0x1, buf2);
aptCloseSession(); aptCloseSession();
if(type)
{
aptOpenSession();
APT_AppletUtility(NULL, NULL, 0x4, 0x1, buf1, 0x1, buf2);
aptCloseSession();
}
} }
NS_APPID aptGetMenuAppID() NS_APPID aptGetMenuAppID()
@ -257,7 +264,7 @@ void aptAppletStarted()
void aptAppletClosed() void aptAppletClosed()
{ {
aptAppletUtility_Exit_RetToApp(); aptAppletUtility_Exit_RetToApp(1);
GSPGPU_AcquireRight(NULL, 0x0); GSPGPU_AcquireRight(NULL, 0x0);
GSPGPU_RestoreVramSysArea(NULL); GSPGPU_RestoreVramSysArea(NULL);
@ -354,7 +361,7 @@ static bool __handle_incoming_parameter() {
case 0xB: // Just returned from menu. case 0xB: // Just returned from menu.
GSPGPU_AcquireRight(NULL, 0x0); GSPGPU_AcquireRight(NULL, 0x0);
GSPGPU_RestoreVramSysArea(NULL); GSPGPU_RestoreVramSysArea(NULL);
aptAppletUtility_Exit_RetToApp(); aptAppletUtility_Exit_RetToApp(0);
aptSetStatus(APP_RUNNING); aptSetStatus(APP_RUNNING);
return true; return true;
@ -436,7 +443,7 @@ Result aptInit(void)
void aptExit() void aptExit()
{ {
if(!(__system_runflags&RUNFLAG_APTWORKAROUND))aptAppletUtility_Exit_RetToApp(); if(!(__system_runflags&RUNFLAG_APTWORKAROUND))aptAppletUtility_Exit_RetToApp(0);
// This is only executed when application-termination was triggered via the home-menu power-off screen. // This is only executed when application-termination was triggered via the home-menu power-off screen.
if(aptGetStatusPower() == 1) if(aptGetStatusPower() == 1)