#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";
}
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)];
// 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" };
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;
}
}
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;
}
}
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;
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
return 0;
}
-void hexdump_titleid(uint64_t tid, char* path);
+void hexdump_titleid(uint64_t tid, char *path);
#ifdef LOADER
int
#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];
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;
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();
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)) {
{ 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 },
" 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"
{
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.
{
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.
#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.