Posted September 18, 2023 by SunnyChowTheGuy
When you launch my GameBoy homebrew game, Kaiju Kai Kai, the first thing you'll see is a captivating 3D animation of a monochrome arcade machine. This animation is designed to work even on a GameBoy DMG-01 device. Considering the hardware specifications of the GameBoy, creating this animation was quite a technical challenge, and in this post, I'll explain how I achieved it using GB Studio.
The GameBoy has three tile blocks, each capable of storing 128 texture tiles, which adds up to a total of 384 tiles. On the GameBoy screen, you can draw 20x18 tiles, which equals 360 tiles in total. Since animations of this resolution can't be preloaded when switching scenes, they need to be loaded and unloaded frame by frame during runtime. GB Studio provides a handy function called VM_REPLACE_TILE, which allows you to replace a whole string of tiles in VRAM at once. However, due to the memory being divided into three blocks, this function can only replace a maximum of one block (128 tiles) at a time. To maintain acceptable performance, I set this as my target number.