gitmyhub

pascal-gba

Pascal ★ 1 updated 19d ago

Pascal toolchain for Game Boy Advance development: FPC cross-compilation, a Pascal-written GBA emulator with headless replay and debugging, and an AI-image-to-GBA asset pipeline

A Pascal toolchain for building real Game Boy Advance games, complete with its own Pascal-written emulator, debugging tools, and an AI-image-to-sprite asset pipeline.

PascalFree Pascal CompilerdevkitARMPythonsetup: hardcomplexity 4/5

pascal-gba is a complete toolchain for making Game Boy Advance games using the Pascal programming language, along with its own emulator and debugging tools built specifically to support that development. It lets you compile real Pascal source code into actual .gba ROM files that can run on original hardware or an emulator, using the Free Pascal compiler's Game Boy Advance target.

The project includes its own Game Boy Advance emulator, written entirely in Pascal, that can boot both commercial game cartridges and homemade games. It ships with a replacement system BIOS built from an existing open source project, so nothing extra is needed to run it. The emulator supports a headless mode with no window or audio, meant for scripted and repeatable test runs, plus features aimed squarely at debugging: it can play back a recorded sequence of button presses, take screenshots of the game screen at specific points, and dump a full snapshot of the emulator's internal state, including the processor, timers, and memory, to disk. Game code running inside the emulator can also send log messages out to the host computer through a small logging channel built into the emulator itself.

Beyond the emulator, the project includes an asset pipeline that turns AI generated images into game ready graphics, handling steps like removing backgrounds, reducing colors to the format the hardware expects, and packing the result into tiles and sprite sheets, with an optional check where the finished art is rendered through the real emulator to confirm it looks right in game. There is also a small windowed launcher application for picking and running ROM files, and a skill file meant to teach an AI coding agent how to drive the whole toolchain.

Getting started requires a Windows computer and three separate installs: a patched version of the Free Pascal compiler with its Game Boy Advance target, the devkitARM toolchain, and Python, all set up through provided installer scripts. Once installed, a single command builds a test ROM, and another single command runs it headlessly to confirm the whole chain works, from compiler through the processor emulation to the debug logging channel. The project, along with its bundled BIOS, is released under the MIT license.

Where it fits