Decompilation of Pokémon Emerald
Go to file
2025-06-24 20:39:12 -04:00
.github Merge remote-tracking branch 'upstream/master' into followers 2025-02-10 00:11:38 -05:00
asm Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
constants Add include guards for assembly constants files 2023-09-03 20:57:54 -04:00
data Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
docs Cleaned trailing whitespace 2022-09-11 14:14:49 -04:00
graphics Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
include Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
libagbsyscall Fix $(AR) define, remove \u warns on macOS. 2021-01-04 11:35:59 -05:00
sound Align gMPlayTrack_BGM 2025-04-01 00:31:38 +02:00
src Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
tools Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
.git-blame-ignore-revs Added .git-blame-ignore-revs to hide whitespace-only changes from blame. 2024-02-15 23:06:05 -05:00
.gitattributes Add missing files to .gitattributes. 2020-11-08 20:13:21 -05:00
.gitignore Merge remote-tracking branch 'upstream/master' into followers 2025-02-10 00:11:38 -05:00
asmdiff.ps1 Remove debug printing 2019-04-07 19:18:42 -05:00
asmdiff.sh Don't assume bash is at /bin/bash 2024-05-29 19:32:17 -04:00
audio_rules.mk Add missing terminal newlines 2024-08-31 00:53:23 -04:00
build_tools.sh Update deprecated build_tools script 2019-08-27 09:15:44 -04:00
charmap.txt Review changes 2023-03-05 17:17:39 -03:00
compile_flags.txt Added clangd compile flags & updated .gitignore. 2022-09-10 21:22:37 -04:00
extract_sprites.py Added Mr. Mime & Farfetch'd. Fixed transparency issues. 2021-03-03 01:48:45 -05:00
follower_emotions.py Added system for conditional follower messages. 2022-05-03 23:01:02 -04:00
front_palette.py Modified front palette script. 2021-03-03 02:00:36 -05:00
graphics_file_rules.mk Fixes for Mirage Tower graphics (#2120) 2025-04-14 08:12:45 +02:00
INSTALL.md Update INSTALL.md to state that Windows 8 is no longer supported by Microsoft 2024-09-10 23:36:13 -04:00
json_data_rules.mk Generate heal location constants automatically, move data back to a single file. 2025-02-03 20:25:11 -05:00
ld_script_modern.ld Get rid of common syms (#2040) 2024-10-14 23:52:11 -04:00
ld_script.ld Merge remote-tracking branch 'upstream/master' into followers 2025-02-10 00:11:38 -05:00
make_tools.mk Merge branch 'master' of https://github.com/pret/pokeemerald into build-makefile-cleanup 2024-08-31 00:17:07 -04:00
Makefile Merge remote-tracking branch 'upstream/master' into followers 2025-06-24 20:39:12 -04:00
map_data_rules.mk Generate heal location constants automatically, move data back to a single file. 2025-02-03 20:25:11 -05:00
palette.py Fixed follower not disappearing when surfing. 2021-03-03 01:33:13 -05:00
README.md meta: updated README with new config settings 2024-12-30 21:38:18 -05:00
remote_build.sh meta: remote_build no longer untracks new files after build 2024-10-12 12:19:42 -04:00
rom.sha1 Make rom.sha1 lowercase to fix erroneous comparison results on *nix 2017-09-06 09:20:49 -04:00
spritesheet_rules.mk refactor: code review for expansion 2024-05-17 20:45:32 -04:00
sym_bss.txt remove gflib 2024-09-18 10:37:34 -04:00
sym_common.txt Remove explicit symbol sizes in sym_common.txt 2024-09-25 16:14:10 -04:00
sym_ewram.txt remove gflib 2024-09-18 10:37:34 -04:00

Pokémon Emerald

This is a fork of the matching decompilation at PRET.

This fork tries to maintain vanilla compatibility whenever possible. It doesn't increase the size of any save data structure or the object event structure.

There are several branches, each with one main feature (and sometimes some extra stuff):

followers branch:

  • HGSS-style pokémon followers for all 386 pokémon (including forms & shinies)
  • Includes follower emotes and a majority of the HGSS messages
  • Custom pokeball sprites for Gen 1-7 pokéballs
  • Followers can use field moves in the overworld
  • Overworld form changes for Ditto, Mew, Castform, etc.
  • Asymmetrical & 64x64 OW support
  • Dynamic Overworld Palette System (DOWP) & reflections compatible with berry trees, etc.

Note: Unless you have a specific need for it, you should probably use followers-expanded-id over this.

Pokeball Messages Forms HM

icons branch:

  • Everything from the followers branch.
  • All pokemon icons updated to Gen 6, based on this repo
  • This includes compatibility with the PC, trade, contests, mail, Battle Dome. Examples: PC Party Contest
  • Icons share palettes with front sprites, meaning that shiny pokemon will also have shiny icons!

lighting branch:

  • Everything from the followers branch.
  • Day/night shading compatible with weather.
  • GSC-style window lights.
  • WIP interframe-blended lamp lights at night, i.e in Rustboro.
  • HGSS-style alpha-blended shadows for object events.

just-lighting branch:

  • lighting-expanded-id but with following pokémon code & assets completely removed. (This allows for more than 255 OW graphics)
  • Saves with following pokémon can still safely be loaded.

followers-expanded-id branch:

  • Like followers, but includes expands OW graphicsIds to 16-bits in a backwards compatible way
  • Includes support for compressed OW graphics

Additional branches to mention:

  • lighting-expanded-id - like the above but for lighting.

To set up the repository, see INSTALL.md.

guillotine branch:

  • Decapitates Decapitalizes all text at runtime, with some exceptions (see the FAQ)
  • Future-proof, does not require mass-replacing strings

To set up the repository, see INSTALL.md.

FAQ

(followers*) Q: Where are the config settings?

A: Configuration for the follower system is mostly in event_objects.h:

// If true, follower pokemon will bob up and down
// during their idle & walking animations
#define OW_MON_BOBBING  TRUE

// If true, adds a small amount of overhead
// to OW code so that large (48x48, 64x64) OWs
// will display correctly under bridges, etc.
#define LARGE_OW_SUPPORT TRUE

// Followers will emerge from the pokeball they are stored in,
// instead of a normal pokeball
#define OW_MON_POKEBALLS TRUE

// New/old handling for followers during scripts;
// TRUE: Script collisions hide follower, FLAG_SAFE_FOLLOWER_MOVEMENT on by default
// (scripted player movement moves follower too!)
// FALSE: Script collisions unhandled, FLAG_SAFE_FOLLOWER_MOVEMENT off by default
#define OW_MON_SCRIPT_MOVEMENT TRUE

// If set, the only pokemon allowed to follow you
// will be those matching species, met location,
// and/or met level;
// These accept vars, too: VAR_TEMP_1, etc
#define OW_MON_ALLOWED_SPECIES (0)
#define OW_MON_ALLOWED_MET_LVL (0)
#define OW_MON_ALLOWED_MET_LOC (0)

(lighting) Q: How do I mark certain colors in a palette as light-blended?

A: Create a .pla file in the same folder as the .pal with the same name.

In this file you can enter color indices [0,15] on separate lines to mark those colors as being light-blended, i.e:

06.pla:

# A comment
0 # if color 0 is listed, uses it to blend with instead of the default!
1
9
10

You might have to make mostlyclean or change the .pal file to pick up the changes.

(guillotine) Q: How can I keep my string(s) from being decapped?

A: There are a number of ways to make a string "fixed case" so that it will not be decapitalized when displayed:

C strings: Replace the _ with _C:

// _C = fixed (C)ase string!
const u8 gText_IDNumber[] = _C("IDNo.");

ASM strings: Replace .string with .fixstr:

gText_SavingDontTurnOff::
    @ Lasts until the string terminator '$'
	.fixstr "SAVING…\n"
	.string "DON'T TURN OFF THE POWER.$"

You can fix-case/unfix parts of a string like so:

	.string "{FIXED_CASE}WARNING!{UNFIX_CASE}\p"

For a placeholder (only the placeholder will be fixed-case):

	.string "{STR_VAR_2_FIXED} was transferred to\n"
	.string "BOX “{STR_VAR_1}.”$"

See also the configuration in text.h.

There's also special handling for "separated bigrams"; basically, two letter words. This includes: "TM01", "PC", "EV", any two uppercase characters surrounded by digits, whitespace, or the start/end of a string. These will not be decapped.

See also

For contacts and other pret projects, see pret.github.io.