Luma3DS
Luma3DS copied to clipboard
Add EmuNAND support for TWL_FIRM, other related fixes
This pull request fixes reading sector 0 of most EmuNAND configurations (I wrote about that in more detail in #1687), fixes a minor bug in the exception display code, fixes loading certain old TWL_FIRM versions as external firms, adds support for handling arm9 exceptions in TWL_FIRM (mainly just useful for debugging other patches), and adds support for patching TWL_FIRM Process9 to use EmuNAND.
EmuNAND and exception support was tested on the Old3DS TWL_FIRM versions introduced in 3.0, 3.1, 4.0, 4.4, 4.5, 6.0, 6.2, and 11.8 and on the New3DS TWL_FIRM versions introduced in 8.1 and 11.8 (thanks to @ItsPizzaTime1501 for help with some of that). I'm pretty sure that covers all TWL_FIRM versions since 3.0, but let me know if I missed one. Here's a build of commit e5fb94d0 for anyone who'd like to do additional testing or just use these features.
It should be noted that this only affects NAND interaction done by TWL_FIRM's Process9. Once control has been handed off to devLauncher and the launched TWL app, SysNAND will be used as usual. To have TWL mode fully functional without any reliance on SysNAND, which was my original goal, NAND redirection patches for devLauncher would be required in conjunction with the changes in this PR. I intend to eventually try to create such patches, but for now I think the closest thing that exists is this.
Although I understand that retail DSiWare will still load their data off their NAND due to the lack of patches, will your commit (https://github.com/LumaTeam/Luma3DS/pull/1696/commits/de7d57640b1c498a955b49505d3f0cc228878c03) allow us to install homebrew that do not rely on NAND (nds_hb_menu) only on EmuNAND, or would they also need a SysNAND installation as well (as per current requirements)?