Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
38
48-05.md
38
48-05.md
|
|
@ -9,16 +9,16 @@ left-to-right copying. Downward scrolls require bottom-to-top copying;
|
|||
likewise, rightward horizontal scrolls require right-to-left copying. As
|
||||
it happens, my intended use for Listing 48.3 is to copy images between
|
||||
off-screen memory and on-screen memory, and to save areas under pop-up
|
||||
menus and the like, so I don’t really need overlap handling—and I do
|
||||
menus and the like, so I don't really need overlap handling—and I do
|
||||
really need to keep the complexity of this discussion down. However, you
|
||||
will surely want to add overlap handling if you plan to perform
|
||||
arbitrary scrolling and copying in display memory.
|
||||
|
||||
Now that we have a fast way to copy images around in display memory, we
|
||||
can draw icons and other images as much as four times faster than in
|
||||
mode 13H, depending on the speed of the VGA’s display memory. (In case
|
||||
you’re worried about the nibble-alignment limitation on fast copies,
|
||||
don’t be; I’ll address that fully in due time, but the secret is to
|
||||
mode 13H, depending on the speed of the VGA's display memory. (In case
|
||||
you're worried about the nibble-alignment limitation on fast copies,
|
||||
don't be; I'll address that fully in due time, but the secret is to
|
||||
store all four possible rotations in off-screen memory, then select the
|
||||
correct one for each copy.) However, before our fast display
|
||||
memory-to-display memory copy routine can do us any good, we must have a
|
||||
|
|
@ -42,7 +42,7 @@ in off-screen memory and copied to the screen via the latches much
|
|||
faster than even the speediest system memory-to-display memory copy
|
||||
routine could manage.
|
||||
|
||||
I’m not going to present a routine to perform Mode X copies from display
|
||||
I'm not going to present a routine to perform Mode X copies from display
|
||||
memory to system memory, but such a routine would be a straightforward
|
||||
inverse of Listing 48.4.
|
||||
|
||||
|
|
@ -93,10 +93,10 @@ inverse of Listing 48.4.
|
|||
.code
|
||||
public _CopySystemToScreenX
|
||||
_CopySystemToScreenX proc near
|
||||
push bp ;preserve caller’s stack frame
|
||||
push bp ;preserve caller's stack frame
|
||||
mov bp,sp ;point to local stack frame
|
||||
sub sp,STACK_FRAME_SIZE ;allocate space for local vars
|
||||
push si ;preserve caller’s register variables
|
||||
push si ;preserve caller's register variables
|
||||
push di
|
||||
|
||||
cld
|
||||
|
|
@ -120,10 +120,10 @@ inverse of Listing 48.4.
|
|||
add di,ax ;offset of first dest rect pixel in page
|
||||
add di,[bp+DestPageBase] ;offset of first dest rect pixel
|
||||
; in display memory
|
||||
and cl,011b ;CL = first dest pixel’s plane
|
||||
and cl,011b ;CL = first dest pixel's plane
|
||||
mov al,11h ;upper nibble comes into play when
|
||||
; plane wraps from 3 back to 0
|
||||
shl al,cl ;set the bit for the first dest pixel’s
|
||||
shl al,cl ;set the bit for the first dest pixel's
|
||||
mov [bp+LeftMask],al ; plane in each nibble to 1
|
||||
|
||||
mov cx,[bp+SourceEndX] ;calculate # of pixels across
|
||||
|
|
@ -145,7 +145,7 @@ inverse of Listing 48.4.
|
|||
CopyScanLineLoop:
|
||||
out dx,al ;set the plane for this pixel
|
||||
movsb ;copy the pixel to the screen
|
||||
rol al,1 ;set mask for next pixel’s plane
|
||||
rol al,1 ;set mask for next pixel's plane
|
||||
cmc ;advance destination address only when
|
||||
sbb di,0 ; wrapping from plane 3 to plane 0
|
||||
; (else undo INC DI done by MOVSB)
|
||||
|
|
@ -159,31 +159,31 @@ inverse of Listing 48.4.
|
|||
dec bx ;count down scan lines
|
||||
jnz CopyRowsLoop
|
||||
CopyDone:
|
||||
pop di ;restore caller’s register variables
|
||||
pop di ;restore caller's register variables
|
||||
pop si
|
||||
mov sp,bp ;discard storage for local variables
|
||||
pop bp ;restore caller’s stack frame
|
||||
pop bp ;restore caller's stack frame
|
||||
ret
|
||||
_CopySystemToScreenX endp
|
||||
end
|
||||
|
||||
### Who Was that Masked Image Copier? {#Heading6}
|
||||
|
||||
At this point, it’s getting to be time for us to take all the Mode X
|
||||
tools we’ve developed, together with one more tool—masked image
|
||||
At this point, it's getting to be time for us to take all the Mode X
|
||||
tools we've developed, together with one more tool—masked image
|
||||
copying—and the remaining unexplored feature of Mode X, page flipping,
|
||||
and build an animation application. I hope that when we’re done, you’ll
|
||||
and build an animation application. I hope that when we're done, you'll
|
||||
agree with me that Mode X is *the* way to animate on the PC.
|
||||
|
||||
In truth, though, it matters less whether or not *you* think that Mode X
|
||||
is the best way to animate than whether or not your users think it’s the
|
||||
is the best way to animate than whether or not your users think it's the
|
||||
best way based on results; end users care only about results, not how
|
||||
you produced them. For my writing, you folks are the end users—and
|
||||
notice how remarkably little you care about how this book gets written
|
||||
and produced. You care that it turned up in the bookstore, and you care
|
||||
about the contents, but you sure as heck don’t care about how it got
|
||||
that far from a bin of tree pulp. When you’re a creator, the process
|
||||
matters. When you’re a buyer, results are everything. All important.
|
||||
about the contents, but you sure as heck don't care about how it got
|
||||
that far from a bin of tree pulp. When you're a creator, the process
|
||||
matters. When you're a buyer, results are everything. All important.
|
||||
*Sine qua non.* The whole enchilada.
|
||||
|
||||
If you catch my drift.
|
||||
|
|
|
|||
Loading…
Reference in a new issue