gemarcano / arm9launcher

Nintendo 3DS ARM9 bootloader
Other
5 stars 0 forks source link

arm9launcher

Copyright 2016 Gabriel Marcano



Licensing

This project is licensed under the GPL 2 or later licenses, at your choice. Refer to COPYING for more licensing information and for the licensing for the code borrowed from other sources.


About

This set of programs form a 3DS ARM9 payload selector, or bootloader. This project was started for two reasons: the author thought most ARM9 payload selectors in existence were too convoluted for their own good, and he wanted an application to showcase the usage of his general purpose libctr9 3DS ARM9 code library.

Currently arm9launcher supports the following:

-Button based payload selection, configurable via a configuration file

-Human readable configuration file, in JSON format

-Payloads can be launched from an external SD card, and internal CTRNAND, TWLN, and TWLP partitions

-The configuration and bootloader files can be stored in CTRNAND or an SD card.

Planned features:

-Menu based payload selection

--Author is open to suggestions

Note that this project is still under active development. Please


Build dependencies


Compiling

The Autotools setup assumes that devkitarm is already in the PATH. It also assumes the environmental variable CTRARM9 is set to wherever the --prefix used to install libctr9 is.

this following line is if the 3ds compiler isn't in the path

export PATH=${PATH}:${DEVKITPRO}/bin:${DEVKITARM}/bin export CTRARM9=[root path of libctr9 installation] autoreconf -if ./configure --host arm-none-eabi --prefix=$CTRARM9 make

Example: export PATH=${PATH}:${DEVKITPRO}/bin:${DEVKITARM}/bin export CTRARM9=~/.local/usr/arm-none-eabi-9 autoreconf -if ./configure --host arm-none-eabi --prefix=$CTRARM9 make -j10


Installation

In the src/ directory after make is run, the files arm9loaderhax.bin and arm9launcher.bin are the loader and bootloader, respectively. These can be copied to the root of an SD card or the root of CTRNAND.

Besides the executables, the loader needs a configuration file, arm9launcher.cfg. An example configuration file is included on the root of the armlauncher repository. This configuration needs to be on the root of an SD card or CTRNAND.


Configuration

The configuration file is in JSON. Every entry is in a key, value pair. The configuration JSON consists of a configuration entry with a value of an array of entries. Each configuration entry is a JSON object with some keys.

Each entry requires the following keys with values:

Entries support the following optional entries:

See the arm9launcher.cfg file included in the repository for an example configuration file.


Usage

When the arm9loaderhax.bin program is launched somehow, it will read the current HID input state (buttons) to determine which payload to load. It will then try to parse the configuration file it finds (either on the SD card or on the CTRNAND, in that order). If the HID state matched any of the payloads described in the configuration file, it will then try to hand off execution to the arm9launcher.bin to actually launch the payload.

If an error occurs, like the SD card being really screwed up, or NAND is bad, or the configuration file is bad, or if the payload was not found, some error will be reported. Pressing any button will cause the system to power off. Currently error messages are not exactly user friendly.


Issues/Bugs

Please report these to the issue tracker at the repository, and these will be addressed as soon as possible, if not at least acknowledged. The more detailed the reports, the more likely they are to be addressed quickly. In particular, the following information can be quite useful when debugging bugs:


Contributing

Pull requests are welcome. All requests will be looked at in detail, and must be documented in a similar fashion as the rest of the code for this project. In particular, it is unlikely (but not impossible) that code that emmits warnings with the warnings in use by this library would be merged without first fixing/ addressing what is causing the warnings to be emitted.


Credits