Skip to main content
pokeemerald is a GBA decompilation of Pokémon Emerald. The repository separates C source, assembly stubs, binary assets, and build tooling into distinct directory trees.

Top-level layout

Directory reference

All game logic written in C, organized by subsystem. Over 300 .c files cover the battle engine, Pokémon data, overworld, UI screens, save system, and scripting.Key files:
Hand-written or not-yet-decompiled ARM Thumb assembly files (.s). Also contains asm/macros/ with .inc files that define the domain-specific assembly languages used in data/.
Binary and text data consumed by the C source.
All .h files. Two important sub-trees:
  • include/constants/ — numeric constant definitions: species.h, moves.h, items.h, flags.h, vars.h, abilities.h, maps.h, songs.h, battle.h
  • include/gba/ — GBA hardware register definitions and I/O macros (display, DMA, timers, interrupts)
include/global.h is the universal prelude. It pulls in the GBA headers, game type definitions, fixed-point math macros, and all constant headers.
PNG source images and precompiled binary tilesets. gbagfx converts these to .4bpp, .8bpp, and .bin files that are INCBIN-embedded into the ROM at build time.
MIDI song files (.mid) and raw audio samples. mid2agb and wav2agb convert these to the GBA m4a sound driver format during the build.
Custom tools compiled from C and invoked by the Makefile:

Build system

The Makefile at the repository root drives the entire build and targets the arm-none-eabi toolchain.
Produces a byte-for-byte identical ROM to the original Pokémon Emerald release.
Output: pokeemerald.gba (in the repository root)
Key Makefile variables:
The standard matching build requires the arm-none-eabi toolchain at a specific version. See the repository README for version requirements and setup instructions.

Linker scripts

Build output

The build/ directory is created automatically:
Add build/ to your editor’s file exclude list to prevent indexing thousands of generated object files.