mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 05:12:39 +02:00
Fixed+enabled appletSetTerminateResult and added it to applet.h.
This commit is contained in:
parent
d8683ea188
commit
ced4f16ee1
@ -143,6 +143,9 @@ Result appletPopLaunchParameter(AppletStorage *s, AppletLaunchParameterKind kind
|
|||||||
|
|
||||||
Result appletGetDesiredLanguage(u64 *LanguageCode);
|
Result appletGetDesiredLanguage(u64 *LanguageCode);
|
||||||
|
|
||||||
|
/// Only available with AppletType_*Application.
|
||||||
|
Result appletSetTerminateResult(Result res);
|
||||||
|
|
||||||
/// Gets whether video recording is supported.
|
/// Gets whether video recording is supported.
|
||||||
/// See also \ref appletInitializeGamePlayRecording.
|
/// See also \ref appletInitializeGamePlayRecording.
|
||||||
Result appletIsGamePlayRecordingSupported(bool *flag);
|
Result appletIsGamePlayRecordingSupported(bool *flag);
|
||||||
|
@ -79,7 +79,6 @@ static Result _appletSetOperationModeChangedNotification(u8 flag);
|
|||||||
static Result _appletSetPerformanceModeChangedNotification(u8 flag);
|
static Result _appletSetPerformanceModeChangedNotification(u8 flag);
|
||||||
|
|
||||||
static Result _appletSelfExit(void);
|
static Result _appletSelfExit(void);
|
||||||
//static Result _appletSetTerminateResult(Result res);
|
|
||||||
|
|
||||||
static Result _appletExitProcessAndReturn(void);
|
static Result _appletExitProcessAndReturn(void);
|
||||||
|
|
||||||
@ -307,7 +306,7 @@ void appletExit(void)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (_appletIsApplication()) {
|
if (_appletIsApplication()) {
|
||||||
//_appletSetTerminateResult(0);
|
//appletSetTerminateResult(0);
|
||||||
_appletSelfExit();
|
_appletSelfExit();
|
||||||
}
|
}
|
||||||
if (__nx_applet_type == AppletType_LibraryApplet)
|
if (__nx_applet_type == AppletType_LibraryApplet)
|
||||||
@ -828,6 +827,43 @@ Result appletGetDesiredLanguage(u64 *LanguageCode) {
|
|||||||
return _appletCmdNoInOut64(&g_appletIFunctions, LanguageCode, 21);
|
return _appletCmdNoInOut64(&g_appletIFunctions, LanguageCode, 21);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result appletSetTerminateResult(Result res) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
Result res;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = serviceIpcPrepareHeader(&g_appletIFunctions, &c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 22;
|
||||||
|
raw->res = res;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_appletIFunctions);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
} *resp;
|
||||||
|
|
||||||
|
serviceIpcParse(&g_appletIFunctions, &r, sizeof(*resp));
|
||||||
|
resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result appletBeginBlockingHomeButton(s64 val) {
|
Result appletBeginBlockingHomeButton(s64 val) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -1424,40 +1460,6 @@ Result appletSetScreenShotImageOrientation(s32 val) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static Result _appletSetTerminateResult(Result res) {
|
|
||||||
IpcCommand c;
|
|
||||||
ipcInitialize(&c);
|
|
||||||
|
|
||||||
struct {
|
|
||||||
u64 magic;
|
|
||||||
u64 cmd_id;
|
|
||||||
Result res;
|
|
||||||
} *raw;
|
|
||||||
|
|
||||||
raw = serviceIpcPrepareHeader(&g_appletISelfController, &c, sizeof(*raw));
|
|
||||||
|
|
||||||
raw->magic = SFCI_MAGIC;
|
|
||||||
raw->cmd_id = 22;
|
|
||||||
raw->res = res;
|
|
||||||
|
|
||||||
Result rc = serviceIpcDispatch(&g_appletISelfController);
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
|
||||||
IpcParsedCommand r;
|
|
||||||
struct {
|
|
||||||
u64 magic;
|
|
||||||
u64 result;
|
|
||||||
} *resp;
|
|
||||||
|
|
||||||
serviceIpcParse(&g_appletISelfController, &r, sizeof(*resp));
|
|
||||||
resp = r.Raw;
|
|
||||||
|
|
||||||
rc = resp->result;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Result appletCreateManagedDisplayLayer(u64 *out) {
|
Result appletCreateManagedDisplayLayer(u64 *out) {
|
||||||
return _appletCmdNoInOut64(&g_appletISelfController, out, 40);
|
return _appletCmdNoInOut64(&g_appletISelfController, out, 40);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user