/natu

Toolkit for writing Game Boy Advance games in Nim

Primary LanguageNimzlib LicenseZlib

Natu GBA Logo

Natu is a package for making Game Boy Advance games in Nim.

Primarily a wrapper for libtonc, we are now growing in our own direction: ditching some old conventions to be more Nim-friendly, and adding more libraries.

Features

  • Full GBA memory map + flag definitions
  • BIOS routines
  • Interrupt manager
  • A powerful text system (TTE)
  • Surfaces (draw to tiles like a canvas)
  • Efficient copy routines
  • Sin/Cos/Div LUTs + other math functions
  • Fixed-point numbers, 2D vector types
  • Random number generator
  • Hardware sprites, affine matrix helpers
  • Color/palette utilities
  • Button states (hit, down, released)
  • mGBA logging functions
  • Maxmod bindings for music/sfx
  • Posprintf wrapper for string formatting

Usage

You will need devkitARM with GBA tools and libraries. If you are using the graphical installer, simply check "tools for GBA development" during setup. Otherwise be sure to install the gba-dev group of packages. Either way, the libtonc package is included so you should be good to go!

Before diving into Nim, try building some of the Tonc 'advanced' demos to make sure your environment is good.

The examples in this repo each use a nimscript configuration which should make a good starting point for any project. From within an example you can run nim build in the terminal to produce a GBA rom.

Happy coding! And if you need any help you can reach me (exelotl) on the gbadev discord.

Thanks

tonc + libtonc by cearn
devkitARM toolchain maintained by wintermute
maxmod sound system by mukunda johnson
mGBA by endrift
posprintf by dan posluns
natu logo by hot_pengu, based on pixel art by iamrifki


Natu