Minor code syntax stuff

This commit is contained in:
Aurora Wright 2017-08-16 18:02:35 +02:00
parent a3cb6a622d
commit fbf8a1b6d9
4 changed files with 118 additions and 115 deletions

View File

@ -78,14 +78,14 @@ void writeConfig(bool isConfigOptions)
void configMenu(bool oldPinStatus, u32 oldPinMode) void configMenu(bool oldPinStatus, u32 oldPinMode)
{ {
const char *multiOptionsText[] = { "Default EmuNAND: 1( ) 2( ) 3( ) 4( )", static const char *multiOptionsText[] = { "Default EmuNAND: 1( ) 2( ) 3( ) 4( )",
"Screen brightness: 4( ) 3( ) 2( ) 1( )", "Screen brightness: 4( ) 3( ) 2( ) 1( )",
"Splash: Off( ) Before( ) After( ) payloads", "Splash: Off( ) Before( ) After( ) payloads",
"PIN lock: Off( ) 4( ) 6( ) 8( ) digits", "PIN lock: Off( ) 4( ) 6( ) 8( ) digits",
"New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )", "New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )",
}; };
const char *singleOptionsText[] = { "( ) Autoboot EmuNAND", static const char *singleOptionsText[] = { "( ) Autoboot EmuNAND",
"( ) Use EmuNAND FIRM if booting with R", "( ) Use EmuNAND FIRM if booting with R",
"( ) Enable loading external FIRMs and modules", "( ) Enable loading external FIRMs and modules",
"( ) Enable game patching", "( ) Enable game patching",
@ -96,7 +96,7 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
"( ) Disable ARM11 exception handlers", "( ) Disable ARM11 exception handlers",
}; };
const char *optionsDescription[] = { "Select the default EmuNAND.\n\n" static const char *optionsDescription[] = { "Select the default EmuNAND.\n\n"
"It will be booted when no\n" "It will be booted when no\n"
"directional pad buttons are pressed.", "directional pad buttons are pressed.",

View File

@ -84,7 +84,6 @@ void detectAndProcessExceptionDumps(void)
0b1111, 0b1000, 0b10110, 0b10 0b1111, 0b1000, 0b10110, 0b10
}; };
initScreens(); initScreens();
drawString(true, 10, 10, COLOR_RED, "An exception occurred"); drawString(true, 10, 10, COLOR_RED, "An exception occurred");
@ -97,12 +96,14 @@ void detectAndProcessExceptionDumps(void)
{ {
u32 xfsr = dumpHeader->type == 2 ? regs[18] : regs[17]; u32 xfsr = dumpHeader->type == 2 ? regs[18] : regs[17];
xfsr &= 0xF; xfsr &= 0xF;
for (int i = 0; i < 15; i++) for(u32 i = 0; i < 15; i++)
if (xfsr == faultStatusValues[i]){ if(xfsr == faultStatusValues[i])
{
faultStatusInfos = faultStatusNames[i]; faultStatusInfos = faultStatusNames[i];
break; break;
} }
} }
if(dumpHeader->type == 2) if(dumpHeader->type == 2)
{ {
if((regs[16] & 0x20) == 0 && dumpHeader->codeDumpSize >= 4) if((regs[16] & 0x20) == 0 && dumpHeader->codeDumpSize >= 4)
@ -126,6 +127,7 @@ void detectAndProcessExceptionDumps(void)
} }
else else
posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "Exception type: %s", handledExceptionNames[dumpHeader->type]); posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "Exception type: %s", handledExceptionNames[dumpHeader->type]);
if(faultStatusInfos != NULL) posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "Fault status: %s", faultStatusInfos); if(faultStatusInfos != NULL) posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "Fault status: %s", faultStatusInfos);
if(dumpHeader->processor == 11 && dumpHeader->additionalDataSize != 0) if(dumpHeader->processor == 11 && dumpHeader->additionalDataSize != 0)
@ -142,6 +144,7 @@ void detectAndProcessExceptionDumps(void)
else if(dumpHeader->processor == 11) else if(dumpHeader->processor == 11)
posY = drawFormattedString(true, 10 + 22 * SPACING_X, posY, COLOR_WHITE, "%-7s%08X", registerNames[i + 1], regs[20]); posY = drawFormattedString(true, 10 + 22 * SPACING_X, posY, COLOR_WHITE, "%-7s%08X", registerNames[i + 1], regs[20]);
} }
if(dumpHeader->type == 3) if(dumpHeader->type == 3)
posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "%-7s%08X Access type: %s", "FAR", regs[19], regs[17] & (1u << 11) ? "Write" : "Read"); posY = drawFormattedString(true, 10, posY + SPACING_Y, COLOR_WHITE, "%-7s%08X Access type: %s", "FAR", regs[19], regs[17] & (1u << 11) ? "Write" : "Read");

View File

@ -108,7 +108,7 @@ static bool checkFirm(u32 firmSize)
static inline u32 loadFirmFromStorage(FirmwareType firmType) static inline u32 loadFirmFromStorage(FirmwareType firmType)
{ {
const char *firmwareFiles[] = { static const char *firmwareFiles[] = {
"native.firm", "native.firm",
"twl.firm", "twl.firm",
"agb.firm", "agb.firm",

View File

@ -251,7 +251,7 @@ bool payloadMenu(char *path)
u32 firmRead(void *dest, u32 firmType) u32 firmRead(void *dest, u32 firmType)
{ {
const char *firmFolders[][2] = {{"00000002", "20000002"}, static const char *firmFolders[][2] = {{"00000002", "20000002"},
{"00000102", "20000102"}, {"00000102", "20000102"},
{"00000202", "20000202"}, {"00000202", "20000202"},
{"00000003", "20000003"}, {"00000003", "20000003"},