Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Pointer: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
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.
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 [[Category:Earthbound|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.
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.
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 19:02, 17 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.