Merge pull request #101 from profi200/master
Implemented functions to start system applets.
This commit is contained in:
commit
c71637d9ca
@ -8,7 +8,7 @@
|
||||
typedef struct
|
||||
{
|
||||
u64 titleID;
|
||||
u64 unknown;
|
||||
u64 size;
|
||||
u16 titleVersion;
|
||||
u8 unknown2[6];
|
||||
} TitleList;
|
||||
|
@ -82,4 +82,6 @@ Result APT_DoAppJump(Handle* handle, u32 NSbuf0Size, u32 NSbuf1Size, u8 *NSbuf0P
|
||||
Result APT_PrepareToStartLibraryApplet(Handle* handle, NS_APPID appID);
|
||||
Result APT_StartLibraryApplet(Handle* handle, NS_APPID appID, Handle inhandle, u32 *parambuf, u32 parambufsize);
|
||||
Result APT_LaunchLibraryApplet(NS_APPID appID, Handle inhandle, u32 *parambuf, u32 parambufsize);//This should be used for launching library applets, this uses the above APT_StartLibraryApplet/APT_PrepareToStartLibraryApplet funcs + apt*Session(). parambuf is used for APT params input, when the applet closes the output param block is copied here. This is not usable from the homebrew launcher. This is broken: when the applet does get launched at all, the applet process doesn't actually get terminated when the applet gets closed.
|
||||
Result APT_PrepareToStartSystemApplet(Handle* handle, NS_APPID appID);
|
||||
Result APT_StartSystemApplet(Handle* handle, NS_APPID appID, u32 bufSize, Handle applHandle, u8 *buf);
|
||||
|
||||
|
@ -1155,3 +1155,36 @@ Result APT_LaunchLibraryApplet(NS_APPID appID, Handle inhandle, u32 *parambuf, u
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result APT_PrepareToStartSystemApplet(Handle* handle, NS_APPID appID)
|
||||
{
|
||||
if(!handle)handle=&aptuHandle;
|
||||
|
||||
u32* cmdbuf=getThreadCommandBuffer();
|
||||
cmdbuf[0]=0x00190040; //request header code
|
||||
cmdbuf[1]=appID;
|
||||
|
||||
Result ret=0;
|
||||
if((ret=svcSendSyncRequest(*handle)))return ret;
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result APT_StartSystemApplet(Handle* handle, NS_APPID appID, u32 bufSize, Handle applHandle, u8 *buf)
|
||||
{
|
||||
if(!handle)handle=&aptuHandle;
|
||||
|
||||
u32* cmdbuf=getThreadCommandBuffer();
|
||||
cmdbuf[0] = 0x001F0084; //request header code
|
||||
cmdbuf[1] = appID;
|
||||
cmdbuf[2] = bufSize;
|
||||
cmdbuf[3] = 0;
|
||||
cmdbuf[4] = applHandle;
|
||||
cmdbuf[5] = (bufSize<<14) | 2;
|
||||
cmdbuf[6] = (u32)buf;
|
||||
|
||||
Result ret=0;
|
||||
if((ret=svcSendSyncRequest(*handle)))return ret;
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user