]> Chaos Git - corbenik/ctrulib.git/commitdiff
APT : NS_APPID
authorsmea <smealum@gmail.com>
Mon, 20 Jan 2014 21:10:09 +0000 (22:10 +0100)
committersmea <smealum@gmail.com>
Mon, 20 Jan 2014 21:10:09 +0000 (22:10 +0100)
arm11u/Makefile
arm11u/source/main.c
libctru/include/ctr/APT.h
libctru/source/APT.c

index cfb8abd1b331ef8d3338b09b9fa89b878d904cba..8690c1d691f1c475d83d2d7e556817346ee6495c 100644 (file)
@@ -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 $< $@
index 0e17dedf857672f4563b5c8421a7b952a8e35335..9941a064d55bed24e6e4ffb2b9bead71f7702624 100644 (file)
@@ -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
        
index 03705d0c358b458e2ec6f1873bd8a29d466e16db..a58cc64bb87012d4ebd5620d98234eb5a46b27ed 100644 (file)
@@ -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);
index ed5a2edbad58687625ce7acae0a598e69cf6db5c..6ecba90d4f524c37b3146d9032e7e1f81c791289 100644 (file)
@@ -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 ?