Subversion Repositories Kolibri OS

Rev

Rev 224 | Rev 230 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 224 Rev 227
Line 149... Line 149...
149
           mov [rBase],edi
149
           mov [rBase],edi
150
           sub [height],1
150
           sub [height],1
151
           jnz .row_24
151
           jnz .row_24
152
           ret
152
           ret
153
 
153
endp
154
endp
-
 
155
 
154
 
Line 156... Line 155...
156
align 4
155
align 4
157
proc alloc_cursor
156
proc alloc_cursor
Line 170... Line 169...
170
           xor eax,eax
169
           xor eax,eax
171
           ret
170
           ret
172
.found:
171
.found:
173
           btr [ebx], eax
172
           btr [ebx], eax
174
           mov [cursor_start],ebx
173
           popfd
-
 
174
 
-
 
175
           mov [cursor_start],ebx
175
           sub ebx, cursor_map
176
           sub ebx, cursor_map
176
           shl ebx, 3
177
           shl ebx, 3
177
           add eax,ebx
178
           add eax,ebx
178
           shl eax,3
179
           shl eax,3
179
           lea eax,[cursors+eax+eax*2]
180
           lea eax,[cursors+eax+eax*2]
180
           popfd
181
 
-
 
182
           xor ebx, ebx
181
           ret
183
           mov [eax+CURSOR.magic], 'CURS'
-
 
184
           mov [eax+CURSOR.size],  CURSOR_SIZE
-
 
185
           mov [eax+CURSOR.pid], ebx
-
 
186
           mov [eax+CURSOR.hot_x], ebx
-
 
187
           mov [eax+CURSOR.hot_y], ebx
-
 
188
           ret
182
endp
189
endp
183
 
190
 
Line 184... Line 191...
184
align 4
191
align 4
185
proc create_cursor
192
proc set_cursor stdcall, hcursor:dword
186
           locals
193
           mov eax, [hcursor]
-
 
194
           mov ebx, [CURRENT_TASK]
187
             h_cur  dd ?
195
           shl ebx, 8
-
 
196
           xchg eax, [ebx+PROC_BASE+APPDATA.cursor]
188
           endl
197
           ret
-
 
198
endp
Line -... Line 199...
-
 
199
 
-
 
200
proc vesa_cursor stdcall, hcursor:dword, src:dword, flags:dword
189
 
201
 
190
           call alloc_cursor
202
           stdcall kernel_alloc, 0x1000
191
           test eax, eax
203
           test eax, eax
Line 192... Line -...
192
           jz .fail
-
 
193
 
204
           jz .fail
194
           mov [h_cur], eax
-
 
195
           mov edi, eax
-
 
196
 
-
 
197
           xor ebx, ebx
-
 
198
 
-
 
199
           mov [edi+CURSOR.magic], 'CURS'
205
 
200
           mov [edi+CURSOR.size],  CURSOR_SIZE
-
 
201
           mov [edi+CURSOR.pid], ebx
-
 
Line 202... Line 206...
202
           mov [edi+CURSOR.hot_x], ebx
206
           mov edi, [hcursor]
203
           mov [edi+CURSOR.hot_y], ebx
207
           mov [edi+CURSOR.base], eax
-
 
208
 
204
 
209
           mov esi, [src]
-
 
210
           mov ebx, [flags]
-
 
211
           cmp bx, LOAD_INDIRECT
-
 
212
           je .indirect
-
 
213
 
-
 
214
           movzx ecx, word [esi+10]
Line 205... Line 215...
205
           stdcall kernel_alloc, dword 0x2000
215
           movzx edx, word [esi+12]
206
           test eax, eax
216
           mov [edi+CURSOR.hot_x], ecx
207
           jz .fail
-
 
208
 
-
 
209
           mov ebx, eax
217
           mov [edi+CURSOR.hot_y], edx
210
           mov eax, [h_cur]
218
 
211
           mov [eax+CURSOR.base], ebx
219
           stdcall vesa_init_cursor, eax, esi
-
 
220
           mov eax, [hcursor]
-
 
221
.fail:
-
 
222
           ret
-
 
223
.indirect:
-
 
224
           shr ebx, 16
Line 212... Line -...
212
           ret
-
 
213
.fail:
-
 
214
           ret
225
           movzx ecx, bh
215
endp
226
           movzx edx, bl
216
 
227
           mov [eax+CURSOR.hot_x], ecx
217
align 4
228
           mov [eax+CURSOR.hot_y], edx
218
proc set_cursor stdcall, hcursor:dword
229
 
219
           mov eax, [hcursor]
230
           xchg edi, eax
Line 220... Line 231...
220
           mov ebx, [CURRENT_TASK]
231
           mov ecx, 1024
221
           shl ebx, 8
232
           cld
222
           xchg eax, [ebx+PROC_BASE+APPDATA.cursor]
233
           rep movsd
223
           ret
234
           ret
224
endp
235
endp
Line 225... Line 236...
225
 
236
 
-
 
237
align 4
226
align 4
238
proc load_cursor stdcall, src:dword, flags:dword
227
proc load_cursor stdcall, src:dword, flags:dword
239
           locals
Line 228... Line 240...
228
           locals
240
             handle  dd ?
229
             handle  dd ?
241
           endl
230
           endl
242
 
231
 
243
           xor eax, eax
232
           movzx eax, word [flags]
244
           mov [handle], eax
233
           cmp eax, LOAD_FROM_FILE
245
           cmp word [flags], LOAD_FROM_FILE
234
           jne .from_mem
246
           jne @F
235
 
247
 
Line -... Line 248...
-
 
248
           stdcall load_file, [src]
236
           stdcall load_file, [src]
249
           test eax, eax
237
           test eax, eax
-
 
238
           jz .exit
-
 
239
           mov [src], eax
-
 
240
 
-
 
241
           call create_cursor
-
 
242
           test eax, eax
-
 
243
           jz .fail
-
 
244
 
-
 
245
           mov [handle], eax
-
 
246
           mov esi, [src]
-
 
247
           movzx ebx, word [esi+10]
-
 
248
           movzx ecx, word [esi+12]
-
 
249
           mov [eax+CURSOR.hot_x], ebx
-
 
250
           mov [eax+CURSOR.hot_y], ecx
-
 
251
 
-
 
252
           stdcall vesa_init_cursor, [eax+CURSOR.base], esi
-
 
253
           stdcall kernel_free, [src]
-
 
254
           mov eax, [handle]
-
 
255
           ret
-
 
256
 
-
 
257
.from_mem:
-
 
258
           cmp eax, LOAD_FROM_MEM
-
 
259
           jne .indirect
-
 
260
 
-
 
261
           call create_cursor
-
 
262
           test eax, eax
-
 
263
           jz .exit
-
 
264
 
-
 
265
           mov [handle], eax
-
 
266
           mov esi, [src]
-
 
267
           movzx ebx, word [esi+10]
-
 
268
           movzx ecx, word [esi+12]
-
 
269
           mov [eax+CURSOR.hot_x], ebx
-
 
270
           mov [eax+CURSOR.hot_y], ecx
-
 
271
 
-
 
272
           stdcall vesa_init_cursor, [eax+CURSOR.base], [src]
-
 
273
           mov eax, [handle]
-
 
274
           ret
-
 
275
 
-
 
276
.indirect:
-
 
277
           cmp eax, LOAD_INDIRECT
-
 
278
           jne .fail
-
 
279
 
-
 
280
           call create_cursor
-
 
281
           test eax, eax
-
 
282
           jz .exit
-
 
283
 
-
 
284
           movzx edx, byte [flags+2]
-
 
285
           movzx ebx, byte [flags+3]
-
 
286
           mov [eax+CURSOR.hot_x], ebx
250
           jz .exit
-
 
251
           mov [src], eax
287
           mov [eax+CURSOR.hot_y], edx
252
@@:
288
 
253
           call alloc_cursor
289
           mov edi, [eax+CURSOR.base]
254
           test eax, eax
290
           mov esi, [src]
255
           jz .fail
291
           mov ecx, 1024
256
 
292
           cld
257
           stdcall [create_cursor], eax, [src], [flags]
Line 293... Line 258...
293
           rep movsd
258
           mov [handle], eax
294
           ret
259
.fail:
Line 328... Line 293...
328
           mov [cursor_start], edx
293
           mov [cursor_start], edx
329
           add edx, 4
294
           add edx, 4
330
           mov [cursor_end], edx
295
           mov [cursor_end], edx
331
 
296
 
Line -... Line 297...
-
 
297
           stdcall load_driver, drv_hw_mouse
-
 
298
           test eax, eax
-
 
299
           jz .sw_mouse
-
 
300
 
-
 
301
           stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
-
 
302
           mov [def_cursor], eax
-
 
303
           ret
-
 
304
.sw_mouse:
-
 
305
           mov [create_cursor], vesa_cursor
-
 
306
 
332
           stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
307
           stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
333
           mov [def_cursor], eax
308
           mov [def_cursor], eax
Line 334... Line 309...
334
 
309
 
335
           mov ecx, [SCR_X_SIZE]
310
           mov ecx, [SCR_X_SIZE]
Line 444... Line 419...
444
           mov eax, 32
419
           mov eax, 32
445
 
420
 
Line 446... Line 421...
446
           sub edi, ecx
421
           sub edi, ecx
447
           cmp edi, eax
422
           cmp edi, eax
448
           ;cmovg edi, eax
-
 
449
           jng @F
423
           jng @F
450
           mov edi, eax
424
           mov edi, eax
451
@@:
425
@@:
452
           sub edi, [_dx]
426
           sub edi, [_dx]
Line 453... Line 427...
453
 
427
 
454
           sub edx, [y]
428
           sub edx, [y]
455
           cmp edx, eax
-
 
456
           ;cmovg edx, eax
429
           cmp edx, eax
457
           jng @F
430
           jng @F
458
           mov edx, eax
431
           mov edx, eax
459
@@:
432
@@:
Line 557... Line 530...
557
           mov eax, 32
530
           mov eax, 32
558
 
531
 
Line 559... Line 532...
559
           sub edi, ecx
532
           sub edi, ecx
560
           cmp edi, eax
533
           cmp edi, eax
561
;           cmovg edi, eax
-
 
562
           jng @F
534
           jng @F
563
           mov edi, eax
535
           mov edi, eax
564
@@:
536
@@:
565
           sub edi, [_dx]
537
           sub edi, [_dx]
Line 566... Line 538...
566
 
538
 
567
           sub edx, [y]
539
           sub edx, [y]
568
           cmp edx, eax
-
 
569
;           cmovg edx, eax
540
           cmp edx, eax
570
           jng @F
541
           jng @F
571
           mov edx, eax
542
           mov edx, eax
572
@@:
543
@@: