Pointers and Anchors - haven1433/HexManiacAdvance GitHub Wiki

One of the main features of Hex Maniac Advance is the ability to detect and render pointers in the data. It can also mark the locations being pointed to (called anchors).

Pointers

What is a Pointer?

Sometimes, the game will need to reference data in another location. It does this by using 4 bytes to describe the address where the other data is stored.

Example

00 AB 12 08 might be a pointer that points to address 12AB00. Notice two things about the pointer:

  • The 3 address bytes are reversed.
  • A 4th byte, 08, is added to the end.

A pointer can also end with 09 if the ROM is more than 16 MB. ROM addressess after 0xFFFFFF will have corresponding pointers end with 09.

What do they look like?

When HMA recognizes a pointer, it will write the address that it points to in blue, surrounded by <> angle braces. This keeps you from having to mentally flip the bytes.

Sometimes, a pointer will have a name in it instead of an address. That means it points to an anchor with a unique name.

How do I use them?

You can Ctrl+Click or double-click on a pointer to automatically follow it to its destination anchor. Or you can Right-Click on it for more options.

How do I add one?

If you see 4 bytes that you think is a pointer, select all 4 bytes and then type <>. Doing so will make HMA reinterpret the bytes as a pointer.

If you want to add a new pointer, just type the address you want it to point to surrounded by angle braces. For example, you could type <123456>.

Anchors

What is an Anchor?

An anchor is a location in the ROM that is pointed to by something else. An anchor can also store meta-data that lets HMA provide an improved editing experience, such as a name and a format.

Example

While editing a Pokemon ROM, choose "Edit -> Goto", then type in data.pokemon.names. The editor will automatically jump to a list of names of all the pokemon. Just above, the data, you should see something like:

^data.pokemon.names[name""11]412

This is the anchor. Whenever you click on a ^ in the data, you'll see information about the anchor in the row above the data.

What do they look like?

When HMA recognizes an anchor, it will place a ^ in the data at the location being pointed to. This keeps you from having to mentally recall where blocks of data start.

Remember, each pointer will point to a single anchor, but a single anchor may have many pointers leading to it.

How do I use them?

You can Right-Click on an anchor to list the pointers leading to it. If there are many pointers, you'll also have the option to open a new tab with a summary of all of them and the surrounding data.

How do I add one?

Select any byte in the data, then type ^, followed by a name and optionally a format. If you enter a format, HMA will automatically try to re-interpret the current data using that format. For example, if you see bytes that you think are text, try clicking on it and typing something like:

^myNewText""

And then hit space to commit the anchor. If the data can be interpreted as text, you'll see the change immediately. If it can't, HMA will display an error.

For more information about adding new anchors with formats, see the Formats page.

⚠️ **GitHub.com Fallback** ⚠️