Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
48
30-03.md
48
30-03.md
|
|
@ -2,7 +2,7 @@
|
|||
[Previous](30-02.html) [Table of Contents](index.html) [Next](30-04.html)
|
||||
------------------------ --------------------------------- --------------------
|
||||
|
||||
#### VGA and EGA Split-Screen Operation Don’t Mix {#Heading5}
|
||||
#### VGA and EGA Split-Screen Operation Don't Mix {#Heading5}
|
||||
|
||||
You must set the **IS\_VGA** equate at the start of Listing 30.1
|
||||
correctly for the adapter the code will run on in order for the program
|
||||
|
|
@ -16,19 +16,19 @@ the split screen start scan line are set by reading the registers they
|
|||
reside in, changing only the split-screen-related bits, and writing the
|
||||
modified settings back to their respective registers.
|
||||
|
||||
The VGA version of Listing 30.1 won’t work on an EGA, because EGA
|
||||
registers aren’t readable. The EGA version of Listing 30.1 won’t work on
|
||||
The VGA version of Listing 30.1 won't work on an EGA, because EGA
|
||||
registers aren't readable. The EGA version of Listing 30.1 won't work on
|
||||
a VGA, both because VGA monitors require different vertical settings
|
||||
than EGA monitors and because the EGA version doesn’t set bit 9 of the
|
||||
than EGA monitors and because the EGA version doesn't set bit 9 of the
|
||||
split screen start scan line. In short, there is no way that I know of
|
||||
to support both VGA and EGA split screens with common code; separate
|
||||
drivers are required. This is one of the reasons that split screens are
|
||||
so rarely used in PC programming.
|
||||
|
||||
By the way, Listing 30.1 operates in mode 10H because that’s the
|
||||
highest-resolution mode the VGA and EGA share. That’s not the only mode
|
||||
By the way, Listing 30.1 operates in mode 10H because that's the
|
||||
highest-resolution mode the VGA and EGA share. That's not the only mode
|
||||
the split screen works in, however. In fact, it works in *all* modes, as
|
||||
we’ll see later.
|
||||
we'll see later.
|
||||
|
||||
### Setting the Split-Screen-Related Registers {#Heading6}
|
||||
|
||||
|
|
@ -50,24 +50,24 @@ because the changed screen can appear *before* the new split screen
|
|||
start scan line is set.
|
||||
|
||||
------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
 *Remember, the split screen start scan line is spread out over two or three registers. What if the incompletely-changed value matches the current scan line after you’ve set one register but before you’ve set the rest? For one frame, you’ll see the split screen in a wrong place—possibly a very wrong place—resulting in jumping and flicker.*
|
||||
 *Remember, the split screen start scan line is spread out over two or three registers. What if the incompletely-changed value matches the current scan line after you've set one register but before you've set the rest? For one frame, you'll see the split screen in a wrong place—possibly a very wrong place—resulting in jumping and flicker.*
|
||||
------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
The solution is simple: Set the split screen start scan line at a time
|
||||
when it can’t possibly match the currently displayed scan line. The easy
|
||||
way to do that is to set it when there isn’t any currently displayed
|
||||
scan line—during vertical non-display time. One safe time that’s easy to
|
||||
when it can't possibly match the currently displayed scan line. The easy
|
||||
way to do that is to set it when there isn't any currently displayed
|
||||
scan line—during vertical non-display time. One safe time that's easy to
|
||||
find is the start of the vertical sync pulse, which is typically pretty
|
||||
near the middle of vertical non-display time, and that’s the approach
|
||||
I’ve followed in Listing 30.1. I’ve also disabled interrupts during the
|
||||
period when the split screen registers are being set. This isn’t
|
||||
absolutely necessary, but if it’s not done, there’s the possibility that
|
||||
near the middle of vertical non-display time, and that's the approach
|
||||
I've followed in Listing 30.1. I've also disabled interrupts during the
|
||||
period when the split screen registers are being set. This isn't
|
||||
absolutely necessary, but if it's not done, there's the possibility that
|
||||
an interrupt will occur between register sets and delay the later
|
||||
register sets until display time, again causing flicker.
|
||||
|
||||
One interesting effect of setting the split screen registers at the
|
||||
start of vertical sync is that it has the effect of synchronizing the
|
||||
program to the display adapter’s frame rate. No matter how fast the
|
||||
program to the display adapter's frame rate. No matter how fast the
|
||||
computer running Listing 30.1 may be, the split screen will move at a
|
||||
maximum rate of once per frame. This is handy for regulating execution
|
||||
speed over a wide variety of hardware performance ranges; however, be
|
||||
|
|
@ -77,7 +77,7 @@ modes support 60 Hz frame rates.
|
|||
|
||||
### The Problem with the EGA Split Screen {#Heading7}
|
||||
|
||||
I mentioned earlier that the EGA’s split screen is a little buggy. How?
|
||||
I mentioned earlier that the EGA's split screen is a little buggy. How?
|
||||
you may well ask, particularly given that Listing 30.1 illustrates that
|
||||
the EGA split screen seems pretty functional.
|
||||
|
||||
|
|
@ -87,8 +87,8 @@ twice. In other words, the first line of split screen display memory,
|
|||
and only the first line, is replicated one unnecessary time, pushing all
|
||||
the other lines down by one.
|
||||
|
||||
That’s not a fatal bug, of course. In fact, if the first few scan lines
|
||||
are identical, it’s not even noticeable. The EGA’s split-screen bug can
|
||||
That's not a fatal bug, of course. In fact, if the first few scan lines
|
||||
are identical, it's not even noticeable. The EGA's split-screen bug can
|
||||
produce visible distortion given certain patterns, however, so you
|
||||
should try to make the top few lines identical (if possible) when
|
||||
designing split-screen images that might be displayed on EGAs, and you
|
||||
|
|
@ -96,13 +96,13 @@ should in any case check how your split-screens look on both VGAs and
|
|||
EGAs.
|
||||
|
||||
------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
 *I have an important caution here: Don’t count on the EGA’s split-screen bug; that is, don’t rely on the first scan line being doubled when you design your split screens. IBM designed and made the original EGA, but a lot of companies cloned it, and there’s no guarantee that all EGA clones copy the bug. It is a certainty, at least, that the VGA didn’t copy it.*
|
||||
 *I have an important caution here: Don't count on the EGA's split-screen bug; that is, don't rely on the first scan line being doubled when you design your split screens. IBM designed and made the original EGA, but a lot of companies cloned it, and there's no guarantee that all EGA clones copy the bug. It is a certainty, at least, that the VGA didn't copy it.*
|
||||
------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
There’s another respect in which the EGA is inferior to the VGA when it
|
||||
comes to the split screen, and that’s in the area of panning when the
|
||||
split screen is on. This isn’t a bug—it’s just one of the many areas in
|
||||
which the VGA’s designers learned from the shortcomings of the EGA and
|
||||
There's another respect in which the EGA is inferior to the VGA when it
|
||||
comes to the split screen, and that's in the area of panning when the
|
||||
split screen is on. This isn't a bug—it's just one of the many areas in
|
||||
which the VGA's designers learned from the shortcomings of the EGA and
|
||||
went the EGA one better.
|
||||
|
||||
------------------------ --------------------------------- --------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue