Advertising (This ad goes away for registered users. You can Login or Register)

3DS Homebrew Dev Guide, CH 2: ARM11 with ctrulib (Gateway)

Underground 3DS Discussions
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
User avatar
josh_axey
Retired Mod
Posts: 266
Joined: Sun Oct 07, 2012 10:14 pm
Location: /dev/null
Contact:

3DS Homebrew Dev Guide, CH 2: ARM11 with ctrulib (Gateway)

Post by josh_axey » Mon May 12, 2014 9:29 am

Click here to return to the Chapter Index


Welcome to Chapter 2.

This guide assumes you have set up your dev environment from the previous thread, and that you are yet to install devkitPro. If you chose devkitPro as your toolchain, then you will need to add the libs mentioned below via updater or manually (dependant).
This is also orientated around the homebrew support in the new Gateway card firmware (as it now supports ctrulib). It requires a card, but it is a start in the right direction.
I have a note regarding this at the bottom of the post.

This is all per my dev machine setup (linux), but I cater for Windows users where I remember.

Things You Will Need

Refer to the "Where To Start" article for setting up your ARM9 dev environment: Here

Once you have the above set up and running, you will need to install devkitPro. Along with devkitPro you will also require all of the additional libraries required for NDS homebrew previously.

Windows users can use the devkitPro updater to download all optional libraries (using this link).
Linux users are best to refer to the guide put together by the devkitPro team: Here
This will allow you to install the libs for libnds, libfat-nds, dswifi, libfilesystem, maxmod, default arm7 + examples, etc.

Additional to devkitPro + libs, you will also need:
Makerom: Here
ctr_homebrew (ccd00.ld): Here (by 3DSGuy)
Gateway homebrew files: Here

Store makerom and the gateway card work around files in a dev directory of your choice for later use. Rename ctr_homebrew.ld to ccd00.ld and place it in the arm11u folder in the root directory of ctrulib.

Last but not least, grab ctrulib (if you haven't already): Here (by Smealum)
It should be self explanatory, but ctrulib will require you to leave the directory structure as is. Elsewise, you will have a hard time when you go to use makefile etc.


How To Compile ctrulib

Open your command line tool (cmd, terminal, whatever) and navigate in to the ctrulib root directory then, use the make command.
If this fails, check your makefile has the correct directories etc. for your compilers.
Now you have ctrulib compiled ready to go.


How To Compile The Sample Homebrew
This will compile the arm11u example within ctrulib, to kick you off.
Open your command line tool again (or use your same session preferably) and navigate in to the arm11u directory within ctrulib directory. Now run make again (Windows users will not need to do this).
Your make output will produce an elf file, which is the compiled example.


Converting The elf File To A 3ds File For Use
Navigate to the dev directory you placed makerom and the work around files in. Copy your elf file into this folder so that you can make your rom file.
Linux users should open the build.bat file with your text editor of choice (Windows users should not edit build.bat). Change target 1 ("%1") to "arm11u.elf" and target 2 ("%2") to "arm11u.3ds" in the build line, then copy it to your clipboard.
Open your command line tool again (or use your same session preferably) and navigate in to your dev directory above that has the elf and makerom etc. within it, now paste the command you copied above and run it.
Windows users need only type the command "build.bat arm11u.elf arm11u.3ds" and run that command.

You now have a piece of 3DS ARM11 compiled code. Load this on to your microSD card and test it out.


Note Regarding Gateway Target
I am aware of the debates etc. going on around homebrew development in this format being tied to the use of a proprietary piece of hardware. I am not here to represent any side on this matter, just to inform.
For gateway-less ARM11 code we are going to have to sit tight a little longer.
Advertising
Catch me: on Twitter | on GitHub | Rambling
【・ヘ・?】0b00000101

Post Reply

Return to “Programming and Security”