mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 21:02:39 +02:00
Added support for errorEulaShow/errorSystemUpdateEulaShow.
This commit is contained in:
parent
1ec8e3b29e
commit
018441a1f6
@ -7,6 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
#include "../services/applet.h"
|
#include "../services/applet.h"
|
||||||
|
#include "../services/set.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 unk_x0[0x200];
|
u8 unk_x0[0x200];
|
||||||
@ -29,6 +30,15 @@ typedef struct {
|
|||||||
Result res;
|
Result res;
|
||||||
} ErrorCommonArg;
|
} ErrorCommonArg;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
ErrorCommonHeader hdr;
|
||||||
|
SetRegion regionCode;
|
||||||
|
} ErrorEulaArg;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
u8 data[0x20000];
|
||||||
|
} ErrorEulaData;
|
||||||
|
|
||||||
/// SystemErrorArg
|
/// SystemErrorArg
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ErrorCommonHeader hdr;
|
ErrorCommonHeader hdr;
|
||||||
@ -57,6 +67,19 @@ typedef struct {
|
|||||||
ErrorContext ctx;
|
ErrorContext ctx;
|
||||||
} ErrorApplicationConfig;
|
} ErrorApplicationConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Launches the applet for displaying the EULA.
|
||||||
|
* @param RegionCode \ref SetRegion
|
||||||
|
*/
|
||||||
|
Result errorEulaShow(SetRegion RegionCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Launches the applet for displaying the system-update EULA.
|
||||||
|
* @param RegionCode \ref SetRegion
|
||||||
|
* @param eula EULA data. Address must be 0x1000-byte aligned.
|
||||||
|
*/
|
||||||
|
Result errorSystemUpdateEulaShow(SetRegion RegionCode, ErrorEulaData* eula);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates an ErrorSystemConfig struct.
|
* @brief Creates an ErrorSystemConfig struct.
|
||||||
* @param c ErrorSystemConfig struct.
|
* @param c ErrorSystemConfig struct.
|
||||||
|
@ -76,6 +76,45 @@ static Result _errorShowContext(const void* indata, size_t insize, ErrorContext*
|
|||||||
return _errorShow(indata, insize, ctx_ptr, ctx_size);
|
return _errorShow(indata, insize, ctx_ptr, ctx_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Eula
|
||||||
|
|
||||||
|
Result errorEulaShow(SetRegion RegionCode) {
|
||||||
|
ErrorEulaArg arg;
|
||||||
|
|
||||||
|
memset(&arg, 0, sizeof(arg));
|
||||||
|
arg.hdr.type = 3;
|
||||||
|
arg.hdr.unk_x1 = 1;
|
||||||
|
arg.regionCode = RegionCode;
|
||||||
|
|
||||||
|
return _errorShow(&arg, sizeof(arg), NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result errorSystemUpdateEulaShow(SetRegion RegionCode, ErrorEulaData* eula) {
|
||||||
|
Result rc=0;
|
||||||
|
AppletHolder holder;
|
||||||
|
AppletStorage storage={0};
|
||||||
|
ErrorEulaArg arg;
|
||||||
|
|
||||||
|
memset(&arg, 0, sizeof(arg));
|
||||||
|
arg.hdr.type = 8;
|
||||||
|
arg.hdr.unk_x1 = 1;
|
||||||
|
arg.regionCode = RegionCode;
|
||||||
|
|
||||||
|
rc = _errorAppletCreate(&holder, &arg, sizeof(arg), NULL, 0);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
if (R_SUCCEEDED(rc)) rc = appletCreateTransferMemoryStorage(&storage, eula, sizeof(*eula), false);
|
||||||
|
if (R_SUCCEEDED(rc)) rc = appletHolderPushInData(&holder, &storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) rc = _errorRun(&holder);
|
||||||
|
|
||||||
|
appletHolderClose(&holder);
|
||||||
|
appletStorageCloseTmem(&storage);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
// System
|
// System
|
||||||
|
|
||||||
Result errorSystemCreate(ErrorSystemConfig* c, const char* dialog_message, const char* fullscreen_message) {
|
Result errorSystemCreate(ErrorSystemConfig* c, const char* dialog_message, const char* fullscreen_message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user