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 "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)();
}

View File

@ -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();
}

View File

@ -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);