1 ; THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
2 ; SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
3 ; END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
4 ; ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
5 ; IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
6 ; SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
7 ; FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
8 ; CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
9 ; AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
10 ; COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
21 assume cs:_TEXT, ds:_DATA
23 _DATA segment dword public USE32 'DATA'
25 rcsid db "$Id: winckpit.asm,v 1.1.1.2 2001-01-19 03:33:51 bradleyb Exp $"
32 _TEXT segment dword public USE32 'CODE'
34 ; gr_winckpit_blt_span
35 ; blts a span region from source to dest buffer given a span
40 ; ESI = bm_data source at start of y
43 PUBLIC gr_winckpit_blt_span
48 inc ecx ; Better for counting and testing
51 mov al, [esi+ebx] ; else blt odd pixel then check right
62 ; gr_winckpit_blt_span_long
63 ; blts a span region from source to dest buffer given a span
65 ; This uses word optimization, and should be used for spans longer
66 ; than 10 pixels, and can't be used for spans of 3 pixels or less.
70 ; ESI = bm_data source at start of y
73 PUBLIC gr_winckpit_blt_span_long
74 gr_winckpit_blt_span_long:
76 ; EDX = right word boundary
80 inc ecx ; Better for counting and testing
81 mov edx, ecx ; Current right word boundary
83 test ebx, 1 ; is left boundary odd?
84 jz TestRightBound ; if even check right boundary.
86 mov al, [esi+ebx] ; else blt odd pixel then check right
90 ; Assured even left boundary and find right word boundary.
93 test ecx, 1 ; if even, then we have an even bound
95 dec edx ; if odd, force even boundary
99 ; This is a word only blt. No odd pixels.
103 mov [edi+ebx], ax ; straight out blt.
105 cmp ebx, edx ; do up to right word boundary
110 ; Blts word span and odd right byte is needed.
114 mov [edi+ebx], ax ; straight out blt.
116 cmp ebx, edx ; do up to right word boundary
118 mov al, [esi+ebx] ; blt right odd pixel.