Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
24
23-03.md
24
23-03.md
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#### Linear Planes and True VGA Modes {#Heading6}
|
||||
|
||||
The VGA’s memory is organized as four 64K planes. Each of these planes
|
||||
The VGA's memory is organized as four 64K planes. Each of these planes
|
||||
is a linear bitmap; that is, each byte from a given plane controls eight
|
||||
adjacent pixels on the screen, the next byte controls the next eight
|
||||
pixels, and so on to the end of the scan line. The next byte then
|
||||
|
|
@ -13,46 +13,46 @@ end of the screen.
|
|||
|
||||
The VGA adds a powerful twist to linear addressing; the logical width of
|
||||
the screen in VGA memory need not be the same as the physical width of
|
||||
the display. The programmer is free to define all or part of the VGA’s
|
||||
the display. The programmer is free to define all or part of the VGA's
|
||||
large memory map as a logical screen of up to 4,080 pixels in width, and
|
||||
then use the physical screen as a window onto any part of the logical
|
||||
screen. What’s more, a virtual screen can have any logical height up to
|
||||
screen. What's more, a virtual screen can have any logical height up to
|
||||
the capacity of VGA memory. Such a virtual screen could be used to store
|
||||
a spreadsheet or a CAD/CAM drawing, for instance. As we will see
|
||||
shortly, the VGA provides excellent hardware for moving around the
|
||||
virtual screen; taken together, the virtual screen and the VGA’s smooth
|
||||
virtual screen; taken together, the virtual screen and the VGA's smooth
|
||||
panning capabilities can generate very impressive effects.
|
||||
|
||||
All four linear planes are addressed in the same 64K memory space
|
||||
starting at A000:0000. Consequently, there are four bytes at any given
|
||||
address in VGA memory. The VGA provides special hardware to assist the
|
||||
CPU in manipulating all four planes, in parallel, with a single memory
|
||||
access, so that the programmer doesn’t have to spend a great deal of
|
||||
access, so that the programmer doesn't have to spend a great deal of
|
||||
time switching between planes. Astute use of this VGA hardware allows
|
||||
VGA software to as much as quadruple performance by processing the data
|
||||
for all the planes in parallel.
|
||||
|
||||
Each memory plane provides one bit of data for each pixel. The bits for
|
||||
a given pixel from each of the four planes are combined into a nibble
|
||||
that serves as an address into the VGA’s palette RAM, which maps the one
|
||||
that serves as an address into the VGA's palette RAM, which maps the one
|
||||
of 16 colors selected by display memory into any one of 64 colors, as
|
||||
shown in Figure 23.1. All sixty-four mappings for all 16 colors are
|
||||
independently programmable. (We’ll discuss the VGA’s color capabilities
|
||||
independently programmable. (We'll discuss the VGA's color capabilities
|
||||
in detail starting in Chapter 33.)
|
||||
|
||||
The VGA BIOS supports several graphics modes (modes 4, 5, and 6) in
|
||||
which VGA memory appears not to be organized as four linear planes.
|
||||
These modes exist for CGA compatibility only, and are not true VGA
|
||||
graphics modes; use them when you need CGA-type operation and ignore
|
||||
them the rest of the time. The VGA’s special features are most powerful
|
||||
them the rest of the time. The VGA's special features are most powerful
|
||||
in true VGA modes, and it is on the 16-color true-VGA modes (modes 0DH
|
||||
(320x200), 0EH (640x200), 10H (640x350), and 12H (640x480)) that I will
|
||||
concentrate in this part of the book. There is also a 256-color mode,
|
||||
mode 13H, that appears to be a single linear plane, but, as we will see
|
||||
in Chapters 31-34 and 47-49 of this book, that’s a polite fiction—and
|
||||
in Chapters 31-34 and 47-49 of this book, that's a polite fiction—and
|
||||
discarding that fiction gives us an opportunity to unleash the power of
|
||||
the VGA’s hardware for vastly better performance. VGA text modes, which
|
||||
feature soft fonts, are another matter entirely, upon which we’ll touch
|
||||
the VGA's hardware for vastly better performance. VGA text modes, which
|
||||
feature soft fonts, are another matter entirely, upon which we'll touch
|
||||
from time to time.
|
||||
|
||||
\
|
||||
|
|
@ -60,7 +60,7 @@ from time to time.
|
|||
|
||||
With that background out of the way, we can get on to the sample VGA
|
||||
program shown in Listing 23.1. I suggest you run the program before
|
||||
continuing, since the explanations will mean far more to you if you’ve
|
||||
continuing, since the explanations will mean far more to you if you've
|
||||
seen the features in action.
|
||||
|
||||
**LISTING 23.1 L23-1.ASM**
|
||||
|
|
|
|||
Loading…
Reference in a new issue