From bd34fd59dbf0691e2dba76be65f260303d8ccec7 Mon Sep 17 00:00:00 2001 From: SciresM Date: Sun, 4 Sep 2016 05:41:28 -0700 Subject: [PATCH] Add GSPLCD_GetVendors (#311) --- libctru/include/3ds/services/gsplcd.h | 5 +++++ libctru/source/services/gsplcd.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libctru/include/3ds/services/gsplcd.h b/libctru/include/3ds/services/gsplcd.h index a5b4c7e..0ac9a97 100644 --- a/libctru/include/3ds/services/gsplcd.h +++ b/libctru/include/3ds/services/gsplcd.h @@ -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); \ No newline at end of file diff --git a/libctru/source/services/gsplcd.c b/libctru/source/services/gsplcd.c index 52bea9a..0c27cb8 100644 --- a/libctru/source/services/gsplcd.c +++ b/libctru/source/services/gsplcd.c @@ -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]; +} +