diff --git a/include/arm9/config.h b/include/arm9/config.h index b6871b2..7d9a18f 100644 --- a/include/arm9/config.h +++ b/include/arm9/config.h @@ -15,6 +15,12 @@ KLast }; +enum BootModes { + BootModeNormal = 0, + BootModeQuick, + BootModeQuiet +}; + #define numKeys KLast void *configCopyText(int key); diff --git a/source/arm9/config_parser.c b/source/arm9/config_parser.c index 8613287..b3cfade 100644 --- a/source/arm9/config_parser.c +++ b/source/arm9/config_parser.c @@ -309,8 +309,31 @@ static bool parseBootMode(AttributeEntryType *attr) { - // TODO - attr->data = NULL; + char c; + char *textData = attr->textData; + u32 i; + + static const char * table[] = { + "Normal", "Quick", "Quiet" + }; + + for(i=0; i<3; i++) + { + if(strnicmp(textData, table[i], strlen(table[i])) == 0) + break; + } + + if(i >= 3) + { + attr->data = NULL; + return false; + } + + attr->data = (u32 *) malloc(sizeof(u32)); + if(!attr->data) + return false; + + *(u32 *)attr->data = i; return true; } diff --git a/source/arm9/menu.c b/source/arm9/menu.c index 60a2096..27cdfe6 100644 --- a/source/arm9/menu.c +++ b/source/arm9/menu.c @@ -199,6 +199,8 @@ printf("filepath: %s", (char*)data); else if(i < KBootMode) printf("pad val: 0x%lX", *(u32*)data); + else + printf("boot mode val: 0x%lX", *(u32*)data); } else printf(""); }