Made the AGB_FIRM splash screen optional

Apparently it causes compatibility issues
This commit is contained in:
Aurora 2016-04-04 01:08:42 +02:00
parent a127a38438
commit f7bbc4bfec
3 changed files with 22 additions and 10 deletions

View File

@ -38,7 +38,8 @@ static u32 firmSize,
selectedFirm, selectedFirm,
usePatchedFirm, usePatchedFirm,
emuOffset, emuOffset,
emuHeader; emuHeader,
config;
void setupCFW(void) void setupCFW(void)
{ {
@ -56,8 +57,13 @@ void setupCFW(void)
//Attempt to read the configuration file //Attempt to read the configuration file
const char configPath[] = "/aurei/config.bin"; const char configPath[] = "/aurei/config.bin";
u32 config = 0, u32 needConfig;
needConfig = fileRead(&config, configPath, 3) ? 1 : 2; if(fileRead(&config, configPath, 3)) needConfig = 1;
else
{
config = 0;
needConfig = 2;
}
//Determine if A9LH is installed and the user has an updated sysNAND //Determine if A9LH is installed and the user has an updated sysNAND
u32 updatedSys; u32 updatedSys;
@ -114,7 +120,7 @@ void setupCFW(void)
//If no configuration file exists or SELECT is held, load configuration menu //If no configuration file exists or SELECT is held, load configuration menu
if(needConfig == 2 || (pressed & BUTTON_SELECT)) if(needConfig == 2 || (pressed & BUTTON_SELECT))
configureCFW(configPath, patchedFirms[3]); configureCFW(configPath, patchedFirms);
//If screens are inited, load splash screen //If screens are inited, load splash screen
if(PDN_GPU_CNT != 1) loadSplash(); if(PDN_GPU_CNT != 1) loadSplash();
@ -261,8 +267,10 @@ static inline void patchTwlAgb(u32 mode)
{{0xD7A12, 0xD8B8A}, { .type1 = 0xEF26 }, 1} {{0xD7A12, 0xD8B8A}, { .type1 = 0xEF26 }, 1}
}; };
//Calculate the amount of patches to apply /* Calculate the amount of patches to apply. Only count the splash screen patch for AGB_FIRM
u32 numPatches = mode ? (sizeof(agbPatches) / sizeof(struct patchData)) : (sizeof(twlPatches) / sizeof(struct patchData)); if the matching option was enabled (keep it as last) */
u32 numPatches = mode ? (sizeof(agbPatches) / sizeof(struct patchData)) - !((config >> 6) & 1) :
(sizeof(twlPatches) / sizeof(struct patchData));
const struct patchData *patches = mode ? agbPatches : twlPatches; const struct patchData *patches = mode ? agbPatches : twlPatches;
//Patch //Patch

View File

@ -46,7 +46,7 @@ static u32 waitInput(void)
return key; return key;
} }
void configureCFW(const char *configPath, const char *firm90Path) void configureCFW(const char *configPath, const char *patchedFirms[])
{ {
initScreens(); initScreens();
@ -58,7 +58,8 @@ void configureCFW(const char *configPath, const char *firm90Path)
"( ) Force A9LH detection", "( ) Force A9LH detection",
"( ) Use 9.0 FIRM as default", "( ) Use 9.0 FIRM as default",
"( ) Use second EmuNAND as default", "( ) Use second EmuNAND as default",
"( ) Show current NAND in System Settings" }; "( ) Show current NAND in System Settings",
"( ) Show splash screen in patched AGB_FIRM" };
u32 optionsAmount = sizeof(optionsText) / sizeof(char *); u32 optionsAmount = sizeof(optionsText) / sizeof(char *);
struct option options[optionsAmount]; struct option options[optionsAmount];
@ -112,7 +113,10 @@ void configureCFW(const char *configPath, const char *firm90Path)
} }
//If the user has been using A9LH and the "Updated SysNAND" setting changed, delete the patched 9.0 FIRM //If the user has been using A9LH and the "Updated SysNAND" setting changed, delete the patched 9.0 FIRM
if(((tempConfig >> 16) & 1) && ((tempConfig & 1) != options[0].enabled)) fileDelete(firm90Path); if(((tempConfig >> 16) & 1) && ((tempConfig & 1) != options[0].enabled)) fileDelete(patchedFirms[3]);
//If the "Show splash screen in patched AGB_FIRM" setting changed, delete the patched AGB_FIRM
if(((tempConfig >> 6) & 1) != options[6].enabled) fileDelete(patchedFirms[5]);
//Preserve the last-used boot options (last 12 bits) //Preserve the last-used boot options (last 12 bits)
tempConfig &= 0xFFF000; tempConfig &= 0xFFF000;

View File

@ -10,6 +10,6 @@
#define CFG_BOOTENV (*(vu32 *)0x10010000) #define CFG_BOOTENV (*(vu32 *)0x10010000)
void configureCFW(const char *configPath, const char *firm90Path); void configureCFW(const char *configPath, const char *patchedFirms[]);
void deleteFirms(const char *firmPaths[], u32 firms); void deleteFirms(const char *firmPaths[], u32 firms);
void error(const char *message); void error(const char *message);