]> Chaos Git - corbenik/corbenik.git/commitdiff
Run reformat (again)
authorchaoskagami <chaos.kagami@gmail.com>
Thu, 9 Jun 2016 17:56:57 +0000 (13:56 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Thu, 9 Jun 2016 17:56:57 +0000 (13:56 -0400)
external/loader/source/patcher.c
source/config.h
source/interp.c
source/main.c
source/menu.c
source/patch_format.h

index 8682de02f246c117ce6d006d91b78a2f1383a489..0e9328de24656f3b377ea5cc03190ae96f074456 100644 (file)
@@ -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;
 
index b1a6a8d515ff208062a8b2c8200c4a5cb7c91dd8..59316cfca147fde30307b398c00f5249aea9fb2b 100644 (file)
@@ -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
index 3ae139578abf998605e7c0c120a35be5186250b3..d69e622999a5a85d28f684a3a7b973a1207f1896 100644 (file)
@@ -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, charpath);
+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;
index 7307d0e8eaa34652f4c22f0337462470ccb8e482..a56356a65d76608c9a9864e8794db7ff6df6159c 100644 (file)
@@ -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)) {
index ae86a0adf4e16906e6b98a717ceff3519e32e70c..fe60a22dc02b1e80a838987411f0e796e74afaab 100644 (file)
@@ -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.
 
index afe96468d0873981c4df8d99b4bd11bb561fd2f4..e236551c7723d9847dcf5545111195d693556f68 100644 (file)
 #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.