Line 16: |
Line 16: |
| ** Windows 10 (post-Anniversary Update): Start -> devkitPro -> MSYS | | ** Windows 10 (post-Anniversary Update): Start -> devkitPro -> MSYS |
| | | |
− | Alternatively starting with Windows 10 Anniversary Update (Version 1607), the [https://msdn.microsoft.com/en-us/commandline/wsl/install_guide Windows Subsystem for Linux (WSL)] may also be used to run the Linux version of devkitARM. Due to the fact that GCC was originally designed for Unix-like platforms its use may yield performance and convenience improvements. For instructions on how to set up devkitARM under WSL refer to the ''Unix-like platforms'' section. For WSL installation instructions, see the linked MSDN page. | + | Alternatively starting with Windows 10 Anniversary Update (Version 1607), the [https://msdn.microsoft.com/en-us/commandline/wsl/install_guide Windows Subsystem for Linux (WSL)] may also be used to run the Linux version of devkitARM. Unless you have some particular need for WSL it's recommended that you stick to a more standard environment. |
| | | |
| ==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/x64), macOS (universal binary). Note that Linux x64 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 ctrulib 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. |
| | | |
| * 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: |
Line 49: |
Line 49: |
| | | |
| * To download these, if you installed Git (as you will have if you followed the above instructions), simply type <code>git clone https://github.com/devkitPro/3ds-examples.git</code> into your shell in the directory you wish to store the 3ds-examples folder in. | | * To download these, if you installed Git (as you will have if you followed the above instructions), simply type <code>git clone https://github.com/devkitPro/3ds-examples.git</code> into your shell in the directory you wish to store the 3ds-examples folder in. |
− | ** To overwrite the (almost certainly outdated) examples installed by the devkitPro updater, type <code>git clone https://github.com/devkitPro/3ds-examples.git $DEVKITPRO/examples/3ds</code>.
| |
| | | |
| These can be built from the command line. | | These can be built from the command line. |
Line 56: |
Line 55: |
| cp -r $DEVKITPRO/examples/3ds/templates/application '''~/projects/my3dsproject''' | | cp -r $DEVKITPRO/examples/3ds/templates/application '''~/projects/my3dsproject''' |
| cd '''~/projects/my3dsproject''' | | cd '''~/projects/my3dsproject''' |
| + | |
| + | The standard Makefile will use the folder as the name of the 3dsx that will be built. You can keep that behaviour or simply change the <code>TARGET := $(notdir $(CURDIR))</code> line in the Makefile to explicitly name your project. |
| | | |
| To compile it, type <code>make</code> in the project directory. | | To compile it, type <code>make</code> in the project directory. |
− | 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 -a '''192.168.X.X''' '''my3dsproject'''.3dsx</code>, replacing '''192.168.X.X''' with your 3DS's IP address (displayed in the network loader screen) and '''my3dsproject''' with the name of the folder your project is in (ie. the folder you have the source folder in and the README file.) | + | 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.) |
− | Don't type the full path, just the last segment - eg. for <code>C:\a\b\'''verygood3dsapp'''</code>, you would type <code>'''verygood3dsapp'''.3dsx</code>.
| + | </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 73: |
Line 74: |
| * Right-click the project and go to Properties->Code Assistance and click C Compiler. | | * Right-click the project and go to Properties->Code Assistance and click C Compiler. |
| * In include directories enter | | * In include directories enter |
− | <pre>/opt/devkitpro/devkitARM/include;/opt/devkitpro/ctrulib/libctru/include</pre> | + | <pre>/opt/devkitpro/devkitARM/include;/opt/devkitpro/libctru/include</pre> |
| adjusting again for your devkitPro path. | | adjusting again for your devkitPro path. |
| * Do the same for 'C++ Compiler'. | | * Do the same for 'C++ Compiler'. |
Line 86: |
Line 87: |
| * This will build a .elf file and a .3dsx file (the homebrew executable itself) together with a .smdh file (the icon). | | * 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. | | ** 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 99: |
Line 96: |
| echo "export DEVKITARM="/opt/devkitpro/devkitARM/" >> ~/.profile | | echo "export DEVKITARM="/opt/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. |
− |
| |
− | '''Unable to load source code when debugging using the provided GDB. It says, "No source files available".'''
| |
− |
| |
− | When after loading your ELF file, make sure to set a breakpoint at main(), then continue. The GDB will refresh with your source code.
| |