Introduction
The Pokémon Red and Blue disassembly is a complete reverse-engineering of the original Game Boy games, reconstructed into human-readable assembly language. This project allows developers to understand, modify, and learn from the original game’s implementation.Project Structure
The disassembly is organized into several key components:Source Code
Assembly files organized by functionality (engine, data, graphics)
Build System
Makefile-based build process using RGBDS toolchain
ROM Banks
Code and data distributed across 45 ROM banks (16KB each)
Memory Layout
Structured RAM, VRAM, and SRAM for game state
Directory Organization
The project follows a clear organizational structure:Code Organization
Section-Based Structure
The code is organized using RGBDSSECTION directives that define where code and data are placed in the ROM:
Bank System
The Game Boy’s banking system allows access to more memory than the addressable 64KB space:- Bank 0 (ROM0): Always accessible at
$0000-$3FFF, contains core routines - Banks 1-44 (ROMX): Switchable at
$4000-$7FFF, contain game content - Banking is managed through the MBC3 memory bank controller
Build Process
Key Build Targets
From the Makefile:The build system supports both Pokémon Red and Blue versions by using conditional assembly directives (
-D _RED or -D _BLUE).Assembly to ROM Flow
Memory Map Overview
| Region | Address Range | Description |
|---|---|---|
| ROM Bank 0 | $0000-$3FFF | Fixed home bank |
| Switchable ROM | $4000-$7FFF | Banks 1-44 |
| VRAM | $8000-$9FFF | Video memory |
| External RAM | $A000-$BFFF | Cartridge save data |
| Work RAM | $C000-$DFFF | Main game state |
| Echo RAM | $E000-$FDFF | Mirror of WRAM |
| OAM | $FE00-$FE9F | Sprite attributes |
| I/O Registers | $FF00-$FF7F | Hardware control |
| High RAM | $FF80-$FFFE | Fast access RAM |
Toolchain Requirements
The project uses the RGBDS (Rednex Game Boy Development System) toolchain:rgbasm
Assembler that processes Z80-like assembly into object files
rgblink
Linker that combines objects and places sections in the ROM
rgbfix
ROM fixer that sets header values and checksums
rgbgfx
Graphics converter for PNG to Game Boy tile format
Version-Specific Features
The build system handles differences between versions:The disassembly maintains byte-perfect accuracy with the original ROMs, verified through SHA-1 checksums.
Next Steps
Game Boy Hardware
Learn about the Game Boy’s CPU, memory, and hardware
Memory Layout
Explore how RAM and variables are organized
ROM Structure
Understand how the ROM is organized
Bank System
Deep dive into ROM banking mechanics