News: 11 March 2016 - Forum Rules

Author Topic: Finding 2 tile characters in a rom  (Read 2722 times)

jobless_floppy

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
Finding 2 tile characters in a rom
« on: August 27, 2014, 05:28:42 pm »
So I'm messing around with Gokinjo Boukentai in No$sns, when dialogue is displayed I can see the font in vram:

Each character is 2 tiles, how do I go about finding text in the rom? What would be the best way to find out how the text is stored? Because it's 2 tiles would the top tiles be listed first? or like the complete character one after another?

Also if the text is compressed, how should I go about figuring out what kind of compression it uses?

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: Finding 2 tile characters in a rom
« Reply #1 on: August 28, 2014, 01:43:41 pm »
Are you sure that you see 2 tiles because they are physically encoded as 2 images, or could it be that the emulator shows you tiles with a "default" size it chose (say 8*8 pixels) instead of what the program assumes (8*16 pixels)?

For finding text: it doesn't matter that it's on 2 vertical tiles. What matters is the order of the letters. So do as if there was one 8*16 pixels tile per letter, and you didn't have this problem. ;)
Edit: More background on the logic behind this: When you see these kinds of things, always think about how you would go about coding a program that uses this piece of data. In this case, you'd probably still encode a letter with a number, and then do some calculations with the number to find the tiles to use.

About encryption: you cry, you suffer. There's no generic rule for all cases.
Edit: Going a bit further on this:
- you look for text as if it was not encrypted. If it works, you are happy and you run naked around your place shouting about how life is good. (or not)
- if you don't, find it, try again a couple of times with different approaches. I mean - don't give up right away because you used RSearch. Search for different words. Assume a couple of orders.
- if you don't find it, there are 2 approaches usually: either you try to see how the code behaves, or you try to interpret the data. Or a bit of both.
To see how code behaves, you need ASM understanding. You need to find where it displays text (or uses the textures you posted), and work backwards from there to see how it chose the tiles, and from there how it calculated numbers that allowed to choose tiles, etc.
To interpret the data, you need to find where it is (which is the tricky part) and then see if you understand how it is organized. This link could be useful, maybe: http://zenhax.com/viewtopic.php?f=4&t=27

Again: don't look for encryption where it is not. Assume luck, be persistent. ;)

Good luck in your endeavors!
« Last Edit: August 28, 2014, 01:51:06 pm by BlackDog61 »

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3536
    • View Profile
    • Aeon Genesis
Re: Finding 2 tile characters in a rom
« Reply #2 on: August 28, 2014, 02:04:47 pm »
Are you sure that you see 2 tiles because they are physically encoded as 2 images, or could it be that the emulator shows you tiles with a "default" size it chose (say 8*8 pixels) instead of what the program assumes (8*16 pixels)?

No, he's correct. In SNES-land you can have 8x8 tiles and *occasionally* 16x16 tiles but you can't have 8x16 tiles.

To find the text you could potentially relative search the way everyone used to, or you could use a debugger to figure out where the text is getting tilemapped to in VRAM, search backwards to find that in RAM, then look through a trace log to find out when the game writes to the tilemap and where it gets the values to write. Look back enough steps and you'll have found your text.

naxis

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Re: Finding 2 tile characters in a rom
« Reply #3 on: August 31, 2014, 03:04:30 am »
Gideon, what do you mean when you say "search backwards to find that in RAM?"

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Finding 2 tile characters in a rom
« Reply #4 on: August 31, 2014, 06:16:25 am »
It is rather simple. First you go for a known point (the tilemap) and then you find what code writes to that. Then you check if that's the actual source of the data. If not, then you need to find where that code reads from and repeat from there.