From ca496619c8dc536e0900a1408ce12a956d19f17a Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Thu, 9 Jun 2016 13:56:57 -0400 Subject: [PATCH] Run reformat (again) --- external/loader/source/patcher.c | 26 +++++++++++++------------- source/config.h | 12 ++++++------ source/interp.c | 6 +++--- source/main.c | 12 ++++++------ source/menu.c | 12 +++++------- source/patch_format.h | 8 ++++---- 6 files changed, 37 insertions(+), 39 deletions(-) diff --git a/external/loader/source/patcher.c b/external/loader/source/patcher.c index 8682de0..0e9328d 100644 --- a/external/loader/source/patcher.c +++ b/external/loader/source/patcher.c @@ -13,7 +13,7 @@ #endif #include "../../../source/config.h" -#define CODE_PATH PATH_EXEFS "/0000000000000000" +#define CODE_PATH PATH_EXEFS "/0000000000000000" #define LANG_PATH PATH_LOCEMU "/0000000000000000" const char hexDigits[] = "0123456789ABCDEF"; @@ -79,7 +79,8 @@ load_config() } void -hexdump_titleid(u64 progId, char* buf) { +hexdump_titleid(u64 progId, char *buf) +{ u32 i = strlen(buf) - 1; while (progId) { buf[i--] = hexDigits[(u32)(progId & 0xF)]; @@ -111,7 +112,7 @@ loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId) // This really does need a rewrite. char path[] = LANG_PATH; - hexdump_titleid(progId, path); + hexdump_titleid(progId, path); static const char *regions[] = { "JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN" }; static const char *languages[] = { "JA", "EN", "FR", "DE", "IT", "ES", "ZH", "KO", "NL", "PT", "RU", "TW" }; @@ -129,9 +130,9 @@ loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId) for (u32 i = 0; i < 7; i++) { if (memcmp(buf, regions[i], 3) == 0) { *regionId = (u8)i; - logstr(" localeemu region - "); - logstr(regions[i]); - logstr("\n"); + logstr(" localeemu region - "); + logstr(regions[i]); + logstr("\n"); break; } } @@ -139,9 +140,9 @@ loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId) for (u32 i = 0; i < 12; i++) { if (memcmp(buf + 4, languages[i], 2) == 0) { *languageId = (u8)i; - logstr(" localeemu lang - "); - logstr(languages[i]); - logstr("\n"); + logstr(" localeemu lang - "); + logstr(languages[i]); + logstr("\n"); break; } } @@ -336,20 +337,19 @@ sd_code(u64 progId, u8 *code_loc, u32 code_len) char code_path[] = CODE_PATH; Handle code_f; - hexdump_titleid(progId, code_path); + hexdump_titleid(progId, code_path); u32 len; // Attempts to load code section from SD card, including system titles/modules/etc. - if (R_SUCCEEDED(fileOpen(&code_f, ARCHIVE_SDMC, code_path, FS_OPEN_READ)) && config.options[OPTION_LOADER_LOADCODE]) - { + if (R_SUCCEEDED(fileOpen(&code_f, ARCHIVE_SDMC, code_path, FS_OPEN_READ)) && config.options[OPTION_LOADER_LOADCODE]) { FSFILE_Read(code_f, &len, 0, code_loc, code_len); logstr(" loaded code from "); logstr(code_path); logstr("\n"); } // Either system title with OPTION_LOADER_DUMPCODE_ALL enabled, or regular title - else if ( config.options[OPTION_LOADER_DUMPCODE] ) { + else if (config.options[OPTION_LOADER_DUMPCODE]) { if ((highTid == 0x00040000 || highTid == 0x00040002) && !config.options[OPTION_LOADER_DUMPCODE_ALL]) goto return_close; diff --git a/source/config.h b/source/config.h index b1a6a8d..59316cf 100644 --- a/source/config.h +++ b/source/config.h @@ -30,12 +30,12 @@ extern struct config_file config; enum type { - boolean_val = 0, // Toggle - ranged_val = 1, // N1 - N2, left and right to pick. - mask_val = 2, // Bitmask allowed values. - not_option = 3, // Skip over this. - call_fun = 4, // Call a function. Treat (a) as (void)(*)(void). - boolean_val_n3ds = 5 // Toggle, but only show on n3DS + boolean_val = 0, // Toggle + ranged_val = 1, // N1 - N2, left and right to pick. + mask_val = 2, // Bitmask allowed values. + not_option = 3, // Skip over this. + call_fun = 4, // Call a function. Treat (a) as (void)(*)(void). + boolean_val_n3ds = 5 // Toggle, but only show on n3DS }; struct range_str diff --git a/source/interp.c b/source/interp.c index 3ae1395..d69e622 100644 --- a/source/interp.c +++ b/source/interp.c @@ -396,7 +396,7 @@ exec_bytecode(uint8_t *bytecode, uint16_t ver, uint32_t len, int debug) return 0; } -void hexdump_titleid(uint64_t tid, char* path); +void hexdump_titleid(uint64_t tid, char *path); #ifdef LOADER int @@ -412,7 +412,7 @@ execb(char *filename, int build_cache) #ifdef LOADER char cache_path[] = PATH_LOADER_CACHE "/0000000000000000"; - hexdump_titleid(tid, cache_path); + hexdump_titleid(tid, cache_path); static uint8_t patch_dat[MAX_PATCHSIZE]; @@ -511,7 +511,7 @@ execb(char *filename, int build_cache) char cache_path[] = PATH_LOADER_CACHE "/0000000000000000"; uint32_t len = strlen(cache_path) - 1; - uint64_t prog = *(uint64_t*)title_buf; + uint64_t prog = *(uint64_t *)title_buf; while (prog) { title_buf[i--] = hexDigits[(uint32_t)(prog & 0xF)]; prog >>= 4; diff --git a/source/main.c b/source/main.c index 7307d0e..a56356a 100644 --- a/source/main.c +++ b/source/main.c @@ -15,8 +15,8 @@ void shut_up(); int main() { - if (PDN_MPCORE_CFG == 7) - is_n3ds = 1; // Enable n3ds specific options. + if (PDN_MPCORE_CFG == 7) + is_n3ds = 1; // Enable n3ds specific options. int c = fmount(); screen_init(); @@ -28,10 +28,10 @@ main() load_config(); // Load configuration. - if (CFG_BOOTENV == 7) { - fprintf(stderr, "Rebooted from AGB, disabling EmuNAND\n"); - config.options[OPTION_EMUNAND] = 0; - } + if (CFG_BOOTENV == 7) { + fprintf(stderr, "Rebooted from AGB, disabling EmuNAND\n"); + config.options[OPTION_EMUNAND] = 0; + } // Autoboot. Non-standard code path. if (config.options[OPTION_AUTOBOOT] && !(HID_PAD & BUTTON_R)) { diff --git a/source/menu.c b/source/menu.c index ae86a0a..fe60a22 100644 --- a/source/menu.c +++ b/source/menu.c @@ -45,12 +45,10 @@ static struct options_s options[] = { { OPTION_LOADER_LOADCODE, " Load Code Sections", "Loads code sections from SD card and patches afterwards.", boolean_val, 0, 0 }, { OPTION_LOADER_DUMPCODE, " Dump Title Code Sections", - "Dumps code sections for titles to SD card the first time they're loaded. Slows things down considerably.", boolean_val, - 0, 0 }, + "Dumps code sections for titles to SD card the first time they're loaded. Slows things down considerably.", boolean_val, 0, 0 }, { OPTION_LOADER_DUMPCODE_ALL, " + System Titles", - "Dumps code sections for system titles, too. Expect to sit at a black screen for >3mins on the first time.", boolean_val, - 0, 0 }, + "Dumps code sections for system titles, too. Expect to sit at a black screen for >3mins on the first time.", boolean_val, 0, 0 }, // space { 0, "", "", not_option, 0, 0 }, @@ -266,7 +264,7 @@ menu_help() " together either by code or documentation:\n" " @mid-kid, @Wolfvak, @Reisyukaku, @AuroraWright\n" " @d0k3, @TuxSH, @Steveice10, @delebile,\n" - " @Normmatt, @b1l1s, @dark-samus, @TiniVi, etc\n" + " @Normmatt, @b1l1s, @dark-samus, @TiniVi, etc\n" "\n" "[PROTECT BREAK] DATA DRAIN: OK\n" "\n" @@ -286,7 +284,7 @@ menu_reset() { write_file(enable_list, PATH_TEMP "/PATCHENABLE", FCRAM_SPACING / 2); config.options[OPTION_RECONFIGURED] = 1; - save_config(); // Save config, including the reconfigured flag. + save_config(); // Save config, including the reconfigured flag. fumount(); // Unmount SD. @@ -302,7 +300,7 @@ menu_poweroff() { write_file(enable_list, PATH_TEMP "/PATCHENABLE", FCRAM_SPACING / 2); config.options[OPTION_RECONFIGURED] = 1; - save_config(); // Save config, including the reconfigured flag. + save_config(); // Save config, including the reconfigured flag. fumount(); // Unmount SD. diff --git a/source/patch_format.h b/source/patch_format.h index afe9646..e236551 100644 --- a/source/patch_format.h +++ b/source/patch_format.h @@ -30,10 +30,10 @@ #define PATH_CFW "/corbenik" // CFW root directory. #endif -#define PATH_CONFIG_DIR PATH_CFW "/config" // Config file directory. -#define PATH_CONFIG PATH_CONFIG_DIR "/main.conf" // Config file. -#define PATH_LOCEMU PATH_CONFIG_DIR "/locale" // Locale emulation config -#define PATH_CPU_CFG PATH_CONFIG_DIR "/cpu.conf" // CPU settings config +#define PATH_CONFIG_DIR PATH_CFW "/config" // Config file directory. +#define PATH_CONFIG PATH_CONFIG_DIR "/main.conf" // Config file. +#define PATH_LOCEMU PATH_CONFIG_DIR "/locale" // Locale emulation config +#define PATH_CPU_CFG PATH_CONFIG_DIR "/cpu.conf" // CPU settings config #define PATH_PATCHES PATH_CFW "/patch" // Patch binary folder. #define PATH_FIRMWARES PATH_CFW "/firmware" // Firmware folder. -- 2.39.5