From a945036c67d39e34b5bf95ab3c668f31acfd898f Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 12 Jul 2017 02:02:17 -0400 Subject: [PATCH] Minor clean up + upstream changes form GUI --- source/main.c | 2 +- source/services/actu.c | 8 ++++---- source/services/am.c | 2 +- source/services/cfgs.c | 8 ++++---- source/services/gsplcd.c | 19 ++++++++++--------- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/source/main.c b/source/main.c index 73f7d69..0bd372d 100644 --- a/source/main.c +++ b/source/main.c @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) getSizeString(ctrTotalSize, getTotalStorage(SYSTEM_MEDIATYPE_CTR_NAND)); printf("\x1b[32;1m*\x1b[0m CTR Size: \x1b[32;1m%s\x1b[0m / \x1b[32;1m%s\x1b[0m \n", ctrFreeSize, ctrTotalSize); - printf("\x1b[32;1m*\x1b[0m Installed titles: SD: \x1b[32;1m%i\x1b[0m (NAND: \x1b[32;1m%i\x1b[0m)\n", (int)titleCount(MEDIATYPE_SD), (int)titleCount(MEDIATYPE_NAND)); + printf("\x1b[32;1m*\x1b[0m Installed titles: SD: \x1b[32;1m%lu\x1b[0m (NAND: \x1b[32;1m%lu\x1b[0m)\n", titleCount(MEDIATYPE_SD), titleCount(MEDIATYPE_NAND)); while (aptMainLoop()) { diff --git a/source/services/actu.c b/source/services/actu.c index 8ba181b..c7ce6cb 100644 --- a/source/services/actu.c +++ b/source/services/actu.c @@ -60,12 +60,12 @@ void actExit(void) } } -Result ACTU_Initialize(u32 sdkVer, void *addr, u32 memSize) +Result ACTU_Initialize(u32 sdkVer, void * addr, u32 memSize) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = IPC_MakeHeader(0x1,2,4); // 0x00010084 + cmdbuf[0] = IPC_MakeHeader(0x1, 2, 4); // 0x00010084 cmdbuf[1] = sdkVer; cmdbuf[2] = memSize; cmdbuf[3] = 0x20; @@ -79,12 +79,12 @@ Result ACTU_Initialize(u32 sdkVer, void *addr, u32 memSize) return (Result)cmdbuf[1]; } -Result ACTU_GetAccountDataBlock(void *buffer, u32 size, u32 blkId) +Result ACTU_GetAccountDataBlock(void * buffer, u32 size, u32 blkId) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = IPC_MakeHeader(6,3,2); // 0x00600C2 + cmdbuf[0] = IPC_MakeHeader(6, 3, 2); // 0x00600C2 cmdbuf[1] = 0xFE; cmdbuf[2] = size; cmdbuf[3] = blkId; diff --git a/source/services/am.c b/source/services/am.c index 4e7e65a..be04f8d 100644 --- a/source/services/am.c +++ b/source/services/am.c @@ -7,7 +7,7 @@ Result amNetGetDeviceCert(u8 const * buffer) Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = IPC_MakeHeader(0x818,1,2); // 0x08180042 + cmdbuf[0] = IPC_MakeHeader(0x818, 1, 2); // 0x08180042 cmdbuf[1] = 0x180; cmdbuf[2] = (0x180 << 4) | 0xC; cmdbuf[3] = (u32)buffer; diff --git a/source/services/cfgs.c b/source/services/cfgs.c index ef198df..b5ff891 100644 --- a/source/services/cfgs.c +++ b/source/services/cfgs.c @@ -12,12 +12,12 @@ Result cfgsExit() return svcCloseHandle(cfgHandle); } -Result CFG_GetConfig(u32 size, u32 blkID, u8* outData) +Result CFG_GetConfig(u32 size, u32 blkID, u8 * outData) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = IPC_MakeHeader(0x1,2,2); // 0x10082 + cmdbuf[0] = IPC_MakeHeader(0x1, 2, 2); // 0x10082 cmdbuf[1] = size; cmdbuf[2] = blkID; cmdbuf[3] = IPC_Desc_Buffer(size,IPC_BUFFER_W); @@ -29,12 +29,12 @@ Result CFG_GetConfig(u32 size, u32 blkID, u8* outData) return (Result)cmdbuf[1]; } -Result cfgsSecureInfoGetSerialNo(char *serial) +Result cfgsSecureInfoGetSerialNo(char * serial) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = IPC_MakeHeader(0x408,1,2); // 0x10082 + cmdbuf[0] = IPC_MakeHeader(0x408, 1, 2); // 0x10082 cmdbuf[1] = 0xF; cmdbuf[2] = 12 | (0xF << 4); cmdbuf[3] = (u32)serial; diff --git a/source/services/gsplcd.c b/source/services/gsplcd.c index 57d79de..f7fd943 100644 --- a/source/services/gsplcd.c +++ b/source/services/gsplcd.c @@ -1,18 +1,19 @@ #include "gsplcd.h" -static Handle gspLcdHandle; +Handle gspLcdHandle; -Result GSPLCD_GetBrightness(u32 screen, u32 *brightness) +Result GSPLCD_GetBrightness(u32 screen, u32 * brightness) { - u32 *cmdbuf = getThreadCommandBuffer(); + u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = IPC_MakeHeader(0x15,1,0); // 0x150040 - cmdbuf[1] = screen; + cmdbuf[0] = IPC_MakeHeader(0x15, 1, 0); // 0x150040 + cmdbuf[1] = screen; - Result ret = 0; - if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) return ret; + Result ret = 0; + if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) + return ret; - *brightness = cmdbuf[2]; + *brightness = cmdbuf[2]; - return cmdbuf[2]; + return cmdbuf[2]; } \ No newline at end of file