Minor stuff

This commit is contained in:
Aurora 2016-07-19 20:03:35 +02:00
parent a68e14def3
commit d3c507b0d4
5 changed files with 18 additions and 22 deletions

View File

@ -380,7 +380,6 @@ void arm9Loader(u8 *arm9Section)
{
//Determine the arm9loader version
u32 a9lVersion;
switch(arm9Section[0x53])
{
case 0xFF:

View File

@ -46,7 +46,7 @@ bool loadSplash(void)
//Don't delay boot if no splash image is on the SD
if(fileRead(fb->top_left, "/luma/splash.bin") +
fileRead(fb->bottom, "/luma/splashbottom.bin") != 0) return true;
fileRead(fb->bottom, "/luma/splashbottom.bin")) return true;
return false;
}

View File

@ -285,7 +285,7 @@ static inline void patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32
//Apply FIRM0/1 writes patches on sysNAND to protect A9LH
else if(isA9lh) patchFirmWrites(process9Offset, process9Size);
//Apply firmlaunch patches, not on 9.0 FIRM as it breaks firmlaunchhax
//Apply firmlaunch patches
patchFirmlaunches(process9Offset, process9Size, process9MemAddr);
//11.0 FIRM patches
@ -294,6 +294,7 @@ static inline void patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32
//Apply anti-anti-DG patches
patchTitleInstallMinVersionCheck(process9Offset, process9Size);
//Restore SVCBackdoor
reimplementSvcBackdoor((u8 *)firm + section[1].offset, section[1].size);
}
}

View File

@ -133,7 +133,7 @@ u32 firmRead(void *dest, u32 firmType)
f_opendir(&dir, path);
u32 id = 0xFFFFFFFF;
u32 firmVersion = 0xFFFFFFFF;
//Parse the target directory
while(f_readdir(&dir, &info) == FR_OK && info.fname[0])
@ -142,15 +142,15 @@ u32 firmRead(void *dest, u32 firmType)
if(info.altname[9] != 'A') continue;
//Convert the .app name to an integer
u32 tempId = 0;
u32 tempVersion = 0;
for(char *tmp = info.altname; *tmp != '.'; tmp++)
{
tempId <<= 4;
tempId += *tmp > '9' ? *tmp - 'A' + 10 : *tmp - '0';
tempVersion <<= 4;
tempVersion += *tmp > '9' ? *tmp - 'A' + 10 : *tmp - '0';
}
//Found an older cxi
if(tempId < id) id = tempId;
if(tempVersion < firmVersion) firmVersion = tempVersion;
}
f_closedir(&dir);
@ -162,16 +162,15 @@ u32 firmRead(void *dest, u32 firmType)
u32 i = 42;
//Convert back the .app name from integer to array
u32 tempId = id;
while(tempId)
u32 tempVersion = firmVersion;
while(tempVersion)
{
static const char hexDigits[] = "0123456789ABCDEF";
path[i--] = hexDigits[tempId & 0xF];
tempId >>= 4;
path[i--] = hexDigits[tempVersion & 0xF];
tempVersion >>= 4;
}
fileRead(dest, path);
return id;
return firmVersion;
}

View File

@ -32,7 +32,8 @@
#include "draw.h"
#include "i2c.h"
vu32 *arm11Entry = (vu32 *)0x1FFFFFF8;
vu32 *const arm11Entry = (vu32 *)0x1FFFFFF8;
static const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};
void __attribute__((naked)) arm11Stub(void)
{
@ -46,14 +47,13 @@ void __attribute__((naked)) arm11Stub(void)
((void (*)())*arm11Entry)();
}
static inline void invokeArm11Function(void (*func)())
static void invokeArm11Function(void (*func)())
{
static bool hasCopiedStub = false;
if(!hasCopiedStub)
{
memcpy((void *)ARM11_STUB_ADDRESS, arm11Stub, 0x40);
flushDCacheRange((void *)ARM11_STUB_ADDRESS, 0x40);
memcpy((void *)ARM11_STUB_ADDRESS, arm11Stub, 0x30);
flushDCacheRange((void *)ARM11_STUB_ADDRESS, 0x30);
hasCopiedStub = true;
}
@ -62,8 +62,6 @@ static inline void invokeArm11Function(void (*func)())
*arm11Entry = ARM11_STUB_ADDRESS;
}
static const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};
void deinitScreens(void)
{
void __attribute__((naked)) ARM11(void)
@ -85,7 +83,6 @@ void deinitScreens(void)
void updateBrightness(u32 brightnessIndex)
{
static u32 brightnessLevel;
brightnessLevel = brightness[brightnessIndex];
void __attribute__((naked)) ARM11(void)