Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pret/pokeemerald/llms.txt
Use this file to discover all available pages before exploring further.
Default build
From thepokeemerald directory, run:
pokeemerald.gba will be produced in the project folder.
The default build uses agbcc — the custom GBA C compiler originally used by Game Freak — which is required to produce output that is byte-identical to the original retail ROM. The modern build (described below) uses the system
arm-none-eabi-gcc and produces a functionally equivalent but not byte-identical ROM.Parallel builds
Building with multiple CPU cores significantly reduces compile times. First, get your core count:- Linux / WSL
- macOS
make -j:
4 with the number returned by your core-count command.
Verify against the original
To confirm your build is byte-identical to the original Pokémon Emerald ROM, run:Modern compiler build
This project also supports thearm-none-eabi-gcc compiler included with devkitARM. If devkitARM is installed, run:
pokeemerald_modern.gba. Build output is placed in build/modern/ instead of build/emerald/.
Debug build
To build with debug symbols under a modern toolchain:pokeemerald_modern.elf with full debug symbols attached. Debug symbols are included by default in non-modern builds without needing DINFO=1.
Custom toolchain
To build using a toolchain other than devkitARM, override theTOOLCHAIN variable with the path to your toolchain. The path must contain a bin/ subdirectory:
To use a custom toolchain for the
modern target, the toolchain directory must also contain lib/, include/, and arm-none-eabi/ subdirectories.Build output
| Directory | Contents |
|---|---|
build/emerald/ | Object files for the default (agbcc) build |
build/modern/ | Object files for the modern (arm-none-eabi-gcc) build |
Switching terminals on Windows
If you switch terminals between builds (for example, from msys2 to WSL1), you must run the following command once before any subsequentmake invocations:
Preserving intermediate files
By default, intermediate files (.i preprocessed sources and .s assembly files) are deleted after compilation. To keep them for inspection, set KEEP_TEMPS=1:
build/ directory.