News: 11 March 2016 - Forum Rules

Author Topic: My Problems with Pointers (SNES HiROM)  (Read 1573 times)

brianblakely

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
My Problems with Pointers (SNES HiROM)
« on: August 06, 2016, 01:30:32 pm »
GAME: Slap Stick (Japan)

I'm attempting to discover the pointer tables for in-game text, and so I wrote a pointer sniffer.

Via the sniffer I found a table whose first pointer seems to be $3DC5 at offset 01C4FD.  So, I went to offset 01C53D to see what was there. To my surprise, it contained not data, but another pointer. More strangely, that pointer is... $00003DC5.

The pointer points to a pointer with an almost identical signature?  What's going on?

Thanks

August 06, 2016, 01:41:44 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
More info:

The table seems to be divided into two sections.  The first section is a bunch of 16-bit pointers. They point to a very similar set of what look like 32-bit pointers, and I don't know what those point to.

It takes this form:

16-bit pointers - XXXX YYYY ZZZZ WWWW UUUU

Their corresponding 32-bit entries - 0000XXXX 0100YYYY FFFFZZZZ 0200WWWW FEFFUUUU

In the 32-bit section, the first 16 bits are actual values from the ROM.  It actually follows that pattern of alternating increments from 0000 and decrements from FFFF for a little while.  Then, those bytes switch to a format that isn't as simple to discern.
« Last Edit: August 06, 2016, 01:42:36 pm by brianblakely »

jonk

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: My Problems with Pointers (SNES HiROM)
« Reply #1 on: August 06, 2016, 03:11:01 pm »
Via the sniffer I found a table whose first pointer seems to be $3DC5 at offset 01C4FD.  So, I went to offset 01C53D to see what was there.
Just to help clarify things for me, is it the case that you found $3D at address $01C4FD and that you found $C5 at address $01C4FE? Or the other way around? I can't tell from your writing. What I can tell is that you found a word value that includes $3D and $C5. But not which addresses held which byte values. Just as an aside, did you consider the thought that it may be $013DC5 you need to check? I ask these things not to imply you don't know what you are doing -- because you probably do and it's my problem understanding your wording only. I just want to make sure, is all.
An equal right to an opinion isn't a right to an equal opinion. -- 1995, me
Saying religion is the source of morality is like saying a squirrel is the source of acorns.  -- 2002, me

brianblakely

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Re: My Problems with Pointers (SNES HiROM)
« Reply #2 on: August 09, 2016, 03:49:14 am »
Thanks for replying.

You read it right, and yes I interpreted the pointer as a little-endian reference.

I abandoned that particular investigation for now, but would still like to understand what is happening there.

jonk

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: My Problems with Pointers (SNES HiROM)
« Reply #3 on: August 09, 2016, 01:56:08 pm »
Well, I'm still a little confused about exactly what you are seeing. It's not just the table value but also the RAM value, but I guess you'd have to copy in a lot more stuff here to satisfy my desire for details. But I do gather that you know what you are doing regarding the interpretation of pointer values. They are little endian, usually, unless the software re-orders them manually first for some crazy reason. (I would not expect that, of course. But sometimes people do nutty things.) If you do get back into this, perhaps we could continue then.

An equal right to an opinion isn't a right to an equal opinion. -- 1995, me
Saying religion is the source of morality is like saying a squirrel is the source of acorns.  -- 2002, me