Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
24
49-02.md
24
49-02.md
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
#### Faster Masked Copying {#Heading4}
|
||||
|
||||
In the previous chapter we saw how the VGA’s latches can be used to copy
|
||||
In the previous chapter we saw how the VGA's latches can be used to copy
|
||||
four pixels at a time from one area of display memory to another in Mode
|
||||
X. We’ve further seen that in Mode X the Map Mask register can be used
|
||||
to select which planes are copied. That’s all we need to know to be able
|
||||
X. We've further seen that in Mode X the Map Mask register can be used
|
||||
to select which planes are copied. That's all we need to know to be able
|
||||
to perform fast masked copies; we can store an image in off-screen
|
||||
display memory, and set the Map Mask to the appropriate mask value as up
|
||||
to four pixels at a time are copied.
|
||||
|
||||
There’s a slight hitch, though. The latches can only be used when the
|
||||
There's a slight hitch, though. The latches can only be used when the
|
||||
source and destination left edge coordinates, modulo four, are the same,
|
||||
as explained in the previous chapter. The solution is to copy all four
|
||||
possible alignments of each image to display memory, each properly
|
||||
|
|
@ -20,8 +20,8 @@ positioned for one of the four possible
|
|||
destination-left-edge-modulo-four cases. These aligned images must be
|
||||
accompanied by the four possible alignments of the image mask, stored in
|
||||
system memory. Given all four image and mask alignments, masked copying
|
||||
is a simple matter of selecting the alignment that’s appropriate for the
|
||||
destination’s left edge, then setting the Map Mask with the 4-bit mask
|
||||
is a simple matter of selecting the alignment that's appropriate for the
|
||||
destination's left edge, then setting the Map Mask with the 4-bit mask
|
||||
corresponding to each four-pixel set as we copy four pixels at a time
|
||||
via the latches.
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ and mask alignments. The aligned images are already stored in display
|
|||
memory, and the aligned masks are already stored in system memory;
|
||||
further, the masks are predigested into Map Mask register-compatible
|
||||
form. Given all that ready-to-use data, Listing 49.2 selects and works
|
||||
with the appropriate image-mask pair for the destination’s left edge
|
||||
with the appropriate image-mask pair for the destination's left edge
|
||||
alignment.
|
||||
|
||||
**LISTING 49.2 L49-2.ASM**
|
||||
|
|
@ -94,10 +94,10 @@ alignment.
|
|||
.code
|
||||
public _CopyScreenToScreenMaskedX
|
||||
_CopyScreenToScreenMaskedX 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
|
||||
|
|
@ -117,7 +117,7 @@ alignment.
|
|||
shr di,1 ; scan line
|
||||
add di,ax ;offset of first dest rect pixel in page
|
||||
add di,[bp+DestPageBase] ;offset of first dest rect pixel in display
|
||||
; memory. now look up the image that’s
|
||||
; memory. now look up the image that's
|
||||
; aligned to match left-edge alignment
|
||||
; of destination
|
||||
and si,3 ;DestStartX modulo 4
|
||||
|
|
@ -190,10 +190,10 @@ alignment.
|
|||
mov al,0ffh ; which selects all bits from the CPU
|
||||
out dx,al ; and none from the latches (the GC
|
||||
; Index still points to Bit Mask)
|
||||
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
|
||||
_CopyScreenToScreenMaskedX endp
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue