• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[ASM & Hex] FireRed string repointing, how to 100% identify a string pointer

7
Posts
5
Years
  • Age 39
  • Seen Jan 2, 2019
Hello,

I am working on a translation of FireRed to Dutch.

Initially I used AdvanceText for this, but this cause my rom to get corrupted after a while, now I have written my own toolchain and I do encounter the same issues I have with AdvanceText.

What I think is happening is that text at position AABBCC that has pointer CCBBAA08 just happens to have a pointer value that also occurs in other places where it is NOT a pointer to that specific string, but just data/code that happens to look like a pointer.

For example:
mf5gvls.png

(Column Ref# is number of references found in rom to that specific string start address)

While I can imagine the word EXIT is referenced in 64 places, I find it really hard to believe that that one line about being comfy in a KANGASKHAN's belly pouch is referenced in 67 places.

so I think the byte sequence 48 09 18 08 just happens to occur in 67 places, but only one or two of those are actual references to this piece of text, and the other 65 are probably code. If I would then make this text too long to fit in the original place and it needed repointing I would change the correct pointer to the new address, but also change 65 sequences of 4 bytes that are wholly unrelated. Logically the game itself is not entirely happy about this.

Now of course this assumption might be wrong, but I had an issue this morning that I "fixed" by just shifting the offset of my new string locations by 2 bytes. This probably means I am horribly breaking other bits of code in subtle ways. In a way it surprises me that, if my assumption is correct, the game even works at all being abused like this.


My main question is, how do I determine which sequence of 48 09 18 08 is an actual pointer to that string, and which sequence of those bytes just happens to look like that.

Is it alignment ? (I did try looking at word and halfword alignments but this misses a whole lot of real string pointers)

Are there regions of the rom that never contain string pointers, or are the regions that only contain the string pointers?

I am sorry if this is rather naïve of a question. I am a decent C# developer, but not that well versed in ASM.

For reference, this is the Project URL: https://github.com/boranblok/PokemonFireRed_Dutch/
This is an ips file where I have the crash issue (happens as soon as you enter a pokemon fight)

And this is the "fixed" version where I just modified some translation bits, and moved my new pointers to 0x8000000 instead of 0x71A300
 
Back
Top