Merge branch 'master' into great-refactor
Conflicts: libctru/include/3ds/services/gsp.h libctru/source/services/gsp.c
This commit is contained in:
commit
8e052004d5
@ -48,9 +48,19 @@ typedef enum
|
||||
GSPEVENT_MAX, // used to know how many events there are
|
||||
} GSP_Event;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GSPLCD_TOP = BIT(0),
|
||||
GSPLCD_BOTTOM = BIT(1),
|
||||
GSPLCD_BOTH = GSPLCD_TOP | GSPLCD_BOTTOM,
|
||||
}GSPLCD_Screens;
|
||||
|
||||
Result gspInit(void);
|
||||
void gspExit(void);
|
||||
|
||||
Result gspLcdInit(void);
|
||||
void gspLcdExit(void);
|
||||
|
||||
Result gspInitEventHandler(Handle gspEvent, vu8* gspSharedMem, u8 gspThreadId);
|
||||
void gspExitEventHandler(void);
|
||||
void gspWaitForEvent(GSP_Event id, bool nextEvent);
|
||||
@ -79,3 +89,6 @@ Result GSPGPU_RegisterInterruptRelayQueue(Handle eventHandle, u32 flags, Handle*
|
||||
Result GSPGPU_UnregisterInterruptRelayQueue(void);
|
||||
Result GSPGPU_TriggerCmdReqQueue(void);
|
||||
Result GSPGPU_SubmitGxCommand(u32* sharedGspCmdBuf, u32 gxCommand[0x8]);
|
||||
|
||||
Result GSPLCD_PowerOffBacklight(GSPLCD_Screens screen);
|
||||
Result GSPLCD_PowerOnBacklight(GSPLCD_Screens screen);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define GSP_EVENT_STACK_SIZE 0x1000
|
||||
|
||||
Handle gspGpuHandle=0;
|
||||
Handle gspLcdHandle=0;
|
||||
Handle gspEvents[GSPEVENT_MAX];
|
||||
vu32 gspEventCounts[GSPEVENT_MAX];
|
||||
u64 gspEventStack[GSP_EVENT_STACK_SIZE/sizeof(u64)]; //u64 so that it's 8-byte aligned
|
||||
@ -400,3 +401,39 @@ Result GSPGPU_SubmitGxCommand(u32* sharedGspCmdBuf, u32 gxCommand[0x8])
|
||||
if(totalCommands==1)return GSPGPU_TriggerCmdReqQueue();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result gspLcdInit(void)
|
||||
{
|
||||
return srvGetServiceHandle(&gspLcdHandle, "gsp::Lcd");
|
||||
}
|
||||
|
||||
void gspLcdExit(void)
|
||||
{
|
||||
if(gspLcdHandle)svcCloseHandle(gspLcdHandle);
|
||||
}
|
||||
|
||||
Result GSPLCD_PowerOffBacklight(GSPLCD_Screens screen)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x00120040;
|
||||
cmdbuf[1] = screen;
|
||||
|
||||
Result ret=0;
|
||||
if ((ret = svcSendSyncRequest(gspLcdHandle)))return ret;
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result GSPLCD_PowerOnBacklight(GSPLCD_Screens screen)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x00110040;
|
||||
cmdbuf[1] = screen;
|
||||
|
||||
Result ret=0;
|
||||
if ((ret = svcSendSyncRequest(gspLcdHandle)))return ret;
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user