]> Chaos Git - corbenik/ctrulib.git/commitdiff
Add GSPLCD_GetVendors (#311)
authorSciresM <Sciresm@gmail.com>
Sun, 4 Sep 2016 12:41:28 +0000 (05:41 -0700)
committerfincs <fincs.alt1@gmail.com>
Sun, 4 Sep 2016 12:41:28 +0000 (14:41 +0200)
libctru/include/3ds/services/gsplcd.h
libctru/source/services/gsplcd.c

index a5b4c7e195412c1b57d488ea50fe95e646444dca..0ac9a975b356984fa702de310123c8cd9898945a 100644 (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);
\ No newline at end of file
index 52bea9a12726c73f33a913326396bf70bca2f292..0c27cb80b30530b155ba576414ce0a837674ab18 100644 (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];
+}
+