Pages: 1
Posted on 02-22-12, 03:11 pm (rev. 1)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10010
Posts: 1500/4457
Since: 06-08-11
It's easy. There's no need to modify the ROM or anything, there's a table in RAM that has all the information we need.

- Open the RAM viewer. In desmume it's in Tools -> View Memory.
- Go to address 0x02085D0C. (The address is for the U rom, it's different for other regions)

At that address , there's a table that has 16 entries. Every entry holds 4 integers of 4 bytes each (So each entry is 16 bytes).

The table contains:

- 4 bytes: Overlay ID (Beware: it's the overlay ID, not the file ID) OR 0xFFFFFFFF (-1) for an unused entry in the table.
- 4 bytes: The overlay start address in RAM.
- 4 bytes: The overlay size in RAM. (when loaded and decompressed)
- 4 bytes: Either 0 or 1. If it's 0, NSMB will halt and display the debug screen when something tries to unload the overlay. If it's 1, the overlay will unload normally. It appears that all the entries have this value set to 1. EDIT: This is probably some debug method from Nintendo to check that no conflicting overlays are being loaded. (At the same address). It's not used in the final game.

=====

So, the most useful information you can get out of this is what overlays are loaded at a certain point in the game. You'll see these change depending whether you're in the world map, a level, the main menu... Also sprite sets hold their data in overlays.

So if you want to find out where's the data for something and you suspect it's in the overlays, you can use this to check which ones are loaded so you know in which ones to look. Remember that overlays are compressed, you'll have to decompress them if you want to see something in them that makes sense.

EDIT: Changed some things so it's more understandable
Posted on 02-22-12, 03:46 pm (rev. 1)
Banned for being a complete idiot.

Karma: 529
Posts: 718/987
Since: 07-09-11
Posted by Dirbaio
So if you want to find out where's the data for something and you suspect it's in the overlays, you can use this to check which ones are loaded so you know in which ones to look. Remember that overlays are compressed, you'll have to decompress them if you want to see something in them that makes sense.

If you want to modify the Overlay0, it will be decompressed and saved to the ROM once you open the ROM in NSMBe.

Anways, thanks for the info.
Posted on 02-22-12, 09:48 pm (rev. 2)


Karma: 3752
Posts: 940/2112
Since: 06-28-11
WOW!
Now I will go discovering the whole game. This will help a lot! Thanks, Dirbaio.

EDIT: I found already the table, but under Overlay ID (the first 4 bytes) I can see "A5 07 00 00". What OV ID is this?
Another thing: Is the start address in RAM the same as the offset? This is the very first time I am messing arround with those values.
Posted on 02-22-12, 09:54 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10010
Posts: 1501/4457
Since: 06-08-11
All the 4-byte values are reversed. so that'd be Overlay ID 0x000007A5, or 0x7A5. That's too big, there aren't that many overlays. Are you sure you're looking in the right place?

The overlay start address is the place where the overlay data is loaded. The game copies the overlays from ROM to RAM. One thing is the offset of the overlay file in the ROM, the other thing is the address in RAM. Basically, if you go to the RAM address in the RAM viewer, you'll see the overlay contents in there.
Posted on 02-22-12, 10:03 pm


Karma: 3752
Posts: 944/2112
Since: 06-28-11
Ok, WHAT "RAM Viewer" do you mean? Probably I fail because I can't find such a "RAM Viewer" Button.
Posted on 02-22-12, 10:10 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10010
Posts: 1502/4457
Since: 06-08-11
Desmume has one. In the menu Tools -> View Memory.
Posted on 02-22-12, 10:12 pm


Karma: 3752
Posts: 945/2112
Since: 06-28-11
Ok. I was using the same one.
And then I found this nice "not existing Overlay ID".
Posted on 02-22-12, 10:13 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10010
Posts: 1503/4457
Since: 06-08-11
Huh
Screenshot plz

And are you 100% sure you're using the U rom?!
Posted on 02-22-12, 10:15 pm


Karma: 3752
Posts: 946/2112
Since: 06-28-11
Whoops! Now I found something in your description I missed.
I think it should work now. Thanks anyways! XD
Pages: 1