Examples
We included a few examples in the examples/
folder. To build the ROM files,
run the following from your terminal:
make examples
10 Print โ
The gbforth version of the classic BASIC one-liner
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
. Produces a random maze-like pattern on
the screen.
Aces Up โ
A solitaire card game.
Brainfuck โ
A Brainfuck interpreter running a program that prints โHello World!โ to the screen.
Happy Birthday โ
Written for the Game Boyโs 30th anniversary. Uses the music lib to play Happy Birthday and prints the lyrics to the screen.
Hello World ASM โ
The result of decompiling an example ROM at the very start of this project. Uses plain assembly to print โHello World !โ to the screen.
Hello World โ
The most basic introduction to gbforth โ essentially a Forth rewrite from the ASM version. Uses the term lib to print โHello World !โ to the screen.
Simon โ
A classic game where the player needs to memorise and repeat a growing sequence of notes. Read the step-by-step guide to learn how to implement this game yourself.
Sokoban โ
Bernd Paysan wrote this code
in 1995 for gforth.
We modified it slightly (but as little as possible) to make it run on the Game
Boy. The changes are limited to adding ROM
and RAM
to control memory
locations, moving some definitions into meta definitions (:m ... ;
), and
adding a little initialisation code to main
. Most levels are commented out to
make the game fit on a 32 KB cartridge, and the UI strings are shortened to fit
the LCD display.