394 lines
36 KiB
HTML
394 lines
36 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><title>NES RAM (Mapping/Finding Values)</title>
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
<style type="text/css"><!--
|
|
body {
|
|
margin: 5px 5px 5px 5px;
|
|
background-color: #ffffff;
|
|
}
|
|
/* ========== Text Styles ========== */
|
|
hr { color: #000000}
|
|
body, table /* Normal text */
|
|
{
|
|
font-size: 10pt;
|
|
font-family: 'Arial', 'Helvetica', sans-serif;
|
|
font-style: normal;
|
|
font-weight: normal;
|
|
color: #000000;
|
|
text-decoration: none;
|
|
;
|
|
}
|
|
span.rvts1 /* Heading */
|
|
{
|
|
font-weight: bold;
|
|
color: #0000ff;
|
|
}
|
|
span.rvts2 /* Subheading */
|
|
{
|
|
font-weight: bold;
|
|
color: #000080;
|
|
}
|
|
span.rvts3 /* Keywords */
|
|
{
|
|
font-style: italic;
|
|
color: #800000;
|
|
}
|
|
a.rvts4, span.rvts4 /* Jump 1 */
|
|
{
|
|
color: #008000;
|
|
text-decoration: underline;
|
|
}
|
|
a.rvts5, span.rvts5 /* Jump 2 */
|
|
{
|
|
color: #008000;
|
|
text-decoration: underline;
|
|
}
|
|
span.rvts6 /* Font Hint */
|
|
{
|
|
color: #808080;
|
|
}
|
|
span.rvts7 /* Font Hint Title */
|
|
{
|
|
font-size: 15pt;
|
|
font-family: 'Tahoma', 'Geneva', sans-serif;
|
|
font-weight: bold;
|
|
color: #404040;
|
|
}
|
|
span.rvts8 /* Font Hint Bold */
|
|
{
|
|
font-weight: bold;
|
|
color: #808080;
|
|
}
|
|
span.rvts9 /* Font Hint Italic */
|
|
{
|
|
font-style: italic;
|
|
color: #808080;
|
|
}
|
|
span.rvts10
|
|
{
|
|
font-size: 18pt;
|
|
}
|
|
span.rvts11
|
|
{
|
|
font-size: 24pt;
|
|
text-decoration: underline;
|
|
}
|
|
a.rvts12, span.rvts12
|
|
{
|
|
color: #0000ff;
|
|
text-decoration: underline;
|
|
}
|
|
a.rvts12:hover { color: #0000ff; }
|
|
span.rvts13
|
|
{
|
|
font-size: 12pt;
|
|
}
|
|
span.rvts14
|
|
{
|
|
text-decoration: underline;
|
|
}
|
|
span.rvts15
|
|
{
|
|
font-size: 14pt;
|
|
text-decoration: underline;
|
|
}
|
|
span.rvts16
|
|
{
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
}
|
|
span.rvts17
|
|
{
|
|
font-weight: bold;
|
|
}
|
|
span.rvts18
|
|
{
|
|
font-style: italic;
|
|
}
|
|
span.rvts19
|
|
{
|
|
font-family: 'Lucida Console', 'Monaco', monospace;
|
|
}
|
|
span.rvts20
|
|
{
|
|
font-family: 'Lucida Console', 'Monaco', monospace;
|
|
text-decoration: underline;
|
|
}
|
|
span.rvts21 /* Font Style */
|
|
{
|
|
font-size: 16pt;
|
|
font-family: 'Tahoma', 'Geneva', sans-serif;
|
|
color: #ffffff;
|
|
}
|
|
span.rvts22 /* Font Style */
|
|
{
|
|
font-family: 'MS Sans Serif', 'Geneva', sans-serif;
|
|
color: #808080;
|
|
}
|
|
span.rvts23 /* Font Style */
|
|
{
|
|
font-family: 'Verdana', 'Geneva', sans-serif;
|
|
font-style: italic;
|
|
color: #c0c0c0;
|
|
}
|
|
a.rvts24, span.rvts24 /* Font Style */
|
|
{
|
|
font-family: 'Verdana', 'Geneva', sans-serif;
|
|
font-style: italic;
|
|
color: #6666ff;
|
|
text-decoration: underline;
|
|
}
|
|
/* ========== Para Styles ========== */
|
|
p,ul,ol /* Paragraph Style */
|
|
{
|
|
text-align: left;
|
|
text-indent: 0px;
|
|
padding: 0px 0px 0px 0px;
|
|
margin: 0px 0px 0px 0px;
|
|
}
|
|
.rvps1 /* Centered */
|
|
{
|
|
text-align: center;
|
|
}
|
|
.rvps2 /* Paragraph Style */
|
|
{
|
|
background: #9fbed0;
|
|
margin: 0px 0px 20px 0px;
|
|
}
|
|
.rvps3 /* Paragraph Style */
|
|
{
|
|
text-align: center;
|
|
background: #e4e4e4;
|
|
margin: 20px 0px 0px 0px;
|
|
}
|
|
.rvps4 /* Paragraph Style */
|
|
{
|
|
border-color: #c0c0c0;
|
|
border-style: solid;
|
|
border-width: 1px;
|
|
border-right: none;
|
|
border-bottom: none;
|
|
border-left: none;
|
|
background: #ffffff;
|
|
padding: 3px 0px 0px 0px;
|
|
margin: 27px 0px 0px 0px;
|
|
}
|
|
--></style>
|
|
<script type="text/javascript">if(top.frames.length == 0) { top.location.href="../fceux-2.0.2.htm?{C652C305-E5FC-4C80-BCCD-721D9B6235EF}.htm"; }</script>
|
|
<meta name="generator" content="HelpNDoc Free"></head>
|
|
<body>
|
|
|
|
<p class=rvps2><span class=rvts21>NES RAM (Mapping/Finding Values)</span></p>
|
|
<p><span class=rvts11>NES Mapping</span></p>
|
|
<p><br></p>
|
|
<p>This guide gives a map of the addresses in the NES cpu and explains each portion in detail. </p>
|
|
<p><br></p>
|
|
<p>It also provides information for the basic layout of ram values in typical NES games. This info can be used to quickly map and find useful values in the game's ram.</p>
|
|
<p><br></p>
|
|
<p><span class=rvts10>Contents</span></p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Memory Map</span></p>
|
|
<p> Gives a diagram of the 2A03 CPU memory map .</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>2C02 PPU memory map</span></p>
|
|
<p> Gives more detailed info about each section of the Memory map diagram</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Game Ram Details</span></p>
|
|
<p> On board RAM Map ($000-$07FF) Map (gives specific info on the how NES games typically layout their ram values)</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Online Resources</span></p>
|
|
<p><a class=rvts12 href="http://en.wikibooks.org/wiki/NES_Programming">NES Programming - Wikipedia</a></p>
|
|
<p><a class=rvts12 href="http://everything2.com/e2node/NES%2520memory%2520map">NES Memory Map</a></p>
|
|
<p><br></p>
|
|
<p><span class=rvts10><br></span></p>
|
|
<p><span class=rvts10>Memory Map </span><span class=rvts13>(NES RAM/ROM)</span></p>
|
|
<p><br></p>
|
|
<p>2A03 CPU memory map</p>
|
|
<p>2A03 CPU is a 6502-compatible CPU without the decimal mode (CLD and SED do nothing). It has an on-die sound generator, very limited DMA capability, and an input device controller that can be accessed through the 2A03 registers.</p>
|
|
<p><br></p>
|
|
<p> </p>
|
|
<p><span class=rvts15>6502 CPU Memory Map </span></p>
|
|
<p>Address Range Size in bytes Notes (Page size = 256bytes)</p>
|
|
<p><span class=rvts14>(Hexadecimal) </span></p>
|
|
<p><br></p>
|
|
<p>$0000 - $07FF 2048 Game Ram</p>
|
|
<p><br></p>
|
|
<p>($0000 - $00FF) 256 Zero Page - Special Zero Page addressing modes give faster memory read/write access</p>
|
|
<p>($0100 - $01FF) 256 Stack memory</p>
|
|
<p>($0200 - $07FF) 1536 RAM</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$0800 - $0FFF 2048 Mirror of $0000-$07FF </p>
|
|
<p><br></p>
|
|
<p>($0800 - $08FF) 256 Zero Page</p>
|
|
<p>($0900 - $09FF) 256 Stack</p>
|
|
<p>($0A00 - $0FFF) 1024 Ram</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$1000 - $17FF 2048 bytes Mirror of $0000-$07FF</p>
|
|
<p><br></p>
|
|
<p>($1000 - $10FF) 256 Zero Page</p>
|
|
<p>$1100 - $11FF 256 Stack</p>
|
|
<p>$1200 - $17FF 1024 RAM</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$1800 - $1FFF 2048 bytes Mirror of $0000-$07FF </p>
|
|
<p><br></p>
|
|
<p>($1800 - $18FF) 256 Zero Page</p>
|
|
<p>($1900 - $19FF) 256 Stack</p>
|
|
<p>($1A00 - $1FFF) 1024 RAM</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$2000 - $2007 8 bytes Input / Output registers</p>
|
|
<p>$2008 - $3FFF 8184 bytes Mirror of $2000-$2007 (mulitple times)</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$4000 - $401F 32 bytes Input / Output registers</p>
|
|
<p>$4020 - $5FFF 8160 bytes Expansion ROM - Used with Nintendo's MMC5 to expand the capabilities of VRAM.</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$6000 - $7FFF 8192 bytes SRAM - Save Ram used to save data between game plays.</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p>$8000 - $BFFF 16384 bytes PRG-ROM lower bank - executable code</p>
|
|
<p>$C000 - $FFFF 16384 bytes PRG-ROM upper bank - executable code</p>
|
|
<p>$FFFA - $FFFB 2 bytes Address of Non Maskable Interrupt (NMI) handler routine</p>
|
|
<p>$FFFC - $FFFD 2 bytes Address of Power on reset handler routine</p>
|
|
<p>$FFFE - $FFFF 2 bytes Address of Break (BRK instruction) handler routine</p>
|
|
<p><span class=rvts14> </span></p>
|
|
<p><br></p>
|
|
<p><br></p>
|
|
<p><span class=rvts10>2C02 PPU memory map</span></p>
|
|
<p><br></p>
|
|
<p>2C02 PPU is a character generator with sprites, designed by Nintendo specifically for the NES.</p>
|
|
<p><br></p>
|
|
<p> __________________________________________</p>
|
|
<p>0000| Pattern table 0 |</p>
|
|
<p> |__________________________________________|</p>
|
|
<p>1000| Pattern table 1 |</p>
|
|
<p> |__________________________________________| _____ _____</p>
|
|
<p>2000| Nametable 0 | | | |</p>
|
|
<p> |__________________________________________| | 0 | 1 |</p>
|
|
<p>2400| Nametable 1 | |_____|_____|</p>
|
|
<p> |__________________________________________| | | |</p>
|
|
<p>2800| Nametable 2 | | 2 | 3 |</p>
|
|
<p> |__________________________________________| |_____|_____|</p>
|
|
<p>2c00| Nametable 3 |</p>
|
|
<p> |__________________________________________|</p>
|
|
<p>3000| Mirror of $2000-$2eff |</p>
|
|
<p> |__________________________________________|</p>
|
|
<p>3f00| Palette |</p>
|
|
<p> |__________________________________________|</p>
|
|
<p>3f20| Mirrors of $3f00-$3f1f |</p>
|
|
<p> |__________________________________________|</p>
|
|
<p><br></p>
|
|
<p>The NES PPU has enough RAM for two nametables (0 and 3); it brings some PPU nametable address lines to the cart edge so that the cart can decide whether to map 0 onto 2 and 1 onto 3 (vertical mirroring as in Super Mario Brothers and Contra) or 0 onto 1 and 2 onto 3 (horizontal mirroring as in Kid Icarus and Ikari), all screens to either 0 or 3 (as in many Rare games such as Battletoads and Jeopardy!), or all screens to RAM on the cartridge (as in Gauntlet). Split-screen games that scroll in all four directions (such as Super Mario Brothers 3 and Kirby's Adventure) often use vertical or one-screen mirroring (with a small amount of screen corruption at the sides due to tiles wrapping around the sides) and stick the status bar in some random unused area of the screen. </p>
|
|
<p><br></p>
|
|
<p><br></p>
|
|
<p><span class=rvts10>Game RAM Details</span></p>
|
|
<p> Mapping RAM/Finding Ram</p>
|
|
<p> Written by: adelikat</p>
|
|
<p><br></p>
|
|
<p>This guide is written specifically for finding useful values for TAS <a class=rvts12 href="{695C964E-B83F-4A6E-9BA2-1A975387DB55}.htm">movie making</a>. </p>
|
|
<p>It does not tell you how to use specific tools to find values. For that refer to <a class=rvts12 href="{06F7BBD5-399E-4CA0-8E4E-75BE0ACC525A}.htm">Hex editor</a>, <a class=rvts12 href="{B37E7A47-E65F-4544-BDDF-39BE708BA68F}.htm">Cheat Search</a>, and <span class=rvts12>RAM filter</span>.</p>
|
|
<p><br></p>
|
|
<p>Most games use the basic on board ram. The address range of this ram is $0000-$07FF. This translates to 2048 possible ram values.</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Pages</span></p>
|
|
<p><br></p>
|
|
<p>This ram is broken down into 8 pages. A "page" is a block of 256 ram values.</p>
|
|
<p><br></p>
|
|
<p>I will refer to these values as such:</p>
|
|
<p>Block 0 $00xx ($0000-$00FF)</p>
|
|
<p>Block 1 $01xx ($0100-$01FF)</p>
|
|
<p>Block 2 $02xx ($0200-$02FF)</p>
|
|
<p>Block 3 $03xx ($0300-$03FF)</p>
|
|
<p>Block 4 $04xx ($0400-$04FF)</p>
|
|
<p>Block 5 $05xx ($0500-$05FF)</p>
|
|
<p>Block 6 $06xx ($0600-$06FF)</p>
|
|
<p>Block 7 $07xx ($0700-$07FF)</p>
|
|
<p><br></p>
|
|
<p>Each block will be organized will similar data. For instance, all sprite data will be in the same block. Enemy/Player statistics (energy, coordinates, speed, etc.) will be in another. For instance, if you find the main character's HP and it is located in block 3, you know that the remaining stats for the character are also in that block. This can significantly cut down time when trying to find related values.</p>
|
|
<p><br></p>
|
|
<p>There are always the following blocks:</p>
|
|
<p><br></p>
|
|
<p><span class=rvts17>Sprite Data </span>Block 2</p>
|
|
<p><br></p>
|
|
<p>I've yet to see map a game that does not use this block solely for sprite data. It will contain the "ID" numbers for all the items currently on the screen. Simply put, this data is precisely the data you see on the screen. For making TAS movies this is not useful data. If you are using cheat search and have narrowed it down your search to a few values, you can immediately discard any $02xx values.</p>
|
|
<p><br></p>
|
|
<p>In games with a lot of sprite data, I've seen blocks 1 & 3 also reserved for sprite data.</p>
|
|
<p><br></p>
|
|
<p><span class=rvts17>Music & Sound FX </span>Block 1 or 7, generally</p>
|
|
<p><br></p>
|
|
<p>This one has more deviation, but almost all games reserve an entire block for memory allocated to the game's Music and Sound FX. Again, for TAS purposes these values are not *useful. By finding even 1 of these values, you can eliminate that block from your search possibilities. Finding which block is reserved for music is often quite simple with the <a class=rvts12 href="{06F7BBD5-399E-4CA0-8E4E-75BE0ACC525A}.htm">Hex editor</a>. Watching the ram values with the game playing, you can see which addresses "move to the beat". </p>
|
|
<p><br></p>
|
|
<p>*Actually they can come in handy for "dancing to the beat"</p>
|
|
<p><br></p>
|
|
<p><span class=rvts17>Player & Enemy Stats</span> Blocks 1,3,4,5 generally (any or all of these)</p>
|
|
<p><br></p>
|
|
<p>This is your "sweet spot" for movie making, as often you will be wanting to track the players speed or coordinates, enemy energy, or enemy coordinates.</p>
|
|
<p><br></p>
|
|
<p>These values rarely (if at all) reside outside blocks 1, 3, 4, or 5. This knowledge already reduces your search possibilities in half!</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Rows </span></p>
|
|
<p><span class=rvts16><br></span></p>
|
|
<p>Each block is broken down into 16 "rows" of addresses. For example, in block 3, the first row is $030x ($0300-$030F).</p>
|
|
<p><br></p>
|
|
<p>Each row of 16* will contain similar data. For instance all x coordinates will generally be in the same row. So xxx0 might be the main characters x position. xxxx1 would be "enemy 1" (1st enemy loaded onto the screen), and so on.</p>
|
|
<p><br></p>
|
|
<p>The y coordinates would be in another row, x subpixel values in yet another row, etc.</p>
|
|
<p><br></p>
|
|
<p>*Super Mario Bros. 2 (U) is a rare example that uses rows of 10</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Columns</span></p>
|
|
<p><br></p>
|
|
<p>A column would be all the values of a block that share the same last digit. So a column would be 16 addresses such as $0300, $0310, $0320, etc.</p>
|
|
<p><br></p>
|
|
<p>For enemy/player stats, columns usually refer to the same player or enemy.</p>
|
|
<p><br></p>
|
|
<p>So for example, if a player's energy was stored in $0300. The remaining row will be other player/enemy's energy. </p>
|
|
<p><br></p>
|
|
<p>If the next row ($031x) is x positions. $0310 would be the player's x position. The remaining positions of that row would correspond to the other player/enemy x positions in line with the hp values of the previous row.</p>
|
|
<p><br></p>
|
|
<p><span class=rvts16>Example</span></p>
|
|
<p><br></p>
|
|
<p>These distinctions are easier to see in a visual example. This is the enemy/player stats as they are mapped in the game <span class=rvts18>Teenage Mutant Ninja Turtles</span>.</p>
|
|
<p><br></p>
|
|
<p><span class=rvts17>Block 4</span></p>
|
|
<p><span class=rvts20> P W1 W2 W3 E1 E2 E3 E4 E5 E6 E7 E8 X X X X </span></p>
|
|
<p><span class=rvts19>Sprite ID: 040x: 09 00 00 00 00 9E 9E 9E 9E 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>ID counter: 041x: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Timer/sp change: 042x: 02 00 00 00 00 03 03 03 03 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>hit animation: 043x: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>characteristics: 044x: 00 00 00 00 00 8D 8D 8D 8D 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>characteristics: 045x: C2 00 00 00 00 C2 C2 C3 C3 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Y position: 046x: 4C 00 00 00 00 B4 B4 64 B4 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Y subpixel: 047x: 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>X position: 048x: 50 00 00 00 00 79 B9 CC CC 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>X subpixel: 049x: 80 00 00 00 00 C0 C0 C0 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Not used: 04ax: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Y pix speed: 04bx: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Y subpix speed: 04cx: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>Not used: 04dx: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>X pix speed: 04ex: 00 00 00 00 00 01 01 FE FE 00 00 00 00 00 00 00</span></p>
|
|
<p><span class=rvts19>X subpix speed: 04fx: 00 00 00 00 00 60 60 A0 A0 00 00 00 00 00 00 00</span></p>
|
|
<p><br></p>
|
|
<p>P = current turtle (player)</p>
|
|
<p>W = weapon (up to 3 on the screen at one time)</p>
|
|
<p>E = enemy (up to 8 on the screen at one time)</p>
|
|
<p>X = no use</p>
|
|
<p><br></p>
|
|
<p>E1 = "Enemy slot 1" which will be the first enemy on the screen loaded into memory. The 2nd will be placed in "Enemy slot 2". When enemy 1 is removed from memory (killed or goes off screen), the next enemy will be loaded into that slot. Enemy's always take the lowest available slot when loaded. Note: usually enemy slots are in reverse order. So the first addresses is usually the last enemy slot loaded into memory. TMNT is an exception.</p>
|
|
<p><br></p>
|
|
<p>All object (player, weapon, enemy) characteristics reside in block 4.</p>
|
|
<p>Each row is a different characteristic of each object on the screen (040x refers to a sprite ID of an object)</p>
|
|
<p>Each column corresponds to a specific object on the screen. (All 04x0 's refer to the player).</p>
|
|
<p><br></p>
|
|
<p>See also, <a class=rvts12 href="{01ABA5FD-D54A-44EF-961A-42C7AA586D95}.htm">Memory Watch</a>, <a class=rvts12 href="{06F7BBD5-399E-4CA0-8E4E-75BE0ACC525A}.htm">Hex Editor</a>,<a class=rvts12 href="{B37E7A47-E65F-4544-BDDF-39BE708BA68F}.htm"> Cheat Search</a>, <span class=rvts12>Ram Filter</span>, <a class=rvts12 href="{695C964E-B83F-4A6E-9BA2-1A975387DB55}.htm">Movie Making</a>, <a class=rvts12 href="{FFA06380-625B-4EF0-AE42-BA201A5A9306}.htm">Tool Assisted Speedruns</a></p>
|
|
<p><br></p>
|
|
<p><br></p>
|
|
<p class=rvps3><span class=rvts22>2008</span></p>
|
|
<p class=rvps4><span class=rvts23>This help file has been generated by the freeware version of </span><a class=rvts24 href="http://www.ibe-software.com/products/software/helpndoc/" target="_blank">HelpNDoc</a></p>
|
|
|
|
</body></html>
|