Jon Feldman [Thu, 9 Feb 2017 13:33:52 +0000 (08:33 -0500)]
Save path string the same way as Luma, rather than convert the path string like Cakes; that's way too much assembly imho
It's not like there's really any other way to implement this, unless I were to stick it in memory elsewhere. The assembly would still be the same other than the offset.
Jon Feldman [Thu, 9 Feb 2017 12:41:19 +0000 (07:41 -0500)]
Clean up a lot of logic related to the reboot hook.
I can confirm that we now get into corbenik's payload on firmlaunch (the good old power off on button approach) but some step of initialization is resulting in a hang. Not there yet, sadly.
Jon Feldman [Wed, 8 Feb 2017 18:14:51 +0000 (13:14 -0500)]
Put corbenik at 0x24F00000 and use a loader to get it there from non-elf-based a9lh.
This is a pre-requisite for using a reentrant payload.
This brings an important note; chain.bin is now required even on non-chainloader builds, and unless you are booting via the elf, arm9loaderhax.bin is a stub responsible for loading PREFIX/libexec/corbenik.bin
Update chainloader to directly launch payload (chain.bin is a thing of the past now that we're further up in memory)
chaoskagami [Tue, 17 Jan 2017 13:33:29 +0000 (08:33 -0500)]
Kill common.h, std/unused.h
_UNUSED is a stupid macro and I should just use __attribute__((unused)) directly.
This will never build on anything aside from GCC or clang anyways, since msvc is shit
that targets windows and armcc is proprietary and expensive.
Clean up includes massively; the mess was mainly due to common.h "abstracting" all
the dependencies, allowing me to be lazy and not properly componentize code. Now all
files include solely what they need, which is a step in the right direction of unfucking
all the cross-dependencies.
This would have been much more painful to figure out were it not for include-what-you-use
(https://github.com/include-what-you-use/include-what-you-use) so next time you dig your
grave into source dependency hell using a common header, try that tool.
chaoskagami [Tue, 10 Jan 2017 07:52:46 +0000 (02:52 -0500)]
Potential edge case; when the first byte of the NAND CID is 0x00 - 0x0F, the config name is zero terminated early and this may very well break everything
chaoskagami [Wed, 28 Dec 2016 22:56:12 +0000 (17:56 -0500)]
Add a early-ish prototype ips2pco tool.
This tool takes an IPS or IPS32 patch and creates a .pco (bytecode source) skeleton. This is based on a previously written tool in my libbinmod repository for actually creating/applying IPS patches. The core changes to blib.c/blib.h will make it there soon-ish.
This can be used to automate conversion of IPS patches to a format compatible with corbenik's patcher system. Do note the output files are not ready for use as-is -- you will need to manually edit the name, description, and titleID as needed, as well as actually run it through bytecode_asm.py.
chaoskagami [Mon, 26 Dec 2016 23:38:51 +0000 (18:38 -0500)]
Allow merged codebins as option.
This is utterly stupid and a lossy removal of information. Unfortunately, it's what you call a "scene standard" which is to say an idiotic decision that somehow stuck.
Anyways, add a toggle for usage of merged codebins. These should go one level above where text/ro/data are and are named by titleid sans extension.
chaoskagami [Tue, 20 Dec 2016 07:24:53 +0000 (02:24 -0500)]
Big commit
malloc(3) is now newlib's implementation instead of my shitty one. Turns out; after poking around the latest linker.ld in libctr9, all this time...
It was a linker script issue. I. Hate. Everything.
Miscellaneous changes also here:
* f{whatever} -> cr{whatever} to avoid clashes with newlib (and hopefully facillitate replacement)
* FIRM allocation size was made to be fixed at 0x100000 as a stopgap. Turns out that memory corruption was massive, and the only thing saving my ass before was the allocator being...dumb.
chaoskagami [Sat, 8 Oct 2016 15:11:26 +0000 (11:11 -0400)]
Minor cleanup.
I recently learned that the C standard differentiates between empty parameters
and (void) parameters (wow me) so clean up to clarify what does and doesn't take
arguments.
Functions called from menus are left as accepts-any to prevent GCC from potentially
fucking up optimizations.