Language…
15 users online: anonimzwx, Darolac, DasFueller, Dennsen86, Doopu, Gamet2004, Green, LightAligns, Mike777, MorrieTheMagpie, RicardoDeMelo, romw314, sinseiga, Sokobansolver, twicepipes - Guests: 269 - Bots: 239
Users: 64,795 (2,375 active)
Latest user: mathew

Miscellaneous Sprite RAM Usage

The RAM map has rather... sparse descriptions of the miscellaneous RAM tables used by SMW, I ended up going through every single sprite in the game and documenting the usage of every table. And after about a year of gradually working my way through, I'm done with it.

You can find the table here.


I've chosen to omit the following common usages from the table, since they pretty much apply to every sprite:
  • $1540: A timer used when the sprite is killed in various ways. Notably, smoke clouds (from e.g. spinjumping) and squished sprites use this as an animation timer, and it's also set for any sprites killed by a block, capespin, net punch, cape smash, or Yoshi stomp.
  • $154C: Timer for disabling player contact. Every sprite that uses default Mario interaction sets this address when touched, so those are ommitted. Certain non-standard cases where it gets set are mentioned, however.
  • $1558: Timer for sinking in lava. Also set for a lot of sprites when hit by a block, capespin, net punch, cape smash, or Yoshi stomp.
  • $1FE2: Set for every sprite for a couple frames after spawn, with the purpose of preventing a splash sprite from appearing if the sprite spawns in water.
These tables are marked with a *.

It is is also worth noting the following tables are intended as timers, and decrement by 1 per frame while non-zero: $1540, $154C, $1558, $1564, $15AC, $163E, $1FE2. These tables are marked with a ᵀ.

Lastly, the misc RAM for the shell version of sprite 9 is also excluded, since it's just a duplicate of the shell-related RAM already noted in 4-7 and would just needlessly expand the table to include it.



Additionally, I've excluded cases where the table is handled by one of SMW's shared routines rather than being specific to the sprite, as otherwise almost every sprite would have these uses. These routines are listed below for each of the RAM tables. If a routine is marked with a "*", it indicates that the routine is handled automatically outside of the sprite, rather than being part of a routine that has to be called from within it. Hover over the routine's name to get the ROM address of it.
(note: "quake sprites" will be used as a general term for referring to the interaction 'sprites' from hit blocks, capespins, and net punches; their usage can be completely disabled by setting bit 5 of $166E)

$C2:
> Solid sprite routine: (input/output) For a sprite ID >= 83 when hit from below: If 0, set to 1, as a flag for having been hit.
> Quake sprite interaction: (input/output) If non-zero, will be cleared and the sprite will have $AA, $1540, $1558, and $157C modified.

$1528:
> Solid sprite routine: (input) Number of pixels moved horizontally in a frame, for moving Mario (note: not cleared post-routine).
> Fireball-Sprite interaction: (input/output) If the sprite takes 5 fireballs to kill ($190F bit 3 is set), then used as a counter for the number of hits.

$1534:
> Item box drop: (output) Flag for the sprite having been dropped from the item box.

$1540:
> Sprite status 4 (death by spinjump): (input) Timer for the smoke cloud.
> Sprite status 6 (goal tape coin): (input) Timer for the smoke cloud before actually becoming a coin.
> Mario-Sprite interaction: (output) If $1656 bit 6 is set (die when jumped on), set to #$20 when jumped on, for a squish animation timer.
> Mario-Sprite interaction: (output) If the sprite can be killed by a spinjump, set to #$1F, for the death cloud's timer.
> Quake sprite interaction: (output) If $C2 was non-zero, set to #$10.

$154C:
> Mario-Sprite interaction: (input/output) Disables default interaction. Set to #$08 if interaction occurs.
> Quake sprite interaction: (input/output) Disables interaction. Set to #$08 if interaction occurs.
> Cape smash: (input/output) Disables interaction. Set to #$08 if interaction occurs.

$1558:
> Sprite status 5 (sinking in lava): (input) Timer for sinking.
> Object interaction: (output) Set if the sprite lands in lava, for the sinking animation.
> Solid sprite routine: (output) For a sprite ID >= 83 when hit from below: If $C2 was initially 0, set to #$10, for usage as a bounce animation timer.
> Quake sprite interaction: (output) If $C2 was non-zero, set to #$20.

$1564:
> Sprite-Sprite interaction: (input) Disables interaction with other sprites.
> Solid sprite routine: (output) For a sprite ID >= 83 when hit from below: Set to #$10.

$157C:
> Sprite-Sprite interaction: (output) If $1686 bit 4 is set (change direction when touched) and the two sprites are facing each other, bit 0 is inverted when interaction occurs.
> Mario-Sprite interaction: (output) If $1686 bit 4 is set (change direction when touched), bit 0 is inverted when interaction occurs.
> Quake sprite interaction: (output) If $C2 was non-zero, will be cleared.
> Shared GFX routines: (input) Flag for X flip (except for SubSprGfx0 / $019CF3)

$15AC:
> Sprite-Sprite interaction: (input/output) If $1686 bit 4 is set (change direction when touched) and currently zero and the two sprites are facing each other, set to #$08 when interaction occurs.
> Object interaction: (input) If non-zero and the sprite has no X speed, horizontal block interaction will be skipped.

$15D0:
> Yoshi-Sprite interaction: (input) Disables interaction.
> Sprite-Sprite interaction: (input) Disables interaction with sprites in lower slots.
> Fireball-Sprite interaction: (input) Disables interaction.
> Quake sprite interaction: (input) Disables interaction.
> Cape smash: (input) Disables interaction.
> Tongue-Sprite interaction: (input/output) Set when the sprite is on Yoshi's tongue.

$1602:
> Shared GFX routines: (input) Animation frame index to sprite's GFX table.

$187B:
> Mario-Sprite interaction: (input) Flag to make Mario bounce off the sprite like a disco shell.

$1FE2:
> Level load: (output) Set for a few frames after spawn, for every standard sprite (to prevent a water splash if spawning in water).
> Object interaction: (input) Disables water splashes when landing in water.
> Quake sprite interaction: (input) Disables interaction.