Added libappletRequestHomeMenu and libappletRequestJumpToSystemUpdate.

This commit is contained in:
yellows8 2018-12-19 20:37:19 -05:00
parent 6e10568589
commit 0bab302c3b
2 changed files with 34 additions and 0 deletions

View File

@ -41,3 +41,11 @@ void libappletArgsSetPlayStartupSound(LibAppletArgs* a, bool flag);
*/
Result libappletArgsPush(LibAppletArgs* a, AppletHolder *h);
/// Wrapper for \ref appletPushToGeneralChannel, see appletPushToGeneralChannel regarding the requirements for using this.
/// Returns to the main Home Menu, equivalent to pressing the HOME button.
Result libappletRequestHomeMenu(void);
/// Wrapper for \ref appletPushToGeneralChannel, see appletPushToGeneralChannel regarding the requirements for using this.
/// Equivalent to entering "System Update" under System Settings. When leaving this, it returns to the main Home Menu.
Result libappletRequestJumpToSystemUpdate(void);

View File

@ -40,3 +40,29 @@ Result libappletArgsPush(LibAppletArgs* a, AppletHolder *h) {
return appletHolderPushInData(h, &storage);
}
static Result _libappletQlaunchRequest(u8* buf, size_t size) {
Result rc=0;
AppletStorage storage;
rc = appletCreateStorage(&storage, size);
if (R_FAILED(rc)) return rc;
rc = appletStorageWrite(&storage, 0, buf, size);
if (R_FAILED(rc)) {
appletStorageClose(&storage);
return rc;
}
return appletPushToGeneralChannel(&storage);
}
Result libappletRequestHomeMenu(void) {
u8 storagedata[0x10] = {0x53, 0x41, 0x4d, 0x53, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00};//RequestHomeMenu
return _libappletQlaunchRequest(storagedata, sizeof(storagedata));
}
Result libappletRequestJumpToSystemUpdate(void) {
u8 storagedata[0x10] = {0x53, 0x41, 0x4d, 0x53, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00};//RequestJumpToSystemUpdate
return _libappletQlaunchRequest(storagedata, sizeof(storagedata));
}