Jon Feldman [Sat, 20 May 2017 07:34:47 +0000 (03:34 -0400)]
Screeninit is broken
I'm still unsure as to *why*, but I assume something I'm doing is probably causing an ARM11 exception.
To be honest, part of the problem here is that I never should have gone with the whole mixing arm11 and arm9 code thing.
For now, I've temporarily made the drawing code work in 24-bit mode and 32-bit mode via #ifdefs and nerfed screeninit from the code, instead adding the '-i' flag to firmtool.
Jon Feldman [Mon, 27 Mar 2017 20:51:35 +0000 (16:51 -0400)]
So very very late!
...Well, it's better than nothing.
The Switch is out and things are now slow with the 3DS. Time for a stable release; it's long overdue(*) and I keep getting people using the old-ass stable filing bugs. This cannot continue.
Jon Feldman [Sat, 11 Feb 2017 12:15:13 +0000 (07:15 -0500)]
BOOM, FIRMLAUNCH IS A GO
Turns out the entrypoint under firmlaunch for ARM11 is at 0x1FFFFFFC, not 0x1FFFFFF8 like arm9loaderhax / brahma
That also explains why screeninit fails on firmlaunch; the wrong entry is used.
Either way I still want to do some cleanup, but it works now.
I'm going to slap a big thank you here to the authors of Luma3DS. I never would have realized the entrypoint was different unless I looked at their code.
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.