all-local:
mkdir -p out
- mkdir -p out/@prefix@
- mkdir -p out/@libdir@/{module,firmware}
- mkdir -p out/@datarootdir@/{keys,locale/emu}
- mkdir -p out/@bindir@
- mkdir -p out/@sbindir@
- mkdir -p out/@prefix@/boot
- mkdir -p out/@libexecdir@
- mkdir -p out/@sysconfdir@
- mkdir -p out/@localstatedir@
+ mkdir -p out@prefix@
+ mkdir -p out@libdir@/{module,firmware}
+ mkdir -p out@datarootdir@/{keys,locale/emu}
+ mkdir -p out@bindir@
+ mkdir -p out@sbindir@
+ mkdir -p out@prefix@/boot
+ mkdir -p out@libexecdir@
+ mkdir -p out@sysconfdir@
+ mkdir -p out@localstatedir@
cp source/corbenik.bin out/arm9loaderhax.bin
- cp source/corbenik.bin out/@prefix@/boot/
- cp external/loader/loader.cxi out/@libdir@/module/loader.cxi
- cp external/bits/*.bin out/@libexecdir@/
- cp external/screeninit/build/screeninit.bin out/@libexecdir@/
- cp host/termfont.bin out/@libexecdir@/
- cp patch/*.vco out/@sbindir@
- cp contrib/*.vco out/@bindir@
+ cp source/corbenik.bin out@prefix@/boot/
+ cp external/loader/loader.cxi out@libdir@/module/loader.cxi
+ cp external/bits/*.bin out@libexecdir@/
+ cp external/screeninit/build/screeninit.bin out@libexecdir@/
+ cp host/termfont.bin out@sharedir@/
+ cp patch/*.vco out@sbindir@
+ cp contrib/*.vco out@bindir@
+ echo "#!/bin/bash" > out/o3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/00000052 -O .@libdir@/firmware/native" >> out/o3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000002/cetk -O .@datarootdir@/keys/native.cetk" >> out/o3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000102/00000016 -O .@libdir@/firmware/twl" >> out/o3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000102/cetk -O .@datarootdir@/keys/twl.cetk" >> out/o3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000202/0000000B -O .@libdir@/firmware/agb" >> out/o3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000202/cetk -O .@datarootdir@/keys/agb.cetk" >> out/o3ds_firm.sh
+ echo "#!/bin/bash" > out/n3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/00000021 -O .@libdir@/firmware/native" >> out/n3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/cetk -O .@datarootdir@/keys/native.cetk" >> out/n3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000102/00000000 -O .@libdir@/firmware/twl" >> out/n3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000102/cetk -O .@datarootdir@/keys/twl.cetk" >> out/n3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/00000000 -O .@libdir@/firmware/agb" >> out/n3ds_firm.sh
+ echo "wget http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/cetk -O .@datarootdir@/keys/agb.cetk" >> out/n3ds_firm.sh
+ chmod 755 out/*.sh
+ cp README.md LICENSE.txt out/
* firm: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/00000021
* cetk: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000002/cetk
-Note that this is only a recommendation - you can supply near any valid firmware file for your console. You can also supply a decrypted native_firm titlekey as `/corbenik/share/keys/native.key`, although this is no longer required.
+Note that this is only a recommendation - you can supply near any valid firmware file for your console. You can also supply a decrypted native_firm titlekey as `/corbenik/share/keys/native.key`, although this is no longer required and it can be automatically retrieved from the cetk.
-You can also fetch the agb firm and twl firms to `/corbenik/lib/firmware/agb` and `/corbenik/lib/firmware/twl` respectively. If you don't have the firmkeys for these, you can fetch the cetk for each of them to `/corbenik/keys/agb.cetk` and `/corbenik/keys/twl.cetk`, or acquire decrypted titlekeys (firmkeys) for them.
+You can also fetch the agb firm and twl firms to `/corbenik/lib/firmware/agb` and `/corbenik/lib/firmware/twl` respectively. You can fetch the cetk for each of them to `/corbenik/share/keys/agb.cetk` and `/corbenik/share/keys/twl.cetk`, or acquire decrypted titlekeys (firmkeys) for them.
Old 3DS TWL_FIRM (Firmware for DS/DSi games):
* cetk: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013800000102/cetk
* cetk: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/cetk
* firm: http://nus.cdn.c.shop.nintendowifi.net/ccs/download/0004013820000202/00000000
-On New3DS units, there's additional encryption on arm9loader which requires the 9.6 key to decrypt. This key also happens to be trashed by arm9loaderhax, so you'll need to acquire it elsewhere. It usually is named as `Slot0x11Key96.bin`. I can't tell you where to find this. Corbenik will attempt to read this from the root as well as `/corbenik/keys/11key96.key`. In a future version, keydb reading may be implemented, but no guarantees.
+On New3DS units, there's additional encryption on arm9loader which requires the 9.6 key to decrypt. This key also happens to be trashed by arm9loaderhax, so you'll need to acquire it elsewhere. It usually is named as `Slot0x11Key96.bin`. I can't tell you where to find this. Corbenik will attempt to read this from the root as well as `/corbenik/share/keys/11key96.key`. In a future version, keydb reading may be implemented, but no guarantees.
The folder `/corbenik/share/locale/emu` is automatically generated language emulation files from 3dsdb for games that only specify one region and one language. Games which support more than one language are not generated, because there's no 'correct' language. You can remove this if the number of files unnerves you. It isn't required. You can also add new files if you have specific needs.
-The folder `/corbenik/bin` contains additional patches you may add at your own discretion. These are not as well tested as official patches and don't generally affect core functionality. Documentation is usually found on the header of the source code for them (contrib/*.pco) in the git repo. Everything in `/corbenik/sbin` is core mostly-essential patches.
+The folder `/corbenik/bin` contains additional patches you may enable at your own discretion. These are not as well tested as official patches and don't generally affect core functionality. Documentation is usually found on the header of the source code for them (contrib/*.pco) in the git repo. Everything in `/corbenik/sbin` is core mostly-essential patches.
Setup
-------------------------
-------------------------
You can copy some 90° rotated BGR8 pixel data sized to the screen (essentially, a menuhax splash) and it will be used as backgrounds for menus. Put them at:
- * Top: `/corbenik/libexec/top.bin`
- * Bottom: `/corbenik/libexec/bottom.bin`
+ * Top: `/corbenik/share/top.bin`
+ * Bottom: `/corbenik/share/bottom.bin`
-The font is also customizable - read the github wiki for details.
+The font is also customizable (`/corbenik/share/termfont.bin`) - read the github wiki for details.
Reporting issues
-------------------------
If you think you've found a bug, please do the following first, to save me some time:
* Check if a recently enabled patch is the cause of the issue. If so, you should include this in the report.
- * Enable `Logging` and `Verbose` in `Options` then `Save Configuration` and retrieve the files `/corbenik/boot.log` and `/corbenik/loader.log` if they exist. I will want them. Do not report bugs without them, unless they are not created with the above enabled.
+ * Enable `Logging` and `Verbose` in `Options` then `Save Configuration` and retrieve the files `/corbenik/var/log/boot.log` and `/corbenik/var/log/loader.log` if they exist. I will want them. Do not report bugs without them, unless they are not created with the above enabled.
* Please at least try to reproduce the bug from a clean installation.
* Try to reproduce the problem from another CFW like luma or cakes, optionally.
AC_PREFIX_DEFAULT([/corbenik])
-if "x$enable_chainloader" == "xyes" ; then
- CHAINLOADER="1"
-else
- CHAINLOADER="0"
-fi
+CHAINLOADER=1
+test "$enable_chainloader" = "no" && CHAINLOADER=0
AC_DEFINE_UNQUOTED([CHAINLOADER], [$CHAINLOADER])
mount -t vfat ${dev}1 $mnt || exit 0
rm -rf $mnt/corbenik
cp -r out/* $mnt/ || exit 0
-cp -r input/* $mnt/ || exit 0
cp out/arm9loaderhax.bin $mnt/corbenik/boot/Corbenik || exit 0
+( cd $mnt/ && ./n3ds_firm.sh )
umount $mnt || exit 0
sync || exit 0
eject ${dev} || exit 0
#define PATH_REBOOT_HOOK PATH_BITS "/reboot_hook.bin" // Reboot hook
#define PATH_REBOOT_CODE PATH_BITS "/reboot_code.bin" // Reboot entry code
+#define PATH_TOP_BG PATH_SHARE "/top.bin"
+#define PATH_BOTTOM_BG PATH_SHARE "/bottom.bin"
+#define PATH_TERMFONT PATH_SHARE "/termfont.bin"
+
#define PATH_CHAINS PREFIX "/boot"
-#define PATH_TEMP LOCALSTATEDIR // Files that are transient and used to speed operation
-#define PATH_LOADER_CACHE PATH_TEMP "/loader" // Cached patch bytecode for loader.
+#define PATH_TEMP LOCALSTATEDIR "/cache" // Files that are transient and used to speed operation
+#define PATH_LOADER_CACHE PATH_TEMP "/loader" // Cached patch bytecode for loader.
-#define PATH_LOCEMU LOCALEDIR "/emu" // Locale emulation config
+#define PATH_LOCEMU LOCALEDIR "/emu" // Locale emulation config
#define PATH_FIRMWARES LIBDIR "/firmware" // Firmware folder.
#define PATH_CONFIG_DIR SYSCONFDIR // Config file directory.
#define PATH_KEYS SHAREDIR "/keys" // Keyfiles will be loaded from this dir, and
// additionally the root if not found.
-#define PATH_EXEFS LIBDIR "/exe" // ExeFS overrides/dumps, named by titleid
+#define PATH_EXEFS LIBDIR "/exefs" // ExeFS overrides/dumps, named by titleid
#define PATH_EXEFS_TEXT PATH_EXEFS "/text" // Text segment overrides/dumps, named by titleid
#define PATH_EXEFS_RO PATH_EXEFS "/ro" // RO segment overrides/dumps, named by titleid
#define PATH_EXEFS_DATA PATH_EXEFS "/data" // Data segment overrides/dumps, named by titleid
#define PATH_ALT_SLOT0X11KEY96 "/slot0x11key96.bin" // Hey, your perrogative, buddy. I like cleaned up
// paths.
-#define PATH_BOOTLOG LOCALSTATEDIR "/boot.log"
-#define PATH_LOADERLOG LOCALSTATEDIR "/loader.log"
+#define PATH_LOG LOCALSTATEDIR "/log"
+
+#define PATH_BOOTLOG PATH_LOG "/boot.log"
+#define PATH_LOADERLOG PATH_LOG "/loader.log"
#define PATCH_FLAG_REQUIRE (1 << 0) // Force enable patch unless 'Unsafe Options' is checked.
#define PATCH_FLAG_DEVMODE (1 << 1) // Require 'Developer Options' to be checked.
clear_bg();
- load_bg_top (PATH_BITS "/top.bin");
- load_bg_bottom(PATH_BITS "/bottom.bin"); // This is basically a menuhax splash (90deg rotated BGR8 pixel data)
+ load_bg_top (PATH_TOP_BG);
+ load_bg_bottom(PATH_BOTTOM_BG); // This is basically a menuhax splash (90deg rotated BGR8 pixel data)
clear_disp(TOP_SCREEN);
clear_disp(BOTTOM_SCREEN);
ctr_screen_enable_backlight(CTR_SCREEN_BOTH);
- set_font(PATH_BITS "/termfont.bin");
+ set_font(PATH_TERMFONT);
install_interrupts(); // Get some free debug info.
f_mkdir(PATH_FIRMWARES);
f_mkdir(PATH_MODULES);
f_mkdir(BINDIR);
+#if defined(CHAINLOADER) && CHAINLOADER == 1
+ f_mkdir(PATH_CHAINS);
+#endif
f_mkdir(SBINDIR);
f_mkdir(SYSCONFDIR);
f_mkdir(LOCALSTATEDIR);
f_mkdir(PATH_TEMP);
f_mkdir(PATH_LOADER_CACHE);
+ f_mkdir(PATH_LOG);
f_mkdir(SHAREDIR);
f_mkdir(PATH_KEYS);
f_mkdir(LOCALEDIR);