fceux/web/help/NESScrolling1.html

127 lines
4.8 KiB
HTML

<html>
<head>
<title>NES Scrolling 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="HelpNDoc Personal Edition 3.8.0.560">
<link type="text/css" rel="stylesheet" media="all" href="css/reset.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/base.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/hnd.css" />
<!--[if lte IE 8]>
<link type="text/css" rel="stylesheet" media="all" href="css/ielte8.css" />
<![endif]-->
<style type="text/css">
#topic_header
{
background-color: #EFEFEF;
}
</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/hnd.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
if (top.frames.length == 0)
{
var sTopicUrl = top.location.href.substring(top.location.href.lastIndexOf("/") + 1, top.location.href.length);
top.location.href = "fceux.html?" + sTopicUrl;
}
else if (top && top.FrameTOC && top.FrameTOC.SelectTocItem)
{
top.FrameTOC.SelectTocItem("NESScrolling1");
}
});
</script>
</head>
<body>
<div id="topic_header">
<div id="topic_header_content">
<h1>NES Scrolling 1</h1>
<div id="topic_breadcrumb">
<a href="Technicalinformation.html">Technical Information</a> &rsaquo;&rsaquo; <a href="NESProcessor.html">NES Processing</a> &rsaquo;&rsaquo; </div>
</div>
<div id="topic_header_nav">
<a href="NESProcessor.html"><img src="img/arrow_up.png" alt="Parent"/></a>
<a href="PPU.html"><img src="img/arrow_left.png" alt="Previous"/></a>
<a href="NESScrolling2.html"><img src="img/arrow_right.png" alt="Next"/></a>
</div>
<div class="clear"></div>
</div>
<div id="topic_content">
<p></p>
<p>Subject: [nesdev] the skinny on nes scrolling</p>
<p>Date: Tue, 13 Apr 1999 16:42:00 -0600</p>
<p>From: loopy &lt;zxcvzxcv@netzero.net&gt;</p>
<p>Reply-To: nesdev@onelist.com</p>
<p>To: nesdev@onelist.com</p>
<p><br/></p>
<p>From: loopy &lt;zxcvzxcv@netzero.net&gt;</p>
<p><br/></p>
<p>---------</p>
<p>the current information on background scrolling is sufficient for most games;</p>
<p>however, there are a few that require a more complete understanding.</p>
<p><br/></p>
<p>here are the related registers:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;(v) vram address, a.k.a. 2006 which we all know and love. &nbsp;(16 bits)</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;(t) another temp vram address (16 bits)</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (you can really call them 15 bits, the last isn't used)</p>
<p> &nbsp; &nbsp; &nbsp; (x) tile X offset (3 bits)</p>
<p><br/></p>
<p>the ppu uses the vram address for both reading/writing to vram thru 2007,</p>
<p>and for fetching nametable data to draw the background. &nbsp;as it's drawing the</p>
<p>background, it updates the address to point to the nametable data currently</p>
<p>being drawn. &nbsp;bits 0-11 hold the nametable address (-$2000). &nbsp;bits 12-14 are</p>
<p>the tile Y offset.</p>
<p><br/></p>
<p>---------</p>
<p>stuff that affects register contents:</p>
<p>(sorry for the shorthand logic but i think it's easier to see this way)</p>
<p><br/></p>
<p>2000 write:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:0000110000000000=d:00000011</p>
<p>2005 first write:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:0000000000011111=d:11111000</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;x=d:00000111</p>
<p>2005 second write:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:0000001111100000=d:11111000</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:0111000000000000=d:00000111</p>
<p>2006 first write:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:0011111100000000=d:00111111</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:1100000000000000=0</p>
<p>2006 second write:</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;t:0000000011111111=d:11111111</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;v=t</p>
<p>scanline start (if background and sprites are enabled):</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;v:0000010000011111=t:0000010000011111</p>
<p>frame start (line 0) (if background and sprites are enabled):</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;v=t</p>
<p><br/></p>
<p>note! &nbsp;2005 and 2006 share the toggle that selects between first/second</p>
<p>writes. &nbsp;reading 2002 will clear it.</p>
<p><br/></p>
<p>note! &nbsp;all of this info agrees with the tests i've run on a real nes. &nbsp;BUT</p>
<p>if there's something you don't agree with, please let me know so i can verify</p>
<p>it.</p>
<p><br/></p>
<p><br/></p>
<p></p>
<p class="rvps2"><span class="rvts13">Created with the Personal Edition of HelpNDoc: </span><a class="rvts14" href="http://www.helpndoc.com">Free EPub and documentation generator</a></p>
</div>
<div id="topic_footer">
<div id="topic_footer_content">
2016</div>
</div>
</body>
</html>