-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTRBLT.ASM
executable file
·217 lines (171 loc) · 4.82 KB
/
STRBLT.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
page ,132
;-----------------------------Module-Header-----------------------------;
; Module Name: STRBLT.ASM
;
; This module contains the strblt function and the ExtendedTextOut
; function.
;
; Created: 17-Mar-1987
; Author: **** ***** [*****]
;
; Copyright (c) 1984-1987 Microsoft Corporation
;
; Exported Functions: Strblt
;
; Public Functions: none
;
; Public Data: none
;
; General Description:
;
; Restrictions:
;
;-----------------------------------------------------------------------;
; 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
incFont = 1 ;Include control for gdidefs.inc
incDrawMode = 1 ;Include control for gdidefs.inc
.xlist
include cmacros.inc
include gdidefs.inc
include display.inc
include egamem.inc
include macros.mac
include strblt.inc
include fontseg.inc
.list
??_out strblt
; Link time constants describing the size that the EGA will
; be running in.
externA ScreenSelector ;Selector to the screen
externA SCREEN_W_BYTES ;Screen width in bytes
externA SCREEN_WIDTH ;Screen width in pixels
; Other functions required for strblt.
; externNP fixed_pitch_strblt ;Fixed pitch 8 wide font code
; externNP build_string ;All other font code
ifdef EXCLUSION
externNP exclude ;Exclude area from screen
externNP unexclude ;Clear excluded area
endif
externFP OutputDebugString
sBegin Data
externB enabled_flag ;Non-zero if output allowed
sEnd Data
sBegin Code
assumes cs,Code
page
;--------------------------Exported-Routine-----------------------------;
; Strblt
;
; This is the old strblt entry point. Null parameters are pushed
; for the ExtTextOut's extra parameters, and control given to
; ExtTextOut.
;
; Entry:
; EGA registers in default state
; Returns:
; DX = Y extent of string if extent call
; AX = X extent of string if extent call
; EGA registers in default state
; Error Returns:
; DX:AX = 8000:0000H
; Registers Preserved:
; SI,DI,DS,BP
; Registers Destroyed:
; AX,BX,CX,DX,ES,FLAGS
; Calls:
; See ExtTextOut
; History:
; Thu 09-Apr-1987 13:36:08 -by- **** ***** [*****]
; Created.
;-----------------------------------------------------------------------;
;------------------------------Pseudo-Code------------------------------;
; {
; }
;-----------------------------------------------------------------------;
assumes ds,Data
assumes es,nothing
cProc Strblt,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lp_device ;Destination device
parmW x ;Left origin of string
parmW y ;Top origin of string
parmD lp_clip_rect ;Clipping rectangle
parmD lp_string ;The string itself
parmW count ;Number of characters in the string
parmD lp_font ;Font to use
parmD lp_draw_mode ;Drawmode structure to use
parmD lp_xform ;Current text transform
; ExtTextOut parameters we have to dummy up.
;
; parmD lp_dx ;Widths for the characters
; parmD lp_opaque_rect ;Opaquing rectangle
; parmW eto_options ;ExtTextOut options
cBegin <nogen>
pop cx ;Save caller's return address
pop bx
xor ax,ax
push ax ;Push null for lp_dx
push ax
push ax ;Push null for lp_opaque_rect
push ax
push ax ;Push null for options
push bx ;Restore return address
push cx
; jmp ExtTextOut
errn$ ExtTextOut
cEnd <nogen>
page
;--------------------------Exported-Routine-----------------------------;
; ExtTextOut
;
; Entry:
; EGA registers in default state
; Returns:
; DX = Y extent of string if extent call
; AX = X extent of string if extent call
; EGA registers in default state
; Error Returns:
; DX:AX = 8000:0000H
; Registers Preserved:
; SI,DI,DS,BP
; Registers Destroyed:
; AX,BX,CX,DX,ES,FLAGS
; Calls:
; exclude
; unexclude
; ......
; History:
; Tue 18-Aug-1987 16:30:43 -by- **** ***** [*****]
; Added saving enabled_flag.
;
; Thu 09-Apr-1987 13:36:08 -by- **** ***** [*****]
; Created.
;-----------------------------------------------------------------------;
;------------------------------Pseudo-Code------------------------------;
; {
; }
;-----------------------------------------------------------------------;
assumes ds,Data
assumes es,nothing
define_frame ExtTextOut ;Define frame
cBegin
cCall OutputDebugString, <lp_string>
exit_strblt_null:
xor ax,ax ;Return DX:AX = 0000:0000
cwd ; to show success
exit_strblt:
cEnd
ifdef PUBDEFS
include strblt.pub
endif
sEnd code
end