News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Alternate GBC pointer formats?  (Read 2202 times)

USC

  • Submission Reviewer
  • Sr. Member
  • *****
  • Posts: 304
  • Obviously Outdated
    • View Profile
Alternate GBC pointer formats?
« on: November 27, 2019, 10:38:10 am »
Hello all! I've been playing around with translating Soul Getter for the GBC:


I've got the texting encoding and control characters figured out, found the dialogue blocks, and coded a script extractor. But I haven't been able to find the pointer tables with my usual methods. I was hoping someone could check my work and see what I'm missing.

The first two lines of dialogue in the game start at 0x121AFE and 0x121B11 (there are other lines before it in the ROM file, but these are the first you see in the game). That would make the pointer values FE 5A and 11 5B, correct? There's only two places in the ROM with 11 5B next to each other (0x10EC70 and 0x1098E), and neither have FE 5A anywhere near it.
Further more, the next line of dialogue 0x121B23's pointer value (23 5B) doesn't seem to exist at all in the ROM.

I then checked to see if it was more of a block-based pointer (so it links to the first line of dialogue and then just reads forward). I moved the second sentence's starting point earlier, but the game still read from 0x121B11. I suppose the pointer

Any thoughts? I'm probably missing something really obvious.




Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3532
    • View Profile
    • Aeon Genesis
Re: Alternate GBC pointer formats?
« Reply #1 on: November 27, 2019, 03:18:01 pm »
Did you look immediately before the text block? Sometimes pointers are relative to the start of the block (i.e. the pointer to 121AFE might be 0, while the pointer to 121B11 would be 0x13. The trick is finding the offset value for that first pointer. You could do a relative search for 0, 0x13, etc.

Cyneprepou4uk

  • Hero Member
  • *****
  • Posts: 573
  • I am the baldest romhacker
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #2 on: November 27, 2019, 10:46:24 pm »
Try searching only low or high bytes in case they are located in separate tables. Like FE 11 23 or 5A 5B 5B.

Anyway pointers are usually hanging right before the text like Gideon said, try to corrupt some bytes upstairs if nothing else works. Or how about using a debugger maybe?
iromhacker.ru - NES ROM hacking tutorials for beginners. Please use Google Translate browser extension

USC

  • Submission Reviewer
  • Sr. Member
  • *****
  • Posts: 304
  • Obviously Outdated
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #3 on: November 28, 2019, 07:19:56 am »
Gideon Zhi and Cyneprepou4uk: Those are all great ideas - thanks! I guess I just got tunnel vision with assuming GBC pointers are always the same (though they usually are). I'll see if I can figure this out.

danke

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 2067
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #4 on: November 28, 2019, 11:35:45 am »

I might be able to help. Been working on the game for a while. :thumbsup:

USC

  • Submission Reviewer
  • Sr. Member
  • *****
  • Posts: 304
  • Obviously Outdated
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #5 on: November 28, 2019, 02:09:51 pm »
Danke: Ah, I see! Well, I don't mean to snipe it if you're already working on Soul Getter. I'm still interested in figuring out the pointer system though, just in case I run across it on another GBC ROM.

danke

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 2067
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #6 on: November 28, 2019, 02:20:36 pm »
So the pointer to the first line ($121AFE) is at $120F27. Basically, the pointers are essentially scripted in in a custom event system, preceded by 0xC7s.

USC

  • Submission Reviewer
  • Sr. Member
  • *****
  • Posts: 304
  • Obviously Outdated
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #7 on: November 28, 2019, 02:44:55 pm »
Hmm. The pointer value is EE 1A - so instead of adding 0x40 to the middle byte, they subtracted 0x10 from the last byte. That's strange - I wonder what the rationale was?
Thanks for sharing, and good luck on the translation!

danke

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 2067
    • View Profile
Re: Alternate GBC pointer formats?
« Reply #8 on: November 28, 2019, 11:11:04 pm »
They choose 0x10 because, for whatever reason, they choose to dedicate the first 0x10 bytes of each bank as a label/header. This is not a common practice.