Conversation Between miksy91 and hinkage
Showing Visitor Messages 41 to 50 of 60
-
That's not what I want (I don't think).
What I mean is, if offset 0x8123456 has 0xF bytes, will offset 0x9123456 also have 0xF bytes?
-
-
So would the 0x8XXXXXX offset have the same number of bytes as the 0x9XXXXXX offset?
-
As an example, I dug up an existing script of a bug catcher in viridian forest.
#org 0x1605CD
trainerbattle 0x0 0x214 0x0 0x81724F9 0x817251B
msgbox 0x8172527 0x6 '"BUG POKéMON evolve quickly.\nThey'..."
end
#org 0x1724F9
= Did you know that POKéMON evolve?
For example that "0x81724F9" you see in the "trainerbattle" command actually calls for an asm routine to display text through a 4-byte pointer. The pointer in rom looks like this: F9 24 17 08 and so points to the ram address shown in the code 0x81724F9. The rom address then again is 0x1724F9 (as I pointed out in that other message, you can basically decrease 0x8000000 from the pointer to form the rom address it points to).
If we wanted to point to 0x1012345 (ROM) instead, we'd have to add 0x8000000 to it to get 0x9012345 (the form you'd write the pointer in code) (or translated into how it's shown in the game: 45 23 01 09).
-
How I could do that while also making sure I only use offsets greater than 0x8E3CF64?
-
Don't use dynamic pointers then, it's easy enough to do all the repointing manually if you even have a simple idea of how big your script is going to be.
-
Hm... Actually when I tried #dynamic 0x9000000, it just assigns everything to offset 0x10000001
What the helllllllllll
-
No problem, nice to hear you got it working!
-
-
You were missing one 0 from the end but yeah, 0x9000000 should work although I've never scripted with 3rd gen games before.
But the reason for that is because the end of 16MB rom is at 0xFFFFFF which corresponds to ram address 0x8FFFFFF. The expanded 16MB rom is between offsets 0x1000000 and 0x1FFFFFF (which correspond to ram area 0x9000000-0x9FFFFFF).
What you can see by this is that the pointers point to ram, not rom data.
If you'd like to call something from WRAM for instance during a script, you'd set the fourth byte of the gba pointer to 02 (because WRAM is between 0x2000000-0x2FFFFFF).