Small fixes/cleanup.
This commit is contained in:
parent
a719aa2864
commit
e63ec1404f
|
@ -32,7 +32,7 @@
|
|||
|
||||
|
||||
|
||||
noreturn void panic(void)
|
||||
NOINLINE noreturn void panic(void)
|
||||
{
|
||||
enterCriticalSection();
|
||||
|
||||
|
@ -48,7 +48,7 @@ noreturn void panic(void)
|
|||
while(1) __wfi();
|
||||
}
|
||||
|
||||
noreturn void panicMsg(const char *msg)
|
||||
NOINLINE noreturn void panicMsg(const char *msg)
|
||||
{
|
||||
enterCriticalSection();
|
||||
|
||||
|
@ -67,7 +67,7 @@ noreturn void panicMsg(const char *msg)
|
|||
|
||||
// Expects the registers in the exception stack to be in the following order:
|
||||
// r0-r14, pc (unmodified), CPSR, DFSR, IFSR, FAR, WFAR
|
||||
noreturn void guruMeditation(u8 type, const u32 *excStack)
|
||||
NOINLINE noreturn void guruMeditation(u8 type, const u32 *excStack)
|
||||
{
|
||||
const char *const typeStr[3] = {"Undefined instruction", "Prefetch abort", "Data abort"};
|
||||
u32 realPc, instSize = 4;
|
||||
|
|
|
@ -535,11 +535,11 @@ static int confIniHandler(void* user, const char* section, const char* name, con
|
|||
return 1; // 1 is no error? Really?
|
||||
}
|
||||
|
||||
static int gameConfIniHandler(void* user, const char* section, const char* name, const char* value)
|
||||
/*static int gameConfIniHandler(void* user, const char* section, const char* name, const char* value)
|
||||
{
|
||||
//OafGameConfig *const config = (OafGameConfig*)user;
|
||||
OafGameConfig *const config = (OafGameConfig*)user;
|
||||
|
||||
/*if(strcmp(section, "game") == 0)
|
||||
if(strcmp(section, "game") == 0)
|
||||
{
|
||||
// Save type.
|
||||
// Save slot.
|
||||
|
@ -561,18 +561,18 @@ static int gameConfIniHandler(void* user, const char* section, const char* name,
|
|||
else if(strcmp(section, "input") == 0)
|
||||
{
|
||||
}
|
||||
else return 0;*/ // Error.
|
||||
else return 0; // Error.
|
||||
|
||||
return 1; // 1 is no error? Really?
|
||||
}
|
||||
}*/
|
||||
|
||||
static Result parseConfig(const char *const path, u8 confType, void *config)
|
||||
static Result parseConfig(const char *const path, /* u8 confType, */ void *config)
|
||||
{
|
||||
char *iniBuf = (char*)calloc(INI_BUF_SIZE, 1);
|
||||
if(iniBuf == NULL) return RES_OUT_OF_MEM;
|
||||
|
||||
Result res = fsQuickRead(path, iniBuf, INI_BUF_SIZE - 1);
|
||||
if(res == RES_OK) ini_parse_string(iniBuf, (confType == 0 ? confIniHandler : gameConfIniHandler), config);
|
||||
if(res == RES_OK) ini_parse_string(iniBuf, /* (confType == 0 ? */ confIniHandler /* : gameConfIniHandler) */, config);
|
||||
else
|
||||
{
|
||||
const char *const defaultConfig = DEFAULT_CONFIG;
|
||||
|
@ -597,7 +597,7 @@ static Result handleFsStuff(char romAndSavePath[512])
|
|||
if((res = fChdir(OAF_WORK_DIR)) != RES_OK) break;
|
||||
|
||||
// Parse config.
|
||||
parseConfig("config.ini", 0, &g_oafConfig);
|
||||
parseConfig("config.ini", /* 0, */ &g_oafConfig);
|
||||
{ // TODO: Move this elsewhere?
|
||||
const u8 backlight = g_oafConfig.backlight;
|
||||
GFX_setBrightness(backlight, backlight);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
|
||||
|
||||
noreturn void panic()
|
||||
NOINLINE NOINLINE noreturn void panic(void)
|
||||
{
|
||||
enterCriticalSection();
|
||||
//fsDeinit();
|
||||
|
@ -44,7 +44,7 @@ noreturn void panic()
|
|||
}
|
||||
}
|
||||
|
||||
noreturn void panicMsg(UNUSED const char *msg)
|
||||
NOINLINE noreturn void panicMsg(UNUSED const char *msg)
|
||||
{
|
||||
enterCriticalSection();
|
||||
//fsDeinit();
|
||||
|
@ -60,7 +60,7 @@ noreturn void panicMsg(UNUSED const char *msg)
|
|||
|
||||
// Expects the registers in the exception stack to be in the following order:
|
||||
// r0-r14, pc (unmodified), cpsr
|
||||
noreturn void guruMeditation(UNUSED u8 type, UNUSED const u32 *excStack)
|
||||
NOINLINE noreturn void guruMeditation(UNUSED u8 type, UNUSED const u32 *excStack)
|
||||
{
|
||||
// avoid fs corruptions
|
||||
//fsDeinit();
|
||||
|
|
|
@ -29,7 +29,7 @@ NAKED void wait_cycles(u32 cycles)
|
|||
__asm__("1: subs %0, %0, #4\n\t"
|
||||
#elif ARM11
|
||||
__asm__("1: subs %0, %0, #2\n\t"
|
||||
"nop\n\t"
|
||||
"yield\n\t"
|
||||
#endif
|
||||
"bhi 1b\n\t"
|
||||
"bx lr\n\t" : : "r" (cycles) : "cc");
|
||||
|
|
Loading…
Reference in New Issue