Line 1: |
Line 1: |
| = Setup = | | = Setup = |
− | * Install [http://devkitpro.org/ devkitARM]. If it's already installed, update it. | + | * Install [https://devkitpro.org/ devkitARM]. If it's already installed, update it. |
− | ** On Windows, there's a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ graphical installer]. | + | ** On Windows, there's a [https://github.com/devkitPro/installer/releases/latest graphical installer]. |
− | ** On Unix-like platforms such as Linux/macOS, there's a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/devkitARMupdate.pl/download Perl script]. Make sure you also select libctru and the 3ds examples when installing. | + | ** On Unix-like platforms such as Linux/macOS, there's a [https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl Perl script]. Make sure you also select libctru and the 3ds examples when installing. |
| * Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don't ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]]. | | * Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don't ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]]. |
| | | |
| ==Windows== | | ==Windows== |
| devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows. | | devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows. |
− | * [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ download the latest version of the graphical installer] from SourceForge and run it, following the instructions as you go. | + | * [https://github.com/devkitPro/installer/releases/latest download the latest version of the graphical installer] from SourceForge and run it, following the instructions as you go. |
| * An Internet connection is required. | | * An Internet connection is required. |
| * You will want to make sure devkitARM is selected during the installation process to develop for the 3DS (and also the DS and GBA) - you can also install devkitPPC (for GameCube/Wii development) and devkitPSP (for PlayStation Portable development) if you wish. | | * You will want to make sure devkitARM is selected during the installation process to develop for the 3DS (and also the DS and GBA) - you can also install devkitPPC (for GameCube/Wii development) and devkitPSP (for PlayStation Portable development) if you wish. |
Line 19: |
Line 19: |
| | | |
| ==Unix-like platforms== | | ==Unix-like platforms== |
− | Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86/x64), macOS (universal binary). Note that Linux x64 binaries are usable under WSL. | + | Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86_64), macOS (x86_64). Note that Linux x86_64 binaries are usable under WSL. |
| | | |
− | * First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you'll need it to update libctru or share your code on GitHub, among many other things. | + | * First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you'll need it to update libctru or share your code on GitHub, among many other things. If you are running Linux, you'll also need wget; it comes preinstalled on most distributions, but not all. |
| | | |
| * Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS: | | * Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS: |
− | ** Debian/Ubuntu/Linux Mint/WSL: <code>sudo apt-get install git curl</code> | + | ** Debian/Ubuntu/Linux Mint/Ubuntu on WSL: <code>sudo apt-get install git curl</code> |
| ** Fedora/CentOS/RHEL: <code>sudo yum install git curl</code> | | ** Fedora/CentOS/RHEL: <code>sudo yum install git curl</code> |
| ** openSUSE: <code>sudo zypper install git curl</code> | | ** openSUSE: <code>sudo zypper install git curl</code> |
| + | ** Arch Linux/ALWSL: <code>sudo pacman -S git curl wget</code> |
| ** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS. | | ** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS. |
| | | |
Line 33: |
Line 34: |
| curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl | | curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl |
| chmod +x ./devkitARMupdate.pl | | chmod +x ./devkitARMupdate.pl |
− | sudo ./devkitARMupdate.pl /opt/devkitpro
| + | ./devkitARMupdate.pl |
| </pre> | | </pre> |
| | | |
− | * Finally, we need to tell your shell where to find the devkitARM binaries.
| + | You can either use sudo here or chown /opt/devkitpro to be writable by your user before running the script. |
− | <pre>
| |
− | echo "export DEVKITPRO=/opt/devkitpro" >> ~/.bashrc
| |
− | echo "export DEVKITARM=/opt/devkitpro/devkitARM" >> ~/.bashrc
| |
− | echo "export PATH=$PATH:/opt/devkitpro/devkitARM/bin" >> ~/.bashrc
| |
− | source ~/.bashrc
| |
− | </pre>
| |
| | | |
| = Building the examples = | | = Building the examples = |
Line 59: |
Line 54: |
| | | |
| To compile it, type <code>make</code> in the project directory. | | To compile it, type <code>make</code> in the project directory. |
| + | |
| + | ==Running your code== |
| To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: <code>$DEVKITARM/bin/3dslink '''my3dsproject'''.3dsx</code>, replacing '''my3dsproject''' with the name of the 3dsx file you want to run.) | | To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: <code>$DEVKITARM/bin/3dslink '''my3dsproject'''.3dsx</code>, replacing '''my3dsproject''' with the name of the 3dsx file you want to run.) |
− | </code>.
| |
| | | |
| If all goes well, you'll soon see your application running on your 3DS. | | If all goes well, you'll soon see your application running on your 3DS. |
Line 81: |
Line 77: |
| | | |
| Now you can use Netbeans' code completion feature and build your project from the Run menu. | | Now you can use Netbeans' code completion feature and build your project from the Run menu. |
− |
| |
− | = Building homebrew for distribution =
| |
− | To build your homebrew, open a Bash shell as described above, browse to the folder of the homebrew you wish to compile, and run <code>make</code>.
| |
− |
| |
− | * This will build a .elf file and a .3dsx file (the homebrew executable itself) together with a .smdh file (the icon).
| |
− | ** The Homebrew Launcher can only run homebrew in the 3DSX format, and can only display SMDH icons.
| |
− |
| |
− | * To build a CCI (.3ds) file, you need to strip the .elf file and use makerom on it (with the provided RSF file):
| |
− | arm-none-eabi-strip '''[ELF file]'''
| |
− | makerom -f cci -o '''[.3ds file]''' -rsf '''[RSF file]''' -target t -exefslogo -elf '''[ELF file]''' -icon '''[icon file]''' -banner '''[banner file]'''
| |
| | | |
| = Troubleshooting = | | = Troubleshooting = |
Line 97: |
Line 83: |
| Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]: | | Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]: |
| sudo chown $USER /opt/devkitpro/ -R | | sudo chown $USER /opt/devkitpro/ -R |
− | echo "export DEVKITPRO="/opt/devkitpro/" >> ~/.profile | + | echo "export DEVKITPRO=\"/opt/devkitpro/\"" >> ~/.profile |
− | echo "export DEVKITARM="/opt/devkitpro/devkitARM/" >> ~/.profile | + | echo "export DEVKITARM=\"\${DEVKITPRO}/devkitARM/\"" >> ~/.profile |
| source ~/.profile | | source ~/.profile |
| | | |
| For WSL users, you need to close the Bash shell, then reopen it for WSL to reload all of the variables from a clean state. | | For WSL users, you need to close the Bash shell, then reopen it for WSL to reload all of the variables from a clean state. |