Post subject: Memory adresses changing every level?
Joined: 3/28/2009
Posts: 6
Hi, I've been searching for a memory adress that shows my character's movement speed in "Star Wars Trilogy - Apprentice of the Force (U) (M3)" for GBA. I did find an adress for speed in the very first level and went with it, until I discovered that in the second level, that same adress was showing something completely different! Is this normal behaviour? Is it possible to find a memory adress that keeps track of my movement speed, regardless of what level/area I'm in? Having to look up a new adress for every area in the game would be tedious. I'd appreciate any suggestions.
Player (121)
Joined: 2/11/2007
Posts: 1522
Yeah, GBA games in particluar seem to enjoy doing that. More chances to improve your memory searching skills! ;)
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs
Skilled player (1099)
Joined: 8/26/2006
Posts: 1139
Location: United Kingdom
If you are using the internal memory watch then alden is right and you'll just have to search in every level unfortunately. However, if you have been using an external memory watch program (MHS, Artmoney etc.) it may just be screwing you around and it'd be worth continuing to try. I've had it happen before.
Joined: 3/28/2009
Posts: 6
Damn, that's too bad. Guess I'll just have to put up with it then.
Mukki wrote:
If you are using the internal memory watch then alden is right and you'll just have to search in every level unfortunately. However, if you have been using an external memory watch program (MHS, Artmoney etc.) it may just be screwing you around and it'd be worth continuing to try. I've had it happen before.
I'm using gocha's memory watcher, and it seems to be working correctly.
Emulator Coder, Skilled player (1311)
Joined: 12/21/2004
Posts: 2687
It's to be expected, really. If a game handles characters generically enough, then your character is just another "thing" in the world, and of course you can't expect to find every thing in the world at the same memory address, because there's more than one of them. If you're lucky, it'll be at the same place every time anyway simply because the player object gets loaded first and gets assigned to the same slot in memory, but there's nothing stopping a game from putting the player in a random slot every level instead. I had a similar problem recently with a Sega CD game (Popful Mail), where the game code itself got replaced with a slightly different version of the code per level, and the data I wanted to read (hitbox dimensions) was mixed in with that code that was shifting around. So while I thought I had something already working with minimal effort, suddenly I had to figure out what exactly the game does to calculate the memory address it reads that data from. In this case, yeah, unless you have some way of scripting custom offset calculations into the memory watch tool you're using, you'll have to redo the search per level.
upthorn
He/Him
Emulator Coder, Active player (392)
Joined: 3/24/2006
Posts: 1802
nitsuja wrote:
It's to be expected, really. If a game handles characters generically enough, then your character is just another "thing" in the world, and of course you can't expect to find every thing in the world at the same memory address, because there's more than one of them. If you're lucky, it'll be at the same place every time anyway simply because the player object gets loaded first and gets assigned to the same slot in memory, but there's nothing stopping a game from putting the player in a random slot every level instead.
Indeed, I found the same thing happening in Chaotix - the player characters were dynamically loaded into a linked list of objects at the start of every level. [quote="nitsuja"I had a similar problem recently with a Sega CD game (Popful Mail), where the game code itself got replaced with a slightly different version of the code per level, and the data I wanted to read (hitbox dimensions) was mixed in with that code that was shifting around.[/quote] Virtually every SegaCD game is going to do this. Because of the way the addon works, each level has to be a complete self-contained program that no more than 256KB in size. And while working within that limitation, it's much easier to include the common routines and data at the same basic positions in the source code than to include them at the same offsets assembled binary.
How fleeting are all human passions compared with the massive continuity of ducks.