Fix screens not working on firmlaunch
- LCD fill was not unset - Still needs to do screeninit on firmlaunch even though PDN_GPU_CNT is 0x1007F
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
#include "i2c.h"
|
||||
#include "utils.h"
|
||||
|
||||
bool needToSetupScreens = true;
|
||||
|
||||
struct fb fbs[2] =
|
||||
{
|
||||
{
|
||||
@@ -92,11 +94,9 @@ void clearScreens(bool isAlternate)
|
||||
|
||||
void initScreens(void)
|
||||
{
|
||||
static bool needToSetup = true;
|
||||
|
||||
if(needToSetup)
|
||||
if(needToSetupScreens)
|
||||
{
|
||||
if(!ARESCREENSINITIALIZED)
|
||||
if(!ARESCREENSINITIALIZED || bootType == FIRMLAUNCH)
|
||||
{
|
||||
*(vu32 *)ARM11_PARAMETERS_ADDRESS = brightness[MULTICONFIG(BRIGHTNESS)];
|
||||
memcpy((void *)(ARM11_PARAMETERS_ADDRESS + 4), fbs, sizeof(fbs));
|
||||
@@ -111,7 +111,7 @@ void initScreens(void)
|
||||
invokeArm11Function(SETUP_FRAMEBUFFERS);
|
||||
|
||||
clearScreens(true);
|
||||
needToSetup = false;
|
||||
needToSetupScreens = false;
|
||||
}
|
||||
|
||||
clearScreens(false);
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define PDN_GPU_CNT (*(vu8 *)0x10141200)
|
||||
#define PDN_GPU_CNT (*(vu32 *)0x10141200)
|
||||
|
||||
#define ARESCREENSINITIALIZED (PDN_GPU_CNT != 1)
|
||||
#define ARESCREENSINITIALIZED ((PDN_GPU_CNT & 0xFF) != 1)
|
||||
|
||||
#define ARM11_PARAMETERS_ADDRESS 0x1FFFF000
|
||||
|
||||
@@ -65,6 +65,8 @@ typedef enum
|
||||
|
||||
extern struct fb fbs[2];
|
||||
|
||||
extern bool needToSetupScreens;
|
||||
|
||||
void prepareArm11ForFirmlaunch(void);
|
||||
void deinitScreens(void);
|
||||
void swapFramebuffers(bool isAlternate);
|
||||
|
||||
@@ -106,7 +106,7 @@ u32 waitInput(bool isMenu)
|
||||
|
||||
void mcuPowerOff(void)
|
||||
{
|
||||
if(bootType != FIRMLAUNCH && ARESCREENSINITIALIZED) clearScreens(false);
|
||||
if(!needToSetupScreens) clearScreens(false);
|
||||
|
||||
//Shutdown LCD
|
||||
if(ARESCREENSINITIALIZED) i2cWriteRegister(I2C_DEV_MCU, 0x22, 1 << 0);
|
||||
@@ -136,17 +136,12 @@ void error(const char *fmt, ...)
|
||||
vsprintf(buf, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
if(bootType != FIRMLAUNCH)
|
||||
{
|
||||
initScreens();
|
||||
initScreens();
|
||||
drawString(true, 10, 10, COLOR_RED, "An error has occurred:");
|
||||
u32 posY = drawString(true, 10, 30, COLOR_WHITE, buf);
|
||||
drawString(true, 10, posY + 2 * SPACING_Y, COLOR_WHITE, "Press any button to shutdown");
|
||||
|
||||
drawString(true, 10, 10, COLOR_RED, "An error has occurred:");
|
||||
u32 posY = drawString(true, 10, 30, COLOR_WHITE, buf);
|
||||
drawString(true, 10, posY + 2 * SPACING_Y, COLOR_WHITE, "Press any button to shutdown");
|
||||
|
||||
waitInput(false);
|
||||
}
|
||||
else fileWrite(buf, "firmlauncherror.txt", strlen(buf));
|
||||
waitInput(false);
|
||||
|
||||
mcuPowerOff();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user