Language…
5 users online: Danik2343, Firstnamebutt, pnaha, Wowsie, Zavok - Guests: 107 - Bots: 311
Users: 64,795 (2,381 active)
Latest user: mathew

OAM Map

Below is a list of what's stored at different parts of the OAM. The index is the actual OAM address of the sprite, which is the same thing as the slot number times 4 (as each sprite slot is four bytes large). It's also the index to SMW's RAM mirror of the OAM located at $7E:0200.

Note: When allocating space in the OAM, the game picks the last unused index. For instance, when creating a new sparkle, the game would first check index 31 then 30, 29, etc. until it finds a free slot.

02F0-02FC are used by the contact smoke sprite.

The initial slot is chosen at $0297B3 and it uses the next 3 OAM slots like Yoshi's tounge.

Code
CODE_0297B2:        A0 F0         LDY.B #$F0


Also, it uses a different slot when the player is in a special level (i.e Bowser battle or boss rooms) it uses 0390-039C and the initial slot is chosen at $029839:

Code
CODE_029838:        A0 90         LDY.B #$90
Overworld OAM Map (WIP)

Code
| $0200 to $023C 	| Overworld border squares behind the player.
| $0240 to $0270	| Clouds
| $0274 to $027C	| Yoshi House smoke.
| $0280 to $028C	| Star effect used in the level icon reveal and the "press switch palace" effect.
| $029C to $02B8	| Current player in the map.
| $02BC to $02D8	| Idle player in the map.
| $02AC			| Mario in the "Live Exchange" window
| $02B0			| Luigi in the "Live Exchange" window
| $0340 to $03DC	| Switch palace blocks
| $0350 to $03DC	| Event fade effect
| $03E8 to $03EC	| Walking player in the border
| $03F0 to $03F4	| Unknown (probably unused)
| $03F8			| Cape of the walking player in the border
| $03FC			| Unknown (probably unused)


Notes in $029C and $02BC:
- When idle or standing in level icon or walking down he the first 4 slots are used by Yoshi and the last 4 slots are used by the current player.
- When the player is walking to left, right or up he uses the first 4 slots and yoshi uses the last 4 slots.

I still need to find some slots that are used by some other overworld sprites. I will edit this post when I found these (or someone else does it).
Originally posted by LX5
Code
| $03F0 to $03F4	| Unknown (probably unused)

these are probably reserved for the player's 8x8 tiles (though they would look glitched)

same with $03FC (for one of the cape tiles, doubt it though)
0F0, 0F4, 0F8, and 0FC are used by the spinjump star effect (0F8 and 0FC are shared with mario's fireballs). not sure why it isnt on the map already...
I reported that almost a year ago.

Not sure how to add values to the table, but I'll try to add it.

e: tried to edit, failed to understand HTML.
i think i'm legally blind, welp

but yeah, tables arent very user-friendly, especially large complex ones
Surprisingly undocumented here yet, slots 100+ are used by carried items when those are to be drawn above Mario (specifically when he's turning around or entering a pipe). This is done via the STZ $15EA,x (sprite's OAM slot in range $0300) at $019F83.

In most cases, slot 100 is the only one taken (since most carriable items are made up of a single tile). The only exception is the mechakoopa, which is actually made of 5 (!) tiles. This means not only slot 104 is also taken, but Mario's slots 108, 10C and 110 will get overwritten, which explains the headless Mario bug.
It's easily the best thing I've done
So why the empty numb?
is there a version of this that's more up to date?

Benny Harvey RIP, miss you big man.



Originally posted by zuccha
I made an updated OAM Map available here, feel free to point out missing or wrong entries.

The slot listed for the item box item (00) is somewhat incorrect, that's the slot used for the actual item in Bowser, Morton, Roy, and Reznor's rooms (basically, the mode 7 rooms other than Iggy/Larry). Levels instead use slot E0 for the item, which is the value defined a few lines earlier in the code at $00907A.

There's a few other things missing from the boss rooms, since those are kinda a mess:
  • The BG tiles in Morton/Roy and Ludwig's rooms. Ludwig's tiles start with the index at $0282C4 (E0) while Morton/Roy's is at $0282D6 (FC), although the indices are applied from $020C rather than $0200, and they count down rather than up. So Ludwig uses $020C-$02EC while Morton/Roy use slots $0294-$0308.
  • Score tiles in Reznor/Morton/Roy/Ludwig's rooms will use $0204/$0208 (defined at $02AEA4).
  • Bowser's floor uses additional tiles in $03BC-$03FC before his death, and $0390-$03CC after. Defined at $03B4AE (before) and $03B4BD (after). Strangely, he draws one less tile in the after, though that extra tile isn't visible anyway.
  • Bowser's teardrop and stars are listed at $03EC-$03FC, but they're actually also at $02EC-$02FC. They get written to the $03xx entries temporarily in order to call the FinishOAMWrite routine, but they get immediately copied afterwards to their $02xx entries at $03AFE6 (and the $03xx ones then get overwritten by the arena tiles).
  • The entirety of the "Mario's adventure is over..." text after Bowser uses up $0200-$034C ($03D67E, 16-bit).
  • The firework sprite uses $0300 for the rocket ($03C978) and $0200-$034C for the explosion ($03CA0C)

Other than the bosses, one other thing is that Lakitu's cloud uses $03F8/$03FC ($01E8D3 / $01E8D7, should also match at $01E946), and then either $0300/$0304 ($01E8DB) or $0330/$0334 ($01E8E1) depending on if Mario is in the cloud or not. Similarly, also worth noting that Lakitu's fishing rod already mentioned for $0338 also includes up through $0354 as well (8 tiles).

Lastly, the four OAM indices listed as "fireplace" are actually for the four bird sprites, not the actual fireplace.


Not sure if you plan to add overworld stuff too, though I haven't actually looked into those ones at all.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Thanks for the tips! I added almost everything you noted, but I still have a couple of questions and doubts:
  1. About the item box, what's the point of $0204-$0210 for Bowser? How does it differ from $0200?
  2. Unless I misinterpreted the loops, Morton/Roy and Ludwig's backgrounds occupy $0208-$02EC and $0290-$0308 respectively (one more than you pointed out).
  3. Don't Bowser's fireworks occupy $0200-$023F instead of $0200-$034C? Is that a copy-paste mistake or am I missing something?
  4. I'm unsure how to handle normal sprites slots, since they occupy a wide range, and it might be useful categorizing them by sprite memory setting.
  5. I'm hesitant in adding the "Mario's adventure is over..." text to the list, as it occupies most of the slots and makes the list more unreadable that it already is. I created another sheet where I mention the range, but the solution doesn't satisfy me too much.

Also, in the future I might add overworld stuff, but probably in a separate sheet, since there should be no conflict with level sprites anyway. Maybe it's just a good idea creating a sheet per game mode (if I remember right, the "MARIO START" and "GAME OVER" texts are also using the object layer).
ROM Hack Manager - SMW Resources - SMW Toolbox


Originally posted by zuccha
Thanks for the tips! I added almost everything you noted, but I still have a couple of questions and doubts:
  1. About the item box, what's the point of $0204-$0210 for Bowser? How does it differ from $0200?
  2. Unless I misinterpreted the loops, Morton/Roy and Ludwig's backgrounds occupy $0208-$02EC and $0290-$0308 respectively (one more than you pointed out).
  3. Don't Bowser's fireworks occupy $0200-$023F instead of $0200-$034C? Is that a copy-paste mistake or am I missing something?
  4. I'm unsure how to handle normal sprites slots, since they occupy a wide range, and it might be useful categorizing them by sprite memory setting.
  5. I'm hesitant in adding the "Mario's adventure is over..." text to the list, as it occupies most of the slots and makes the list more unreadable that it already is. I created another sheet where I mention the range, but the solution doesn't satisfy me too much.

  1. The extra ones for Bowser in $0204-$0210 are for the actual item box outline. Bowser's room doesn't make use of an IRQ to keep the status bar in Mode 1 like the other Koopa Kids do, so it manually draws that with sprite tiles instead.
  2. Nah, it is $020C/$0294 on the low end. Keep in mind $02EC and $0308 are also one of the tiles, so technically they use up to $02EF/$030B (also can't go below $020C, since that's where the values are being indexed from). If it helps, here's an image of the actual OAM layout in both.
  3. Fireworks actually technically uses two ranges, one in the $02xx range and one in the $03xx range. The loop for $02xx is at $03CA0B up through $03CAD7 and covers the entire range (0x40 particles) while the loop for $03xx is over at $03CADA up through $03CBA8, and adds an additional 0x14 particles (0x53 - 0x3F). They both share that same base Y index over at $03CA0C, though technically that only actually matters for the second loop since the first one uses the entire $02xx range regardless.
  4. That one's a bit of an awkward situation, also since anyone using the NMSTL patch would make that information unnecessary anyway. One solution there would be to just list it as a general sprite tile area, then add a separate sheet that uses color blocks to denote the ranges given to each sprite slot with the $03xx range on the Y axis and the different sprite memory options on the X axis.
  5. Wondering if the large-scale "special case" uses like that would probably be better off listed separately in a bulk statement off to the side outlining their ranges, since they do kind of make the list a bit harder to read and wouldn't really be a concern anyway if you're not using the default boss fights.

Also, you are correct that the loading screen text gets written to OAM as well, the routine for that one is over at $0091E9, with the OAM being used at $0310-$037C.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by Thomas

  1. The extra ones for Bowser in $0204-$0210 are for the actual item box outline. Bowser's room doesn't make use of an IRQ to keep the status bar in Mode 1 like the other Koopa Kids do, so it manually draws that with sprite tiles instead.
  2. Nah, it is $020C/$0294 on the low end. Keep in mind $02EC and $0308 are also one of the tiles, so technically they use up to $02EF/$030B (also can't go below $020C, since that's where the values are being indexed from). If it helps, here's an image of the actual OAM layout in both.
  3. Fireworks actually technically uses two ranges, one in the $02xx range and one in the $03xx range. The loop for $02xx is at $03CA0B up through $03CAD7 and covers the entire range (0x40 particles) while the loop for $03xx is over at $03CADA up through $03CBA8, and adds an additional 0x14 particles (0x53 - 0x3F). They both share that same base Y index over at $03CA0C, though technically that only actually matters for the second loop since the first one uses the entire $02xx range regardless.
  4. That one's a bit of an awkward situation, also since anyone using the NMSTL patch would make that information unnecessary anyway. One solution there would be to just list it as a general sprite tile area, then add a separate sheet that uses color blocks to denote the ranges given to each sprite slot with the $03xx range on the Y axis and the different sprite memory options on the X axis.
  5. Wondering if the large-scale "special case" uses like that would probably be better off listed separately in a bulk statement off to the side outlining their ranges, since they do kind of make the list a bit harder to read and wouldn't really be a concern anyway if you're not using the default boss fights.

Also, you are correct that the loading screen text gets written to OAM as well, the routine for that one is over at $0091E9, with the OAM being used at $0310-$037C.


  1. Right, why didn't I think of that?
  2. It turns out I cannot count (I counted the number of BG tiles I added in the list and I thought there was one missing, twice smh).
  3. Got it.
  4. I think that's a good idea. I will add the entries in the main sheet, then create a different sheet to highlight usages for different sprite memory settings.
  5. For fireworks and text I created two separate sheets that cover their ranges, I think that should be enough.

In the future I will also add sheets for overworld and other game modes, for completion. I'll resume working on it next week probably.
ROM Hack Manager - SMW Resources - SMW Toolbox