From ea3e45d40aff1bf83ae8757951403088a15e4f7d Mon Sep 17 00:00:00 2001 From: Aurora Date: Wed, 23 Mar 2016 16:10:26 +0100 Subject: [PATCH] Move clearScreens calls and screen-init checks --- source/loader.c | 6 +----- source/screeninit.c | 15 +++++++++++---- source/utils.c | 6 ++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/source/loader.c b/source/loader.c index eca0fc4..845e1f9 100644 --- a/source/loader.c +++ b/source/loader.c @@ -8,17 +8,13 @@ #include "fs.h" #include "memory.h" #include "screeninit.h" -#include "draw.h" #include "../build/loader.h" #define PAYLOAD_ADDRESS 0x24F00000 void loadPayload(void){ if(fileExists("aurei/payloads/default.bin")){ - if(PDN_GPU_CNT == 0x1){ - initScreens(); - clearScreens(); - } + initScreens(); memcpy((void *)PAYLOAD_ADDRESS, loader, loader_size); ((void (*)())PAYLOAD_ADDRESS)(); } diff --git a/source/screeninit.c b/source/screeninit.c index d974f83..6f8ff2d 100644 --- a/source/screeninit.c +++ b/source/screeninit.c @@ -8,6 +8,7 @@ */ #include "screeninit.h" +#include "draw.h" #include "i2c.h" static vu32 *const arm11 = (vu32 *)0x1FFFFFF8; @@ -31,8 +32,10 @@ void deinitScreens(void){ ((void (*)())*arm11)(); } - *arm11 = (u32)ARM11; - while(*arm11); + if(PDN_GPU_CNT != 0x1){ + *arm11 = (u32)ARM11; + while(*arm11); + } } void initScreens(void){ @@ -140,6 +143,10 @@ void initScreens(void){ ((void (*)())*arm11)(); } - *arm11 = (u32)ARM11; - while(*arm11); + if(PDN_GPU_CNT == 0x1){ + *arm11 = (u32)ARM11; + while(*arm11); + } + + clearScreens(); } \ No newline at end of file diff --git a/source/utils.c b/source/utils.c index 65991c2..aae5327 100644 --- a/source/utils.c +++ b/source/utils.c @@ -56,8 +56,7 @@ void configureCFW(const char *configPath){ options.text[1] = "( ) Use pre-patched FIRMs"; options.text[2] = "( ) Force A9LH detection"; - if(PDN_GPU_CNT == 0x1) initScreens(); - clearScreens(); + initScreens(); drawString("AuReiNand configuration", 10, 10, COLOR_TITLE); drawString("Press A to select, START to save and reboot", 10, 30, COLOR_WHITE); @@ -110,8 +109,7 @@ void deleteFirms(const char *firmPaths[], u32 firms){ } void error(const char *message){ - if(PDN_GPU_CNT == 0x1) initScreens(); - clearScreens(); + initScreens(); drawString("An error has occurred:", 10, 10, COLOR_RED); int pos_y = drawString(message, 10, 30, COLOR_WHITE);