Language…
9 users online: 3lectro,  Anorakun, Cape, Gloomyerr_, Golden Yoshi, LetsAGo0123, nicecarlos024, Reiko2121, ShadowBoxer_Sandshrew - Guests: 946 - Bots: 109
Users: 70,464 (2,462 active)
Latest user: RangerMan27

SMW Memory Map

Displaying 75 out of 841 addresses.

View: moderated | waiting (13)

Filter

Link
RAM Address Length Type Description Details
$7E0000 16 bytes Misc. Scratch RAM, is and can be used for a big number of purposes. The general purpose is temporarily preserving a value for later use in a routine.
Of note is the following address, used in LM ASM hacks:
$7E:0003 (16-bit) - Block number from LM Map16 editor. Also used in the custom Map16 tile change routine.
$7E0010 1 byte Flag If the value in it is not zero, run the actual game; otherwise, loop forever. It's set to a non-zero value during NMI, and it's set to zero after the game mode has been run, so that the game runs exactly once a frame - one NMI trigger per frame.
$7E0011 1 byte Flag Used to distinguish IRQ #1 from IRQ #2's code. (Inside the Morton/Ludwig/Roy room, where IRQ is used twice, although it can be used in other areas that run IRQ as well.) #$00 = IRQ #1; #$01 = IRQ #2.
$7E0012 1 byte Graphics Stripe image loader - value must be divisible by 3. Valid Values
$7E0013 1 byte Counter "True" frame counter. Increments once per frame, except when the game is lagging. Note that $7E:0014 is better suited for most purposes.
$7E0014 1 byte Counter "Effective" frame counter. Stops when, for example, RAM addresses such as $7E:009D are not zero (lock sprite flag, usually indicates the player is dying, grabbing a powerup, or something similar). Inside sprite code, this address is often preferred over $7E:0013, especially in graphics routines, as graphics will not be updated when the player dies if this address is used as an index to the tilemap.
$7E0015 1 byte I/O Controller buttons currently held down. Format: byetUDLR.
b = A or B; y = X or Y; e = select; t = Start; U = up; D = down; L = left, R = right.
$7E0016 1 byte I/O Controller buttons newly pressed this frame. Format: byetUDLR.
b = B only; y = X or Y; e = select; t = Start; U = up; D = down; L = left, R = right.
$7E0017 1 byte I/O Controller buttons currently held down. Format: axlr----.
a = A; x = X; l = L; r = R, - = null/unused.
$7E0018 1 byte I/O Controller buttons newly pressed this frame. Format: axlr----.
a = A; x = X; l = L; r = R, - = null/unused.
$7E0019 1 byte Player Current player powerup status. Valid Values
$7E001A 2 bytes Hardware mirror Layer 1 X position, current frame. Mirror of SNES register $210D.

For autoscrolling Layer 1, see $1462 instead.
$7E001C 2 bytes Hardware mirror Layer 1 Y position, current frame. Mirror of SNES register $210E.

For autoscrolling Layer 1, see $1464 instead.
$7E001E 2 bytes Hardware mirror Layer 2 X position, current frame. Mirror of SNES register $210F.

For autoscrolling Layer 2, see $1466 instead.
$7E0020 2 bytes Hardware mirror Layer 2 Y position, current frame. Mirror of SNES register $2110.

For autoscrolling Layer 2, see $1468 instead.
$7E0022 2 bytes Hardware mirror Layer 3 X position. Mirror of SNES register $2111.
$7E0024 2 bytes Hardware mirror Layer 3 Y position. Mirror of SNES register $2112.
$7E0026 2 bytes Misc. If Layer 3 tides are disabled, this is the X offset of Layer 2 from Layer 1, calculated as $1466 - $1462.
If Layer 3 tides are enabled, it is instead the X offset of Layer 3 from Layer 1, calculated as $22 - $1462.

Used for handling interaction with Layer 2/3.
$7E0028 2 bytes Misc. If Layer 3 tides are disabled, this is the Y offset of Layer 2 from Layer 1, calculated as $1468 - $1464.
If Layer 3 tides are enabled, it is instead the Y offset of Layer 3 from Layer 1, calculated as $24 - $1464.

Used for handling interaction with Layer 2/3.
$7E002A 2 bytes Hardware mirror Mode 7 Center X position. Mirror of SNES register $211F, + #$0080.
$7E002C 2 bytes Hardware mirror Mode 7 Center Y position. Mirror of SNES register $2120, + #$0080.
$7E002E 2 bytes Hardware mirror Mode 7 matrix parameter A. Mirror of SNES register $211B.
$7E0030 2 bytes Hardware mirror Mode 7 matrix parameter B. Mirror of SNES register $211C.
$7E0032 2 bytes Hardware mirror Mode 7 matrix parameter C. Mirror of SNES register $211D.
$7E0034 2 bytes Hardware mirror Mode 7 matrix parameter D. Mirror of SNES register $211E.
$7E0036 2 bytes Misc. Mode 7 rotation. Its values are calculated and stored into the respective Mode 7 parameter mirrors at $7E:002E through $7E:0035.
Values #$0000 through #$01FF are all different values, after that it's the same pattern - that is, if you add this 16-bit address with #$0200, there is a 360 degree rotation.
Furthermore, this address is used in the brown chained platform code as an index to the sine and cosine tables at $07:F7DB.
$7E0038 2 bytes Misc. Mode 7 scaling; that is, making Layer 1 shrink or grow. Its values are calculated and stored into the respective Mode 7 parameter mirrors at $7E:002E through $7E:0035.
The first byte - $7E:0038 - is used for horizontal scaling, whereas the second byte - $7E:0039 - is used for vertical scaling.
Default value is #$20. The closer to #$00, the more the layer grows, the further from #$00, the more the layer shrinks. Value #$10 makes the layer twice as large as value #$20, value #$40 makes the layer twice as small as value #$20, etc.
$7E003A 2 bytes Hardware mirror Mode 7 Layer 1 X position. Mirror of SNES register $210D.
$7E003C 2 bytes Hardware mirror Mode 7 Layer 1 Y position. Mirror of SNES register $210E.
$7E003E 1 byte Hardware mirror Background mode select applied with IRQ below status bar (so the area above IRQ is not affected by this). Format: 4321pmmm.
4321 = Layer 1/2/3/4 uses 8x8 tiles when clear, 16x16 tiles when set; p = Layer 3 absolute priority (only in background mode 1); mmm = background mode # (0-7).
Mirror of SNES register $2105.
$7E003F 1 byte Hardware mirror OAM Address, low byte. Also known as the mirror of SNES register $2102. High byte is at $00846B. Is sometimes used to alter priority of various sprite tiles, such as with the sprite backgrounds in the boss rooms.
$7E0040 1 byte Hardware mirror Color math designation settings (CGADSUB), mirror of $2131.
Format: shbo4321
  • s = 0 to add layers, 1 to subtract layers
  • h = half-color mode
  • b = enable on fixed color
  • o = enable on sprites
  • 4321 = enable on Layer 4, 3, 2, 1 (Layer 3 is only affected below the status bar)
$7E0041 3 bytes Hardware mirror Window mask settings, mirroring $2123-$2125. These control what layers each window is active on, as well as whether the window is inverted.
Each of the three addresses has the binary format ABCDabcd:
  • A/a = Enable window 2
  • B/b = Invert window 2
  • C/c = Enable window 1
  • D/d = Invert window 1

The lowercase letters affect BG1, BG3, and sprites, while the upper case letters affect BG2, BG4, and the fixed color. Which of the layers in each set of three is then determined by the particular address you modify:
  • $41: BG1 and BG2
  • $42: BG3 and BG4
  • $43: Sprites and fixed color
$7E0044 1 byte Hardware mirror Color addition select, mirror of $2130.
Format: ccmm--sd
  • cc = clip colors to black before math
  • mm = prevent color math
  • s = add subscreen (instead of fixed color)
  • d = enables direct color mode for 8bpp graphics (modes 3, 4, and 7)

For cc and mm, the values they are set to determine when they apply: 00 = never, 01 = outside color window only, 10 = inside color window only, 11 = always.
$7E0045 2 bytes Camera Column/row of Map16 tiles to use for VRAM upload when layer 1 is scrolling left/up. Its value is equal to $7E:001A (or $7E:001C if vertical) divided by #$10, minus #$08.
$7E0047 2 bytes Camera Column/row of Map16 tiles to use for VRAM upload when layer 1 is scrolling right/down. Its value is equal to $7E:001A (or $7E:001C if vertical) divided by #$10, plus #$17.
$7E0049 2 bytes Camera Column/row of Map16 tiles to use for VRAM upload when interactive layer 2 is scrolling left/up. Its value is equal to $7E:001E (or $7E:0020 if vertical) divided by #$10 (16), minus #$08.
$7E004B 2 bytes Camera Column/row of Map16 tiles to use for VRAM upload when interactive layer 2 is scrolling right/down. Its value is equal to $7E:001E (or $7E:0020 if vertical) divided by #$10, plus #$17.
$7E004D 2 bytes Camera Last X/Y value of layer 1 where VRAM upload of Map16 tiles was performed when scrolling left/up.
The low 4 bits are forced to zero (AND #$FFF0) in order to get scroll values on a 16 pixel boundary.
It is used to determine if a VRAM update is necessary during scrolling.
$7E004F 2 bytes Camera Last X/Y value of layer 1 where VRAM upload of Map16 tiles was performed when scrolling right/down.
The low 4 bits are forced to zero (AND #$FFF0) in order to get scroll values on a 16 pixel boundary.
It is used to determine if a VRAM update is necessary during scrolling.
$7E0051 2 bytes Camera Last X/Y value of interactive layer 2 where VRAM upload of Map16 tiles was performed when scrolling left/up.
The low 4 bits are forced to zero (AND #$FFF0) in order to get scroll values on a 16 pixel boundary.
It is used to determine if a VRAM update is necessary during scrolling.
$7E0053 2 bytes Camera Last X/Y value of interactive layer 2 where VRAM upload of Map16 tiles was performed when scrolling right/down.
The low 4 bits are forced to zero (AND #$FFF0) in order to get scroll values on a 16 pixel boundary.
It is used to determine if a VRAM update is necessary during scrolling.
$7E0055 1 byte Camera Direction of scrolling for Layer 1.
#$00 = left (or up); #$02 = right (or down).
Used to index the various camera tables at $7E0045 to $7E0048 and $7E004D to $7E0050.

When handling routine $00F70D, it is set to $00 if the player's on-screen X position is less than the value of $142A and $02 otherwise. This is used to determine which side to enable spawning sprites depending which side the player is on compared to $142A.

It is also temporarily set to #$01 during level load for loading onscreen sprites.
$7E0056 1 byte Camera Direction of scrolling for Layer 2.
#$00 = left (or up); #$02 = right (or down).
Used to index the various camera tables at $7E:0049 through $7E:004C and $7E:0051 through $7E:0054.
$7E0057 1 byte Blocks Used in the level loading code. It's the position within the subscreen.
Format: yyyyxxxx, where yyyy is the Y position (units of 16 pixels) and xxxx is the X position.
$7E0058 1 byte Empty Empty. Cleared on reset, titlescreen load and overworld load.
$7E0059 1 byte Blocks Used in the level loading routine as an indicator for the size of the object, or extended object type depending on what object is being loaded. Could be used as scratch RAM (except in ObjecTool and similar codes).
$7E005A 1 byte Blocks Used in the level loading routine as the object number. Could be used as scratch RAM (except in ObjecTool and similar codes).
$7E005B 1 byte Misc. Screen mode: CD----Vv.
C = Collision with either Layer 2 or Layer 3.
D = Disable collision with Layer 1.
V = Vertical Layer 2.
v = Vertical Layer 1.
- = unused.

For the most part, this address is managed by a table at $058417, which is indexed by the level mode setting. The only exception to this is that the C bit may also get set if Layer 3 tides are active.
$7E005C 1 byte Empty Empty. Cleared on reset, titlescreen load and overworld load.
$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.