Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Super Mario Bros./RAM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Huge update. Most important stuff is in now. Somebody needs to check the enemy names.)
Line 9: Line 9:
!'''RAM'''  || '''Information'''
!'''RAM'''  || '''Information'''
|-
|-
|0001 || Mario's Animation
|0x0001      || Player's animation
|-
|-
|0002 || Y-axis position (for Mario)
|0x0002      || Something to do with player y (but it skips to 0 every x frames, even when you dont move)
|-
|-
|0003 || Direction Mario's facing
|0x0003      || Player's direction (and others).
* 1 - Right
* 2 - Left
|-
|-
|0004 || How much to load?
|0x0004      || How much to load
|-
|-
|0005 || X-axis position (for Mario)
|0x0005      || Something to do with player x (same as 0x0002)
|-
|-
|000A || Button state
|0x000A      || Button state AB (flags)
* 00 - No button
* 0x00 - No Button
* 04 - A
* 0x40 - A
* 08 - B
* 0x80 - B
* 0xC0 - Both
|-
|-
|000B || Direction-pad state (vertical)
|0x000B      || Vertical direction input state (flags);
*04 - Down
* 0x00 - No Button
*08 - Up
* 0x40 - Down
* 0x80 - Up
* 0xC0 - Both
|-
|-
|000D || Button state
|0x000E      || Player's state
* 00 - No button
* 0x00 - Leftmost of screen
* 04 - A
* 0x01 - Climbing vine
* 08 - B
* 0x02 - Entering pipe
* 0x03 - Pipe2
* 0x04 - Autowalk
* 0x05 - Autowalk
* 0x06 - Player dies
* 0x07 - ?
* 0x08 - Normal
* 0x09 - Cannot move
* 0x0B - Dying
* 0x0C - Palette cycling, can't move
|-
|-
|000E*|| Mario mode
|0x000F-0x0013|| Enemy drawn? Max 5 enemies at once.
* 00 - Leftmost of screen
* 0 - No
* 01 - Climbing vine
* 1 - Yes (not so much drawn as "active" or something)
* 02 - Entered pipe
* 03 - Pipe2
* 04 - Autowalk
* 05 - Autowalk
* 06 - Mario dies
* 08 - Normal
* 09 - Cannot move
* 0B - Dying
* 0C - Pallete Cycling, Can't move
|-
|-
|000F*|| Enemy mode
|0x0014      || Powerup drawn? (Corresponds with hitbox at 0x04C4). If a powerup is on screen and a second one would appear, the first one disappears (completely). You can see this in 1.1, get the star and open the powerup at the top. Hitbox is shared.
* 00 - Not shown
* 0 - No
* 01 - Shown
* 1 - Yes
|-
|-
|0014*|| Show sprite (bool)
|0x0016/A    || Enemy type (5x). (Sorry, not too familiar with names. I'm sure someone will fix them.)
* 0x00 - Green koopa
* 0x01 - Red koopa
* 0x02 - Buzzy beetle
* 0x03 - Red koopa
* 0x04 - Green koopa
* 0x05 - Hammer brother
* 0x06 - Goomba
* 0x07 - Blooper
* 0x08 - Bullet bill low
* 0x09 - Breen koopa paratroopa
* 0x0A - 0x09 flying
* 0x0B - Lakitu (comes back too, probably sets a timer when it dies)
* 0x0C - Lava fireball
* 0x0D - Pirahna
* 0x0E - Airborne fish
* 0x0F - Crashes game
* 0x10 - Bowser fireball
* 0x11 - Bullet bill high
* 0x12 - Spikeything
* 0x13 - Nothing
* 0x14 - Fishy
* 0x15 - Narrow bowser fireball
* 0x16 - Crap? (disappears, perhaps explosion animation?)
* 0x17 - ?
* 0x18 - ?
* 0x19 - ?
* 0x20/0x21/0x22 - Line of fireballs (like in castles)
* 0x21 - Long line of fireballs (castle) AND sets previous enemyslot to 0x20 or else only half of the line shows
* 0x23 - ?
* 0x24/0x25 - Vert lift
* 0x26/0x27 - Static lift
* 0x28 - Horizontal lift
* 0x29 - Static lift
* 0x2A - Horizontal forward moving lift with strange hitbox
* 0x2B/0x2C - Halves of double lift (like 1.2)
* 0x2D - Bowser (special), will try to set previous addr to 2D as well, if unable only his ass shows :) He also tries to reach a certain height, if not there already, before starting his routine.
* 0x30/0x031 - ?
* 0x32 - Trampoline (although you cant use it if you set it to 0x32 when the enemy was a goomba, haven't tested others)
* 0x33 - Bullet bill (low?)
* 0x34 - ?
* 0x35 - Toad!
* 0x36 - Crash
* 0x37 - ?
* 0x3A - Skewed goomba. dont think there are any others.
|-
|-
|0016*|| Current enemy type 1
|0x001B      || Powerup on screen
* 00 - Green Koopa
* 0x00 - No
* 01 - Red Koopa
* 0x2E - Yes
* 02 - Buzzy Beetle
* 03 - Red Koopa
* 04 - Green Koopa
* 05 - Hammer Brother
* 06 - Goomba
* 07 - Blooper
* 08 - Bullet Bill (low)
* 09 - Green Koopa Paratroopa
* 10 - Flying Green Koopa Paratroopa
* 11 - Lakitu
* 12 - Spiny
* 13 - Bizzare
* 14 - Airborne Fish
* 15 - crashes game
* 16 - Fire from Bowser
* 17 - Bullet Bill (high)
* 18 - Goomba
* 19 - nada
* 20 - fire thingy
* 2A - Surfing Lift
|-
|-
|0017|| Current enemy type 2
|0x001D      || Player "float" state
* 0x00 - Standing on solid/else
* 0x01 - Airborn by jumping
* 0x02 - Airborn by walking of a ledge
* 0x03 - Sliding down flagpole
|-
|-
|0018|| Current enemy type 3
|0x001F,0x0023|| Enemy state? Haven't tested much.
* 0x00 - Does _not_ mean they don't exist
* 0xFF - Will kill them off (like getting hit by a star)
|-
|-
|0019|| Current enemy type 4
|0x0023      || Powerup state/heading (there's probably another register to check)
* 0x02-0x06 - 'question block' hit sequence
* 0x07-0x11 - Powerup emerging sequence
* 0xC0 - When shroom airborn going right
* 0xC2 - When shroom airborn going left
* 0x80 - When powerup moving right (or not moving at all)
* 0x82 - When powerup moving left
|-
|-
|0019|| Current enemy type 5
|0x0024/5    || Fireball drawn (corresponds with hitbox coordinates 0x04C8/C) when not 0
|-
|-
|001B*|| Current power-up
|0x002A-0x0032|| Hammers (correspond with last 9 hitbox coordaintes, 0x04D0-0x04F3), when not 0
* 2E - Mushroom/Fire
|-
|-
|001D || Indication value for Mario
|0x0030/2    || Coins (corresponds with last three coordinates, 0x04E0, 0x04EC, 0x04F0), when not 0
* 00 - Standing
* 01 - Jumping
* 02 - Falling
* 03 - Sliding down flagpole
|-
|-
|0023 || Indication value for power-ups
|0x0033      || Player facing
* 06+ - Power-up checking routine is run
* 0 - Not on screen
* 80 - Power-up on screen
* 1 - Right
* 2 - Left
|-
|-
|002A*|| Coin anim (?)
|0x0039      || Powerup type (when on screen)
* 0 - Mushroom
* 1 - Flower
* 2 - Star
* 3 - 1up
|-
|-
|002B*|| Coin anim (?)
|0x0045      || Player facing
* 1 - Right
* 2 - Left
|-
|-
|002C*|| Coin anim (?)
|0x0046/A    || Enemy heading
* 1 - Right
* 2 - Left
|-
|-
|002D*|| Coin anim (?)
|0x004B      || Shroom heading
* 1 - Right
* 2 - Left
|-
|-
|002E*|| Coin anim (?)
|0x0057      || Player horizontal speed
* 0xD8<0 - Moving left
* 0x00 - Not moving
* 0<0x28 - Moving right
|-
|-
|002F*|| Coin anim (?)
|0x0058/C    || Enemy vertical speed
* 0xD8<0 - Moving left
* 0x00 - Not moving
* 0<0x28 - Moving right
|-
|-
|0030*|| Coin anim (?)
|0x006D      || Player horizontal position in level
|-
|-
|0031*|| Coin anim (?)
|0x006E-0x0072|| Enemy horizontal position in level
|-
|-
|0032*|| Run 200pts animation or throw hammer (?)
|0x0086      || Player x position on screen
|-
|-
|0033*|| Facing direction (for Mario)
|0x0087/B    || Enemy x position on screen
*00 - F1 - Right
*F2 - FF - Left
|-
|-
|0039*|| Power-up type on screen
|0x008C      || Powerup x position on screen
*00 - Mushroom
*01 - Fire Flower
*02 - Starman
*03 - 1UP)
|-
|-
|0045 || Facing direction (for Mario)
|0x009F      || Player vertical speed
*01 - Right
* Upward - 0xFB ~ 0xFF (FB = fastest)
*02 - Left
* Downward - 0x01 ~ 0x04 (04 = fastest)
|-
|-
|0046 || Enemy Direction
|0x00A0/4    || Enemy vertical speed
* Upward - 0xFB ~ 0xFF (FB = fastest)
* Downward - 0x01 ~ 0x04 (04 = fastest)
|-
|-
|0047 || Enemy Direction
|0x008F-0x0091|| Brick smash 1 y
|-
|-
|004B || Mushroom Sprite Direction
|0x0090/2    || Brick smash 2 y
*01 - Right
*02 - Left
|-
|-
|0057 || Horizontal speed (pos/neg)
|0x00B5      || Player vertical screen position
* viewport = 1
* above viewport = 0
* anywhere below viewport is >1
* (when falling down a pit this will increase up to 5)
|-
|-
|0058 || Enemy speed (pos/neg)
|0x00B6/A    || Enemy vertical screen position (same as player)
* viewport = 1
* above viewport = 0
* anywhere below viewport is >1
* (when falling down a pit this will increase up to 5)
|-
|-
|0059 || Enemy speed (pos/neg)
|0x00BB      || Powerup vertical screen position (same as player)
* viewport = 1
* above viewport = 0
* anywhere below viewport is >1
* (when falling down a pit this will increase up to 5)
|-
|-
|005A || Enemy speed (pos/neg)
|0x00CE      || Player y pos on screen (multiply with value at 0x00B5 to get level y pos)
|-
|-
|006D*|| Horitonal position (?)
|0x00CF-0x00D3|| Enemy y pos on screen (multiply with value at 0x00B6/A to get level y pos)
|-
|-
|0070 || Current page (?)
|0x00D4      || Powerup sprite y (multiply with value at 0x00BB to get level y pos)
|-
|-
|0071 || Current page (?)
|0x00D79      || Brick smash 1 x
|-
|-
|0072 || Current page (?)
|0x00D8/A    || Brick smash 2 x
|-
|-
|0073 || Current page - 1 (?)
|0x00A2/3    || Timers for the fireballlines (castles). I guess their position can be determined from this. Runs 0-0x1F for one circle (slow?)
|-
|-
|0086*|| X-axis position (for Mario)
|0x00E4/6    || Y of air bubbles when under water :p I think their x is equal to the player, not sure.
|-
|-
|0087*|| Current enemy 1 sprite x location
|0x008D      || Fireball 1 x
|-
|-
|0088*|| Current enemy 2 sprite x location
|0x008E      || Fireball 2 x
|-
|-
|008C*|| Current power up sprite x location
|0x00A6      || Fireball 1 y
|-
|-
|009F || Vertical speed
|0x00A7      || Fireball 2 y
|-
|-
|00B5 || Appears to be the screen height multiplier (ie [mario's y location at 00CE] * [this byte] = [mario's true y val])
|0x00D6      || Vertical 1 vert speed
|-
|-
|00CE*|| Mario sprite y pos
|0x00D7      || Fireball 2 vert speed
|-
|-
|00CF*|| Enemy 1 sprite y pos
|0x0110/5    || Score tiles (the floating numbers when you get points, this tells which number should be shown, it's a palette, surprise surprise...)
|-
|-
|00D0*|| Enemy 2 sprite y pos
|0x0117/B    || Score x
|-
|-
|00D4*|| Power up sprite y pos
|0x011E-0x0122|| Score y
|-
|-
|03AD || Mario x pos
|0x03AD      || Player x pos within current screen offset
|-
|-
|03AE || Enemy x pos
|0x03AE-0x03B2|| Enemy x pos within current screen offset
|-
|-
|03B8 || Mario vertical pos
|0x03B3      || Powerup x pos within current screen offset
|-
|-
|03B9 || Enemy vertical pos
|0x03B8      || Player y pos within current screen (vertical screens always offset at 0?)
|-
|-
|03C4*|| Mario palette #
|0x03B9/D    || Enemy y pos within current screen (vertical screens always offset at 0?)
|-
|-
|0400 || Horizontal movement counter
|0x03BE      || Powerup y pos within current screen (vertical screens always offset at 0?)
|-
|-
|0416 || Mario vert position
|0x03B8      || Player vertical pos?
|-
|-
|0433 || Mario vertical speed
|0x03AF      || When frozen, sets same x coord for both fireballs?
|-
|-
|0450 || F8 if running
|0x03BA      || When frozen, sets same y coord for both fireballs?
|-
|-
|0456 || 28 if running
|0x03C4      || Player palette, cycles when you have a star (not when you become fiery though, even though that uses the exact same cycles)
|-
|-
|0490*|| FF normal game play allows horizontal movement
|0x0400      || Some kind of horizontal movement counter
|-
|-
|04C4 || power up location 1
|0x0416      || Player; some kind of vertical movement counter
|-
|-
|04C6 || power up location 2
|0x0417/B    || Enemy; some kind of vertical movement counter
|-
|-
|06CE || Uses Bit 0 to toggle between the 2 fireballs
|0x043A      || Fireball stuff?
|-
|-
|06D4 || gold color cycle
|0x043B      || Fireball stuff?
|-
|-
|06D5 || Mario state (?) (B8 - small stand, [60, 70, 80] - small walk cycle, C8 - big stand, 20 - big jump, [00, 10, 20] - bigwalk cycle, 50 - crouch)
|0x0450      || Player's speed thingie
* 0xD8 - when running (only when moving, not breaking/turning around and not when standing still),  
* E8 - otherwise
|-
|-
|06FC || buttons pressed
|0x0456      || Enemy's speed thingie
* 0xD8 - when running (only when moving, not breaking/turning around and not when standing still),
* E8 - otherwise
|-
|-
|0700 || x speed
|0x0490      || Horizontal split offset, 0x00-0xFF (it moves up when the screen moves, not when the player moves and the screen does not, each 0-FF is a full screen)
|-
|-
|0701 || is skidding
|0x04AC      || Player hitbox (1x4 bytes, <<x1,y1> <x2,y2>>)
|-
|-
|0702 || E4 - is running, 30 - skidding, 98 normal
|0x04B0      || Enemy hitboxes (5x4 bytes, <<x1,y1> <x2,y2>>)
|-
|-
|0705 || some kind of horizontal movement counter, doesnt count while in air
|0x04C4      || Powerup hitbox (1x4 bytes, <<x1,y1> <x2,y2>>)
|-
|-
|070B || if true, runs big-small animation (doesnt affect state though)
|0x04C8      || (Fiery) fireball hitbox (2x4 bytes, <<x1,y1> <x2,y2>>)
|-
|-
|0714*|| 04 when crouching
|0x04D0      || Hammer hitbox (9x4 bytes, <<x1,y1> <x2,y2>>) (like from bowser, hammerbros)
|-
|-
|071A || current level room
|0x04E0      || Coin hitboxes (3x4 bytes, <<x1,y1> <x2,y2>>) (used for coins from questionmarks and when getting coins above bricks by hitting the brick)
|-
|-
|071B || next level room
|0x06CE      || Fireball counter (increments as you fire). First bit probably used to toggle between hitbox indices
|-
|-
|071C*|| affects marios Horiz pos (on screen only though?)
|0x06D4      || Cycle counter of gold coin in top of screen and image of questionmark blocks
|-
|-
|071D*|| affects marios Horiz pos (on screen only though?)
|0x06D5      || Player sprite Mario state (didn't check them myself)
* 0xB8 - small stand
* [0x60, 0x70, 0x80] - small walk cycle
* 0xC8 - big stand
* 0x20 - big jump
* [0x00, 0x10, 0x20] - bigwalk cycle
* 0x50 - crouch
|-
|-
|071F || scroll speed?
|0x06FC      || Player 1 input (regular flag pattern), select and start are reset after 1 frame. See 0x074A for more accurate input.
|-
|-
|0743 || if true, is cloud level (game sets to $03), can be set mid level
|0x06FD      || Player 2 input (regular flag pattern), select and start are reset after 1 frame. See 0x074B for more accurate input.
|-
|-
|0744 || affects background color
|0x0700      || Player speed in _either_ direction (0 - 0x28)
|-
|-
|0747 || timer (?) pauses enemies while set
|0x0701      || Is breaking when 1 (freeze this and you immediately stand still when you stop moving)
|-
|-
|074A || Buttons pressed
|0x0702      || Walk animation (didn't check values)
* 0xE4 - is running
* 0x30 - skidding
* 98 - normal
* Also some other values when starting to run or when turning around
|-
|-
|074E || "Gold" block pallette - 00 turns blocks into water world and makes bubble, but no swimming
|0x0705      || Some kind of counter that only runs when you press left or right
|-
|-
|0752 || if not 00 will crash game when level load
|0x070B      || When not 0, runs big-small animation (but does not affect anything internally)
|-
|-
|0753 || affects mario/luigi if set before level load, but prevents movement in level if not 00
|0x0714      || 0x04 when ducking as big mario, 0 otherwise (also when ducking as small). Keeps being 4 when you slide of an edge while ducking (so does not affect image, but does when set to 4 and being small...). When this register is frozen, you can move like normal, you're just ducking while doing so.
|-
|-
|0754 || if true, is small
|0x071A      || Current screen (in level)
|-
|-
|0756 || Player Power-Up State
|0x071B      || Next screen (in level)
{| border="1" cellpadding="1"
|0||Small Mario
|-
|1||Big Mario
|-
|2>||Fire Flower Mario
|-
|}
Does not alter sprite or color palette ''(i.e. small Mario fires fireballs)''
|-
|-
|0757 || set to 01 during "prelevel" screen
|0x071C      || Player x position, loads next screen when player past it?
|-
|-
|075A || lives
|0x071D      || Player x position, moves screen position forward when this moves
|-
|-
|075E || coins
|0x071E      || Some kind of load timer between levels (like bonus levels). Counts back, done when this is FF. you can see the level being built in memory up as this counter progresses, one frame at a time.
|-
|-
|075F || Current World number minus one.  This gets set to 23 when warp glitch in 1-2 takes you to level -1
|0x071F      || Some kind of load timer while scrolling, loading the next part up ahead? runs from 4 to 0
|-
|-
|0770*|| game mode (00 - demo, 01 - normal, 02 - End World, 03 - End Game (?) ) (set to 01 at the title screen and you start the game with the title screen showing )
|0x0743      || When true, new groundtiles and blocktiles will be loaded as clouds (coinblocks and questionmark blocks remain the same!)
|-
|-
|0771 ||
|0x0744      || Something with background palette
|-
|-
|0772*|| 00 restarts level
|0x0747      || Some kind of timer. when set, everything freezes; enemies, powerups, even loading of next screen.
|-
|-
|0773*|| Level palette (00 - normal, 01 - underwater, 02 - night, 03 - underground, 04 - castle)
|0x074A      || Buttons pressed player 1 (keeps updated, even while paused or whatever, the other register resets the start and select immediately)
|-
|-
|0774 || ?? changes on game and level start. crashes game if changed
|0x074B      || Buttons pressed player 2 (keeps updated, even while paused or whatever, the other register resets the start and select immediately)
|-
|-
|0775 || scroll speed (?)
|0x074E      || "Gold" block pallette - 00 turns blocks into water world and makes bubble, but no swimming
|-
|-
|0776*|| is paused (bool)
|0x0752      || If not 0 will crash game when level loads
|-
|-
|0777 || timer (set when pausing/unpausing
|0x0753      || Affects mario/luigi before level load, disables movement when not 0 after level load
|-
|-
|0778*|| affects blocks
|0x0754      || Player's state. This also affects hitting stuff. Decreases when you eat a mushroom! Increases when you get hit.
* 0 - Big
* 1 - Small
* 2 - When set to two, you can't hit blocks but you can stand on them... (no idea where this is used)
* 5 - Makes you small (even when your state is big or even fiery, in fiery case you become a small fiery)
|-
|-
|0779*|| affects colors.. most values crash, 1E default, 1F makes it grey scale
|0x0755      || Something with background. It moves up to 0x70 (sometimes even 0x72) when player moves. When this register is frozen, NOTHING changes in the level, not even internally.
|-
|-
|077A*|| if true, will load luigi when mario dies. you have to unset 0753 to move with luigi though
|0x0756      || Powerup state
* 0 - Small
* 1 - Big
* >2 - fiery
|-
|-
|0780*|| timer - (all timers count down from whatever value they are set to)
|0x075E      || Set to 1 during "prelevel" screen
|-
|-
|0781*|| timer - fired when fireball shot
|0x075A      || Lives
|-
|-
|0782*|| timer - fired when jumping
|0x075E      || Coins
|-
|-
|0783*|| timer
|0x075F      || "current world minus one. This gets set to 23 when warp glitch in 1-2 takes you to level -1 "
|-
|-
|0784*|| timer
|0x0770      || Game mode. Setting this will take affect immediately. You can skip a WORLD by setting it to 02 (and waiting a second or two). Crashes when set to >02 or when set to 02 in world 8. You can activate the demo at _any_ time. Set to 01 at the title screen and you start the game with the title screen showing.
* 00 - Start demo
* 01 - Start normal
* 02 - End current world
* 03 - End game (?)
|-
|-
|0785*|| timer
|0x0772      || Level loading setting. You can set this while playing.
- 00 - Restarts level
- 01 - Right before the start of a level
- 02 - Has an effect but unsure what (skip frame or input?)
- 03 - Reset level. When in a level when doing this midlevel, this sometimes teleports you to a bonuslevel. exiting that bonuslevel enters another bonuslevel (as if you were exiting a pipe though), and exiting that level enters the normal world again.
|-
|-
|0786*|| timer
|0x0773      || Level palette
* 00 - Normal
* 01 - Underwater
* 02 - Night
* 03 - Underground
* 04 - Castle
|-
|-
|0787 || ??
|0x0774      || ?? Changes on game and level start. Crashes game if changed
|-
|-
|0788*|| timer
|0x0775      || Scrollspeed
|-
|-
|0789 || ??
|0x0776      || Is paused
|-
|-
|078A*|| timer
|0x0777      || Timer when (un)pausing, you can only re/unpause when this is zero
|-
|-
|078B*|| timer
|0x0778      || Affects blocks and level, lowest bit seems to toggle loaded screen..? also affects sprite palletes of objects
|-
|-
|078C*|| timer
|0x0779      || Affects colors.. most values crash
* 1E - Default
* 1F - Makes it grey scale
|-
|-
|078D*|| timer
|0x077A      || If true, will load luigi when mario dies. You have to unset 0753 to move with luigi though
|-
|-
|078E*|| timer
|0x0780-0x07A2|| All kinds of timers. Should investigate more to see what timer does what. Some are explained below
|-
|-
|078F*|| timer
|0x0781      || Timer: fireball shot
|-
|-
|0790*|| timer
|0x0782      || Timer: when jumping
|-
|-
|0791*|| timer
|0x0795      || Timer: falling down a pit (and more...)
|-
|-
|0792*|| timer
|0x079E      || Timer: invincible after enemy collision. Freeze this register to anything but 0 and you remain invincible
|-
|-
|0793*|| timer
|0x079F      || Timer: star (when you have star)
|-
|-
|0794*|| timer
|0x07A0      || Timer: "prelevel" screen timer, fired again when level starts
|-
|-
|0795*|| timer - fired when you fall down a pit
|0x07A2      || Timer: demo start
|-
|-
|0796*|| timer
|0x07B1      || If true, you wont "die" after falling or getting hit while small. You will be unable to move at the bottom of the screen though until you set it to 00
|-
|-
|0x07D7/C    || High score (1000000 100000 10000 1000 100 10)
|-
|-
|0797*|| timer
|0x07DD-0x07E2|| Mario score (1000000 100000 10000 1000 100 10)
|-
|-
|0798*|| timer
|0x07D3/8    || Luigi score (1000000 100000 10000 1000 100 10)
|-
|-
|0799*|| timer
|0x07ED/E    || Coins (10 1) (on screen only) 
|-
|-
|079A*|| timer
|0x07F8/A    || Digits of time (100 10 1)
|-
|-
|079B*|| timer
|0x07FC      || Game difficulty (set when you beat the game)
|-
|079C*|| timer
|-
|079D*|| timer
|-
|079E*|| flashing timer (when you get hit and are invincible for a short while)
|-
|079F*|| starman timer
|-
|07A0*|| timer - "prelevel" screen timer, fired again when level starts
|-
|07A1*|| timer
|-
|07A2*|| timer - counts how long before demo is run on main screen
|-
|07A7 || ?? rapidly changing even when paused
|-
|07A8 || ?? rapidly changing even when paused
|-
|07A9 || ?? rapidly changing even when paused
|-
|07AA || ?? rapidly changing even when paused
|-
|07AB || ?? rapidly changing even when paused
|-
|07AC || ?? rapidly changing even when paused
|-
|07AD || ?? rapidly changing even when paused
|-
|07B1*|| if true, you wont "die" after falling or getting hit while small. you will be unable to move at the bottom of the screen though until you set it to 00)
|-
|07BD*|| timer (?) 10 when mushroom/fireflower block last hit (fired when power up grabbed or coin block hit)
|-
|07D7*|| high score - 1000000s
|-
|07D8*|| high score - 100000s
|-
|07D9*|| high score - 10000s
|-
|07DA*|| high score - 1000s
|-
|07DB*|| high score - 100s
|-
|07DC*|| high score - 10s
|-
|07DD*|| mario score - 1000000s
|-
|07DE*|| mario score - 100000s
|-
|07DF*|| mario score - 10000s
|-
|07E0*|| mario score - 1000s
|-
|07E1*|| mario score - 100s
|-
|07E2*|| mario score - 10s
|-
|07E3*|| luigi score - 1000000s
|-
|07E4*|| luigi score - 100000s
|-
|07E5*|| luigi score - 10000s
|-
|07E6*|| luigi score - 1000s
|-
|07E7*|| luigi score - 100s
|-
|07E8*|| luigi score - 10s
|-
|07ED*|| coins 10s (on screen only)
|-
|07EE*|| coins 1s (on screen only)
|-
|07F8*|| time - 100s
|-
|07F9*|| time - 10s
|-
|07FA*|| time - 1s
|-
|07FC*|| if true, game is harder (set after you beat the game)
|-
|17A2||timer for demo start
|}
|}


[[Category:Super Mario Bros.|RAM map]]
[[Category:Super Mario Bros.|RAM map]]

Revision as of 17:33, 29 July 2008

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

This data is relevant to Super Mario Bros. (JU) (PRG0) [!] and may not be correct for other dumps.

Table

RAM Information
0x0001 Player's animation
0x0002 Something to do with player y (but it skips to 0 every x frames, even when you dont move)
0x0003 Player's direction (and others).
  • 1 - Right
  • 2 - Left
0x0004 How much to load
0x0005 Something to do with player x (same as 0x0002)
0x000A Button state AB (flags)
  • 0x00 - No Button
  • 0x40 - A
  • 0x80 - B
  • 0xC0 - Both
0x000B Vertical direction input state (flags);
  • 0x00 - No Button
  • 0x40 - Down
  • 0x80 - Up
  • 0xC0 - Both
0x000E Player's state
  • 0x00 - Leftmost of screen
  • 0x01 - Climbing vine
  • 0x02 - Entering pipe
  • 0x03 - Pipe2
  • 0x04 - Autowalk
  • 0x05 - Autowalk
  • 0x06 - Player dies
  • 0x07 - ?
  • 0x08 - Normal
  • 0x09 - Cannot move
  • 0x0B - Dying
  • 0x0C - Palette cycling, can't move
0x000F-0x0013 Enemy drawn? Max 5 enemies at once.
  • 0 - No
  • 1 - Yes (not so much drawn as "active" or something)
0x0014 Powerup drawn? (Corresponds with hitbox at 0x04C4). If a powerup is on screen and a second one would appear, the first one disappears (completely). You can see this in 1.1, get the star and open the powerup at the top. Hitbox is shared.
  • 0 - No
  • 1 - Yes
0x0016/A Enemy type (5x). (Sorry, not too familiar with names. I'm sure someone will fix them.)
  • 0x00 - Green koopa
  • 0x01 - Red koopa
  • 0x02 - Buzzy beetle
  • 0x03 - Red koopa
  • 0x04 - Green koopa
  • 0x05 - Hammer brother
  • 0x06 - Goomba
  • 0x07 - Blooper
  • 0x08 - Bullet bill low
  • 0x09 - Breen koopa paratroopa
  • 0x0A - 0x09 flying
  • 0x0B - Lakitu (comes back too, probably sets a timer when it dies)
  • 0x0C - Lava fireball
  • 0x0D - Pirahna
  • 0x0E - Airborne fish
  • 0x0F - Crashes game
  • 0x10 - Bowser fireball
  • 0x11 - Bullet bill high
  • 0x12 - Spikeything
  • 0x13 - Nothing
  • 0x14 - Fishy
  • 0x15 - Narrow bowser fireball
  • 0x16 - Crap? (disappears, perhaps explosion animation?)
  • 0x17 - ?
  • 0x18 - ?
  • 0x19 - ?
  • 0x20/0x21/0x22 - Line of fireballs (like in castles)
  • 0x21 - Long line of fireballs (castle) AND sets previous enemyslot to 0x20 or else only half of the line shows
  • 0x23 - ?
  • 0x24/0x25 - Vert lift
  • 0x26/0x27 - Static lift
  • 0x28 - Horizontal lift
  • 0x29 - Static lift
  • 0x2A - Horizontal forward moving lift with strange hitbox
  • 0x2B/0x2C - Halves of double lift (like 1.2)
  • 0x2D - Bowser (special), will try to set previous addr to 2D as well, if unable only his ass shows :) He also tries to reach a certain height, if not there already, before starting his routine.
  • 0x30/0x031 - ?
  • 0x32 - Trampoline (although you cant use it if you set it to 0x32 when the enemy was a goomba, haven't tested others)
  • 0x33 - Bullet bill (low?)
  • 0x34 - ?
  • 0x35 - Toad!
  • 0x36 - Crash
  • 0x37 - ?
  • 0x3A - Skewed goomba. dont think there are any others.
0x001B Powerup on screen
  • 0x00 - No
  • 0x2E - Yes
0x001D Player "float" state
  • 0x00 - Standing on solid/else
  • 0x01 - Airborn by jumping
  • 0x02 - Airborn by walking of a ledge
  • 0x03 - Sliding down flagpole
0x001F,0x0023 Enemy state? Haven't tested much.
  • 0x00 - Does _not_ mean they don't exist
  • 0xFF - Will kill them off (like getting hit by a star)
0x0023 Powerup state/heading (there's probably another register to check)
  • 0x02-0x06 - 'question block' hit sequence
  • 0x07-0x11 - Powerup emerging sequence
  • 0xC0 - When shroom airborn going right
  • 0xC2 - When shroom airborn going left
  • 0x80 - When powerup moving right (or not moving at all)
  • 0x82 - When powerup moving left
0x0024/5 Fireball drawn (corresponds with hitbox coordinates 0x04C8/C) when not 0
0x002A-0x0032 Hammers (correspond with last 9 hitbox coordaintes, 0x04D0-0x04F3), when not 0
0x0030/2 Coins (corresponds with last three coordinates, 0x04E0, 0x04EC, 0x04F0), when not 0
0x0033 Player facing
  • 0 - Not on screen
  • 1 - Right
  • 2 - Left
0x0039 Powerup type (when on screen)
  • 0 - Mushroom
  • 1 - Flower
  • 2 - Star
  • 3 - 1up
0x0045 Player facing
  • 1 - Right
  • 2 - Left
0x0046/A Enemy heading
  • 1 - Right
  • 2 - Left
0x004B Shroom heading
  • 1 - Right
  • 2 - Left
0x0057 Player horizontal speed
  • 0xD8<0 - Moving left
  • 0x00 - Not moving
  • 0<0x28 - Moving right
0x0058/C Enemy vertical speed
  • 0xD8<0 - Moving left
  • 0x00 - Not moving
  • 0<0x28 - Moving right
0x006D Player horizontal position in level
0x006E-0x0072 Enemy horizontal position in level
0x0086 Player x position on screen
0x0087/B Enemy x position on screen
0x008C Powerup x position on screen
0x009F Player vertical speed
  • Upward - 0xFB ~ 0xFF (FB = fastest)
  • Downward - 0x01 ~ 0x04 (04 = fastest)
0x00A0/4 Enemy vertical speed
  • Upward - 0xFB ~ 0xFF (FB = fastest)
  • Downward - 0x01 ~ 0x04 (04 = fastest)
0x008F-0x0091 Brick smash 1 y
0x0090/2 Brick smash 2 y
0x00B5 Player vertical screen position
  • viewport = 1
  • above viewport = 0
  • anywhere below viewport is >1
  • (when falling down a pit this will increase up to 5)
0x00B6/A Enemy vertical screen position (same as player)
  • viewport = 1
  • above viewport = 0
  • anywhere below viewport is >1
  • (when falling down a pit this will increase up to 5)
0x00BB Powerup vertical screen position (same as player)
  • viewport = 1
  • above viewport = 0
  • anywhere below viewport is >1
  • (when falling down a pit this will increase up to 5)
0x00CE Player y pos on screen (multiply with value at 0x00B5 to get level y pos)
0x00CF-0x00D3 Enemy y pos on screen (multiply with value at 0x00B6/A to get level y pos)
0x00D4 Powerup sprite y (multiply with value at 0x00BB to get level y pos)
0x00D79 Brick smash 1 x
0x00D8/A Brick smash 2 x
0x00A2/3 Timers for the fireballlines (castles). I guess their position can be determined from this. Runs 0-0x1F for one circle (slow?)
0x00E4/6 Y of air bubbles when under water :p I think their x is equal to the player, not sure.
0x008D Fireball 1 x
0x008E Fireball 2 x
0x00A6 Fireball 1 y
0x00A7 Fireball 2 y
0x00D6 Vertical 1 vert speed
0x00D7 Fireball 2 vert speed
0x0110/5 Score tiles (the floating numbers when you get points, this tells which number should be shown, it's a palette, surprise surprise...)
0x0117/B Score x
0x011E-0x0122 Score y
0x03AD Player x pos within current screen offset
0x03AE-0x03B2 Enemy x pos within current screen offset
0x03B3 Powerup x pos within current screen offset
0x03B8 Player y pos within current screen (vertical screens always offset at 0?)
0x03B9/D Enemy y pos within current screen (vertical screens always offset at 0?)
0x03BE Powerup y pos within current screen (vertical screens always offset at 0?)
0x03B8 Player vertical pos?
0x03AF When frozen, sets same x coord for both fireballs?
0x03BA When frozen, sets same y coord for both fireballs?
0x03C4 Player palette, cycles when you have a star (not when you become fiery though, even though that uses the exact same cycles)
0x0400 Some kind of horizontal movement counter
0x0416 Player; some kind of vertical movement counter
0x0417/B Enemy; some kind of vertical movement counter
0x043A Fireball stuff?
0x043B Fireball stuff?
0x0450 Player's speed thingie
  • 0xD8 - when running (only when moving, not breaking/turning around and not when standing still),
  • E8 - otherwise
0x0456 Enemy's speed thingie
  • 0xD8 - when running (only when moving, not breaking/turning around and not when standing still),
  • E8 - otherwise
0x0490 Horizontal split offset, 0x00-0xFF (it moves up when the screen moves, not when the player moves and the screen does not, each 0-FF is a full screen)
0x04AC Player hitbox (1x4 bytes, <<x1,y1> <x2,y2>>)
0x04B0 Enemy hitboxes (5x4 bytes, <<x1,y1> <x2,y2>>)
0x04C4 Powerup hitbox (1x4 bytes, <<x1,y1> <x2,y2>>)
0x04C8 (Fiery) fireball hitbox (2x4 bytes, <<x1,y1> <x2,y2>>)
0x04D0 Hammer hitbox (9x4 bytes, <<x1,y1> <x2,y2>>) (like from bowser, hammerbros)
0x04E0 Coin hitboxes (3x4 bytes, <<x1,y1> <x2,y2>>) (used for coins from questionmarks and when getting coins above bricks by hitting the brick)
0x06CE Fireball counter (increments as you fire). First bit probably used to toggle between hitbox indices
0x06D4 Cycle counter of gold coin in top of screen and image of questionmark blocks
0x06D5 Player sprite Mario state (didn't check them myself)
  • 0xB8 - small stand
  • [0x60, 0x70, 0x80] - small walk cycle
  • 0xC8 - big stand
  • 0x20 - big jump
  • [0x00, 0x10, 0x20] - bigwalk cycle
  • 0x50 - crouch
0x06FC Player 1 input (regular flag pattern), select and start are reset after 1 frame. See 0x074A for more accurate input.
0x06FD Player 2 input (regular flag pattern), select and start are reset after 1 frame. See 0x074B for more accurate input.
0x0700 Player speed in _either_ direction (0 - 0x28)
0x0701 Is breaking when 1 (freeze this and you immediately stand still when you stop moving)
0x0702 Walk animation (didn't check values)
  • 0xE4 - is running
  • 0x30 - skidding
  • 98 - normal
  • Also some other values when starting to run or when turning around
0x0705 Some kind of counter that only runs when you press left or right
0x070B When not 0, runs big-small animation (but does not affect anything internally)
0x0714 0x04 when ducking as big mario, 0 otherwise (also when ducking as small). Keeps being 4 when you slide of an edge while ducking (so does not affect image, but does when set to 4 and being small...). When this register is frozen, you can move like normal, you're just ducking while doing so.
0x071A Current screen (in level)
0x071B Next screen (in level)
0x071C Player x position, loads next screen when player past it?
0x071D Player x position, moves screen position forward when this moves
0x071E Some kind of load timer between levels (like bonus levels). Counts back, done when this is FF. you can see the level being built in memory up as this counter progresses, one frame at a time.
0x071F Some kind of load timer while scrolling, loading the next part up ahead? runs from 4 to 0
0x0743 When true, new groundtiles and blocktiles will be loaded as clouds (coinblocks and questionmark blocks remain the same!)
0x0744 Something with background palette
0x0747 Some kind of timer. when set, everything freezes; enemies, powerups, even loading of next screen.
0x074A Buttons pressed player 1 (keeps updated, even while paused or whatever, the other register resets the start and select immediately)
0x074B Buttons pressed player 2 (keeps updated, even while paused or whatever, the other register resets the start and select immediately)
0x074E "Gold" block pallette - 00 turns blocks into water world and makes bubble, but no swimming
0x0752 If not 0 will crash game when level loads
0x0753 Affects mario/luigi before level load, disables movement when not 0 after level load
0x0754 Player's state. This also affects hitting stuff. Decreases when you eat a mushroom! Increases when you get hit.
  • 0 - Big
  • 1 - Small
  • 2 - When set to two, you can't hit blocks but you can stand on them... (no idea where this is used)
  • 5 - Makes you small (even when your state is big or even fiery, in fiery case you become a small fiery)
0x0755 Something with background. It moves up to 0x70 (sometimes even 0x72) when player moves. When this register is frozen, NOTHING changes in the level, not even internally.
0x0756 Powerup state
  • 0 - Small
  • 1 - Big
  • >2 - fiery
0x075E Set to 1 during "prelevel" screen
0x075A Lives
0x075E Coins
0x075F "current world minus one. This gets set to 23 when warp glitch in 1-2 takes you to level -1 "
0x0770 Game mode. Setting this will take affect immediately. You can skip a WORLD by setting it to 02 (and waiting a second or two). Crashes when set to >02 or when set to 02 in world 8. You can activate the demo at _any_ time. Set to 01 at the title screen and you start the game with the title screen showing.
  • 00 - Start demo
  • 01 - Start normal
  • 02 - End current world
  • 03 - End game (?)
0x0772 Level loading setting. You can set this while playing.

- 00 - Restarts level - 01 - Right before the start of a level - 02 - Has an effect but unsure what (skip frame or input?) - 03 - Reset level. When in a level when doing this midlevel, this sometimes teleports you to a bonuslevel. exiting that bonuslevel enters another bonuslevel (as if you were exiting a pipe though), and exiting that level enters the normal world again.

0x0773 Level palette
  • 00 - Normal
  • 01 - Underwater
  • 02 - Night
  • 03 - Underground
  • 04 - Castle
0x0774 ?? Changes on game and level start. Crashes game if changed
0x0775 Scrollspeed
0x0776 Is paused
0x0777 Timer when (un)pausing, you can only re/unpause when this is zero
0x0778 Affects blocks and level, lowest bit seems to toggle loaded screen..? also affects sprite palletes of objects
0x0779 Affects colors.. most values crash
  • 1E - Default
  • 1F - Makes it grey scale
0x077A If true, will load luigi when mario dies. You have to unset 0753 to move with luigi though
0x0780-0x07A2 All kinds of timers. Should investigate more to see what timer does what. Some are explained below
0x0781 Timer: fireball shot
0x0782 Timer: when jumping
0x0795 Timer: falling down a pit (and more...)
0x079E Timer: invincible after enemy collision. Freeze this register to anything but 0 and you remain invincible
0x079F Timer: star (when you have star)
0x07A0 Timer: "prelevel" screen timer, fired again when level starts
0x07A2 Timer: demo start
0x07B1 If true, you wont "die" after falling or getting hit while small. You will be unable to move at the bottom of the screen though until you set it to 00
0x07D7/C High score (1000000 100000 10000 1000 100 10)
0x07DD-0x07E2 Mario score (1000000 100000 10000 1000 100 10)
0x07D3/8 Luigi score (1000000 100000 10000 1000 100 10)
0x07ED/E Coins (10 1) (on screen only)
0x07F8/A Digits of time (100 10 1)
0x07FC Game difficulty (set when you beat the game)