Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
32
57-03.md
32
57-03.md
|
|
@ -39,7 +39,7 @@
|
|||
SourceY dd ? ;Y location in source for this edge
|
||||
SourceStepX dd ? ;X step in source for Y step in dest of 1
|
||||
SourceStepY dd ? ;Y step in source for Y step in dest of 1
|
||||
;variables used for all-integer Bresenham’s-type
|
||||
;variables used for all-integer Bresenham's-type
|
||||
; X stepping through the dest, needed for precise
|
||||
; pixel placement to avoid gaps
|
||||
DestX dw ? ;current X location in dest for this edge
|
||||
|
|
@ -79,10 +79,10 @@
|
|||
public -ScanOutLine
|
||||
align 2
|
||||
-ScanOutLine proc near
|
||||
push bp ;preserve caller’s stack frame
|
||||
push bp ;preserve caller's stack frame
|
||||
mov bp,sp ;point to our stack frame
|
||||
sub sp,LOCAL-SIZE ;allocate space for local variables
|
||||
push si ;preserve caller’s register variables
|
||||
push si ;preserve caller's register variables
|
||||
push di
|
||||
; Nothing to do if destination is fully X clipped.
|
||||
mov di,[bp].RightEdge
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
cmp ax,0 ;is the whole step exactly an integer?
|
||||
jz SourceXNonNeg ;yes
|
||||
inc dx ;no, truncate to integer in the direction of
|
||||
; 0, because otherwise we’ll end up with a
|
||||
; 0, because otherwise we'll end up with a
|
||||
; whole step of 1-too-large magnitude
|
||||
SourceXNonNeg:
|
||||
mov [bp].lXAdvanceByOne,cx ;amount to add to source pointer to
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
cmp ax,0 ;is the whole step exactly an integer?
|
||||
jz SourceYNonNeg ;yes
|
||||
inc dx ;no, truncate to integer in the direction of
|
||||
; 0, because otherwise we’ll end up with a
|
||||
; 0, because otherwise we'll end up with a
|
||||
; whole step of 1-too-large magnitude
|
||||
SourceYNonNeg:
|
||||
mov [bp].lYAdvanceByOne,cx ;amount to add to source pointer to
|
||||
|
|
@ -164,9 +164,9 @@
|
|||
imul dx ; image bitmap when Y steps (ignoring
|
||||
mov [bp].lYBaseAdvance,ax ; carry from the fractional part)
|
||||
; Advance 1/2 step in the stepping direction, to space scanned pixels evenly
|
||||
; between the left and right edges. (There’s a slight inaccuracy in dividing
|
||||
; between the left and right edges. (There's a slight inaccuracy in dividing
|
||||
; negative numbers by 2 by shifting rather than dividing, but the inaccuracy
|
||||
; is in the least significant bit, and we’ll just live with it.)
|
||||
; is in the least significant bit, and we'll just live with it.)
|
||||
mov ax,word ptr [bp].lSourceStepX
|
||||
mov dx,word ptr [bp].lSourceStepX+2
|
||||
sar dx,1
|
||||
|
|
@ -242,13 +242,13 @@
|
|||
add di,[-CurrentPageBase] ;offset of pixel in display memory
|
||||
;ES:DI now points to the first destination pixel
|
||||
|
||||
and cl,011b ;CL = pixel’s plane
|
||||
and cl,011b ;CL = pixel's plane
|
||||
mov al,MAP-MASK
|
||||
mov dx,SC-INDEX
|
||||
out dx,al ;point the SC Index register to the Map Mask
|
||||
mov al,11h ;one plane bit in each nibble, so we’ll get carry
|
||||
mov al,11h ;one plane bit in each nibble, so we'll get carry
|
||||
; automatically when going from plane 3 to plane 0
|
||||
shl al,cl ;set the bit for the first pixel’s plane to 1
|
||||
shl al,cl ;set the bit for the first pixel's plane to 1
|
||||
; If source X step is negative, change over to working with non-negative
|
||||
; values.
|
||||
cmp word ptr [bp].lXAdvanceByOne,0
|
||||
|
|
@ -264,13 +264,13 @@
|
|||
not word ptr [bp].lSourceY
|
||||
SYStepSet:
|
||||
; At this point:
|
||||
; AL = initial pixel’s plane mask
|
||||
; AL = initial pixel's plane mask
|
||||
; BX = pointer to initial image pixel
|
||||
; SI = # of pixels to fill
|
||||
; DI = pointer to initial destination pixel
|
||||
mov dx,SC-INDEX+1 ;point to SC Data; Index points to Map Mask
|
||||
TexScanLoop:
|
||||
; Set the Map Mask for this pixel’s plane, then draw the pixel.
|
||||
; Set the Map Mask for this pixel's plane, then draw the pixel.
|
||||
out dx,al
|
||||
mov ah,[bx] ;get image pixel
|
||||
mov es:[di],ah ;set image pixel
|
||||
|
|
@ -278,13 +278,13 @@
|
|||
add bx,[bp].lXBaseAdvance ;advance the minimum # of pixels in X
|
||||
mov cx,word ptr [bp].lSourceStepX
|
||||
add word ptr [bp].lSourceX,cx;step the source X fractional part
|
||||
jnc NoExtraXAdvance ;didn’t turn over; no extra advance
|
||||
jnc NoExtraXAdvance ;didn't turn over; no extra advance
|
||||
add bx,[bp].lXAdvanceByOne ;did turn over; advance X one extra
|
||||
NoExtraXAdvance:
|
||||
add bx,[bp].lYBaseAdvance;advance the minimum # of pixels in Y
|
||||
mov cx,word ptr [bp].lSourceStepY
|
||||
add word ptr [bp].lSourceY,cx;step the source Y fractional part
|
||||
jnc NoExtraYAdvance;didn’t turn over; no extra advance
|
||||
jnc NoExtraYAdvance;didn't turn over; no extra advance
|
||||
add bx,[bp].lYAdvanceByOne;did turn over; advance Y one extra
|
||||
NoExtraYAdvance:
|
||||
; Point to the next destination pixel, by cycling to the next plane, and
|
||||
|
|
@ -295,10 +295,10 @@
|
|||
dec si
|
||||
jnz TexScanLoop
|
||||
ScanDone:
|
||||
pop di ;restore caller’s register variables
|
||||
pop di ;restore caller's register variables
|
||||
pop si
|
||||
mov sp,bp ;deallocate local variables
|
||||
pop bp ;restore caller’s stack frame
|
||||
pop bp ;restore caller's stack frame
|
||||
ret
|
||||
-ScanOutLine endp
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue