Language…
3 users online: fanfan21, lRichieBiersack, Morph Moth - Guests: 109 - Bots: 86
Users: 70,493 (2,450 active)
Latest user: Edilson

SMW Memory Map

Displaying 50 out of 841 addresses.

View: moderated | waiting (13)

Filter

Link
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 16
  • 17
RAM Address Length Type Description Details
$7E005D 1 byte Misc. Number of screens in level (equivalent to the "number of screens" setting in Lunar Magic). Note that there is no differentiation here between horizontal and vertical levels, so you will need to check that seperately before using this address to handle the maximum X or Y position of something. See $5E instead for specifically horizontal levels, or $5F for specifically vertical levels.
Also set to FF in Ludwig and Reznor's boss rooms. Instead, those rooms used a fixed width of 1.5 screens.
$7E005E 1 byte Camera In horizontal levels, used as the level's width in screens, i.e. the screen number (plus 1) at which the camera should stop scrolling rightwards. Equivalent to the "number of screens" dropdown in Lunar Magic's "Change Properties in Header" dialogue. Not used in vertical levels, where it is always set to 01; see $5F instead.
Also set to 00 in Ludwig and Reznor's boss rooms. Instead, those rooms used a fixed width of 1.5 screens.
$7E005F 1 byte Camera In vertical levels, used as the level's height in screens, i.e. the screen number (plus 1) at which the camera should stop scrolling downwards. Equivalent to the "number of screens" dropdown in Lunar Magic's "Change Properties in Header" dialogue. Not used in horizontal levels, where it is always set to 01; see $5E instead.
$7E0060 4 bytes Empty Empty. Cleared on reset, titlescreen load and overworld load.
$7E0064 1 byte Misc. Properties (YXPPCCCT) byte for most sprites inside levels - including the player. Exceptions to this include sprites that mess with sprite priority in a different way, such as Piranha Plants, items coming out of a box (and inside the item box) and Net Koopas behind the nets.
$7E0065 3 bytes Pointer 24-bit pointer to layer 1 data - both level and overworld.

Also used during the staff roll sequence of the credits to hold some data about the current line being uploaded to VRAM:
- $65-$66 is used to hold the first two bytes of the stripe image header for the current line (in little endian), mainly for keeping track of the Y position.
- $67 tracks the current line number being written, with a line defined as two consecutive 8x8 rows.
$7E0068 3 bytes Pointer 24-bit pointer to layer 2 data.
$7E006B 3 bytes Pointer 24-bit pointer to low byte of Map16 block data. Used during level load.
$7E006E 3 bytes Pointer 24-bit pointer to high byte of Map16 block data. Used during level load.
$7E0071 1 byte Player Player animation trigger states. When nonzero, the player character is performing an action and cannot be controlled by the player. Often used for cutscenes. Valid values
$7E0072 1 byte Player Player is in the air flag, as well as the actual pose value to store to $13E0 while the player is in midair. This is set to a certain value depending on how the player got in the air in the first place, and in what state they are currently (rising or sinking).
This address is not affected by phases such as climbing. It is, however, also used in swimming animation.

Notable values:
#$0B = Jumping/swimming upwards.
#$0C = Shooting out of a slanted pipe, running at maximum speed.
#$24 = Descending/sinking. NOTE: Hitting bottom-solid sprites like invisible solid block, message block etc. does NOT set $72 to this value as cape mario.

The address in general is used in many instances.
For example, the game checks if this address is #$0C. If not, the player cannot ascend properly with the cape. Furthermore, the Layer 3 smash won't hurt the player if they're not on the ground (any non-zero value) and this address prevents the player from locking in place when still airborne during the Morton/Roy/Ludwig battle.
$7E0073 1 byte Flag Player is ducking flag. #$00 = No; #$04 = Yes. However, any value that is not zero also counts as 'Yes', SMW just stores that specific value to it.
$7E0074 1 byte Player Player is climbing flag: format: n--sifhb
n: Net/vine flag. 1 - net, 0 - vine. Determines whether Mario can move diagonally.
s: Side body collision point with climbing. If clear, block horizontal movement.
i: Side head collision point with climbing.
f: Feet collision point with climbing.
h: Head collision point with climbing.
b: Body collision point with climbing.
$7E0075 1 byte Flag Player is in water flag. #$00 = No; #$01 = Yes.
$7E0076 1 byte Player Player direction. #$00 = Left; #$01 = Right.
$7E0077 1 byte Player Player blocked status - Used to check if player is blocked in a certain direction. Format: SxxMUDLR
The M bit means that the player is in the middle of a block.
The S bit indicates that the player is touching the side of the screens while horizontal screen scrolling is disabled.
UDLR = up, down, left, right (contact with walls).

L is checked each 4 frames when the player have negative X speed. Others frames is zero.

R is checked each 4 frames when the player have positive X speed. Others frames is zero.
$7E0078 1 byte Player Used to hide the player partially or fully. Format: dlucapLU.
d = used in conjunction with all other set bits in order to disable processes such as the star timer decrementing.
l = hide lower extra player tile when in flight (hovering with the cape).
u = hide upper extra player tile when in flight (hovering with the cape).
c = hide regular cape tile.
a = hide attributive 8x8 tile.
p = hide extra player tile that is shown during the inflated P-balloon pose (does not apply if the player is small).
L = hide lower half of the body.
U = hide upper half of the body.
$7E0079 1 byte Empty Empty. Cleared on reset, titlescreen load, overworld load and level load.
$7E007A 1 byte Player Accumulating fraction bits for fixed point player X speed (fractions of 256, see code around $00D792, this handles horizontal movement with the player and when the player is on the slope).

Not to be confused with $7E13DA, which handles X position.
$7E007B 1 byte Player Player X speed (8-bit, signed), in 1/16s of a pixel per frame. Positive speeds (01-7F) are rightwards while negative speeds (80-FF) are leftwards.
$7E007C 1 byte Empty Empty. Cleared on reset, titlescreen load, overworld load and level load.
$7E007D 1 byte Player Player Y speed (8-bit, signed), in 1/16s of a pixel per frame. Positive speeds (01-7F) are downwards while negative speeds (80-FF) are upwards.

SMW generally restricts Mario's downwards speed to a maximum of #$40, although because the game applies gravity after capping the speed, the actual maximum downwards speed is either #$43 (holding A/B) or #$46 (not holding A/B).
$7E007E 2 bytes Player Player X position (16-bit), within the borders of the screen.
$7E0080 2 bytes Player Player Y position (16-bit), within the borders of the screen.
Note that this value may be displaced by $1888 (the screen shake), in addition to small one-pixel displacements based on Mario's powerup status and walking animation frame.
$7E0082 3 bytes Pointer Points to how steep the various slopes are and which parts of the slopes they represent. Points to $00:E5C8 in tilesets 0 and 7, and $00:E55E in others.
The table this one points to has one byte per block, from tile 16E to tile 1D7.
The value in these tables is then multiplied by 16, the lowest nibble of the sprite/player X position is added, and this is then used as an index to $00:E632 to tell how many pixels the sprite/player should move down from the nearest 16x16 tile.
$7E0085 1 byte Flag Water level flag. #$00 = No; #$01 = Yes.
$7E0086 1 byte Flag Slippery level flag. #$00 = No; #$01 through #$7F = Half-slippery; #$80 through #$FF = Yes. Possible values in the clean ROM are #$00 and #$80.
$7E0087 1 byte Empty Empty. Cleared on reset, titlescreen load, overworld load and level load.
Note that this address is used as freeram by the SA-1 patch.
$7E0088 1 byte Player How long the player goes into a pipe until they warp to another level.

Also used as a timer in the castle destruction scenes for holding inputs.
$7E0089 1 byte Player Action to take when the player enters or exits from a pipe (see valid values).

It also serves as a timer for the No Yoshi cutscenes for each controller command (for the table at $00:C848).
Valid Values
$7E008A 3 bytes Misc. Used as scratch RAM by various routines; see details for more info. Usage
$7E008D 3 bytes Misc. Used as scratch RAM in multiple locations:
  • During GFX file decompression, $8F is used for holding the current decompression operation and $8D/$8E are used for holding the 16-bit length of that operation.
  • After decompressing GFX33, all three of these get used as a 24-bit pointer to its decompressed data for the purpose of converting it from 3BPP to 4BPP.
  • During the player-object interaction routine, $8D is used as a backup of $13EF (player on ground flag), $8E is used as a backup of $5B (layer interaction and vertical flags), and $8F is used as a copy of $72 (player in air flag). $8D is used to detect if code for being on top of a tile should be run, $8E is used for handling whether tile interaction should occur and whether the player should move horizontally with the layer, and $8F is used to detect whether the player has just landed (for the purposes of ground stomps, cape smashes, and breaking turnblocks) or has not been on the ground for at least a frame (for entering doors and horizontal pipes).
$7E0090 1 byte Player Player Y position within a block. Calculated with $7E:0096 & #$0F. Indicates whether the player is touching the top or the bottom of the block.
$7E0091 1 byte Player Y position of the player's head and feet within a block. For the head interaction, this is calculated by taking the player's Y position, adding it with the interaction point offset of MarioAbove, and limiting it to the lowest four bits. For the feet interaction, this is handled by simply storing $7E0090 (the player's Y position within the block) to this address.

This is used to calculate how far the interaction points are inside of a block (values of $00 - $07 denotes the top half while $08 - $0F denotes the bottom half) and to determine which direction the player should be pushed out if the block is solid.
$7E0092 1 byte Player Player X position within a block. Calculated with $7E:0094 + #$08 & #$0F.
$7E0093 1 byte Player The side of a block the player is on. It's set to #$00 for the right side and #$01 for the left side. This address is relative to the block the player is currently inside.
$7E0094 2 bytes Player Player X position (16-bit) within the level, next frame (calculates player position one frame ahead, as opposed to $D1).
It's also used as a player X position on-screen on the overworld border.

NOTE: During player interaction with blocks on Layer 2, this value is modified to be relative to Layer 2's position rather than Layer 1. This can be checked via $1933, and can be offset back to Layer 1 by subtracting $26.
$7E0096 2 bytes Player Player Y position (16-bit) within the level, next frame (calculates player position one frame ahead, as opposed to $D3).
It's also used as a player Y position on-screen on the overworld border.

NOTE: the player's Y position is not affected by their powerup, nor whether they are crouching; the point will always be 32 pixels above their feet. However, if riding on Yoshi, their Y position does get offset 16 pixels upwards.

Additionally, during player interaction with blocks on Layer 2, this value is modified to be relative to Layer 2's position rather than Layer 1. This can be checked via $1933, and can be offset back to Layer 1 by subtracting $28.
$7E0098 4 bytes Misc. Position (in pixels) of the collision point currently being processed for player interaction with blocks in the level. Also used in the creation of various sprite types/other blocks.

$98-$99: 16-bit Y position
$9A-$9B: 16-bit X position

Note that this position is with respect to the top left of the layer being processed. Hence, if Layer 1 and Layer 2 are offset from each other, this value will differ between the two, even when Mario is at the same position with respect to the level.

Also note that, in vertical levels, the X and Y position may be swapped after running certain block changing routines (e.g. $00BEB0 or the ChangeMap16 routine included with various tools).
$7E009C 1 byte Blocks Map16 tile to generate (used with $00BEB0). Valid Values
$7E009D 1 byte Flag Lock animation and sprites flag. Most codes will still run if this is set, but almost nothing will move or animate. Set by a number of events such as screen scrolling, entering pipes, dying, and more.

Notably, not set when the game is actually paused by $13D4, since most resource processing is skipped altogether by that flag. However, UberASM codes still run prior to that flag being checked, so in those you'll need to check both to prevent any unwanted code from running while the game is frozen.
$7E009E 12 bytes Sprites Sprite number, or Acts Like setting for custom sprites. To check the actual sprite ID for custom sprites, see $7FAB9E instead.
$7E00AA 12 bytes Sprites Sprite Y speed table.
$7E00B6 12 bytes Sprites Sprite X speed table.
$7E00C2 12 bytes Sprites Miscellaneous sprite table. In SMW, it's commonly used as a pointer to different parts of a sprite. More information can be found here.
$7E00CE 3 bytes Pointer 24-bit pointer to level's sprite data.
$7E00D1 2 bytes Player Player X position (16-bit) within the level, current frame (as opposed to $7E:0094).
$7E00D3 2 bytes Player Player Y position (16-bit) within the level, current frame (as opposed to $7E:0096).
$7E00D5 3 bytes Pointer Pointer to X and Y positions of Wiggler segments. Table at $7F9A7B.
$7E00D8 12 bytes Sprites Sprite Y position, low byte.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 16
  • 17