Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

3ds-template: Difference between revisions

From GameBrew
No edit summary
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Infobox 3DS homebrew
{{Infobox 3DS Homebrews
| title = amaredeus - 3DSBuildTemplate
|title=3ds-template
| type = PC Utilities
|image=3dspc.png
| version = unknown
|description=Template Project for Code::Blocks for developing 3DS homebrew.
| licence = Mixed
|author=TricksterGuy
| author = amaredeus
|lastupdated=2017/07/19
| website = https://github.com/amaredeus/3DSBuildTemplate
|type=Developments
| download = https://dlhb.gamebrew.org/3dshomebrew/amaredeus-3DSBuildTemplate-master.zip
|version=2017
| source = https://dlhb.gamebrew.org/3dshomebrew/amaredeus-3DSBuildTemplate-master.zip
|license=Mixed
|download=https://dlhb.gamebrew.org/3dshomebrews/3ds_template_tricksterguy.zip
|website=https://github.com/TricksterGuy/3ds-template
|source=https://github.com/TricksterGuy/3ds-template
}}
}}
A starter template for various 3DS homebrew applications. This template is geared specifically towards the Code::Blocks IDE. This template can also be used without Code::Blocks just use the Makefile</code> and directory structure provided.


= 3DSBuildTemplate =
This is designed to be a simple and fairly minimal setup required to begin developing homebrew for the 3ds system. As such it doesn't include everything needed to build everything out of the box if you want to build 3ds or cia homebrew.
A starter template for various 3DS homebrew applications.
 
== Usage ==
==User guide==
{|
{| class="wikitable sortable" style="width: 700px;"
! Make Commands
!style="width: 10%;"|Targets
! Action
!Action
|-
| make
|
|-
| make 3ds
| The 3ds target will build a <code>&lt;project name&gt;.3ds</code> file.
|-
|-
| make 3dsx
|3ds||Builds <code><project name>.3ds</code>. (1)
| The 3dsx target will build both a <code>&lt;project name&gt;.3dsx</code> and a <code>&lt;project name&gt;.smdh</code> files.
|-
|-
| make cia
|3dsx||Builds <code><project name>.3dsx</code> and <project name>.smdh</code>.
| The cia target will build a <code>&lt;project name&gt;.cia</code> file.
|-
|-
| make citra
|cia||Builds <code><project name>.cia</code>. (1)
| The citra target will build a <code>&lt;project name&gt;.elf</code> file and automatically run citra.<sup>1</sup>
|-
|-
| make elf
|citra||Builds and automatically runs <code>citra</code> for testing. (2)
| The elf target will build a <code>&lt;project name&gt;.elf</code> file.
|-
|-
| make fbi
|elf||Builds <code><project name>.elf</code>.
| The fbi target will build a <code>&lt;project name&gt;.cia</code> file and send it to your 3ds via [https://github.com/Steveice10/FBI FBI].
|-
|-
| make hblauncher
|release||Release build, creates a <code>cia</code>, <code>3ds</code>, and a zip file containing the <code>smdh</code> and <code>3dsx</code>. (3)
| The hblauncher target will build a <code>&lt;project name&gt;.3dsx</code> file and send your 3ds via homebrew launcher.<sup>2</sup>
|-
|-
| make release
| The release target will build <code>.elf</code>, <code>.3dsx</code>, <code>.cia</code>, <code>.3ds</code> files and a zip file (.3dsx and .smdh only).<sup>3</sup>
|}
|}
'''Notes:'''
 
* <sup>1</sup> <code>make citra</code> requires having citra installed and in your <code>$PATH</code>)
* (1) This requires having [https://github.com/profi200/Project_CTR makerom] and [https://github.com/Steveice10/buildtools bannertool] in your <code>$PATH</code>
* <sup>2</sup> If you intend to use the hblauncher and fbi targets ensure you have set IP3DS in the <code>Makefile</code> to the ip address of your 3ds on your network.
* (2) <code>make citra</code> requires having [https://github.com/citra-emu/citra citra] installed and in your <code>$PATH</code>
* In homebrew launcher press Y and you can netload your 3dsx file.
* (3) If you are on Windows you will need both of the following in your <code>$PATH</code> [http://downloads.sourceforge.net/gnuwin32/zip-3.0-bin.zip zip] and [http://downloads.sourceforge.net/gnuwin32/zip-3.0-dep.zip libbz2.dll]
* In [https://github.com/Steveice10/FBI FBI] go to remote install and select <code>Receive URLs over the network</code>.
 
* <sup>3</sup> This requires having [https://github.com/profi200/Project_CTR makerom] and [https://github.com/Steveice10/bannertool bannertool] both included in <code>buildtools</code> as 7z files.
===Setting up devkitPro===
* If your on windows you will need both of the following in your <code>$PATH</code> (included aswell)
Follow the steps installing devkitPro at the [https://wiki.gbatemp.net/wiki/3DS_Homebrew_Development#Install_devkitARM gbatemp wiki].
* [http://downloads.sourceforge.net/gnuwin32/zip-3.0-bin.zip zip]
 
* [http://downloads.sourceforge.net/gnuwin32/zip-3.0-dep.zip libbz2.dll]
If you want to build cia and 3ds then follow these extra steps:
== IDE Setup ==
* Aquire makerom and bannertool binaries from [https://github.com/Steveice10/buildtools buildtools], or compile them yourself from [https://github.com/profi200/Project_CTR makerom] and [https://github.com/Steveice10/buildtools bannertool]
=== IntelliJ's CLion ===
* Copy the makerom/bannertool to <code>$DEVKITARM/bin</code> or some other directory in your <code>$PATH</code>
# Open project folder in Clion.
 
# Adjust <code>CMakeLists.txt</code> include_directories to point to devkitArm.
===Code::Blocks Setup===
'''Note:''' Make sure [https://sourceforge.net/projects/mingw-w64/ mingw-w64] toolchain is setup in settings.
* Simply open <code>3ds.cbp</code> in Code::Blocks
=== Code::Blocks ===
* Choose File > Save as user-template and enter a template name. The project setup is now a user template to create new projects.
# Simply open the 3ds.cbp in Code::Blocks
* When creating a new project select File > New > From template and follow the wizard's instructions.
# Choose File &gt; Save as user-template and enter a template name. The project setup is now a user template to create new projects.
* Ensure you have the environment variables plugin installed (in linux you can install this by installing the codeblocks-contrib package)
# When creating a new project select File &gt; New &gt; From template and follow the wizard's instructions.
* Choose Settings > Environment and scroll down to the Environment Variables section.
# Ensure you have the environment variables plugin installed (in linux you can install this by installing the codeblocks-contrib package)
* Add <code>DEVKITPRO</code> and point it to where devkitpro is installed
# Choose Settings &gt; Environment and scroll down to the Environment Variables section.
* Add <code>DEVKITARM</code> and point it to where devkitarm is.
# Add DEVKITPRO to point to where devkitpro is installed
 
# Add DEVKITARM to point to where devkitarm is.
To compile in Code::Blocks simply select your target from the list and click the Gear icon to automatically invoke the <code>Makefile</code>
== Compiling ==
 
=== Unix ===
'''Note:''' Make sure you are using MSYS2's make (make.exe) and not MINGW's make (mingw32-make.exe).
You will need [https://sourceforge.net/projects/devkitpro/files/devkitARM/ devkitArm] which can be obtained with
 
<source lang="bash">wget http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/devkitARMupdate.pl
===Creating a new project===
chmod +x devkitARMupdate.pl
* Make a new Code::Blocks project via a user-template you just created above. Or simply copy this directory.
sudo ./devkitARMupdate.pl /opt/devkitPro
* (Only needed for cia/3ds builds) Edit the file <code>resources/AppInfo</code>
echo "export DEVKITPRO=/opt/devkitPro" >> ~/.bashrc
** Edit those values and ensure you choose a unique id see [https://gbatemp.net/threads/homebrew-cias-uniqueid-collection.379362 unique_id_list].
echo "export DEVKITARM=\$DEVKITPRO/devkitARM" >> ~/.bashrc
** Replace the existing files in the <code>resources</code> directory to suit your needs.
echo "export PATH=\$PATH:\$DEVKITARM/bin" >> ~/.bashrc
 
source ~/.bashrc
'''Note:''' Please ensure that no folder/directory used in the project contains spaces. Devkitpro's Makefiles apparently does not like this. That is, do not have it in a folder like <code>C:/3DS Hacking/3ds-template</code> rather <code>C:/3DS_Hacking/3ds-template</code>
</source>
 
Please note: The env variables need to be available from sudo
==Credits==
<source lang="bash">Defaults env_keep += "DEVKITPRO DEVKITARM"
All of this would not have been possible without the work of:
</source>
=== Windows ===
Install the following using [https://sourceforge.net/projects/devkitpro/ devkitProUpdater]:
* [https://sourceforge.net/projects/devkitpro/files/devkitARM/ devkitArm]
* [https://sourceforge.net/projects/devkitpro/files/libctru/ libctru]
* [https://sourceforge.net/projects/devkitpro/files/citro3d/ citro3D]
'''Note''': It is suggested to install dev tools at the root of your disk drive i.e. <code>C:\Development\3ds-homebrew\devkitPro</code>
Once installed, make sure you have access to a C compiler from <code>cmd</code>. If you're not sure install [https://sourceforge.net/projects/mingw-w64/ mingw-w64] to <code>C:\Development\mingw-w64</code> and then add the path <code>C:\Development\mingw-w64\mingw32\bin</code> to your env variables.
Open command prompt as an '''administrator''' and <code>cd</code> into the devkitPro installation folder. Some commands need admin rights to properly install. Additionally make sure your antivirus software does not interfere.
Next <code>git clone</code> the latest [https://github.com/devkitPro/3ds_portlibs 3ds_portlibs]:
<source lang="bash">git clone https://github.com/devkitPro/3ds_portlibs.git
cd 3ds_portlibs
make zlib
make install-zlib
</source>
Finally, clone this repo and build with one of the commands found in usage.
== Credits ==
All of this would not have been possible without the work of
* [https://github.com/smealum Smealum]
* [https://github.com/smealum Smealum]
* [https://github.com/Steveice10 Steveice10]
* [https://github.com/Steveice10 Steveice10] for the [https://github.com/Steveice10/buildtools buildtools]
* and countless others
* [https://github.com/amaredeus amaredeus] for various improvements to the template (such as the formatting in the README)
 
==External links==
* GitHub - https://github.com/TricksterGuy/3ds-template

Latest revision as of 10:33, 22 Haziran 2024

3ds-template
3dspc.png
General
AuthorTricksterGuy
TypeDevelopments
Version2017
LicenseMixed
Last Updated2017/07/19
Links
Download
Website
Source

A starter template for various 3DS homebrew applications. This template is geared specifically towards the Code::Blocks IDE. This template can also be used without Code::Blocks just use the Makefile and directory structure provided.

This is designed to be a simple and fairly minimal setup required to begin developing homebrew for the 3ds system. As such it doesn't include everything needed to build everything out of the box if you want to build 3ds or cia homebrew.

User guide

Targets Action
3ds Builds <project name>.3ds. (1)
3dsx Builds <project name>.3dsx and <project name>.smdh.
cia Builds <project name>.cia. (1)
citra Builds and automatically runs citra for testing. (2)
elf Builds <project name>.elf.
release Release build, creates a cia, 3ds, and a zip file containing the smdh and 3dsx. (3)
  • (1) This requires having makerom and bannertool in your $PATH
  • (2) make citra requires having citra installed and in your $PATH
  • (3) If you are on Windows you will need both of the following in your $PATH zip and libbz2.dll

Setting up devkitPro

Follow the steps installing devkitPro at the gbatemp wiki.

If you want to build cia and 3ds then follow these extra steps:

  • Aquire makerom and bannertool binaries from buildtools, or compile them yourself from makerom and bannertool
  • Copy the makerom/bannertool to $DEVKITARM/bin or some other directory in your $PATH

Code::Blocks Setup

  • Simply open 3ds.cbp in Code::Blocks
  • Choose File > Save as user-template and enter a template name. The project setup is now a user template to create new projects.
  • When creating a new project select File > New > From template and follow the wizard's instructions.
  • Ensure you have the environment variables plugin installed (in linux you can install this by installing the codeblocks-contrib package)
  • Choose Settings > Environment and scroll down to the Environment Variables section.
  • Add DEVKITPRO and point it to where devkitpro is installed
  • Add DEVKITARM and point it to where devkitarm is.

To compile in Code::Blocks simply select your target from the list and click the Gear icon to automatically invoke the Makefile

Note: Make sure you are using MSYS2's make (make.exe) and not MINGW's make (mingw32-make.exe).

Creating a new project

  • Make a new Code::Blocks project via a user-template you just created above. Or simply copy this directory.
  • (Only needed for cia/3ds builds) Edit the file resources/AppInfo
    • Edit those values and ensure you choose a unique id see unique_id_list.
    • Replace the existing files in the resources directory to suit your needs.

Note: Please ensure that no folder/directory used in the project contains spaces. Devkitpro's Makefiles apparently does not like this. That is, do not have it in a folder like C:/3DS Hacking/3ds-template rather C:/3DS_Hacking/3ds-template

Credits

All of this would not have been possible without the work of:

External links

Advertising: