-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
204 lines (149 loc) · 7.85 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
________________________________________________________________________________
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
--------------------------------------------------------------------------------
- Autotools in general. These are used to create the build scripts.
- https://github.com/gemarcano/libctr9 - Used for general 3DS ARM9
functionality.
See that repository for instruction on how to install it.
- https://github.com/gemarcano/libctr_core - Used by libctr9. See that
repository for instructions on how to install it.
- Freetype2. Needed by libctr9.
--------------------------------------------------------------------------------
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:
- "name" : "a string representing a name of a payload (unused currently)"
- "location : "path to the payload. Use SD:/, CTRNAND:/, TWLN:/, TWLP:/
prefixes for accessing payloads in the different partitions."
- "buttons" : [ "array of strings representing which buttons trigger a
particular choice. Multiple buttons for a single entry are supported."]
Buttons supported include (case sensitive):
"None" - Represents the payload chosen if no buttons are pressed
"A"
"B"
"Select"
"Start"
"Right"
"Left"
"Up"
"Down"
"R"
"L"
"X"
"Y"
Note that this list does not include the second shoulder buttons found on
the N3DS, nor the home menu button. Those are handled separately in the
3DS hardware than how the rest of the buttons are polled. This is something
the author can look into addressing at some later date.
Entries support the following optional entries:
- "offset" : a numeric value (hex or decimal) specifying the offset from which
to load the actual payload from the given payload file. This is useful for
programs like CakesFW, which has the ARM9 binary in the Cakes.dat at offset
0x12000.
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:
- Type of 2/3DS system
- Operating system being used to compile
- Release/commit of library in use
- Steps to reproduce issue
- Expected behavior
- Actual behavior
- ARM9 entry poin usedt
- Any modifications or extensions
- Version of libctr9 in use (or commit)
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
- #3dshacks @ Rizon for starting me on my path to 3DS homebrew development
- #Cakey @ Freenode for the continued development support
- #3dsdev @ EFNet for the occasional help answering questions
- Everyone that has helped in the development of libctr9 (see the README of
libctr9 for more details.