APT && HID && GSP : don't ignore errors yo
This commit is contained in:
parent
791e7ed4db
commit
9d68fa3d7a
@ -16,7 +16,7 @@ typedef enum{
|
||||
|
||||
extern Handle aptEvents[3];
|
||||
|
||||
void aptInit(NS_APPID appID);
|
||||
Result aptInit(NS_APPID appID);
|
||||
void aptExit();
|
||||
void aptOpenSession();
|
||||
void aptCloseSession();
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#define GSP_REBASE_REG(r) ((r)-0x1EB00000)
|
||||
|
||||
void gspInit();
|
||||
Result gspInit();
|
||||
void gspExit();
|
||||
|
||||
Result GSPGPU_AcquireRight(Handle *handle, u8 flags);
|
||||
|
@ -28,10 +28,10 @@ typedef enum
|
||||
extern Handle hidMemHandle;
|
||||
extern vu32* hidSharedMem;
|
||||
|
||||
void hidInit(u32* sharedMem);
|
||||
Result hidInit(u32* sharedMem);
|
||||
void hidExit();
|
||||
|
||||
Result HIDUSER_GetInfo(Handle* handle, Handle* outMemHandle);
|
||||
Result HIDUSER_Init(Handle* handle);
|
||||
Result HIDUSER_EnableAccelerometer(Handle* handle);
|
||||
|
||||
#endif
|
||||
|
@ -94,26 +94,30 @@ void aptEventHandler(u32 arg)
|
||||
svc_exitThread();
|
||||
}
|
||||
|
||||
void aptInit(NS_APPID appID)
|
||||
Result aptInit(NS_APPID appID)
|
||||
{
|
||||
Result ret=0;
|
||||
|
||||
//initialize APT stuff, escape load screen
|
||||
srv_getServiceHandle(NULL, &aptuHandle, "APT:U");
|
||||
APT_GetLockHandle(&aptuHandle, 0x0, &aptLockHandle);
|
||||
if((ret=APT_GetLockHandle(&aptuHandle, 0x0, &aptLockHandle)))return ret;
|
||||
svc_closeHandle(aptuHandle);
|
||||
|
||||
currentAppId=appID;
|
||||
|
||||
aptOpenSession();
|
||||
APT_Initialize(NULL, currentAppId, &aptEvents[0], &aptEvents[1]);
|
||||
if((ret=APT_Initialize(NULL, currentAppId, &aptEvents[0], &aptEvents[1])))return ret;
|
||||
aptCloseSession();
|
||||
|
||||
aptOpenSession();
|
||||
APT_Enable(NULL, 0x0);
|
||||
if((ret=APT_Enable(NULL, 0x0)))return ret;
|
||||
aptCloseSession();
|
||||
|
||||
aptOpenSession();
|
||||
APT_NotifyToWait(NULL, currentAppId);
|
||||
if((ret=APT_NotifyToWait(NULL, currentAppId)))return ret;
|
||||
aptCloseSession();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void aptExit()
|
||||
|
@ -8,10 +8,9 @@
|
||||
|
||||
Handle gspGpuHandle=0;
|
||||
|
||||
void gspInit()
|
||||
Result gspInit()
|
||||
{
|
||||
//do stuff with GPU...
|
||||
srv_getServiceHandle(NULL, &gspGpuHandle, "gsp::Gpu");
|
||||
return srv_getServiceHandle(NULL, &gspGpuHandle, "gsp::Gpu");
|
||||
}
|
||||
|
||||
void gspExit()
|
||||
|
@ -11,17 +11,20 @@ Handle hidMemHandle;
|
||||
|
||||
vu32* hidSharedMem;
|
||||
|
||||
void hidInit(u32* sharedMem)
|
||||
Result hidInit(u32* sharedMem)
|
||||
{
|
||||
if(!sharedMem)sharedMem=(u32*)HID_SHAREDMEM_DEFAULT;
|
||||
Result ret=0;
|
||||
|
||||
srv_getServiceHandle(NULL, &hidHandle, "hid:USER");
|
||||
if((ret=srv_getServiceHandle(NULL, &hidHandle, "hid:USER")))return ret;
|
||||
|
||||
HIDUSER_GetInfo(NULL, &hidMemHandle);
|
||||
if((ret=HIDUSER_GetInfo(NULL, &hidMemHandle)))return ret;
|
||||
hidSharedMem=sharedMem;
|
||||
svc_mapMemoryBlock(hidMemHandle, (u32)hidSharedMem, 0x1, 0x10000000);
|
||||
|
||||
HIDUSER_Init(NULL);
|
||||
if((ret=HIDUSER_EnableAccelerometer(NULL)))return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hidExit()
|
||||
@ -45,7 +48,7 @@ Result HIDUSER_GetInfo(Handle* handle, Handle* outMemHandle)
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result HIDUSER_Init(Handle* handle)
|
||||
Result HIDUSER_EnableAccelerometer(Handle* handle)
|
||||
{
|
||||
if(!handle)handle=&hidHandle;
|
||||
u32* cmdbuf=getThreadCommandBuffer();
|
||||
|
Loading…
Reference in New Issue
Block a user