mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-26 23:02:39 +02:00
Added libappletRequestHomeMenu and libappletRequestJumpToSystemUpdate.
This commit is contained in:
parent
6e10568589
commit
0bab302c3b
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user