Skip to content

Commit

Permalink
Move clearScreens calls and screen-init checks
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraWright committed Mar 23, 2016
1 parent 8daf3eb commit ea3e45d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
6 changes: 1 addition & 5 deletions source/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)();
}
Expand Down
15 changes: 11 additions & 4 deletions source/screeninit.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#include "screeninit.h"
#include "draw.h"
#include "i2c.h"

static vu32 *const arm11 = (vu32 *)0x1FFFFFF8;
Expand All @@ -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){
Expand Down Expand Up @@ -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();
}
6 changes: 2 additions & 4 deletions source/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ea3e45d

Please # to comment.