Some documents out there don't make any sense whatsoever so I'm writing my own. This document is exclusively on Low-ROM SNES pointers and related. It is suggested that you become familiar with basic rom hacking before you read any further. If you begin to read this document and don't understand it, go back to the general rom hacking documents and re-read them.
What Is A Pointer?
A pointer is a string of hexadecimal numbers (usually 2 bytes) that tells the ROM to jump to a different place in the code. It is sort of like the GoTo command in Visual Basic, except not as easy as that. By changing the value of a pointer, you can change where the ROM looks for information, which can be very useful in hacking and translating games.
How Pointers Work
A pointer does just what its name means: it points to a certain location in the ROM and reads a string from that point until it reaches an end byte, telling it to stop reading. An example of this would be:
* * *
Stick[FF]Club[FF]Copper[FF]
The *
represents the pointer's reading location and FF
represents the end byte. Note that FF
will not always be the end byte in every rom. Also note that there might be more hex bytes between text blocks. A text block, in case you're wondering, is the text between the pointer and the end byte.
A Pointer usually points to the first letter of the first word in a text string. Lets say if the pointer were to point to the "o" on Copper rather than the "C", the game would read it as "opper", and skip over the C, leaving it unreadable. This possibly could give you an extra space to play with, allowing you to make some of your text blocks longer.
Finding a Pointer for ROM Text
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.
Physical SNES ROM Expansion
SNES ROMs are actually easy to expand. All you need to do it is open up any hex editor and make it bigger by adding the FF byte. Of course the space that you add HAS to be a multiple of 32KB, or $8000
hex bytes, or 1 bank.
Yet, the ROMs are usually more stable if you keep them at a multiple of 80,000 hex bytes. Below is a small chart that shows stable file sizes to keep your rom at (no header sizes):
Hex Offset | Megabytes |
---|---|
080000 | 0.5 |
100000 | 1.0 |
180000 | 1.5 |
200000 | 2.0 |
280000 | 2.5 |
300000 | 3.0 |
380000 | 3.5 |
400000 | 4.0 |
480000 | 4.5 |
500000 | 5.0 |
Ok, that's all for now until I feel like writing more. I hope this helps some people, only because I know how it is to read a romhack document, and then say to yourself, "Huh? I thought documents are supposed to help you learn, not confuse you." So, I bring you this short, yet understandable pointer document. With a little proper grammar, it makes things much more understandable. Good night!
Xcalibur's Pointer Document - Version 1.1 - © 2000 Excalibur Translations