Remove colour attributes from body and strip most of the font tags out

This commit is contained in:
James Gregory 2013-12-30 13:57:02 +11:00
commit c1f88ddb41
362 changed files with 1632 additions and 1706 deletions

View file

@ -24,7 +24,7 @@
<!--CHAPTER=29//-->
<!--PAGES=539-545//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
<!--UNASSIGNED2//--></HEAD><body>
<CENTER>
<TABLE BORDER>
@ -36,19 +36,18 @@
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 29<BR>Saving Screens and Other VGA Mysteries
</FONT></H2>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Useful Nuggets from the VGA Zen File</FONT></H3>
<H2><A NAME="Heading1"></A>Chapter 29<BR>Saving Screens and Other VGA Mysteries</H2>
<H3><A NAME="Heading2"></A>Useful Nuggets from the VGA Zen File</H3>
<P>There are a number of VGA graphics topics that aren&rsquo;t quite involved enough to warrant their own chapters, yet still cause a fair amount of programmer headscratching&mdash;and thus deserve treatment somewhere in this book. This is the place, and during the course of this chapter we&rsquo;ll touch on saving and restoring 16-color EGA and VGA screens, the 16-out-of-64 colors issue, and techniques involved in reading and writing VGA control registers.
</P>
<P>That&rsquo;s a lot of ground to cover, so let&rsquo;s get started!</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Saving and Restoring EGA and VGA Screens</FONT></H3>
<H3><A NAME="Heading3"></A>Saving and Restoring EGA and VGA Screens</H3>
<P>The memory architectures of EGAs and VGAs are similar enough to treat both together in this regard. The basic principle for saving EGA and VGA 16-color graphics screens is astonishingly simple: Write each plane to disk separately. Let&rsquo;s take a look at how this works in the EGA&rsquo;s hi-res mode 10H, which provides 16 colors at 640x350.
</P>
<P>All we need do is enable reads from plane 0 and write the 28,000 bytes of plane 0 that are displayed in mode 10H to disk, then enable reads from plane 1 and write the displayed portion of that plane to disk, and so on for planes 2 and 3. The result is a file that&rsquo;s 112,000 (28,000 * 4) bytes long, with the planes stored as four distinct 28,000-byte blocks, as shown in Figure 29.1.</P>
<P>The program shown later on in Listing 29.1 does just what I&rsquo;ve described here, putting the screen into mode 10H, putting up some bittext so there is something to save, and creating the 112K file SNAPSHOT.SCR, which contains the visible portion of the mode 10H frame buffer.</P>
<P><A NAME="Fig1"><!-- </A><A HREF="javascript:displayWindow('images/29-01.jpg',406,303 )"> --><IMG SRC="images/29-01.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/29-01.jpg',406,303)"> --><FONT COLOR="#000077"><B>Figure 29.1</B></FONT></A>&nbsp;&nbsp;<I>Saving EGA/VGA display memory.</I>
<BR><A HREF="javascript:displayWindow('images/29-01.jpg',406,303)"> --><B>Figure 29.1</B></A>&nbsp;&nbsp;<I>Saving EGA/VGA display memory.</I>
</P>
<P>The only part of Listing 29.1 that&rsquo;s even remotely tricky is the use of the Read Map register (Graphics Controller register 4) to make each of the four planes of display memory readable in turn. The same code is used to write 28,000 bytes of display memory to disk four times, and 28,000 bytes of memory starting at A000:0000 are written to disk each time; however, a different plane is read each time, thanks to the changing setting of the Read Map register. (If this is unclear, refer back to Figure 29.1; you may also want to reread Chapter 28 to brush up on the operation of the Read Map register in particular and reading EGA and VGA memory in general.)
</P>
@ -199,7 +198,7 @@ Code ends
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book &copy; 2001 Michael Abrash</font>
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->