civilized Game Boy Advance development from the comfort of your own editor

Related tags

Game rath
Overview

Rath - civilized Game Boy Advance development from the comfort of your own editor

what is it

Rath is an interactive development environment for the Gameboy Advance using the Forth programming language. This means that you can send code and assets from your editor to your GBA while it is running. Either by typing on an interactive terminal (REPL), or by sending snippets of code straight from your files. Besides this you can of course compile whole GBA binaries as well, which you can run on a real GBA or in an emulator.

The main programming language is Forth (Pandaforth), but you can also call from Forth into C, or whatever language can interface with the Arm ABI. Forth is a pretty awesome low-level programming language. This implementation/flavor is currently about 2000 lines of Arm assembly, including an interactive shell with which you can poke the environment and create new language constructs like functions and arrays, etc on the fly. As 2000 lines is not that much, you can feel pretty confident you can actually be in full control of your programming language.

Using the forth-mode Emacs package, you can send commands, files or file snippets straight from Emacs, never having to leave your editor ever again to repeat that pesky slow and soul-draining cycle of compiling, loading binaries on pesky flash carts, turning on your GBA and seeing things go up in flames yet again (your mileage may vary).

Youtube demo video:

youtube demo vid

history

This is a fork of a Pandaforth repo I found online which is an unmodified version of the sources Torlus published in 2005. Which itself is a port of Camelforth for the Z80, first published by Bradford J. Rodriguez in 1994.

For the original Pandaforth readme, which contains interesting technical information, see the readme.txt file in this repo.

current enhancements

Back in 2005, computers still came standard with serial ports, and the prevaling methods to connect to your GBA were mbv2 and Xboo cables. It turns out you can also use USB UART cables. I made a repo with code and a tutorial on how to make one: gba-serial-adventures

I concocted a (very simple) custom communication protocol between computer and GBA that does checksums of data the computer sends. Also the GBA receives data async in a ring buffer so we can blast at 115200 baud, without spinning when waiting on data while waiting on input (perhaps Xboo and MBv2 did this too, I have no idea). In any case, this makes sending binary data at reasonable speeds possible, without having to worry if we dropped a bit somewhere.

The Forth implementation now runs +- 3x faster. Previously it was executed from EWRAM, which is not ideal, but especially not for Arm-mode assembly. It's more than small enough to run from IWRAM.

I've added a (hopefully cross-platform) Python shell script to interface with the GBA.

We can now build with a current devkitPro.

We're now using libtonc instead of libgba.

I've deleted common build tools, binaries and libraries that were included in the repo: libgba, gbafix, test roms, etc..

Forth now plays nice with unix linebreaks. So we can now handle just line feed instead of cr + line feed.

Xboo and MBv2 support has been removed. I would like to have a conversation with people that can still run that setup in this day and age.

Converted all Forth words to lowercase. I don't like my programming language screaming at me, and life is too short to press the capslock button all the time.

Started on the library code. So far there are constants for memory locations and IO registers, we've got a shadow OAM that updates the OAM data on vblank, we've got key press detection and a mini game loop.

how to build/use

Install devkitARM, libtonc, and make sure the binaries are in your exec path. Also make sure the $(DEVKITARM) env variable is set to your devkitARM folder.

Run make in the root of the repo. This creates a binary called PF.gba.

To make a demo binary, run build.sh, which will create a PFdemo.gba file.

For interactive development, flash the binary on a cart, put the cart in a Game Boy Advance, and start it. PF.gba will put you in repl mode. PFdemo.gba will start a game loop with a little sprite you can control with the direction pad. To jump out of the game loop and into the repl, press select.

To connect to said binary with a UART cable: <this-repo-root>/shell/shell.py --gbaser /dev/ttyUSB0

For a simple shell.py help text: <this-repo-root>/shell/shell.py --help

And then type Forth code, one line at a time.

To load files into the GBA from the REPL, type: include <path/to/filename>

To use Rath with Emacs (see video above), use the forth-mode Emacs package. It looked like the package doesn't allow arguments to the Forth program it asks for, so I've wrapped the above cmdline invocation in a one-liner script.

You can also run the PFdemo.gba file in an emulator, if you want to move the little sprite around. Not too exciting to all, but I think it's quite cool :D

future

Rath is meant to be a bona-fide development environment. Of course there's a big chance this passion project will stumble right after it's first release on Github. As most projects do.

But hopefully it will some day be featureful enough to be able to make some apps/games with. It should have some library code to handle the basics like key presses, background modes, sprites, music, etc (some of this is now implemented). The music engine will come from an existing C/Asm library like Apex Audio System or Maxmod. In addition to that, there are some quality of life development improvements to be done, like easy inclusion of assets, interactive asset testing, better IDE integration, etc.

Beyond that one can think of heaps of improvements: swapping out Forth modules in and out of IWRAM (A lot of Forth implementations make this relatively easy), test framework, optimized graphics routines, 3d engine, neural engine, etc.. But,.. baby steps.

Owner
Ties Stuij
Ties Stuij
A cycle-accurate Game Boy and Game Boy Color Emulator, with rewind feature.

Azayaka is a free and open-source Game Boy and Game Boy Color emulator written in C++. Features Cycle-Accurate emulation. Console based Debugg

Zach Collins 14 Dec 16, 2021
The Game Boy ROM of the Game Boy bitcoin miner!

game-boy-bitcoin-miner The Game Boy ROM of the Game Boy bitcoin miner! To build this, currently this patch needs to be applied to GBDK: https://gist.g

Ghidra Ninja 79 Jul 17, 2022
SameBoy DX is a Qt-based interface of SameBoy, a free, highly accurate Game Boy and Game Boy Color emulator.

SameBoy DX SameBoy DX is a Qt-based interface of SameBoy, a free, highly accurate Game Boy and Game Boy Color emulator. Build requirements: CMake Pyth

Snowy 8 Jul 26, 2022
A Game Boy game that rewards you for playing it on several console models!

GB Corp. A Game Boy game for the Game Boy Competition 2021 by Dr. Ludos (2021) This is the source code, you can get a precompiled rom from here: https

Dr. Ludos 9 Oct 21, 2021
GB Studio is a quick and easy to use retro adventure game creator for Game Boy available for Mac, Linux and Windows

GB Studio is a quick and easy to use retro adventure game creator for Game Boy available for Mac, Linux and Windows

Chris Maltby 6.3k Aug 6, 2022
Realtime strategy game for Gameboy Advance

Skyland Overview A Gameboy Advance game created, frantically, for a game jam, in about twenty days. A simple realtime strategy game where you build fl

Evan Bowman 27 May 20, 2022
GameBoy Advance dungeon crawling game

inheritors-of-the-oubliette GameBoy Advance dungeon crawling game Compilation instructions: have devkitpro installed with all the GBA dev stuff. Also

null 12 Jul 30, 2022
Custom Deflemask .vgm based playback engine for the Nintendo Game Boy

-DeflemaskGBVGM- Custom Deflemask .vgm based playback engine for the Nintendo Game Boy. Now the official Deflemask ROM exporter as of v1.0.3. this eng

Daniel Chu 10 Feb 20, 2022
A repository of gate-level simulators and tools for the original Game Boy.

GateBoy is a gate-level simulation of the original Game Boy hardware that was reverse-engineered from die shots of the original DMG-01 chip.

null 975 Jul 27, 2022
A Game Boy emulator with serial data transfer (link cable) support over tcp.

gbmulator A Game Boy emulator with serial data transfer (link cable) support over tcp. Key bindings Key bindings are not configurable yet. Key Action

null 3 Jul 17, 2022
NeoGB Printer an SD card-based standalone Game Boy Printer emulator.

An open-source and standalone Gameboy Printer emulator 100% compatible with all officially released games (110 in total) that support the accessory. Just print and save the images as BMP

Rafael Zenaro 65 Jul 27, 2022
A Game Boy Printer emulator that supports the Phomemo T02 printer

ESP32 + Phomemo T02 Game Boy Printer This project lets you print Game Boy Printer images via Bluetooth using a Phomemo T02 thermal printer and an ESP3

Jack Gaino 10 May 21, 2022
A WiFi cartridge for the original Game Boy.

wifi-game-boy-cartridge A WiFi cartridge for the original Game Boy. This open source and open hardware Game Boy cartridge uses an ESP8266 to allow WiF

Sebastian Staacks 116 Jul 25, 2022
an AI and gameplay editor for game development, written by c++ , suppport lua and python

an AI and gameplay editor for game development, written by c++ , suppport lua and python

null 24 Dec 31, 2021
Ground Engine is an easy to use Game Engine for 3D Game Development written in C++

Ground Engine is an easy to use Game Engine Framework for 3D Game Development written in C++. It's currently under development and its creation will b

 PardCode 52 Jul 31, 2022
Ncurses based omok game, execute omok game in your terminal

omok_game execute omok game in your terminal Omok game played by two people. 한국어 버전(korean version)

SunjungAn 2 Dec 6, 2021
Design-agnostic node editor for scripting game’s flow in Unreal Engine

Flow plug-in for Unreal Engine provides a graph editor tailored for scripting flow of events in virtual worlds. It's based on a decade of experie

Moth Cocoon 442 Aug 3, 2022
A Tiny 2D OpenGL based C++ Game Engine that is fast, lightweight and comes with a level editor.

A Tiny 2D OpenGL based C++ Game Engine that is fast, lightweight and comes with a level editor.

Samuel Rasquinha 48 Jul 13, 2022
CRYENGINE is a powerful real-time game development platform created by Crytek.

CRYENGINE This repository houses the source code for CRYENGINE. Instructions on getting started with git can be found here, along with details on work

Crytek 931 May 10, 2022