Subversion Repositories Kolibri OS

Rev

Rev 882 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
882 serge 1
 
2
DLL_ENTRY        =  1
3
4
 
5
HS_VERTICAL      =  1
6
HS_FDIAGONAL     =  2
7
HS_BDIAGONAL     =  3
8
HS_CROSS         =  4
9
HS_DIAGCROSS     =  5
10
11
 
12
13
 
14
PX_MEM_LOCAL     =  1
15
PX_MEM_GART      =  2
16
17
 
18
19
 
20
21
 
22
{
23
           pushd fcolor
24
           pushd bkcolor
25
           pushd hatch
26
           call [imp_CreateHatch]
27
           add esp, 3*4
28
}
29
30
 
31
{
32
           pushd brush
33
           call [imp_DestroyBrush]
34
           add esp, 4
35
}
36
37
 
38
{
39
           pushd flags
40
           pushd format
41
           pushd height
42
           pushd width
43
           call [imp_CreatePixmap]
44
           add esp, 4*4
45
}
46
47
 
48
{
49
          pushd pixmap
50
          call [imp_DestroyPixmap]
51
          add esp, 4
52
};
53
54
 
55
{
56
           pushd pixmap
57
           call [imp_LockPixmap]
58
           add esp, 4
59
}
60
61
 
62
{
63
           pushd pixmap
64
           call [imp_UnlockPixmap]
65
           add esp, 4
66
}
67
68
 
69
{
70
           pushd color
71
           pushd pixmap
72
           call [imp_ClearPixmap]
73
           add esp, 2*4
74
}
75
76
 
77
{
78
           pushd color
79
           pushd y1
80
           pushd x1
81
           pushd y0
82
           pushd x0
83
           pushd pixmap
84
           call [imp_Line]
85
           add esp, 6*4
86
};
87
88
 
89
{
90
           pushd border
91
           pushd color
92
           pushd h
93
           pushd w
94
           pushd y
95
           pushd x
96
           pushd pixmap
97
           call [imp_DrawRect]
98
           add esp, 7*4
99
}
100
101
 
102
{
103
           pushd border
104
           pushd brush
105
           pushd h
106
           pushd w
107
           pushd y
108
           pushd x
109
           pushd pixmap
110
           call [imp_FillRect]
111
           add esp, 7*4
112
}
113
114
 
115
{
116
           pushd h
117
           pushd w
118
           pushd srcy
119
           pushd srcx
120
           pushd srcpix
121
           pushd dsty
122
           pushd dstx
123
           pushd dstpix
124
           call [imp_Blit]
125
           add esp, 8*4
126
}
127
128
 
1002 serge 129
{
130
           pushd alpha
131
           pushd h
132
           pushd w
133
           pushd srcy
134
           pushd srcx
135
           pushd srcpix
136
           pushd dsty
137
           pushd dstx
138
           pushd dstpix
139
           call [imp_BlitAlpha]
140
           add esp, 9*4
141
}
142
143
 
882 serge 144
{
145
           pushd key
146
           pushd h
147
           pushd w
148
           pushd srcy
149
           pushd srcx
150
           pushd srcpix
151
           pushd dsty
152
           pushd dstx
153
           pushd dstpix
154
           call [imp_TransparentBlit]
155
           add esp, 9*4
156
}
157
158
 
1002 serge 159
 
160
{
161
          pushd path
162
163
 
164
          push path
165
          call _strrchr
166
167
 
168
169
 
170
          mov ebx, 1
171
          mov ecx, [esp+8]
172
          int 0x40
173
174
 
175
}
176
177
 
882 serge 178
179
 
180
szVersion            db  'version',0
181
182
 
183
szDestroyPixmap      db  'DestroyPixmap',0
184
szLockPixmap         db  'LockPixmap',0
185
szUnlockPixmap       db  'UnlockPixmap',0
186
szGetPixmapPitch     db  'GetPixmapPitch',0
187
188
 
189
szCreateMonoBrush    db  'CreateMonoBrush',0
190
szDestroyBrush       db  'DestroyBrush',0
191
192
 
193
szLine               db  'Line',0
194
szDrawRect           db  'DrawRect',0
195
szFillRect           db  'FillRect',0
196
szBlit               db  'Blit',0
197
szTransparentBlit    db  'TransparentBlit',0
198
szBlitAlpha          db  'BlitAlpha',0
1002 serge 199
882 serge 200
 
201
202
 
203
204
 
205
imp_ver              dd  szVersion
206
207
 
208
imp_DestroyPixmap    dd  szDestroyPixmap
209
imp_LockPixmap       dd  szLockPixmap
210
imp_UnlockPixmap     dd  szUnlockPixmap
211
imp_GetPixmapPitch   dd  szGetPixmapPitch
212
213
 
214
imp_CreateMonoBrush  dd  szCreateMonoBrush
215
imp_DestroyBrush     dd  szDestroyBrush
216
217
 
218
imp_Line             dd  szLine
219
imp_DrawRect         dd  szDrawRect
220
imp_FillRect         dd  szFillRect
221
imp_Blit             dd  szBlit
222
imp_TransparentBlit  dd  szTransparentBlit
223
imp_BlitAlpha        dd  szBlitAlpha
1002 serge 224
882 serge 225
 
226
227
 
228
 
229
;szLineClip           db  'LineClip',0
230
;imp_BlockClip        dd  szBlockClip
231
;imp_LineClip         dd  szLineClip
232
233
 
234
 
235
236
 
237
           mov  eax, 68
238
           mov  ebx, 19
239
           mov  ecx, szPxlib
240
           int  0x40
241
           test eax, eax
242
           jz   .fail
243
244
 
245
           mov  esi, px_import
246
.import_loop:
247
           lodsd
248
           test eax, eax
249
           jz   .import_done
250
           push edx
251
.import_find:
252
           mov ebx, [edx]
253
           test ebx, ebx
254
           jz .fail         ;import_not_found
255
256
 
257
@@:
258
           mov cl, [eax]
259
           cmp cl, [ebx]
260
           jnz .import_find_next
261
262
 
263
           jz .import_found
264
265
 
266
           inc ebx
267
           jmp @b
268
.import_find_next:
269
           pop eax
270
           add edx, 8
271
           jmp .import_find
272
.import_found:
273
           pop eax
274
           mov eax, [edx+4]
275
           mov [esi-4], eax
276
           pop edx
277
           jmp .import_loop
278
.import_done:
279
280
 
281
           jb .fail
282
           cmp word [imp_ver+2], REQ_DLL_VER
283
           ja .fail
284
285
 
286
           call [imp_start]
287
           test eax, eax
288
           jz .fail
289
290
 
291
.fail:
292
           xor eax, eax
293
           ret
294
295
 
1002 serge 296
_strrchr:
297
	push	ebp
298
	mov	ebp, esp
299
	push	edi
300
        mov     edi, [8+ebp]
301
        mov     ecx, -1
302
        xor     al, al
303
        cld
304
        repne
305
        scasb
306
        not     ecx
307
        dec     edi
308
        mov     al, [12+ebp]
309
        std
310
        repne
311
        scasb
312
        cld
313
        jne     .failure
314
        lea     eax, [edi+1]
315
        pop     edi
316
        pop     ebp
317
        ret
318
.failure:
319
        xor     eax, eax
320
        pop     edi
321
        pop     ebp
322
        ret
323