Mario Bros. (NES)/RAM map

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a RAM map for Mario Bros. (NES).

Address Description
0x0018 Controller 1 Held Down Buttons
0x0019 Controller 1 Held Down Buttons Except Jump which is tapped
0x0029 Current Game Mode (0=1P A, 1=1P B, 2=2P A, 3=2P B)
0x002A Fine-Timer
0x002B Fine-Timer For Unpausing the game
0x002D General Coarse-Timer
0x002E Coarse-Timer Until Next Enemy Spawn
0x003A Game A (0)/B (1) flag
0x0041 Current displayed level number
0x0048 Player 1 Lives
0x004C Player 2 Lives
0x0070 POW hits remaining
0x0071 Screen shake timer
0x0091-0x0093 High Score
0x0095-0x0097 Player 1 Score
0x0099-0x009B Player 2 Score
0x00FA-0x00FB Music related stuff
0x0200-0x02FF OAM Page
0x0300-0x047F Entities Array (each entity occupies 0x20 addresses, Mario is 0x0300, Luigi is 0x0320 and the rest is for the enemies)
+ 0x00 Is Entity Enabled ($00 = no, not $00 = yes)
+ 0x01 Entity Direction Flags ($01 = Right, $02 = Left, $04 = Slowing down horizontally, $40 = falling, $80 = rising)
+ 0x02 Entity Walk Forward by a pixel Timer Maximum
+ 0x03 Entity Platform Fine-Timer and Entity Walk Forward by a pixel Fine-Timer (possibly other timers)
+ 0x04 Entity Animation Frame
+ 0x05 Entity Sprite Map (how many sprites are displayed and where)
+ 0x06 Entity Animation Frame Starting Tile
+ 0x07 Entity Sprite Tile Properties And Palette
+ 0x08 Entity Y position in pixels
+ 0x09 Entity X position in pixels
+ 0x0F Entity Object ID ($00 = None, $01 = Mario, $02 = Luigi, $10 = shellcreeper, $20 = crab, $30 = fighterfly, $40 = coin, $80 = freezie, $B0 = fireball...)
+ 0x10 Entity Held Down Buttons Except Jump which is tapped
+ 0x12 Entity Walk State Timer
+ 0x14 Entity Walk State ($00 = 1/3 px/f, $01 = 1/2 px/f, $02 = 1 px/f)
+ 0x19-1A Entity background tile pointer
0x04B0 Bonus Game State ($00 = no bonus game, $01 = start bonus game, $02 = bonus game)
0x04B1 Bonus Timer (seconds)
0x04B2 Bonus Timer (deciseconds)
0x04B3 Bonus Timer (frames)
0x04B5 Bonus Coins collected P1
0x04B6 Bonus Coins collected P2
0x0682 Music SQ2 Note ID
0x0686 Music Noise Note ID
0x0691 Music SQ1 Note Length Timer Maximum