mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
make pl:s accessible (#400)
This commit is contained in:
parent
7e581f6110
commit
a272fa75b9
@ -8,6 +8,11 @@
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
|
||||
typedef enum {
|
||||
PlServiceType_User = 0, ///< Initializes pl:u.
|
||||
PlServiceType_System = 1, ///< Initializes pl:s.
|
||||
} PlServiceType;
|
||||
|
||||
/// SharedFontType
|
||||
typedef enum {
|
||||
PlSharedFontType_Standard = 0, ///< Japan, US and Europe
|
||||
@ -28,7 +33,7 @@ typedef struct {
|
||||
} PlFontData;
|
||||
|
||||
/// Initialize pl.
|
||||
Result plInitialize(void);
|
||||
Result plInitialize(PlServiceType service_type);
|
||||
|
||||
/// Exit pl.
|
||||
void plExit(void);
|
||||
|
@ -6,18 +6,27 @@
|
||||
|
||||
#define SHAREDMEMFONT_SIZE 0x1100000
|
||||
|
||||
static PlServiceType g_plServiceType;
|
||||
static Service g_plSrv;
|
||||
static SharedMemory g_plSharedmem;
|
||||
|
||||
static Result _plGetSharedMemoryNativeHandle(Handle* handle_out);
|
||||
|
||||
NX_GENERATE_SERVICE_GUARD(pl);
|
||||
NX_GENERATE_SERVICE_GUARD_PARAMS(pl, (PlServiceType service_type), (service_type));
|
||||
|
||||
Result _plInitialize(void) {
|
||||
Result rc=0;
|
||||
Result _plInitialize(PlServiceType service_type) {
|
||||
Result rc = MAKERESULT(Module_Libnx, LibnxError_BadInput);
|
||||
Handle sharedmem_handle=0;
|
||||
|
||||
rc = smGetService(&g_plSrv, "pl:u");
|
||||
g_plServiceType = service_type;
|
||||
switch (g_plServiceType) {
|
||||
case PlServiceType_User:
|
||||
rc = smGetService(&g_plSrv, "pl:u");
|
||||
break;
|
||||
case PlServiceType_System:
|
||||
rc = smGetService(&g_plSrv, "pl:s");
|
||||
break;
|
||||
}
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
rc = _plGetSharedMemoryNativeHandle(&sharedmem_handle);
|
||||
|
Loading…
Reference in New Issue
Block a user