Installing the Rednex Game Boy Development System on Windows 10

by Lemma in Circuits > Software

79 Views, 2 Favorites, 0 Comments

Installing the Rednex Game Boy Development System on Windows 10

Tutorial 1 cover image.png

The Rednex Game Boy Development System is a set of tools that make programming for the Game Boy accessible to hobbiests like me or you! There's even a very good tutorial that will teach you how to program in assembly for the Game Boy!

Unfortunately, the official installation instructions for RGBDS aren't very friendly for Windows users like myself. This tutorial seeks to amend that, with a super minimal installation!

After posting this tutorial, it was pointed out to me that these steps are available if you go to the official Windows installation instructions and click on the "none of those" tab. Still, this tutorial has pictures to help along, and it includes a step that the official instructions miss out on. So I hope that if you've had trouble with the official instructions, that this tutorial will help you out!

Before we get started, I've got to give a big thank you to the folks behind the official RGBDS tutorial for teaching me most of what I know about RGBDS. I also need to thank the fine folks on the GBDev discord for helping me figure out the steps I was missing to make this work.

With that said, let's get started!

Downloading the Rednex Game Boy Development System

Step 2 image 1 Unedited.png
Step 2 image 2 Edited.png

This bundle of programs are what will take your assembly code, and translate it into a Game Boy rom!

We're going to download the latest version of RGBDS from the website here:

https://github.com/gbdev/rgbds/releases/latest


Scroll to the bottom of the page, and select either "rgbds-0.8.0-win32.zip" or "rgbds-0.8.0-win64.zip" depending on your OS.


If you don't know how to tell which OS you have, here's a tutorial for that!

https://www.howtogeek.com/21726/how-do-i-know-if-im-running-32-bit-or-64-bit-windows-answers/

Installing the Rednex Game Boy Development System

Step 3 image 1 Edited.png

Bring the zip file to the folder where you want to store the RGBDS executables.

Unzip them all there.

Adding the Rednex Game Boy Development System to the Environment Path

Right now, you've got the RGBDS executables on your computer, and you could use them just like that.

However, you would have to tell your computer where to find them every time.

Like this:

C://<your filepath>/rgbasm.exe -o hello-world.o hello-world.asm

We'd like to just use the program without needing the whole file path.

Like this:

rgbasm -o hello-world.o hello-world.asm

Much nicer right? To make this happen, we're going to need to edit your computer's environment path!

Adding the Rednex Game Boy Development System to the Environment Path

Step 5 image 1 Edited.png

Start by typing the following into your Windows search bar: "system variables"

You should see a result saying "Edit the system environment variables". Go ahead and click that. This will bring up the System Properties window.

Adding the Rednex Game Boy Development System to the Environment Path

Step 6 image 1 Edited.png

Click the button that says "Environment Variables". This will bring up the Environment Variables window.

Adding the Rednex Game Boy Development System to the Environment Path

Step 7 image 1 Edited.png

You do NOT want to edit any of the variables within the User variables (that's in the top half of the window).

You want to edit one of the System Variables (in the second half of the window). Specifically, you want to edit the Path variable.

Go ahead and double click it. This will bring up the Edit Environment Variables window.

Adding the Rednex Game Boy Development System to the Environment Path

Step 8 image 2 Edited.png
Step 8 image 1 Edited.png
Step 8 image 3 Edited.png

The "Edit environment variable" window is where you will add your path.

Go to your folder with your RGBDS executables and copy the path.

Now go back the the "Edit environment variable" window, and hit the "New" button. Paste your path into the new entry. Hit the "OK" button.

Now your RGBDS folder has been added to your environment path!

Downloading the Visual C Redistributable Installer

Step 9 image 1 Edited.png

Right now RGBDS won't work.

That's because it relies on some C libraries that your Windows computer doesn't come with. If you've installed Visual Studio, that will have installed these libraries and you won't need to do anything more. However, most of us will need to download this installer.

Go to:

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version

Click the X64 link. That will start the installer downloading.

Installing the Visual C Redistributable

Step 10 image 1 Unedited.png
Step 10 image 2 Unedited.png

Run the executable.

Click "Install" and let it run.

Now you're good to go!

Emulicious

Step 11 image 1 Unedited.jpg

Even though you've gotten RGBDS set up, we don't have a way to test our code!

It would be tedius (and also a little dangerous!) to load our untested code onto an actual Game Boy every time we want to test it. For that, we want an emulator, but not just any emulator!

We want a debugging emulator!

This will allow us not only to run our code to see if it works, but also to monitor variables and memory, and step through our code line-by-line to watch it being executed. This is a significant tool!

For this tutorial, I'm using Emulicious, although there are others available such as Mesen2 and BGB.

Downloading Emulicious

Step 12 image 1 Edited.png

Start by visiting

https://emulicious.net/downloads

If you're running a 64 bit machine, click the link labeled "with 64-bit Java for Windows".

If you're running a 32 bit machine, click the 32-bit version.

These come with Java, so you don't have to install the Java environment onto your computer.

Installing Emulicious

Step 13 image 1 Unedited.png
Step 13 image 2 Unedited.png

You can install Emulicious anywhere on your computer.

I recommend:

C:\Program Files\Emulicious

But you can install it anywhere that is convenient for you. Move the zip to that folder, and unzip it.

Now you're done! You should be able to continue with the GBDev Tutorial from here, but I have one more step to test that your setup has worked correctly.

Downloading the Test Code

Where would I be if I didn't give you a simple program to test your setup with!

Download the files below and place them in a project folder titled HelloWorld.

Unfortunately Instructables doesn't allow me to upload files other than .txt format, so I've had to append these files with the .txt label. If you delete the ".txt" from the end of each file (don't worry, they're still technically text files) you'll be able to use them to test your setup

Testing Your Setup

Step 14 image 1 Unedited.png

Run the HelloWorld.bat file by double-clicking it. This will automatically run the commands instructing your computer to compile HelloWorld.asm and hardware.inc into a Game Boy Rom. If everything is installed correctly, HelloWorld.gb should appear in your project folder.

Open this with Emulicious and you should see an image appear like the one above!

Congratulations! You've compiled and run your very first Game Boy program!