Provide gspGetSessionHandle and gspLcdGetSessionHandle

This commit is contained in:
TuxSH 2022-04-11 22:55:53 +01:00
parent cf538b1fa8
commit c36d9cc4a6
4 changed files with 24 additions and 2 deletions

View File

@ -89,6 +89,12 @@ Result gspInit(void);
/// Exits GSPGPU.
void gspExit(void);
/**
* @brief Gets a pointer to the current gsp::Gpu session handle.
* @return A pointer to the current gsp::Gpu session handle.
*/
Handle *gspGetSessionHandle(void);
/// Returns true if the application currently has GPU rights.
bool gspHasGpuRight(void);

View File

@ -20,6 +20,12 @@ Result gspLcdInit(void);
/// Exits GSPLCD.
void gspLcdExit(void);
/**
* @brief Gets a pointer to the current gsp::Lcd session handle.
* @return A pointer to the current gsp::Lcd session handle.
*/
Handle *gspLcdGetSessionHandle(void);
/// Powers on both backlights.
Result GSPLCD_PowerOnAllBacklights(void);
@ -69,4 +75,4 @@ Result GSPLCD_SetBrightness(u32 screen, u32 brightness);
* @param screen Screen to set the brightness value of.
* @param brightness Brightness value set.
*/
Result GSPLCD_SetBrightnessRaw(u32 screen, u32 brightness);
Result GSPLCD_SetBrightnessRaw(u32 screen, u32 brightness);

View File

@ -221,6 +221,11 @@ void gspExit(void)
svcCloseHandle(gspGpuHandle);
}
Handle *gspGetSessionHandle(void)
{
return &gspGpuHandle;
}
bool gspHasGpuRight(void)
{
return gspGpuRight;

View File

@ -26,6 +26,11 @@ void gspLcdExit(void)
svcCloseHandle(gspLcdHandle);
}
Handle *gspLcdGetSessionHandle(void)
{
return &gspLcdHandle;
}
Result GSPLCD_PowerOnAllBacklights(void)
{
u32 *cmdbuf = getThreadCommandBuffer();
@ -144,4 +149,4 @@ Result GSPLCD_SetBrightnessRaw(u32 screen, u32 brightness)
if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) return ret;
return cmdbuf[1];
}
}