Top-level layout
Directory reference
src/ — C source files
src/ — C source files
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:asm/ — ARM assembly stubs
asm/ — ARM assembly stubs
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/.data/ — scripts, map data, tilesets, sound data
data/ — scripts, map data, tilesets, sound data
Binary and text data consumed by the C source.
include/ — C headers
include/ — C headers
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.hinclude/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.graphics/ — sprite sheets and tilemaps
graphics/ — sprite sheets and tilemaps
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.sound/ — MIDI songs
sound/ — MIDI songs
MIDI song files (
.mid) and raw audio samples. mid2agb and wav2agb convert these to the GBA m4a sound driver format during the build.tools/ — build tools
tools/ — build tools
Custom tools compiled from C and invoked by the Makefile:
Build system
TheMakefile at the repository root drives the entire build and targets the arm-none-eabi toolchain.
- Standard (matching) build
- Modern (non-matching) build
- Clean
Produces a byte-for-byte identical ROM to the original Pokémon Emerald release.Output:
pokeemerald.gba (in the repository root)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
Thebuild/ directory is created automatically: