Add GSPLCD_GetVendors (#311)

This commit is contained in:
SciresM 2016-09-04 05:41:28 -07:00 committed by fincs
parent b0768e552b
commit bd34fd59db
2 changed files with 19 additions and 0 deletions

View File

@ -31,3 +31,8 @@ Result GSPLCD_PowerOnBacklight(u32 screen);
*/
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);

View File

@ -52,3 +52,17 @@ Result GSPLCD_PowerOffBacklight(u32 screen)
return cmdbuf[1];
}
Result GSPLCD_GetVendors(u8 *vendors)
{
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x14,0,0); // 0x140000
Result ret=0;
if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) return ret;
if(vendors) *vendors = cmdbuf[2] & 0xFF;
return cmdbuf[1];
}