News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: SMB3 NES World Map Level Pointers  (Read 1360 times)

2thoed

  • Newbie
  • *
  • Posts: 1
    • View Profile
SMB3 NES World Map Level Pointers
« on: August 27, 2018, 12:33:32 am »
i am curious if anyone has any info about the structure of data in the super mario 3 nes rom that relates to the overworld tiles that actually load levels that the player enters.

with level 1 in world 1, im assuming that $19438 holds data about the level style in the lower nibble, 0x21 (the 1 means it will be a "plains" level, the first four bits seem to have something to do with the world) and the address $1948C holds an offset in bytes to the level data (0xBB82) from the "plains" style data ($14010), but im unsure what the bytes at $19462 and $19463 mean. im sure they are relevant because i found this out by replacing level 1 with another level in SMB3 workshop then comparing the differences with a hex editor.

im assuming the rest of the levels and worlds follow the order thats written in southbird's disassembly (Map_LevelLayouts in prg012.asm) but still curious if anyone has anything easier to read and if there is anything that isnt obvious from fumbling through the asms some 100+ files, any help would be appreciated.

August 27, 2018, 02:22:47 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
nevermind i think i figured it out, i already had all the info i needed
in case anyone else is wondering...

all the overworld data seems to start at $19434
each world starts with a 4 byte header where each byte represents a page of the overworld map and the value is which tile starts on that page
after the header there is 1 byte for each tile that has to do with the level style in the lower 4 bits
then 1 byte for each tile for something i have no idea about
then 2 bytes for each tile in world that im not sure about but might be an offset to the object data
then 2 bytes for each tile that is an offset to the level layout data

the structure would look something like this for world 1 in a higher level language
Code: [Select]
world_1_data {
    byte header[4];
    byte somethingAndStyleData[21];
    byte unknownData[21];
    word possibleLevelObjectPointer[21];
    word levelLayoutPointer[21];
}
this is sequential for each world

havent verified all this yet and only been messing with world 1 and 2 but i probably didnt need to post here and its not as complicated as i thought
if im wrong about anything or anyone has any extra info i will still be checking this post


August 29, 2018, 01:14:43 am - (Auto Merged - Double Posts are not allowed before 7 days.)
« Last Edit: August 30, 2018, 06:04:28 pm by 2thoed »