Thanks to Manurocker95 for the original https://github.com/Manurocker95/CIABUILDER as well as 3DSGuy for https://github.com/3DSGuy/Project_CTR/releases/tag/makerom-v0.18.4 and https://github.com/devkitpro for https://github.com/devkitPro/3ds-examples
A comprehensive build system for creating Nintendo 3DS homebrew applications in C. This project simplifies the process of compiling C code into multiple 3DS formats (.3dsx, .elf, .3ds, and .cia) with automated asset creation and packaging.
This build system takes your C source code and automatically:
- Compiles it using devkitARM and libctru
- Creates application assets (banner, icon, audio)
- Packages everything into multiple 3DS formats
- Generates both development (.3dsx) and distribution (.3ds/.cia) files
Before using this builder, you need to install:
- devkitARM - The ARM development toolchain
- libctru - 3DS homebrew library
- Make - Build automation tool
- Windows Command Prompt or PowerShell (for the build script)
- 3DS Homebrew Launcher - For testing .3dsx files
- Custom Firmware - For installing .cia files
-
Clone this repository:
git clone https://github.com/slalomsquid/CBuilder3DS.git cd CBuilder3DS -
Set up your development environment:
- Install devkitARM and ensure it's in your PATH
- Verify installation:
arm-none-eabi-gcc --version
-
Prepare your assets:
- Replace
banner.pngwith your app's banner (256x128 pixels) - Replace
icon.pngwith your app's icon (48x48 pixels) - Replace
audio.wavwith your app's audio (optional)
- Replace
-
Write your C code:
- Edit
source/main.cwith your application logic - Add additional source files to the
source/directory as needed
- Edit
-
Build your application:
# On Windows build.bat "MyApp" "My Awesome 3DS App" "Your Name" # Or manually make bannertool.exe makebanner -i banner.png -a audio.wav -o banner.bnr bannertool.exe makesmdh -s "MyApp" -l "My Awesome 3DS App" -p "Your Name" -i icon.png -o icon.icn makerom -f cia -o MyApp.cia -DAPP_ENCRYPTED=false -rsf template.rsf -target t -exefslogo -elf homebrew.elf -icon icon.icn -banner banner.bnr makerom -f cci -o MyApp.3ds -DAPP_ENCRYPTED=true -rsf template.rsf -target t -exefslogo -elf homebrew.elf -icon icon.icn -banner banner.bnr
CBuilder3DS/
โโโ source/ # Your C source code
โ โโโ main.c # Main application file
โโโ include/ # Header files (currently empty)
โโโ build/ # Build output directory
โโโ banner.png # Application banner (256x128)
โโโ icon.png # Application icon (48x48)
โโโ audio.wav # Application audio
โโโ template.rsf # ROM configuration template
โโโ Makefile # Build configuration
โโโ build.bat # Automated build script
โโโ bannertool.exe # Asset creation tool
โโโ makerom.exe # ROM packaging tool
โโโ README.md # This file
- Compiles your C source code using devkitARM
- Links with libctru library
- Generates
.elfand.3dsxfiles
- Banner: Creates
banner.bnrfrombanner.pngandaudio.wav - Icon: Creates
icon.icnfromicon.pngwith metadata
- CIA: Creates installable
.ciafile (unencrypted for homebrew) - 3DS: Creates cartridge
.3dsfile (encrypted for distribution)
Edit template.rsf to modify:
- Title: Application name
- Company Code: Your organization identifier
- Product Code: Unique product identifier
- Unique ID: Application identifier (change from default!)
- Media Size: Storage requirements
- System Permissions: What your app can access
build.bat [short_name] [long_name] [author_name]short_name: Short identifier (e.g., "MyApp")long_name: Full application name (e.g., "My Awesome 3DS App")author_name: Your name or organization
| Format | Extension | Purpose | Usage |
|---|---|---|---|
| 3DSX | .3dsx |
Development | Testing with Homebrew Launcher |
| ELF | .elf |
Debugging | Development and debugging |
| CIA | .cia |
Installation | Installing on 3DS with CFW |
| 3DS | .3ds |
Distribution | Cartridge-style distribution |
- Add your
.cfiles to thesource/directory - Add corresponding
.hfiles to theinclude/directory - The Makefile will automatically include them
- Banner: 256x128 pixels, PNG format
- Icon: 48x48 pixels, PNG format
- Audio: WAV format, 16-bit, 22kHz recommended
- Use
.3dsxfiles for quick testing - Use
.elffiles with debuggers - Check build logs in the
build/directory
"Please set DEVKITARM in your environment"
- Install devkitARM and add it to your PATH
- Restart your command prompt after installation
Build fails with "command not found"
- Ensure all tools (make, bannertool, makerom) are in your PATH
- Check that devkitARM is properly installed
Assets not appearing in final build
- Verify file formats (PNG for images, WAV for audio)
- Check file sizes and dimensions
- Ensure files are in the project root directory
CIA installation fails
- Verify your 3DS has custom firmware installed
- Check that the Unique ID in
template.rsfis unique - Ensure all required system services are available
- libctru Documentation - 3DS homebrew library
- devkitPro Examples - Sample projects
- 3DS Homebrew Development - Technical documentation
- Homebrew Launcher - Testing environment
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the terms specified in the LICENSE file.
- Manurocker95 - Original CIA builder inspiration
- 3DSGuy - makerom tool
- devkitPro - 3DS development tools and examples
- Aurelio Mannara - libctru Hello World example
If you encounter issues or have questions:
- Check the Troubleshooting section
- Search existing Issues
- Create a new issue with detailed information about your problem
Happy 3DS homebrew development! ๐ฎ