+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  GBA Pointers
Pages: [1]
Author Topic: GBA Pointers  (Read 1 times)
SerenadeDS
Guest
« on: April 28, 2008, 07:59:57 pm »

I've been looking around google and other various places, but can't seem to find any documents or info about GBA pointers. I was just wondering if anyone knows any information or any docs that could help.

Thanks  Wink
Ryusui
Guest
« Reply #1 on: April 28, 2008, 08:07:58 pm »

The beautiful thing about GBA pointers is that there's really nothing to say about them. Just add $8000000 to the ROM address and you have the GBA address. 32-bit addressing...it's a beautiful thing. :3
SerenadeDS
Guest
« Reply #2 on: April 28, 2008, 08:13:55 pm »

Yeah.. but what about things like re-pointing text? Would it be the same as GB?
« Last Edit: July 23, 2008, 06:16:25 pm by SerenadeDS »
KingMike
Guest
« Reply #3 on: April 28, 2008, 08:24:47 pm »

Never messed with GBA, but I've been told with pointers on GBA all you have to do is add $08000000 to the address, split it into bytes ($08123456 -> 08 12 34 56) and look for them in reverse order (56 34 12 08).
Ryusui
Guest
« Reply #4 on: April 28, 2008, 08:44:46 pm »

Yeah, repointing text is easy. No fancy bank math required. All you have to do is add the GBA's memory offset for ROM (again, $8000000), which generally means you just have to take the ROM address, pad it with zeros until you have six digits, then slap an "08" at the beginning. If the ROM address is $8417, then the GBA address is $08008417. If it's $245938, then it's $08245938. $42, $08000042. And so on. But like KingMike said, GBA pointers are little-endian, so the bytes are stored in reverse order: that second example would be stored as $38592408, for instance.

This is, however, all assuming that pointers are 32-bit. If they're 16-bit, then you have only the 16-bit address space from the start of the text to work with, which either means you cut your script to fit, or learn ASM to either implement compression or make the game read 32-bit pointers.
SerenadeDS
Guest
« Reply #5 on: April 28, 2008, 08:54:36 pm »

Ah.. Thanks for your help Ryusui and KingMike.
« Last Edit: July 23, 2008, 06:17:16 pm by SerenadeDS »
creaothceann
Guest
« Reply #6 on: April 29, 2008, 02:04:49 am »

Quote from: Ryusui on April 28, 2008, 08:44:46 pm
GBA pointers are little-endian, so the bytes are stored in reverse order

Stored in normal order (lower bytes = lower addresses etc.), displayed in our human reverse-order format.
[/pet] [/peeve]
Ryusui
Guest
« Reply #7 on: April 29, 2008, 03:37:31 am »

Yeah...forgot to mention that. ^_^;
MathOnNapkins
Guest
« Reply #8 on: April 29, 2008, 07:15:29 am »

If the most significant byte is always 08 wouldn't that mean GBA games are limited to 16 megabytes? I could have sworn that there were GBA games larger than that.
KaioShin
Guest
« Reply #9 on: April 29, 2008, 08:53:52 am »

Quote from: MathOnNapkins on April 29, 2008, 07:15:29 am
If the most significant byte is always 08 wouldn't that mean GBA games are limited to 16 megabytes? I could have sworn that there were GBA games larger than that.

You can go into the 09xxxxxx ranges too. 32MB is the max ROM size for GBA.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC