The current URL is datacrystal.tcrf.net.
Pointer: Difference between revisions
(Fixed up some linked. Changed Hexadecimal and Endianness to point to Wikipedia, since they are not ROM hacking specific) |
GuyInSummers (talk | contribs) m (Reverted edit of AnyoneEB, changed back to last version by JeffMan) |
||
Line 1: | Line 1: | ||
A | A pointer is a number that refers to a specific location in a ROM. For example, if you wanted to reference the 155,387th byte of the ROM, the address would be 155387, or 0x25EFB. They may also be referred to as addresses or offsets. | ||
Some games, like Earthbound, use a slightly different way of addressing. In Earthbound's case, it ignores the first 512 bytes of the ROM, which is the header; thus, making the pointer have an actual value of 512 bytes less. As well, the pointers need to have 0xC00000 added to them to have the SNES read it properly. So, if we were going to reference the 155,387th byte of the ROM, you would subtract 512 and add 0xC00000, resulting in C25CFB. Finally, a dollar sign is added to the beginning of the pointer to show that it is a SNES pointer: $C25CFB. | |||
For most games, the pointers are stored in a reversed format. This catches many starters and can cause confusing situations. If we take our pointer from before, $C25CFB, each pair of numbers would be separated. This becomes C2 5C FB. Then, the order of the pairs are reversed. This results in FB 5C C2. Those are the bytes that would appear in a ROM that would point to $C25CFB. | |||
Revision as of 03:39, 21 September 2005
A pointer is a number that refers to a specific location in a ROM. For example, if you wanted to reference the 155,387th byte of the ROM, the address would be 155387, or 0x25EFB. They may also be referred to as addresses or offsets.
Some games, like Earthbound, use a slightly different way of addressing. In Earthbound's case, it ignores the first 512 bytes of the ROM, which is the header; thus, making the pointer have an actual value of 512 bytes less. As well, the pointers need to have 0xC00000 added to them to have the SNES read it properly. So, if we were going to reference the 155,387th byte of the ROM, you would subtract 512 and add 0xC00000, resulting in C25CFB. Finally, a dollar sign is added to the beginning of the pointer to show that it is a SNES pointer: $C25CFB.
For most games, the pointers are stored in a reversed format. This catches many starters and can cause confusing situations. If we take our pointer from before, $C25CFB, each pair of numbers would be separated. This becomes C2 5C FB. Then, the order of the pairs are reversed. This results in FB 5C C2. Those are the bytes that would appear in a ROM that would point to $C25CFB.