Originally posted by GlitterBerri
Do you mean that the final version of Super Mario Sunshine and Double Dash are actually still debug versions?
Not quite. If my memory serves me right, the demo version of Sunshine has a .map file, but the retail version doesn't. And Double Dash has one, but it contains info for the debug binary (which we don't have).
Originally posted by GlitterBerri
What are these symbols you speak of, out of curiosity? I'm not sure I quite understand.
OK, how do I explain this... Each symbol is a pair containing a name (of a function or variable or ...) and an address within the game binary. (It can be more complex than that, but that's not necessary or relevant here). For example, in NSMB Wii, the OSReport function is located at 0x8015F870.
The .map file is simply a list generated by the linker (a piece of software which puts together bits of compiled code into one final binary and links everything together so it works, hence the name) of what things are where within the binary.
So what are these useful for?
1. Debugging: If the game crashes while processing the code at 0x80295AE4, it can search the map file to see what's there.
"Oh, the symbol MarioJump points to 0x80295AD0, and the next one is at 0x80296008, so this error must have occurred within the MarioJump function." This is the reason why .map files are in Nintendo's games. In Zelda WW/TP, the code to read them is still there, and it'll pull up a pretty debug log if the game crashes! This saves a tremendous amount of debugging time, since the developer can just read the log and it'll tell him what code the crash occurred in.
2. Reverse-engineering: When the game is compiled, most useful info like function/variable names are stripped out. (They're not needed to execute the code, and would simply waste memory and space if left in.) This makes reversing a pain because we have to figure out what every bit of code does from the ground up... involving a lot of guessing and so on.
The following code is easy to understand, right? This might be a method on the Mario object.
void Mario::StartJumping() {
ySpeed = -5;
isJumping = true;
}
But when it's compiled, this is what it might look like: (Not exactly like this, because it'd be in assembly - but that'd be much harder to read and would just distract from the purpose of this)
void sub_80045920(void *unknownPointer) {
unknownPointer->numberAtOffset16 = -5;
unknownPointer->numberAtOffset68 = 1;
}
Not quite as easy to understand... it could be practically anything. If I was reverse-engineering this code, and I had symbols for it, I could simply look up 80045920 in the map file and see that it was actually Mario::StartJumping. This would make it fairly straightforward to see that the first assignment was probably setting a Y velocity, and the second one had to be related to jumping somehow.
This was a bit long winded but I hope it made sense
____________________