Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
22
41-03.md
22
41-03.md
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
**LISTING 41.3 L41-3.ASM**
|
||||
|
||||
; Draws all pixels in list of horizontal lines passed in, in mode 13h, VGA’s
|
||||
; Draws all pixels in list of horizontal lines passed in, in mode 13h, VGA's
|
||||
; 320x200 256-color mode. Uses REP STOS to fill each line.
|
||||
; ******************************************************************
|
||||
; NOTE: is able to reverse the X coords for a scan line, if necessary, to make
|
||||
|
|
@ -40,9 +40,9 @@
|
|||
public _DrawHorizontalLineList
|
||||
align 2
|
||||
_DrawHorizontalLineList proc
|
||||
push bp ;preserve caller’s stack frame
|
||||
push bp ;preserve caller's stack frame
|
||||
mov bp,sp ;point to our stack frame
|
||||
push si ;preserve caller’s register variables
|
||||
push si ;preserve caller's register variables
|
||||
push di
|
||||
cld ;make string instructions inc pointers
|
||||
|
||||
|
|
@ -57,14 +57,14 @@
|
|||
; for the first (top) horizontal line
|
||||
mov si,[si+Lngth] ;# of scan lines to draw
|
||||
and si,si ;are there any lines to draw?
|
||||
jz FillDone ;no, so we’re done
|
||||
jz FillDone ;no, so we're done
|
||||
mov al,byte ptr [bp+Color] ;color with which to fill
|
||||
mov ah,al ;duplicate color for STOSW
|
||||
FillLoop:
|
||||
mov di,[bx+XStart] ;left edge of fill on this line
|
||||
mov cx,[bx+XEnd] ;right edge of fill
|
||||
cmp di,cx ;is XStart > XEnd?
|
||||
jle NoSwap ;no, we’re all set
|
||||
jle NoSwap ;no, we're all set
|
||||
xchg di,cx ;yes, so swap edges
|
||||
NoSwap:
|
||||
sub cx,di ;width of fill on this line
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
MainFill:
|
||||
shr cx,1 ;# of words in fill
|
||||
rep stosw ;fill as many words as possible
|
||||
adc cx,cx ;1 if there’s an odd trailing byte to
|
||||
adc cx,cx ;1 if there's an odd trailing byte to
|
||||
; do, 0 otherwise
|
||||
rep stosb ;fill any odd trailing byte
|
||||
LineFillDone:
|
||||
|
|
@ -88,17 +88,17 @@
|
|||
dec si ;count off lines to fill
|
||||
jnz FillLoop
|
||||
FillDone:
|
||||
pop di ;restore caller’s register variables
|
||||
pop di ;restore caller's register variables
|
||||
pop si
|
||||
pop bp ;restore caller’s stack frame
|
||||
pop bp ;restore caller's stack frame
|
||||
ret
|
||||
_DrawHorizontalLineList endp
|
||||
end
|
||||
|
||||
Listing 41.4 is almost identical to Listing 40.1 from Chapter 40. I’ve
|
||||
Listing 41.4 is almost identical to Listing 40.1 from Chapter 40. I've
|
||||
modified Listing 40.1 to employ the vertical-monotone detection test
|
||||
we’ve been talking about and use the fast vertical-monotone drawing code
|
||||
whenever possible; that’s what Listing 41.4 is. Note well that Listing
|
||||
we've been talking about and use the fast vertical-monotone drawing code
|
||||
whenever possible; that's what Listing 41.4 is. Note well that Listing
|
||||
40.5 from Chapter 40 is also required in order for this code to link.
|
||||
Listing 41.5 is an appropriately updated version of the POLYGON.H header
|
||||
file.
|
||||
|
|
|
|||
Loading…
Reference in a new issue