Mega Man (NES)/RAM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Started RAM Map)
 
 
(26 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{rammap|game=Mega Man}}
{{rammap|game=Mega Man}}
<p>Note: Memory locations discovered using the 'FCEU' Emulator for Windows.</p>
<br>
<p>Given values: $Hexadecimal value(Decimal value), ex. $63(99)</p>
<p>Any values less than $0A(10) will only show the Hex value.</p>
<br>


{| border="1" cellpadding="1"
{| border="1" cellpadding="1"
|'''RAM'''  || '''Purpose'''
|'''RAM'''  || '''Function''' || '''Details'''
|-
| 0x0014 || Controller 1 buttons held ||
|-
| 0x0015 || Controller 2 buttons held ||
|-
| 0x0016 || Controller 1 buttons held || clone of 0x0014?
|-
| 0x0017 || Controller 2 buttons held || clone of 0x0015?
|-
| 0x0018 || Controller 1 buttons tapped ||
|-
| 0x0019 || Controller 2 buttons tapped ||
|-
| 0x001A || Camera X position ||
|-
| 0x001B || Camera X screen || when 0x001A gets larger than $FF(255), this value increases by $01
|-
| 0x001C || Camera state ||
{|border="1" cellpadding="0"
|$00||Default
|-
|$01||Changing the nametable (Ex.: scrolling within an area, creating the pause menu, blinking palette in the stage select screen,…)
|-
|$02||Freeze before and after scrolling to a new area
|-
|$40||Scrolling to a new area
|-
|}
|-
| 0x001E || Camera Y position ||
|-
| 0x0020 || Mega Man's X screen || when 0x0022 gets larger than $FF(255), this value increases by $01
|-
| 0x0021-22 || Mega Man's X position || 0x0021 is sub-pixel, 0x0022 is pixel
|-
| 0x0023 || Timer || increases by $01/frame. If we pause the game, it continues while in the menu, but when the game is unpaused, it reverts back to what value it had before pausing.
|-
| 0x0024-25 || Mega Man's Y position || 0x0024 is sub-pixel, 0x0025 is pixel
|-
| 0x002C || Type of object that Mega Man is touching from the top || $00-Air, $01-Solid, $02-Ladder, $03-Spike, $04-Ice, $05-Water
|-
| 0x0031 || Stage ID || $00-Cut Man, $01-Ice Man, $02-Bomb Man, $03-Fire Man, $04-Elec Man, $05-Guts Man, $06-Wily 1, $07-Wily 2, $08-Wily 3, $09-Wily 4, $0A(10)-Title Screen, $0B(11)-Ending BG
|-
| 0x0055 || Mega Man's I-frame Counter || Starts counting down from $6F(111) $01/frame each time Mega Man gets hurt. When it gets to zero, Mega Man stops being invincible. Notes: Mega Man's "is hurt" animation lasts from $6E(110) to $50(80).
|-
| 0x005D || Which enemies have been defeated/Weapons unlocked
{|border="1" cellpadding="1"
|bit 1||Bomb Man/Hyper Bomb
|-
|bit 2||Elec Man/Thunder Beam
|-
|bit 3||Guts Man/Super Arm
|-
|bit 4||Ice Man/Ice Slasher
|-
|bit 5||Cut Man/Rolling Cutter
|-
|bit 6||Fire Man/Fire Storm
|-
|bit 7||Magnet Beam
|-
|}
    ||Setting a bit will defeat/unlock the corresponding villain/weapon.  Set this byte to $FE(254) to go directly to Dr. Wily.
|-
| 0x005F || Weapon Select (Works only when pausing, otherwise values will be different.)
{|border="1" cellpadding="1"
|$00||Mega Buster(normal weapon)
|-
|$01||Hyper Bomb
|-
|$02||Thunder Beam
|-
|$03||Super Arm
|-
|$04||Ice Slasher
|-
|$05||Rolling Cutter
|-
|$06||Fire Storm
|-
|$07||Magnet Beam
|-
|}
    || This only controls the weapon function, it will not change his color.  You can select any weapon even if it's still locked.
|-
| 0x0060 || Are Mega Man's bullets on-screen || $C0(192)-are on-screen, $00-aren't on screen
Probably a boolean to see if some bullet collision-detection routine is executed or not.
|-
| 0x006A || Mega Man Life Bar Value || $1C(28)-Full, $00-Empty
|-
| 0x006B || Cut Man Weapon Energy || $1C(28)-Full, $00-Empty
|-
| 0x006C || Ice Man Weapon Energy || $1C(28)-Full, $00-Empty
|-
| 0x006D || Bomb Man Weapon Energy || $1C(28)-Full, $00-Empty
|-
|-
|06B || Life Remaining
| 0x006E || Fire Man Weapon Energy || $1C(28)-Full, $00-Empty
|-
|-
|072-078 || Score in BCD
| 0x006F || Elec Man Weapon Energy || $1C(28)-Full, $00-Empty
|-
| 0x0070 || Guts Man Weapon Energy || $1C(28)-Full, $00-Empty
|-
| 0x0071 || Magnet Beam Weapon Energy || $1C(28)-Full, $00-Empty
|-
| 0x0072-78 || Score || Each byte represents one digit in BCD. Starts with ones digit (0x0072)
|-
| 0x0094 || Type of object that Mega Man is touching from the sides || $00-Air, $01-Solid, $02-Ladder, $03-Spike, $04-Ice, $05-Water
|-
| 0x00A6 || Lives || Maximum is $80(128). Bit 7 set gives Game Over. Game will not raise it past $63(99).
|-
| 0x00AE || Bonus || Number of bonus energy balls picked up during level.  Is multiplied by 1000 at level completion screen.
|-
| 0x0100-FF || Stack || RAM used by CPU for stack.
|-
| 0x0200-FF || Sprite Data || 256 byte block that is transferred via DMA to PPU memory during each NMI Routine.
|-
| 0x03D0-DF || Palette Data || The whole BG palette. $10(16) bytes long.
|-
| 0x0440 || Mega Man's Blink Timer || Counts upwards $01/frame in pseudo base 9 ($07, $08, $10…) to $A8. Mega Man closes his eyes beginning at $A2 and lasting 9 frames.
|-
| 0x0500-7F || Sound Values || Each channel is attributed $20(32) addresses. Pulse 1, Pulse 2, Triangle and Noise, in that order.
{|border="1" cellpadding="0"
|$00||Note ID
|-
|$01||Music Pattern?
|-
|$02-03||Countdown for when note ends (in frame quarters)
|-
|$06||Vibrato Speed
|-
|$0a||Note Pitch ID
|-
|$0e||Current number of frames after note started
|-
|$14||Vibrato bend direction
|-
|$1d||Current number of frames after note or silence started
|-
|}
|-
| 0x06C1 || Boss Energy || $1C(28)-Full, $00-Empty
|-
|-
|}
|}
 
{{Internal Data|game=Mega Man}}
{{stub}}

Latest revision as of 19:59, 25 January 2024

Chip tiny.png The following article is a RAM map for Mega Man (NES).

Note: Memory locations discovered using the 'FCEU' Emulator for Windows.


Given values: $Hexadecimal value(Decimal value), ex. $63(99)

Any values less than $0A(10) will only show the Hex value.


RAM Function Details
0x0014 Controller 1 buttons held
0x0015 Controller 2 buttons held
0x0016 Controller 1 buttons held clone of 0x0014?
0x0017 Controller 2 buttons held clone of 0x0015?
0x0018 Controller 1 buttons tapped
0x0019 Controller 2 buttons tapped
0x001A Camera X position
0x001B Camera X screen when 0x001A gets larger than $FF(255), this value increases by $01
0x001C Camera state
$00 Default
$01 Changing the nametable (Ex.: scrolling within an area, creating the pause menu, blinking palette in the stage select screen,…)
$02 Freeze before and after scrolling to a new area
$40 Scrolling to a new area
0x001E Camera Y position
0x0020 Mega Man's X screen when 0x0022 gets larger than $FF(255), this value increases by $01
0x0021-22 Mega Man's X position 0x0021 is sub-pixel, 0x0022 is pixel
0x0023 Timer increases by $01/frame. If we pause the game, it continues while in the menu, but when the game is unpaused, it reverts back to what value it had before pausing.
0x0024-25 Mega Man's Y position 0x0024 is sub-pixel, 0x0025 is pixel
0x002C Type of object that Mega Man is touching from the top $00-Air, $01-Solid, $02-Ladder, $03-Spike, $04-Ice, $05-Water
0x0031 Stage ID $00-Cut Man, $01-Ice Man, $02-Bomb Man, $03-Fire Man, $04-Elec Man, $05-Guts Man, $06-Wily 1, $07-Wily 2, $08-Wily 3, $09-Wily 4, $0A(10)-Title Screen, $0B(11)-Ending BG
0x0055 Mega Man's I-frame Counter Starts counting down from $6F(111) $01/frame each time Mega Man gets hurt. When it gets to zero, Mega Man stops being invincible. Notes: Mega Man's "is hurt" animation lasts from $6E(110) to $50(80).
0x005D Which enemies have been defeated/Weapons unlocked
bit 1 Bomb Man/Hyper Bomb
bit 2 Elec Man/Thunder Beam
bit 3 Guts Man/Super Arm
bit 4 Ice Man/Ice Slasher
bit 5 Cut Man/Rolling Cutter
bit 6 Fire Man/Fire Storm
bit 7 Magnet Beam
Setting a bit will defeat/unlock the corresponding villain/weapon. Set this byte to $FE(254) to go directly to Dr. Wily.
0x005F Weapon Select (Works only when pausing, otherwise values will be different.)
$00 Mega Buster(normal weapon)
$01 Hyper Bomb
$02 Thunder Beam
$03 Super Arm
$04 Ice Slasher
$05 Rolling Cutter
$06 Fire Storm
$07 Magnet Beam
This only controls the weapon function, it will not change his color. You can select any weapon even if it's still locked.
0x0060 Are Mega Man's bullets on-screen $C0(192)-are on-screen, $00-aren't on screen

Probably a boolean to see if some bullet collision-detection routine is executed or not.

0x006A Mega Man Life Bar Value $1C(28)-Full, $00-Empty
0x006B Cut Man Weapon Energy $1C(28)-Full, $00-Empty
0x006C Ice Man Weapon Energy $1C(28)-Full, $00-Empty
0x006D Bomb Man Weapon Energy $1C(28)-Full, $00-Empty
0x006E Fire Man Weapon Energy $1C(28)-Full, $00-Empty
0x006F Elec Man Weapon Energy $1C(28)-Full, $00-Empty
0x0070 Guts Man Weapon Energy $1C(28)-Full, $00-Empty
0x0071 Magnet Beam Weapon Energy $1C(28)-Full, $00-Empty
0x0072-78 Score Each byte represents one digit in BCD. Starts with ones digit (0x0072)
0x0094 Type of object that Mega Man is touching from the sides $00-Air, $01-Solid, $02-Ladder, $03-Spike, $04-Ice, $05-Water
0x00A6 Lives Maximum is $80(128). Bit 7 set gives Game Over. Game will not raise it past $63(99).
0x00AE Bonus Number of bonus energy balls picked up during level. Is multiplied by 1000 at level completion screen.
0x0100-FF Stack RAM used by CPU for stack.
0x0200-FF Sprite Data 256 byte block that is transferred via DMA to PPU memory during each NMI Routine.
0x03D0-DF Palette Data The whole BG palette. $10(16) bytes long.
0x0440 Mega Man's Blink Timer Counts upwards $01/frame in pseudo base 9 ($07, $08, $10…) to $A8. Mega Man closes his eyes beginning at $A2 and lasting 9 frames.
0x0500-7F Sound Values Each channel is attributed $20(32) addresses. Pulse 1, Pulse 2, Triangle and Noise, in that order.
$00 Note ID
$01 Music Pattern?
$02-03 Countdown for when note ends (in frame quarters)
$06 Vibrato Speed
$0a Note Pitch ID
$0e Current number of frames after note started
$14 Vibrato bend direction
$1d Current number of frames after note or silence started
0x06C1 Boss Energy $1C(28)-Full, $00-Empty