Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 1 post ] 
    Xilef
  Sun Mar 01, 2020 1:24 pm
User avatar
Staff

Big Dumb Guy

Location: UK
GitHub project page
Download latest version

What is this?

This is a CMake based toolchain for GBA development.
CMake is a "project generator" - so this means you can create GBA homebrew games from any CMake compatible IDE or generate a Unix Makefile for your GBA homebrew game for 1-command creation of GBA ROMs.

For example, Visual Studio supports CMake projects, so this toolchain lets you create GBA homebrew games in Visual Studio.

Visual Studio Tutorial

Download Visual Studio: https://visualstudio.microsoft.com/downloads/

When installing Visual Studio remember to select C++ CMake tools for Windows:
Image

Download and extract the latest version of gba-toolchain (link at top of this post).

In Visual Studio select File -> Open -> CMake... and navigate to the extracted gba-toolchain folder. Select the CMakeLists.txt file.

CMake will now download the GNU ARM Embedded Toolchain and some optional dependencies - please wait!

In the Solution Explorer, switch to CMake Targets View:
Image

Right click on rom.elf (executable) and select Build. Wait for the ROM to be built.

In your gba-toolchain folder, navigate into out\build\Debug and you'll see your ROM built as "rom.gba" - open this in a GBA emulator.

Coding for GBA in Visual Studio

Switch back out of CMake Targets View and open the source folder - this is where the code will live. At the moment a default main.cpp exists here.

If you add any new source files you will need to switch back to CMake Targets View, right click on GameBoyAdvance Project and select Generate Cache to re-detect the source files:
Image

Debugging GBA code in Visual Studio

Install the mGBA emulator: https://mgba.io/

Add the path to your mGBA install directory as an Environment variables called MGBA, close and re-open Visual Studio for this variable to be recognised.

Now back in Visual Studio, right-click on the top level folder in the Solution Explorer and you'll see the Run mGBA [...] options. Run the ROM with the GDB Server - this launches mGBA and pauses it for a debugger to attach.

To connect the debugger, select the Remote Debug option in the run menu:
Image

Click the green play button and the debugger will connect. Ironically the debugger is a bit buggy, so in mGBA reset the emulation (Ctrl R) and then everything should be settled. You can now place breakpoints in Visual Studio and use the standard debugging features.

Extra

If you have GCC installed on your system then the ROM fixing utility will be compiled during the dependency downloading phase and the ROMs produced can run on actual GBA hardware.

If you have LLVM installed on your system then any C/C++ files will compile with clang/clang++ (tends to produce better code for GBA).

My gbaplusplus project is included, however it requires some bleeding edge C++ stuff so likely won't work for now. I'm going to fix it up so it will be usable and then GBA games can be made easily.

Handy links

Everything GBA: http://problemkaputt.de/gbatek.htm


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group