Super Mario Bros. 3/RAM map

From Data Crystal
Jump to navigation Jump to search

NOTE: All values in Table are Hexadecimal unless noted otherwise.

Chip tiny.png The following article is a RAM map for Super Mario Bros. 3.

RAM Purpose
0A Temp. used to adjust main character sprite vertical position
14 Flag to return to map
15 Increased by one every game cycle. Used as timer
75 On map screen vertical position. Multiples of 20, unless in boat. Also horizontal position in levels measured in units of 8 blocks wide.
77 Page counter on map screen
78 On map screen vertical position (see next RAM location description)
79 On map screen horizontal position. Multiples of 20, unless in boat. If multipaged, E0 shifts screen right, then 60, then D0, then 50. Shifting back to the left occurs at 20, then A0, then 20, then A0.
87 Vertical position measured in units of 8 blocks wide
88-?? Enemy Sprite vertical positions on screen high byte
90 Mario/Luigi horizontal position. Changing may cause problems in Name Table.
A2 Mario/Luigi vetical position in levels.
A3-?? Enemy Sprite vertical positions on screen low byte
BD Current horizontal speed
BE-?? Enemy Sprite horizontal speed
CF Vertical velocity (in air)
D0-?? Enemy Sprite vertical speed
D8 In air flag
ED Current Form: 00-Small, 01-Super, 02-Fire, 03-Racoon, 04-Frog, 05-Bear, 06-Hammer
EE Mario/Luigi Character Sprite Displayed(gets set just before display)
EF Mario/Luigi status flag: 40 facing right, 00 facing left
0100-01FF CPU Stack
0376 Pause flag
03DD Power Meter in Status Bar, 7F is Full (Player Can Fly)
03F2 Map starman flag
03F3 Character selection on map (ED value or 7-cloud, 8-p-wing)
04F1 (??) Set to $00 to remove some sounds (i.e. full fly meter sound)
0515 Counts down to zero, next P-meter increment
0545 Level start entrance effect. 0-normal, 1-slide, 2-pipe upwaard, 3-pipe downward, 4-pipe from right, 5-pipe from left, 6-jump on anchor of ship, 7-scroll right and down
0552 Timer that is set after player is hit. Determine how long you flash (are invincible)
0553 Timer for star mario
0554 Timer for change suit poof effect (set value is 17)
0559 Set to FF for auto-control of player character
055A Auto-control mode. 0-normal, 1-run under ship, 2-jump on ship, 3-grab anchor, 4-screen scroll right and down for ship, 6-screen scrolls fast right
055C Mario's velocity; 4 bits precision for 1/256th of a pixel
055D 8 frame timer. Resets at the beginning of a level.
0567 Timer for P-Block
056E Timer that determines how long flight will last. Power Meter instantly empties when this hits zero. Setting to FF enables unlimited flight.
056F Ducking flag; Set to $FF for squat-float effect
0570 Number of frames ducking on white block
0575 Swimming flag
0577 Determines if Player is inside the Goomba Boot: 00-No, 01-Yes
0578 Character change flag. ED value+1, or 40-swim, 80-wear boot
057A Enable statue mario characteristic (gray & invincible, note: can't go down pipes with this characteristic enabled)
057B (??) Set to $FF to fill up fly meter while standing still
057C PrizeBoxCode
0584 Underwater / not underwater selection
0585 (??) Set to $FF to slide "right" (not left) through solid objects
0588 Timer for "Backstage" status
05EE-05F0 Time remaining
05F4 Stomp counter
0669 The item you'll get from a toad house
066F Card selection for the flashing card that you jump to get
0715-0717 current player score divided by dec10. (max F423F[dec999,999]) (There's a hard coded 0 in the score display)
0736 Mario # of Lives (max 63[dec99])
0737 Luigi # of Lives
0746 Mario's Form that he will start next level as. When the level is loaded this value gets transferred to 00ED.
0747 For Luigi; See 0746.
074D Horzontal subpixel position. (1/16 of a pixel)
075F Vertical subpixel position. (1/16 of a pixel)
0781 RNG. 72 bits LSFR.
6000-794F Active level data.
7D80-7D9B Each Byte Represents an Item that Mario is Carrying (Pressing 'B' while at Map Screen): 00-No Item, 01-Mushroom, 02-Flower, 03-Leaf, 04-Frog, 05-Bear, 06-Hammer Bro Suit, 07-Cloud, 08-P-Wing, 09-Star, 0A-Anchor, 0B-Hammer, 0C-Whistle, 0D-Music Box. 0E and above will most likely crash the game, not completely tested though.
7D9C-7D9E Each Byte Represents a reward card Mario has 00-No Item, 01-Mushroom, 02-Flower, 03-Star
7D9F-7DA1 Storage for Mario Score (/dec10)
7DA2 # of coins Mario has
7DA3-7DBE Each Byte Represents an Item that Luigi is Carrying (Pressing 'B' while at Map Screen): 00-No Item, 01-Mushroom, 02-Flower, 03-Leaf, 04-Frog, 05-Bear, 06-Hammer Bro Suit, 07-Cloud, 08-P-Wing, 09-Star, 0A-Anchor, 0B-Hammer, 0C-Whistle, 0D-Music Box. 0E and above will most likely crash the game, not completely tested though.
7DBF-7DC1 Each Byte Represents a reward card Luigi has 00-No Item, 01-Mushroom, 02-Flower, 03-Star
7DC2-7DC4 Storage for Luigi Score(/dec10)
7DC5 # of coins Luigi has
ACA2 (05) Mario falling gravity, added to Y vel each frame.
ACA6 (E0) Governs maximum achievable jump height. Every frame while a jump is in progress, the value at ACB3 (01) is added to 00CF. When this reaches E0, the gravity kicks in and the value at ACA2 (05) is added instead, causing Mario to rapidly start falling. Don't know how run-jumps factor in to this yet. Maybe a different initial jump velocity is set, because ACA6 is hardcoded.
ACB3 (01) Mario jump gravity, added to Y vel each frame while jump in progress.
BFCC Routine that clamps 00CF (Mario Y velocity) to the maximum ($45) when falling.