Minor stuff (2)

This commit is contained in:
Aurora 2016-10-16 23:34:26 +02:00
parent 1e39c999f9
commit 7339f57138
6 changed files with 11 additions and 9 deletions

View File

@ -113,6 +113,6 @@ void __attribute__((noreturn)) mainHandler(u32 *regs, u32 type)
*(ExceptionDumpHeader *)FINAL_BUFFER = dumpHeader;
((void (*)())0xFFFF0830)(); //Ensure that all memory transfers have completed and that the data cache has been flushed
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 1); //Reboot
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2); //Reboot
while(true);
}

View File

@ -319,7 +319,7 @@ static inline void copySection0AndInjectSystemModules(FirmwareType firmType, boo
fileRead(dst, fileName, dstModuleSize) != dstModuleSize ||
memcmp(((Cxi *)dst)->ncch.magic, "NCCH", 4) != 0 ||
memcmp(moduleName, ((Cxi *)dst)->exHeader.systemControlInfo.appTitle, sizeof(((Cxi *)dst)->exHeader.systemControlInfo.appTitle)) != 0)
error("An external FIRM module is invalid.");
error("An external FIRM module is invalid or corrupted.");
loadedModule = true;
}

View File

@ -82,7 +82,7 @@ void deinitScreens(void)
WAIT_FOR_ARM9();
}
if(PDN_GPU_CNT != 1) invokeArm11Function(ARM11);
if(ARESCREENSINITED) invokeArm11Function(ARM11);
}
void updateBrightness(u32 brightnessIndex)
@ -181,7 +181,7 @@ void initScreens(void)
__asm(".word 0xF10C01C0");
u32 brightnessLevel = brightness[MULTICONFIG(BRIGHTNESS)];
*(vu32 *)0x10141200 = 0x1007F;
*(vu32 *)0x10202014 = 0x00000001;
*(vu32 *)0x1020200C &= 0xFFFEFFFE;
@ -288,7 +288,7 @@ void initScreens(void)
if(needToSetup)
{
if(PDN_GPU_CNT == 1)
if(!ARESCREENSINITED)
{
flushDCacheRange(&configData, sizeof(CfgData));
invokeArm11Function(initSequence);

View File

@ -31,6 +31,8 @@
#define PDN_GPU_CNT (*(vu8 *)0x10141200)
#define ARESCREENSINITED (PDN_GPU_CNT != 1)
#define ARM11_STUB_ADDRESS 0x1FFFFFC8
#define WAIT_FOR_ARM9() *arm11Entry = 0; while(!*arm11Entry); ((void (*)())*arm11Entry)();

View File

@ -27,7 +27,7 @@ u32 strlen(const char *string)
{
char *stringEnd = (char *)string;
while(*stringEnd) stringEnd++;
while(*stringEnd != 0) stringEnd++;
return stringEnd - string;
}

View File

@ -56,18 +56,18 @@ u32 waitInput(void)
void mcuReboot(void)
{
if(!ISFIRMLAUNCH && PDN_GPU_CNT != 1) clearScreens(true, true, false);
if(!ISFIRMLAUNCH && ARESCREENSINITED) clearScreens(true, true, false);
//Ensure that all memory transfers have completed and that the data cache has been flushed
flushEntireDCache();
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 1);
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 2);
while(true);
}
void mcuPowerOff(void)
{
if(!ISFIRMLAUNCH && PDN_GPU_CNT != 1) clearScreens(true, true, false);
if(!ISFIRMLAUNCH && ARESCREENSINITED) clearScreens(true, true, false);
//Ensure that all memory transfers have completed and that the data cache has been flushed
flushEntireDCache();