2021 Gameboy SHMUP Devlog #3 – GBDK 2020 Color Troubles

For my 2021 Gameboy SHMUP, my next goal was working with GBDK 2020 Color. Currently, everything was in black n’ white. On some gameboy consoles this would just be shades of green/yellow. Gameplay elements should stand out more. One way to achieve this, is by introducing color.

If your looking for a tutorial for Color Sprites & Backgrounds for Gameboy games, stay tuned to The Junkyard. I plan on writing a tutorial.

Getting color working broke my game for a day. There are two-ish reasons. Misunderstanding Emulator GBDK 2020 Color Palette Management, and Updating my GBDK 2020 version.

Spoiler Alert! TL;DR – My game broke when trying to add color. This is because i needed to set color palettes on everything. Without color palettes explicitly defined some things would default to white.

Misunderstanding Gameboy Emulator Color Palette Management

The emulator i was using mGBA, seemed to automatically handle color palettes and such. Gameplay elements would always render, but not always with the correct colors. When things weren’t going as planned, I switched to BGB. I heard a lot of people recommend BGB for it’s accuracy.

In this scenario, BGB gave me a pure white screen. When i tried on my Gameboy Color, the result was the same. After struggling with that, i decided to update my GBDK 2020 version.

NOTE: The problem wasn’t the GBDK 2020 version, just i didn’t define color palettes for everything, so it defaulted to white.

Updating my GBDK 2020 version

I updated to GBDK 2020 4.0.3. Once updated, new compiler issues were encountered. I’m not entirely sure why, but GBDK 2020 4.0.3 seems to be more strict than whichever previous version I had.

Eventually the game would compile again, but now i got another error.

can’t open 0x143=0x80: No such file or directory

lcc compiler when trying to use “-Wl-yp0x143=0x80”

The lcc compiler was having problems enabling GBDK 2020 Color. This used to be done by adding “-Wl-yp0x143=0x80” to your compilation command. This writes 0x80 (gameboy color support) to the address 0x143.

After some discussion on the GBDK discord, I came across this page on the internet. The page explains:

Setting ROM bytes directly with -Wl-yp0x<address>=0x<value> is no longer supported. Instead use @ref makebin flags. For example, use -Wm-yC instead of -Wl-yp0x143=0xC0.

gbdk 2020 migration FAQ

After reading this, i fixed my previous issue with enabling color support.

Sometime during that time, i learned BGB defaults to white color palettes if not specified. This was the key piece of knowledge i needed. I started explicitly setting color palettes and viola! A GBDK 2020 Color Game!

Color Gameboy SHMUP gameplay made with GBDK 2020

Comments are closed.