Jump to content

Working with pointers on NES, SNES, and GENS!?


champ

Recommended Posts

Does anyone know how to work with pointers on all three systems listed above? (GENS docs are the hardest to find)

1. Finding Pointers

2. Changing Pointers

I'm starting to get how finding pointers for names and other in game text works but once you find the address how do you (for example) make a name longer?

I think a nice info post on this can help everyone that wants to not only edit Tecmo games that dont have managers but other games as well.

If someone can break this down I would really appreciate it.

Thanks

Link to comment
Share on other sites

well, for the snes, it's simple, and I'm sure it's similar for the nes.

You have your first pointer (2 bytes each). Swap the bytes. Read the next pointer, swap the bytes. Convert each to decimal and subtract, and your result is the length of the first string.

Continue on until the last pointer is read.

So, if you update a string, you have to go in and adjust the pointers to reflect these new lengths. If you look at the rom, there are a bunch of FF's after the string data. You can fill up to the end of the FF's with data. Each string must be < = 16 in length (right?).

That's the brief overview...

Link to comment
Share on other sites

well, for the snes, it's simple, and I'm sure it's similar for the nes.

You have your first pointer (2 bytes each). Swap the bytes. Read the next pointer, swap the bytes. Convert each to decimal and subtract, and your result is the length of the first string.

Continue on until the last pointer is read.

So, if you update a string, you have to go in and adjust the pointers to reflect these new lengths. If you look at the rom, there are a bunch of FF's after the string data. You can fill up to the end of the FF's with data. Each string must be < = 16 in length (right?).

That's the brief overview...

==========

Finding a Pointer for ROM Text (Xcalibur's Pointer Document)

==========

Now, before you are able to find a pointer, you must know that

the header for an SNES rom is 200 hex bytes. This is very

important, as you will see. A header, in case you're wondering,

is the first 200 hex bytes of the ROM.

Now, to find a pointer for text in your rom, it is necessary that

you know where the text is in the rom and what hex signifies the

end byte. By knowing these you can then find the beginning of the

text block. Once you've found the beginning of the text block,

take an offset reading. An example would be 02A840. Now, subtract

the header from the offset. 02A840 - 200 = 02A640. Now take off

the first two left digits, which should give you A640. Now split

them into two hex bytes and reverse them, giving you 40A6. 40A6

is your pointer. Search the rom for 40A6 until you find what looks

like a pointer table. It should be the many pointers together;

repeating last two digits (A6) with increasing first two digits.

(40, 4A, 4F, 57, etc.) It makes sense if you think about it.

Note: The last two digits MAY be different. The first two digits

are always the same as the offset, but if you have a wicked rom,

the last two may be different, and you'll have to figure it out

yourself.

Now, all pointers, before you switch bytes, MUST be between 8000

and FFFF hex bytes. An example would be 016438. Let's say you do

all the work up to 6238. Uh oh, it's less than 8000. So, just add

8000 to it. 6238 + 8000 = E238. Now switch the two bytes to get

38E2. 38E2 is the pointer to search for.

There are plenty of documents on finding pointers like that one but after finding the pointer what is the process of changing it? (switching bites) Like your post most documents on this are vague. There are also no documents on Genesis roms. At least I haven't been able to find any.

Link to comment
Share on other sites

Take the original snes rom:

Team name pointers start at x7000

First two pointers:

x3CF0 x4FF0

Swap the bytes and you get:

xF03C xF04F

Subtract xF04F - xF03C and you get 19. That means the first string is 19 characters long.

If you were to change it to something say 15 characters long, you'd need to take the first pointer (xF03C) and add 15, and you get: xF04B. That's your second pointer. Swap the bytes back and write this back to the rom.

So after all that, your first two pointers are:

x3CF0 x4BF0

Link to comment
Share on other sites

Also, if this wasn't obvious, when you change one pointer, you'll have to change all the pointers after it as well. Considering if you change one, it'll affect all the lengths of strings after it.

Also, for the team name example I gave, if you have 28 teams, you'll have 29 pointers...pointer 28 & 29 will determine the length for team 28...

Link to comment
Share on other sites

Tecmo Turd prolly answered your question ok. I just wanted to add that pointers are just the modified offset of the start of the text. So you'd change it to reflect the new offset of the start of each text string.

BILLSDOLPHINS

so B is the first pointer and D is the second.

Did you read the mad hackers pointer doc

Its for nes, but pointers work the same for snes and prolly genesis.

snes is easier than nes from my experience because you usually dont have to subtract x000.

I posted the links because it kinda drives me nuts to ask hacking questions on a tecmo super bowl forum vs a hacking forum. (no offense, a lot of people do it) There are only a few people around here who can answer hacking questions.

Link to comment
Share on other sites

Also, I know with the player names, you have until the end of the FF's for the actual player names (not the pointers, the strings themselves) so if you go under the amount of the original, you need to fill in with FF's, and if you go over, you are safe until you get to the end of the FF's.

I only just learned about the team names/cities and their pointers after doing a hex compare of a before and after TSBM2000 changed the names of a team...not quite sure if it works the same way for team names because at the end of that table is AFC AFC NFC NFC (not sure what is what), and then a bunch of FF's. I guess I could tell by subtracting the next pointer after that and see if it's 3 characters long, and if so, that means the AFC NFC text is controlled by pointers as well, and then the remaining spots would be filled with FF's just as in the player name example. Anyone know the answer to that?

Link to comment
Share on other sites

Thanks for the help.

After reading responses here and all the info on pointers that I can find I can now find

location of pointers in NES, and SNES. (still not GENS)

I'm also starting to get how changing pointers works. ( I think )

Did I get this right: After you find the location of the pointer you just need to add or subtract the number to get the length you need.

ex. 3CFO + 4 = 40F4

???

*** I have asked about pointers on rom hacking sites before and they just give you a link to a document. Problem is that most documents just cover finding the pointers and not how to change them. Guess they assume that everyone already knows how to change them.

Link to comment
Share on other sites

No problem man...if you run into trouble, find me on IM, I'd be glad to help. I owe a lot of service to this community who have helped me out so much when I was just starting out...

P.S. If you need a reference for SNES, I have shared my google notebook on SNES hacking...

http://www.google.com/notebook/public/0 ... oQqJ6WzoIj

Some pieces aren't organized right because they were written down fast and filed to be organized later...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...