-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCONTROL.ASM
executable file
·185 lines (144 loc) · 4.09 KB
/
CONTROL.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
page ,132
;-----------------------------Module-Header-----------------------------;
; Module Name: CONTROL.ASM
;
; This module contains the escape handler for the color display
; drivers.
;
; It also contains stubs for the SetAttribute function and the
; DeviceBitmap function, both of which this driver does not
; support.
;
; Created: 16-Feb-1987
; Author: **** ***** [*****]
;
; Copyright (c) 1983-1987 Microsoft Corporation
;
; Exported Functions: Control
;
; Public Functions: none
;
; Public Data: none
;
; General Description:
;
; Control is the routine which is called when an Escape call
; is made to GDI. This driver only implements two of the
; escape functions. These functions set and get the color
; table. Since the color table is not setable for the display,
; the current value is just returned.
;
; Support for QUERYESCSUPPORT has now been added. This escape
; function is required of all drivers. It informs the caller
; which escape functions are supported (QUERYESCSUPPORT will
; return TRUE for QUERYESCSUPPORT!).
;
; Restrictions:
;
;-----------------------------------------------------------------------;
incControl = 1 ;Include control for gdidefs.inc
.xlist
include cmacros.inc
include gdidefs.inc
include macros.mac
.list
??_out Control
externA COLOR_TBL_SIZE ;# entries in the color table
createSeg _BLUEMOON,BlueMoonSeg,word,public,CODE
sBegin BlueMoonSeg
assumes cs,BlueMoonSeg
externD BlueMoonSeg_color_table ;Color table values
page
;--------------------------Exported-Routine-----------------------------;
; Control
;
; Control is defined so that device specific commands can be issued
; that are not supported by GDI. Some of the Control functions have
; been defined by GDI so that devices that can perform them (and need
; to) can do so, such as clear device.
;
; Clear device will not be allowed. Nobody should do that to the
; system console!
;
; Set/Get color table will be implemented. GetColorTable will
; return the color in the table for the index passed.
;
; SetColorTable should return the color that was actually set
; into the table. Since this driver doesn't allow setting the
; color table, the Set function is the same as the Get function.
;
; Entry:
; None
; Returns:
; AX = 1 if success
; Error Returns:
; AX = 0 if error
; Registers Preserved:
; SI,DI,DS,BP
; Registers Destroyed:
; AX,BX,CX,DX,ES,FLAGS
; Calls:
; None
; History:
; Sun 27-Sep-1987 21:35:42 -by- **** ***** [*****]
; Added QUERYESCSUPPORT, which is the one required
; escape function all drivers must support.
;
; When queried if we support SETCOLORTABLE, we'll
; return false. The code will continue to return
; current color table index if we get the SETCOLORTABLE
; call.
;
; Wed 12-Aug-1987 17:29:30 -by- **** ***** [*****]
; made non-resident
;
; Wed 18-Mar-1987 14:04:30 -by- **** ***** [*****]
; Added COLOR_TBL_SIZE so the code can be shared
; between black/white and color drivers.
;
; Mon 16-Feb-1987 18:09:09 -by- **** ***** [*****]
; Created.
;-----------------------------------------------------------------------;
;------------------------------Pseudo-Code------------------------------;
; {
; }
;-----------------------------------------------------------------------;
assumes ds,Data
assumes es,nothing
cProc Control,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lp_device
parmW function
parmD lp_in_data
parmD lp_out_data
cBegin
mov ah, 0ah
mov al, "C"
mov bh, 0
mov cx, 5
int 10h
mov ax, 1
exit_control:
cEnd
cProc DeviceBitmap,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lpDevice
parmW command
parmD lpBitmap
parmD lpBits
cBegin <nogen>
xor ax,ax
ret 14
cEnd <nogen>
cProc SetAttribute,<FAR,PUBLIC,WIN,PASCAL>,<si,di>
parmD lpDevice
parmW stateNum
parmW index
parmD attribute
cBegin <nogen>
xor ax,ax
ret 12
cEnd <nogen>
sEnd BlueMoonSeg
ifdef PUBDEFS
include control.pub
endif
end