From 5d7e2c389f06134b1bef6bbdb97979f3ce1395d3 Mon Sep 17 00:00:00 2001 From: smea Date: Mon, 20 Jan 2014 22:10:09 +0100 Subject: [PATCH] APT : NS_APPID --- arm11u/Makefile | 2 +- arm11u/source/main.c | 2 +- libctru/include/ctr/APT.h | 9 ++++++++- libctru/source/APT.c | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arm11u/Makefile b/arm11u/Makefile index cfb8abd..8690c1d 100644 --- a/arm11u/Makefile +++ b/arm11u/Makefile @@ -17,7 +17,7 @@ PROJECTNAME = ${shell basename "$(CURDIR)"} all: dir $(PROJECTNAME).bin dir: - mkdir -p build + @mkdir -p build $(PROJECTNAME).bin: $(PROJECTNAME).elf $(OBJCOPY) -O binary $< $@ diff --git a/arm11u/source/main.c b/arm11u/source/main.c index 0e17ded..9941a06 100644 --- a/arm11u/source/main.c +++ b/arm11u/source/main.c @@ -24,7 +24,7 @@ void aptInit() svc_waitSynchronization1(aptLockHandle, U64_MAX); //APT lock handle is used because we need to wait for NS to be ready for us srv_getServiceHandle(srvHandle, &aptuHandle, "APT:U"); - APT_Initialize(aptuHandle, 0x300, &APTevents[0], &APTevents[1]); + APT_Initialize(aptuHandle, APPID_APPLICATION, &APTevents[0], &APTevents[1]); svc_closeHandle(aptuHandle); svc_releaseMutex(aptLockHandle); //release the lock diff --git a/libctru/include/ctr/APT.h b/libctru/include/ctr/APT.h index 03705d0..a58cc64 100644 --- a/libctru/include/ctr/APT.h +++ b/libctru/include/ctr/APT.h @@ -1,8 +1,15 @@ #ifndef APT_H #define APT_H +typedef enum{ + APPID_HOMEMENU = 0x101, // Home Menu + APPID_CAMERA = 0x110, // Camera applet + APPID_WEB = 0x114, // Internet Browser + APPID_APPLICATION = 0x300, // Application +}NS_APPID; // cf http://3dbrew.org/wiki/NS#AppIDs + void APT_GetLockHandle(Handle handle, u16 flags, Handle* lockHandle); -void APT_Initialize(Handle handle, u32 a, Handle* eventHandle1, Handle* eventHandle2); +void APT_Initialize(Handle handle, NS_APPID appId, Handle* eventHandle1, Handle* eventHandle2); Result APT_Enable(Handle handle, u32 a); Result APT_PrepareToJumpToHomeMenu(Handle handle); Result APT_JumpToHomeMenu(Handle handle, u32 a, u32 b, u32 c); diff --git a/libctru/source/APT.c b/libctru/source/APT.c index ed5a2ed..6ecba90 100644 --- a/libctru/source/APT.c +++ b/libctru/source/APT.c @@ -14,11 +14,11 @@ void APT_GetLockHandle(Handle handle, u16 flags, Handle* lockHandle) if(lockHandle)*lockHandle=svcData[5]; } -void APT_Initialize(Handle handle, u32 a, Handle* eventHandle1, Handle* eventHandle2) +void APT_Initialize(Handle handle, NS_APPID appId, Handle* eventHandle1, Handle* eventHandle2) { u32* svcData=svc_getData(); svcData[0]=0x20080; //request header code - svcData[1]=a; + svcData[1]=appId; svcData[2]=0x0; svc_sendSyncRequest(handle); //check return value... if(eventHandle1)*eventHandle1=svcData[3]; //return to menu event ?