Implement GSPLCD::GetBrightness (#351)

* Implement GSPLCD::GetBrightness

* Split input and output params
This commit is contained in:
Joel 2017-04-02 22:55:37 -05:00 committed by mtheall
parent f4232926c3
commit b3742567d4
2 changed files with 22 additions and 1 deletions

View File

@ -35,4 +35,11 @@ Result GSPLCD_PowerOffBacklight(u32 screen);
* @brief Gets the LCD screens' vendors. Stubbed on old 3ds.
* @param vendor Pointer to output the screen vendors to.
*/
Result GSPLCD_GetVendors(u8 *vendors);
Result GSPLCD_GetVendors(u8 *vendors);
/**
* @brief Gets the LCD screens' brightness. Stubbed on old 3ds.
* @param screen Screen to get the brightness value of.
* @param brightness Brightness value returned.
*/
Result GSPLCD_GetBrightness(u32 screen, u32 *brightness);

View File

@ -66,3 +66,17 @@ Result GSPLCD_GetVendors(u8 *vendors)
return cmdbuf[1];
}
Result GSPLCD_GetBrightness(u32 screen, u32 *brightness)
{
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x15,1,0); // 0x150040
cmdbuf[1] = screen;
Result ret = 0;
if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) return ret;
*brightness = cmdbuf[2];
return cmdbuf[2];
}