I am a huge retro-gaming geek, I love reliving my childhood and playing classics such as Super Mario Land and Donkey Kong. The Nintendo Game Boy was (and still is!) one of my favourite systems. I’ve always stayed clear of doing any development on retro-gaming systems from the 80s/90s though as this typically involves writing code in assembly language and the learning curve for a non-dev like me is far too high 🧠.

I recently discovered the Game Boy Development Kit (GBDK) on GitHub, which allows you to write software for the Nintendo Game Boy (and a few other systems too!) in C.
I’m certainly no expert in C, however I was fairly sure that I could knock up “Hello World” without too much of an issue.
I downloaded the GBDK and extracted this to a folder (no install is required), I then set about writing this masterpiece –
#include <stdio.h>
void main()
{
int counter = 1;
while (counter <=16)
{
printf("\nHello World!");
counter++;
}
}
This is similar to the BASIC – 10 Print “Hello World”, 20 GOTO 10 that fills the screen with “Hello World” that I first wrote on my Amstrad CPC 6128 back in 1990 😀.
Once I’d saved the file (naming this “helloworld.c“), I then compiled the code using the following command. This creates a ROM for the Game Boy named helloworld.gb
./gbdk\bin\lcc.exe -o helloworld.gb helloworld.c

Voila!

12-year-old me would have been amazed!
[…] previously posted about writing Hello World for the Nintendo Game Boy using the […]
LikeLike