]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added functions for launching other apps/applets
authorprofi200 <fd3194@gmx.de>
Mon, 10 Nov 2014 16:03:41 +0000 (17:03 +0100)
committerprofi200 <fd3194@gmx.de>
Mon, 10 Nov 2014 16:03:41 +0000 (17:03 +0100)
libctru/include/3ds/services/apt.h
libctru/source/services/apt.c

index a0bfc8703ced50eef0f8576e545e87394550fc2b..ad94d015d9d331f8320b3a2390c3c0b735b19c9d 100644 (file)
@@ -73,4 +73,6 @@ Result APT_GetAppCpuTimeLimit(Handle* handle, u32 *percent);
 Result APT_CheckNew3DS_Application(Handle* handle, u8 *out);//*Application and *System use APT commands 0x01010000 and 0x01020000. Using APT_CheckNew3DS() is recommended, this determines which of those two funcs to use automatically. When this is first called(this calls aptOpenSession/aptCloseSession internally), this initializes an internal flag, which is then used for the out val for all future calls.
 Result APT_CheckNew3DS_System(Handle* handle, u8 *out);
 Result APT_CheckNew3DS(Handle* handle, u8 *out);
+Result APT_PrepareToDoAppJump(Handle* handle, u8 flags, u64 programID, u8 mediatype);
+Result APT_DoAppJump(Handle* handle, u32 NSbuf0Size, u32 NSbuf1Size, u8 *NSbuf0Ptr, u8 *NSbuf1Ptr);
 
index 7bd0799e5d6a07fccf1159929c9e485a5a292c10..db3b011f68aa81e1dae8a67c767e8e58a14897ae 100644 (file)
@@ -886,3 +886,39 @@ Result APT_CheckNew3DS(Handle* handle, u8 *out)
        return ret;
 }
 
+Result APT_PrepareToDoAppJump(Handle* handle, u8 flags, u64 programID, u8 mediatype)
+{
+       if(!handle)handle=&aptuHandle;
+
+       u32* cmdbuf=getThreadCommandBuffer();
+       cmdbuf[0]=0x310100; //request header code
+       cmdbuf[1]=flags;
+       cmdbuf[2]=(u32)programID;
+       cmdbuf[3]=(u32)(programID>>32);
+       cmdbuf[4]=mediatype;
+       
+       Result ret=0;
+       if((ret=svcSendSyncRequest(*handle)))return ret;
+
+       return cmdbuf[1];
+}
+
+Result APT_DoAppJump(Handle* handle, u32 NSbuf0Size, u32 NSbuf1Size, u8 *NSbuf0Ptr, u8 *NSbuf1Ptr)
+{
+       if(!handle)handle=&aptuHandle;
+
+       u32* cmdbuf=getThreadCommandBuffer();
+       cmdbuf[0]=0x320084; //request header code
+       cmdbuf[1]=NSbuf0Size;
+       cmdbuf[2]=NSbuf1Size;
+       cmdbuf[3]=(NSbuf0Size<<14)|2;
+       cmdbuf[4]=(u32)NSbuf0Ptr;
+       cmdbuf[5]=(NSbuf1Size<<14)|0x802;
+       cmdbuf[6]=(u32)NSbuf1Ptr;
+       
+       Result ret=0;
+       if((ret=svcSendSyncRequest(*handle)))return ret;
+
+       return cmdbuf[1];
+}
+