-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFB.ASM
executable file
·192 lines (167 loc) · 4.56 KB
/
FB.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
page ,132
;-----------------------------Module-Header-----------------------------;
; Module Name: FB.ASM
;
; This module contains code for the FastBorder function.
;
; Created: 27-May-1987
; Author: *** ****** [******]
;
; Copyright (c) 1984-1987 Microsoft Corporation
;
; Exported Functions: FastBorder
;
; Public Functions: none
;
; Public Data: none
;
; General Description:
;
; This subroutine draws the four edges of a window border. It
; clips the border to the clipping rectangle passed in.
;
; The following is a legend of symbols used in this file:
;
; corners for input rect: (x1,y1), (x2,y2)
; border thickness horizontally: bth
; (i.e. the width of the left
; and right segments of the
; border)
; border thickness vertically: btv
; (i.e. the height of the top
; and bottom segments of the
; border)
; corners of clipping region: (u1,v1), (u2,v2)
; top left corner of blt: (destx,desty)
; width of blt: xext
; height of blt: yext
;
;
; The shapes of the edges drawn are shown below. If no clipping
; is necessary, the edges are drawn in the order top, bottom,
; right, left. Otherwise, they are drawn in the order top, right,
; bottom, left. The latter order is more visually pleasing, but
; the former order is faster because some blt parameters do not
; change between successive calls to do_blt.
;
;
page
; +-----------------------+---+
; | | |
; | | |
; +---+-------------------+ |
; | | | |
; | | | |
; | | | |
; | | | |
; | | | |
; | | | |
; | | | |
; | +-------------------+---+
; | | |
; | | |
; +---+-----------------------+
;
;
;
; Restrictions:
;
; The clipping rectangle (hRaoClip) is a SIMPLEREGION.
; Rectangle corners have been sorted.
;
;-----------------------------------------------------------------------
; This function will perform private stack checking. In order for
; private stack checking to occur, two symbols must be defined
; prior to the inclusion of cmacros.inc. ?CHKSTK must be defined
; if the cmacros are to perform stack checking on procedures with
; local parameters. ?CHKSTKPROC must be defined if private stack
; checking will be used.
;
; The actual macro body for ?CHKSTKPROC will be defined later.
?CHKSTK = 1
?CHKSTKPROC macro
endm
.xlist
include cmacros.inc
include gdidefs.inc
include macros.mac
.list
externFP BitBlt
sBegin Code
assumes cs,Code
assumes ds,nothing
assumes es,nothing
page
;--------------------------Exported-Routine-----------------------------;
; FastBorder
;
; Draw a border inside a rectangle, clipping to a second rectangle.
;
; Entry:
; See parameter definitions below.
; Returns:
; AX = ~0
; Error Returns:
; AX = 0, if stack overflows allocating local variables
; Registers Preserved:
; SI,DI,DS,BP
; Registers Destroyed:
; AX,BX,CX,DX,ES,FLAGS
; Calls:
; do_blt
; History:
; Wed 27-May-1987 16:29:09 -by- *** ****** [******]
; Created.
; Thu 11-Jun-1987 19:49:30 -by- *** ****** [******]
; Cleaned up comments.
;-----------------------------------------------------------------------;
;------------------------------Pseudo-Code------------------------------;
; {
; }
;-----------------------------------------------------------------------;
cProc FastBorder,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lprect ;--> rectangle to frame
parmW bth ;border thickness horizontally
parmW btv ;border thickness vertically
parmD rop ;raster op
parmD lpPDevice ;--> physical device structure
parmD lpPBrush ;--> physical brush structure
parmD lpDrawMode ;--> drawing mode structure
parmD lprectclip ;--> clipping rectangle
cBegin
mov ax, 1
fb_exit:
cEnd
page
;---------------------------Private-Routine-----------------------------;
; do_blt
;
; Shovel parameters to BitBlt.
;
; Entry:
; None
; Returns:
; AX = return value from BitB t
; Registers Preserved:
; SI,DI,BP
; Registers Destroyed:
; BX,CX,DX,DS,ES,FLAGS (inside BitBlt)
; Calls:
; BitBlt
; History:
; Wed 27-May-1987 16:29:09 -by- *** ****** [******]
; Created.
; Thu 11-Jun-1987 19:49:30 -by- *** ****** [******]
; Cleaned up comments.
;-----------------------------------------------------------------------;
do_blt proc near
xor ax,ax ;generic null-parameter
; arg <lpPDevice,destx,desty,ax,ax,ax,ax,xext,yext,rop,lpPBrush,lpDrawMode>
cCall BitBlt
ret
do_blt endp
ifdef PUBDEFS
include fb.pub
endif
sEnd Code
end