Getting HexManiacAdvance to recognize extra pokemon added with PGE - haven1433/HexManiacAdvance GitHub Wiki

HexManiacAdvance does not know about changes that you make with other tools. But you can tell it! That's what the .toml file is for.

If your rom is called MyRom.gba and you've opened it with HMA, then you should be able to find a file next to it called MyRom.toml. It'll be in the same directory and have the same name, just with a different extension. That file stores all the metadata for your game: it's how HexManiacAdvance knows where to find all the tables, sprites, and constants.

How PGE Pokemon Expansion Works

By default, there are more pokemon sprites, icons, and footprints, than there are pokemon. This is to handle things like Unown having extra sprites, along with the special pokemon-that-isn't-a-pokemon: the egg. This can be confusing to work with, so PGE changes it so that the tables are the same length. You need to tell HMA about this change in relationship.

Since PGE moves the tables when expanding them, it might be best to start with a fresh .toml file. You can rename or delete your existing one and then open your rom with HMA to make it generate a new one. This new one should find all the names, sprites, and other data that PGE expanded / moved.

Edit the Relationship between sprites and pokemon

Look in your .toml file for all the places that mention data.pokemon.names+28 or data.pokemon.names+1. Here's an example of one:

[[NamedAnchors]]
Name = '''graphics.pokemon.sprites.front'''
Address = 0x2350AC
Format = '''[sprite<`lzs4x8x8`> uncompressedLength: index:]data.pokemon.names+28'''

You can see the data.pokemon.names+28 at the end of the Format line. Because of the changes from PGE, you want to strip off the +28. Do the same thing with each copy of data.pokemon.names+28 or data.pokemon.names+1 that you find:

[[NamedAnchors]]
Name = '''graphics.pokemon.sprites.front'''
Address = 0x2350AC
Format = '''[sprite<`lzs4x8x8`> uncompressedLength: index:]data.pokemon.names'''

Extend your number of pokemon

Look in your .toml file for this part:

[[NamedAnchors]]
Name = '''data.pokemon.names'''
Address = 0x245EE0
Format = '''[name""11]412'''

For this one, the format line should end in a number. By default, it's 412. Change that number to however many pokemon you have in your game. If you make it too small, not all your pokemon will show up correctly. If you make it too big, some metadata may get cleared due to overlaps. You can always backup your toml file if you're not sure. For example, if you have added 50 pokemon, then you have 412+50=462, so you would change it to:

[[NamedAnchors]]
Name = '''data.pokemon.names'''
Address = 0x245EE0
Format = '''[name""11]462'''

... And that's it! Your pokemon should show up correctly in HMA now.

Recap

  1. Open your rom's .toml file.
  2. Clear out the +28 and +1 that you see after any data.pokemon.names
  3. Change the length in the Format part of the data.pokemon.names NamedAnchor.
⚠️ **GitHub.com Fallback** ⚠️