APT : NS_APPID

This commit is contained in:
smea 2014-01-20 22:10:09 +01:00
parent 7b9d741127
commit 5d7e2c389f
4 changed files with 12 additions and 5 deletions

View File

@ -17,7 +17,7 @@ PROJECTNAME = ${shell basename "$(CURDIR)"}
all: dir $(PROJECTNAME).bin all: dir $(PROJECTNAME).bin
dir: dir:
mkdir -p build @mkdir -p build
$(PROJECTNAME).bin: $(PROJECTNAME).elf $(PROJECTNAME).bin: $(PROJECTNAME).elf
$(OBJCOPY) -O binary $< $@ $(OBJCOPY) -O binary $< $@

View 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 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"); 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_closeHandle(aptuHandle);
svc_releaseMutex(aptLockHandle); //release the lock svc_releaseMutex(aptLockHandle); //release the lock

View File

@ -1,8 +1,15 @@
#ifndef APT_H #ifndef APT_H
#define 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_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_Enable(Handle handle, u32 a);
Result APT_PrepareToJumpToHomeMenu(Handle handle); Result APT_PrepareToJumpToHomeMenu(Handle handle);
Result APT_JumpToHomeMenu(Handle handle, u32 a, u32 b, u32 c); Result APT_JumpToHomeMenu(Handle handle, u32 a, u32 b, u32 c);

View File

@ -14,11 +14,11 @@ void APT_GetLockHandle(Handle handle, u16 flags, Handle* lockHandle)
if(lockHandle)*lockHandle=svcData[5]; 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(); u32* svcData=svc_getData();
svcData[0]=0x20080; //request header code svcData[0]=0x20080; //request header code
svcData[1]=a; svcData[1]=appId;
svcData[2]=0x0; svcData[2]=0x0;
svc_sendSyncRequest(handle); //check return value... svc_sendSyncRequest(handle); //check return value...
if(eventHandle1)*eventHandle1=svcData[3]; //return to menu event ? if(eventHandle1)*eventHandle1=svcData[3]; //return to menu event ?