Low level library to develop GBA games that can also be built for PC.

Overview

Universal GBA Library

1. Introduction

This is a library for development of GBA games. It can be used to build actual GBA game ROMs, but it can also target a regular PC so that it is easier to debug the logic in the game. It is written in C.

This means you can do things like:

  • Build a GBA ROM and run it in an emulator.
  • Build a Linux executable file and debug it using GDB.
  • Build a Windows executable with MSVC and debug it using Visual Studio.
  • Easily implement unit tests for your game and run them on your PC.

It comes with several examples of how to use each one of the subsystems of the library. All examples are also used as unit tests, and they are part of the automated regresion testing system of the library.

Also note that most of the library is optional and is included for conveniency. The only interfaces that you must use in your project are described in this document.

Note that this is still an early version of the library. The public interface is likely to change a bit, so expect breaking changes at some point. Hopefully, they will be minimal, and the interfaces described in the link above will most likely stay the same even if the internal code changes. The SDL2 port needs a pretty big cleanup.

The GBA version of the library is a static library licensed under the MIT license. The PC version of the library is a dynamic library licensed under the LGPL-3.0 license. The other license files of the repository correspond to some resources used in the examples (like music and sound effects), but don't affect the library itself.

This repository only holds the library code. For more information about testing check the following repository: https://github.com/AntonioND/ugba-testing

The following repository contains an example of a project that uses libugba: https://github.com/AntonioND/ugba-template

2. Limitations

The PC version of the library behaves in a different way as the GBA version of it. Take a look at here for more details.

For a list of planned features, check this link.

3. Dependencies

To generate PC executables:

Required

  • GCC, Clang, MSVC or another compiler supported by CMake.
  • CMake 3.15 or later
  • SDL2 2.0.7 or later (AudioStream support needed)

Optional

For the SDL port:

  • libpng 1.6 or later (Simplified API support needed): Needed to save PNGs like screenshots and dumps from VRAM debugger windows.
  • liblua 5.2 or later (Integer support needed): Needed for the Lua interpreter used for the unit tests.

To generate the GBA library file:

To convert the font used by the library to the GBA format:

  • Grit. It comes with devkitPro. If you don't install devkitPro because you only want to build the PC executables, you still need to get Grit. Note that you will need to add it to your system's PATH environment variable if you download the standalone binary: https://github.com/devkitPro/grit/releases

4. Build library

Linux

If you're on Linux or any Linux-like environment (like MinGW or Cygwin), install the dependencies using your package manager. For example, in Debian or Ubuntu:

sudo apt install libsdl2-dev liblua5.4-dev libpng-dev

Clone this repository:

git clone https://github.com/AntonioND/libugba
cd libugba

Finally, go to the folder of libugba. The following will build the library:

mkdir build
cd build
cmake ..
make

Note: In order to make the compilation process faster you can run make in multiple threads by doing make -j`nproc.

Windows

In order to build with MinGW or Cygwin, you should use the Linux instructions. The following instructions have been tested with Microsoft Visual C++ 2019.

You need to install vcpkg. In short, open a PowerShell window and do:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install --triplet x64-windows

Then, install the dependencies (SDL2, libpng and liblua):

.\vcpkg install SDL2 libpng liblua --triplet x64-windows

Clone this repository:

git clone https://github.com/AntonioND/libugba
cd libugba

Finally, go to the folder of ugba. The following will build the library, and examples, in Developer Command Prompt for VS 2019:

mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\...\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows
msbuild ugba.sln

In order to get a release build, do:

msbuild ugba.sln /property:Configuration=Release

GBA

Clone this repository and build it like this:

git clone https://github.com/AntonioND/libugba
cd libugba
make

Note: In order to make the compilation process faster you can run make in multiple threads by doing make -j`nproc.

5. Acknowledgements

  • Dave Murphy (WinterMute) (and others) for devkitPro and devkitARM.
  • Jasper Vijn (cearn) for Grit and Tonc.
  • Martin Korth (Nocash) for no$gba and GBATEK.
  • Vicki Pfau (endrift) for mGBA.
You might also like...
CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf
CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf

esp-idf-cc2500 CC2500 Low-Cost Low-Power 2.4 GHz RF Transceiver driver for esp-idf. I ported from this. 2.00mm pitch External Antena 1.27mm pitch PCB

A list of excellent resources for anyone to deepen their understanding with regards to Windows Kernel Exploitation and general low level security.

WinKernel-Resources A list of excellent resources for anyone trying to deepen their understanding with regards to Windows Kernel Exploitation and gene

A low level Operating System designed using Linux Kernel

Conqueror A low level Operating System designed using Linux Kernel To develop the basic low level operating system, we need following Virtual Machine

Volatile ELF payloads generator with Metasploit integrations for testing GNU/Linux ecosystems against low-level threats
Volatile ELF payloads generator with Metasploit integrations for testing GNU/Linux ecosystems against low-level threats

Revenant Intro This tool combines SCC runtime, rofi, Msfvenom, Ngrok and a dynamic template processor, offering an easy to use interface for compiling

Some hypervisor research notes. There is also a useful exploit template that you can use to verify / falsify any assumptions you may make while auditing code, and for exploit development.

Introduction Over the past few weeks, I've been doing some hypervisor research here and there, with most of my focus being on PCI device emulation cod

(FIXED) Since the one on github didn't work. (ALSO INCLUDES .DLL SO YOU CAN JUST INJECT INTO FORTNITE)
(FIXED) Since the one on github didn't work. (ALSO INCLUDES .DLL SO YOU CAN JUST INJECT INTO FORTNITE)

Marathon-Fortnite-Cheat-Fix-Leak Fortnite Marathon Cheat v18.20 FIXED [Leak] Getting started Open .sln with Visual Studio 2019 Compile batch build to

A kernel level driver for Windows built to configure the Blue Screen Of Death

BSODConfigure A kernel level driver for Windows built to configure the Blue Screen Of Death. Go see the writeup at https://www.phasetw0.com/configurin

Develop easily on devices like the Samsung Galaxy Z Flip / Z Flip 3

Helper for "Flip" devices A plugin to easily develop Flutter applications for Flip devices like Samsung Galaxy Z Flip or Samsung Galaxy Z Flip 3. It w

Minimal setup required to develop firmware for STM32 using ceedling
Minimal setup required to develop firmware for STM32 using ceedling

STM32 & Ceedling Base Project I created this project as a starting point for anyone looking to create production quality firmware for an embedded syst

Owner
Antonio Niño Díaz
Antonio Niño Díaz
Tools for interacting with music data in GBA games that use the Engine Software replayer.

A suite of tools for interacting with the XM-like music data found in certain Game Boy Advance games - specifically those that use the Engine Software replayer middleware.

Luna 16 Oct 22, 2022
High-level interface for low-level programming

Singeli Singeli is now able to compile useful programs to C, but it's very rough around the edges, with poor error reporting. We are beginning to use

Marshall Lochbaum 40 Dec 30, 2022
A library to develop kernel level Windows payloads for post HVCI era

A library to develop kernel level Windows payloads for post HVCI era

Dmytro Oleksiuk 283 Dec 15, 2022
This project seeks to develop a low-cost, open-source braille display

This project seeks to develop a low-cost, open-source braille display. It is estimated that its cost is reduced to more than 90% compared to the cost of the cheapest screens that exist in the market today. // Este proyecto busca desarrollar una pantalla braille de código abierto y de bajo costo. Se estima que su coste se reduce a más de un 90%.

brailletouch 11 Nov 22, 2022
An embedded CAN bus sniffer which is able to monitor any of the vehicle internal CAN bus and perform some action by triggering new CAN messages.

An embedded CAN bus sniffer which is able to monitor any of the vehicle internal CAN bus and perform some action by triggering new CAN messages. In this way certain vehicle functionality can be triggered by responding to custom steering wheel button events, or use the vehicle virtual cockpit to display OBD-PIDs values instead of relying on an external display to present new information to the user

null 18 Dec 28, 2022
This Repository Aims To Help Beginners with their first successful pull request and Know How to do open source contributions Also For Intermediate and Advance level contributors as well.

Hacktoberfest_2021 This Repository Aims To Help Beginners with their first successful pull request and Know How to do open source contributions Also F

Rishu Rajan 15 Jan 9, 2022
S2-LP driver library, low-level and easy-to-port

S2-LP Library This library provides a simple way to use S2-LP transciever module. This library is WIP, but mostly done. https://www.st.com/en/wireless

Wojciech Olech 7 Oct 10, 2022
Tiny - low-level library for minimizing the size of your types

foonathan/tiny Note: This project is currently WIP, no guarantees are made until an 0.1 release. This project is a C++11 library for putting every las

Jonathan Müller 101 Oct 29, 2022
CQC (Charmed Quark Controller) a commercial grade, full featured, software based automation system. CQC is built on our CIDLib C++ development system, which is also available here on GitHub.

The CQC Automation System What It Is CQC is a commercial quality, software based automation system, suitable for residential or commercial application

Dean Roddey 61 Dec 13, 2022