Strip comments and inline ids onto h*

This commit is contained in:
James Gregory 2013-12-30 15:11:04 +11:00
commit 0f5f617adb
362 changed files with 2519 additions and 6694 deletions

View file

@ -10,16 +10,9 @@
<meta name="vspubdate" content="07/01/97" />
<meta name="vscategory" content="Web and Software Development: Game Development,Web and Software Development: Graphics and Multimedia Development" />
<title>Michael Abrash's Graphics Programming Black Book Special Edition: Split Screens Save the Page Flipped Day</title><!-- HEADER -->
<!-- Empty Reference Subhead -->
<!--ISBN=1576101746//-->
<!--TITLE=Michael Abrash's Graphics Programming Black Book Special Edition//-->
<!--AUTHOR=Michael Abrash//-->
<!--PUBLISHER=The Coriolis Group, Inc.//-->
<title>Michael Abrash's Graphics Programming Black Book Special Edition: Split Screens Save the Page Flipped Day</title>
<meta name="chapter" content="44" />
<meta name="pages" content="835-837" />
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
</head>
<body>
@ -37,7 +30,7 @@
<p><br /></p>
<h4 align="center"><a id="Heading8"></a>Knowing When to Flip</h4>
<h4 align="center" id="Heading8">Knowing When to Flip</h4>
<p>There&rsquo;s a hitch, though, and that hitch is knowing exactly when it is that the page has flipped. The page doesn&rsquo;t flip the instant that you set the Start Address registers. The VGA loads the starting offset from the Start Address registers once before starting each frame, then pays those registers no nevermind until the next frame comes around. This means that you can set the Start Address registers whenever you want&mdash;but the page actually being displayed doesn&rsquo;t change until after the VGA loads that new offset in preparation for the next frame.</p>
@ -49,7 +42,7 @@
<p>So, to flip pages, you must complete all drawing to the non-displayed page, wait for Display Enable to be active, set the new start address, and wait for Vertical Sync to be active. At that point, you can be fully confident that the page that you just flipped off the screen is not displayed and can safely (invisibly) be updated. A side benefit of page flipping is that your program will automatically have a constant time base, with the rate at which new screens are drawn synchronized to the frame rate of the display (typically 60 or 70 Hz). However, complex updates may take more than one frame to complete, especially on slower processors; this can be compensated for by maintaining a count of new screens drawn and cross-referencing that to the BIOS timer count periodically, accelerating the overall pace of the animation (moving farther each time and the like) if updates are happening too slowly.</p>
<h4 align="left"><a id="Heading9"></a>Enter the Split Screen</h4>
<h4 align="left" id="Heading9">Enter the Split Screen</h4>
<p>So far, I&rsquo;ve discussed page flipping in 640x350 mode. There&rsquo;s a reason for that: 640x350 is the highest-resolution standard mode in which there&rsquo;s enough display memory for two full pages on a standard VGA. It&rsquo;s possible to program the VGA to a non-standard 640x400 mode and still have two full pages, but that&rsquo;s pretty much the limit. One 640x480 page takes 38,400 bytes of display memory, and clearly there isn&rsquo;t enough room in 64 K of display memory for two of <i>those</i> monster pages.</p>
@ -59,9 +52,8 @@
<p>That, in turn, allows us to divvy up display memory into three areas, as shown in Figure 44.2. The area from 0 to 11,279 is reserved for the split screen, the area from 11,280 to 38,399 is used for page 0, and the area from 38,400 to 65,519 is used for page 1. This allows page flipping to be performed in the top 339 scan lines (about 70 percent) of the screen, and leaves the bottom 141 scan lines for non-animation purposes, such as showing scores, instructions, statuses, and suchlike. (Note that the allocation of display memory and number of scan lines are dictated by the desire to have as many page-flipped scan lines as possible; you may, if you wish, have fewer page-flipped lines and reserve part of the bitmap for other uses, such as off-screen storage for images.)</p>
<p><a id="Fig2"><!-- </A><A HREF="javascript:displayWindow('images/44-02.jpg',408,263 )"> --><img src="images/44-02.jpg" /><br />
<!-- </A>
<BR><A HREF="javascript:displayWindow('images/44-02.jpg',408,263)"> --><b>Figure 44.2</b></a>&nbsp;&nbsp;<i>Memory allocation for mode 12h page flipping.</i></p>
<p><a id="Fig2"><img src="images/44-02.jpg" /><br />
<b>Figure 44.2</b></a>&nbsp;&nbsp;<i>Memory allocation for mode 12h page flipping.</i></p>
<p>The sample program for this chapter uses the split screen and page flipping exactly as described above. The playfield through which the object bounces is the page-flipped portion of the screen, and the rectangle at the bottom containing the bounce count and the instructions is the split (that is, not animatable) portion of the screen. Of course, to the user it all looks like one screen. There are no visible boundaries between the two unless you choose to create them.</p>
@ -86,10 +78,6 @@
<div align="center">
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div><!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->
<!-- BEGIN SUB FOOTER -->
<!-- END FOOTER -->
</div>
</body>
</html>