Move clearScreens calls and screen-init checks

This commit is contained in:
Aurora 2016-03-23 16:10:26 +01:00
parent 8daf3ebe3f
commit ea3e45d40a
3 changed files with 14 additions and 13 deletions

View File

@ -8,17 +8,13 @@
#include "fs.h" #include "fs.h"
#include "memory.h" #include "memory.h"
#include "screeninit.h" #include "screeninit.h"
#include "draw.h"
#include "../build/loader.h" #include "../build/loader.h"
#define PAYLOAD_ADDRESS 0x24F00000 #define PAYLOAD_ADDRESS 0x24F00000
void loadPayload(void){ void loadPayload(void){
if(fileExists("aurei/payloads/default.bin")){ if(fileExists("aurei/payloads/default.bin")){
if(PDN_GPU_CNT == 0x1){
initScreens(); initScreens();
clearScreens();
}
memcpy((void *)PAYLOAD_ADDRESS, loader, loader_size); memcpy((void *)PAYLOAD_ADDRESS, loader, loader_size);
((void (*)())PAYLOAD_ADDRESS)(); ((void (*)())PAYLOAD_ADDRESS)();
} }

View File

@ -8,6 +8,7 @@
*/ */
#include "screeninit.h" #include "screeninit.h"
#include "draw.h"
#include "i2c.h" #include "i2c.h"
static vu32 *const arm11 = (vu32 *)0x1FFFFFF8; static vu32 *const arm11 = (vu32 *)0x1FFFFFF8;
@ -31,8 +32,10 @@ void deinitScreens(void){
((void (*)())*arm11)(); ((void (*)())*arm11)();
} }
if(PDN_GPU_CNT != 0x1){
*arm11 = (u32)ARM11; *arm11 = (u32)ARM11;
while(*arm11); while(*arm11);
}
} }
void initScreens(void){ void initScreens(void){
@ -140,6 +143,10 @@ void initScreens(void){
((void (*)())*arm11)(); ((void (*)())*arm11)();
} }
if(PDN_GPU_CNT == 0x1){
*arm11 = (u32)ARM11; *arm11 = (u32)ARM11;
while(*arm11); while(*arm11);
}
clearScreens();
} }

View File

@ -56,8 +56,7 @@ void configureCFW(const char *configPath){
options.text[1] = "( ) Use pre-patched FIRMs"; options.text[1] = "( ) Use pre-patched FIRMs";
options.text[2] = "( ) Force A9LH detection"; options.text[2] = "( ) Force A9LH detection";
if(PDN_GPU_CNT == 0x1) initScreens(); initScreens();
clearScreens();
drawString("AuReiNand configuration", 10, 10, COLOR_TITLE); drawString("AuReiNand configuration", 10, 10, COLOR_TITLE);
drawString("Press A to select, START to save and reboot", 10, 30, COLOR_WHITE); 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){ void error(const char *message){
if(PDN_GPU_CNT == 0x1) initScreens(); initScreens();
clearScreens();
drawString("An error has occurred:", 10, 10, COLOR_RED); drawString("An error has occurred:", 10, 10, COLOR_RED);
int pos_y = drawString(message, 10, 30, COLOR_WHITE); int pos_y = drawString(message, 10, 30, COLOR_WHITE);