Implement some services from gsp::Lcd.
http://www.3dbrew.org/wiki/GSP_Services
This commit is contained in:
parent
6590ed3fad
commit
7bad79e8b4
@ -51,6 +51,9 @@ typedef enum
|
||||
Result gspInit();
|
||||
void gspExit();
|
||||
|
||||
Result gspLcdInit();
|
||||
void gspLcdExit();
|
||||
|
||||
Result gspInitEventHandler(Handle gspEvent, vu8* gspSharedMem, u8 gspThreadId);
|
||||
void gspExitEventHandler();
|
||||
void gspWaitForEvent(GSP_Event id, bool nextEvent);
|
||||
@ -79,3 +82,7 @@ Result GSPGPU_RegisterInterruptRelayQueue(Handle *handle, Handle eventHandle, u3
|
||||
Result GSPGPU_UnregisterInterruptRelayQueue(Handle* handle);
|
||||
Result GSPGPU_TriggerCmdReqQueue(Handle *handle);
|
||||
Result GSPGPU_SubmitGxCommand(u32* sharedGspCmdBuf, u32 gxCommand[0x8], Handle* handle);
|
||||
|
||||
// 1 = top, 2 = bottom, 3 = both
|
||||
Result GSPLCD_PowerOffBacklight(u32 screen);
|
||||
Result GSPLCD_PowerOnBacklight(u32 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
|
||||
@ -431,3 +432,37 @@ Result GSPGPU_SubmitGxCommand(u32* sharedGspCmdBuf, u32 gxCommand[0x8], Handle*
|
||||
if(totalCommands==1)return GSPGPU_TriggerCmdReqQueue(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result gspLcdInit()
|
||||
{
|
||||
return srvGetServiceHandle(&gspLcdHandle, "gsp::Lcd");
|
||||
}
|
||||
|
||||
void gspLcdExit()
|
||||
{
|
||||
if(gspLcdHandle)svcCloseHandle(gspLcdHandle);
|
||||
}
|
||||
|
||||
Result GSPLCD_PowerOffBacklight(u32 screen)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x00120040;
|
||||
cmdbuf[1] = screen;
|
||||
|
||||
Result ret = svcSendSyncRequest(gspLcdHandle);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Result GSPLCD_PowerOnBacklight(u32 screen)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x00110040;
|
||||
cmdbuf[1] = screen;
|
||||
|
||||
Result ret = svcSendSyncRequest(gspLcdHandle);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user