Overview
This guide will walk you through cloning the repository, building ROM files, and verifying your build. The entire process takes just a few minutes once you have RGBDS installed.Make sure you’ve completed the Installation guide for your platform before continuing.
Building Your First ROMs
Clone the Repository
Open your terminal and download the source code using Git:This creates a
pokered directory containing all the source files, including:- Assembly source files (
.asm) - Graphics data
- Maps and scripts
- The build system (Makefile)
Build the ROMs
From the This will:
pokered directory, run the build command:- Assemble all
.asmsource files into object files - Convert graphics from PNG to Game Boy format
- Link everything together into ROM files
- Apply ROM fixes and headers
The first build may take longer as it compiles the build tools and processes all graphics files.
Find Your ROMs
After a successful build, you’ll find these files in the project root:
- pokered.gbc - Pokémon Red ROM
- pokeblue.gbc - Pokémon Blue ROM
- pokeblue_debug.gbc - Debug build of Pokémon Blue
Understanding the Build Targets
The Makefile supports several build targets for different purposes:Build Target Reference
| Target | Output | Description |
|---|---|---|
all | pokered.gbc, pokeblue.gbc, pokeblue_debug.gbc | Builds all ROM files (default) |
red | pokered.gbc | Builds only Pokémon Red |
blue | pokeblue.gbc | Builds only Pokémon Blue |
blue_debug | pokeblue_debug.gbc | Debug build with special features |
compare | - | Verifies ROM checksums match originals |
clean | - | Removes all build artifacts including graphics |
tidy | - | Removes ROMs and object files only |
The debug build (
pokeblue_debug.gbc) includes development features that weren’t in the original release. Look for _DEBUG conditionals in the source code to see what’s different.What Gets Built?
When you runmake, several types of files are generated:
ROM Files
- pokered.gbc - The complete Pokémon Red game
- pokeblue.gbc - The complete Pokémon Blue game
- pokeblue_debug.gbc - Debug version with extra features
Symbol Files (.sym)
Symbol files map memory addresses to function and label names. Useful for debugging in emulators:pokered.sympokeblue.sympokeblue_debug.sym
Map Files (.map)
Map files show how data is laid out in the ROM:pokered.mappokeblue.mappokeblue_debug.map
Graphics Files
Converted graphics in Game Boy format:.1bpp- 1 bit per pixel (2 colors).2bpp- 2 bits per pixel (4 colors).pic- Compressed Pokémon sprites
Testing Your ROMs
To play your built ROMs, you’ll need a Game Boy emulator:Recommended Emulators
BGB
Best for development/debugging
- Windows (works on Linux via Wine)
- Excellent debugger with symbol support
- bgb.bircd.org
mGBA
Best for casual play
- Cross-platform (Windows, macOS, Linux)
- Accurate emulation
- mgba.io
SameBoy
Highly accurate
- Cross-platform
- Exceptional accuracy
- sameboy.github.io
Gambatte
Accuracy-focused
- Available as RetroArch core
- Very accurate emulation
- github.com/libretro/gambatte-libretro
pokered.gbc or pokeblue.gbc in your emulator of choice!
Cleaning Up
To remove build artifacts and start fresh:clean and tidy:
make clean- Removes ROMs, object files, AND converted graphics (.1bpp,.2bpp,.pic)make tidy- Removes only ROMs and object files, keeps converted graphics
Advanced Build Options
Using a Local RGBDS Version
If you have RGBDS installed in a local directory:Debug Builds with Symbols
To generate extra debugging information:.sym and .map files even for release builds.
Building Virtual Console Patches
To create patches for 3DS Virtual Console releases:What’s Inside the ROMs?
Your built ROMs contain everything from the original games:Game Engine
Battle system, overworld movement, menus, events, and all core game logic
Pokémon Data
All 151 Pokémon with stats, moves, types, and evolution data
Maps & Scripts
Every town, route, building, and dungeon with NPC dialogue and events
Graphics & Audio
All sprites, tilesets, animations, music, and sound effects
- Bank 0 (Home) - Essential functions always accessible
- Banks 1-31 - Switchable banks containing specific features
- Each bank is 16KB (except Home which is 8KB)
Troubleshooting
Build Fails with “rgbasm: command not found”
Solution: RGBDS isn’t installed or not in your PATH. Revisit the Installation guide.”Error: Unknown symbol” During Assembly
Solution: Usually means dependencies aren’t up to date. Try:Checksums Don’t Match
Solution: Could be using wrong RGBDS version or source code modified. Try:Build is Very Slow
Solution: First build is slower due to graphics processing. Subsequent builds are much faster. Usemake tidy instead of make clean to avoid reconverting graphics.
Next Steps
Now that you have a working build environment, here’s what to explore next:Explore the Source Code
Open the
.asm files in a text editor and start reading. Key files to start with:main.asm- Shows the overall code organizationconstants/pokemon_constants.asm- Pokémon species definitionsengine/battle/core.asm- Main battle enginedata/pokemon/base_stats.asm- Pokémon stats
Make a Simple Modification
Try changing something simple like:
- Starting money in
engine/movie/oak_speech/init_player_data.asm - Pokémon stats in
data/pokemon/base_stats.asm - Starter Pokémon levels
make and test your changes!Read the Documentation
Check out these resources:
- GitHub Wiki - Comprehensive documentation
- Tutorials - Step-by-step guides
- Game Boy Dev Resources - Learn Game Boy programming
Join the Community
Connect with other ROM hackers and developers:
- Discord - #pokered channel
- GitHub Discussions
- Share your modifications and learn from others!
GitHub Wiki Tutorials
Browse community-created tutorials for adding features, creating new content, and understanding the codebase