Subversion Repositories Kolibri OS

Rev

Rev 5596 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5596 Rev 6240
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
$Revision: 5596 $
8
$Revision: 6240 $
9
 
9
 
10
 
10
 
11
LOAD_FROM_FILE  equ 0
11
LOAD_FROM_FILE  equ 0
12
LOAD_FROM_MEM   equ 1
12
LOAD_FROM_MEM   equ 1
13
LOAD_INDIRECT   equ 2
13
LOAD_INDIRECT   equ 2
14
LOAD_SYSTEM     equ 3
14
LOAD_SYSTEM     equ 3
15
 
15
 
16
struct  BITMAPINFOHEADER
16
struct  BITMAPINFOHEADER
17
        Size                    dd ?
17
        Size                    dd ?
18
        Width                   dd ?
18
        Width                   dd ?
19
        Height                  dd ?
19
        Height                  dd ?
20
        Planes                  dw ?
20
        Planes                  dw ?
21
        BitCount                dw ?
21
        BitCount                dw ?
22
        Compression             dd ?
22
        Compression             dd ?
23
        SizeImage               dd ?
23
        SizeImage               dd ?
24
        XPelsPerMeter           dd ?
24
        XPelsPerMeter           dd ?
25
        YPelsPerMeter           dd ?
25
        YPelsPerMeter           dd ?
26
        ClrUsed                 dd ?
26
        ClrUsed                 dd ?
27
        ClrImportant            dd ?
27
        ClrImportant            dd ?
28
ends
28
ends
29
;------------------------------------------------------------------------------
29
;------------------------------------------------------------------------------
30
align 4
30
align 4
31
proc init_cursor stdcall, dst:dword, src:dword
31
proc init_cursor stdcall, dst:dword, src:dword
32
           locals
32
           locals
33
             rBase    dd ?
33
             rBase    dd ?
34
             pQuad    dd ?
34
             pQuad    dd ?
35
             pBits    dd ?
35
             pBits    dd ?
36
             pAnd     dd ?
36
             pAnd     dd ?
37
             width    dd ?
37
             width    dd ?
38
             height   dd ?
38
             height   dd ?
39
             counter  dd ?
39
             counter  dd ?
40
           endl
40
           endl
41
 
41
 
42
        mov     esi, [src]
42
        mov     esi, [src]
43
        add     esi, [esi+18]
43
        add     esi, [esi+18]
44
        mov     eax, esi
44
        mov     eax, esi
45
 
45
 
46
        cmp     [esi+BITMAPINFOHEADER.BitCount], 24
46
        cmp     [esi+BITMAPINFOHEADER.BitCount], 24
47
        je      .img_24
47
        je      .img_24
48
        cmp     [esi+BITMAPINFOHEADER.BitCount], 8
48
        cmp     [esi+BITMAPINFOHEADER.BitCount], 8
49
        je      .img_8
49
        je      .img_8
50
        cmp     [esi+BITMAPINFOHEADER.BitCount], 4
50
        cmp     [esi+BITMAPINFOHEADER.BitCount], 4
51
        je      .img_4
51
        je      .img_4
52
;--------------------------------------
52
;--------------------------------------
53
align 4
53
align 4
54
.img_2:
54
.img_2:
55
        add     eax, [esi]
55
        add     eax, [esi]
56
        mov     [pQuad], eax
56
        mov     [pQuad], eax
57
        add     eax, 8
57
        add     eax, 8
58
        mov     [pBits], eax
58
        mov     [pBits], eax
59
        add     eax, 128
59
        add     eax, 128
60
        mov     [pAnd], eax
60
        mov     [pAnd], eax
61
        mov     eax, [esi+4]
61
        mov     eax, [esi+4]
62
        mov     [width], eax
62
        mov     [width], eax
63
        mov     ebx, [esi+8]
63
        mov     ebx, [esi+8]
64
        shr     ebx, 1
64
        shr     ebx, 1
65
        mov     [height], ebx
65
        mov     [height], ebx
66
 
66
 
67
        mov     edi, [dst]
67
        mov     edi, [dst]
68
        add     edi, 32*31*4
68
        add     edi, 32*31*4
69
        mov     [rBase], edi
69
        mov     [rBase], edi
70
 
70
 
71
        mov     esi, [pQuad]
71
        mov     esi, [pQuad]
72
;--------------------------------------
72
;--------------------------------------
73
align 4
73
align 4
74
.l21:
74
.l21:
75
        mov     ebx, [pBits]
75
        mov     ebx, [pBits]
76
        mov     ebx, [ebx]
76
        mov     ebx, [ebx]
77
        bswap   ebx
77
        bswap   ebx
78
        mov     eax, [pAnd]
78
        mov     eax, [pAnd]
79
        mov     eax, [eax]
79
        mov     eax, [eax]
80
        bswap   eax
80
        bswap   eax
81
        mov     [counter], 32
81
        mov     [counter], 32
82
;--------------------------------------
82
;--------------------------------------
83
align 4
83
align 4
84
@@:
84
@@:
85
        xor     edx, edx
85
        xor     edx, edx
86
        shl     eax, 1
86
        shl     eax, 1
87
        setc    dl
87
        setc    dl
88
        dec     edx
88
        dec     edx
89
 
89
 
90
        xor     ecx, ecx
90
        xor     ecx, ecx
91
        shl     ebx, 1
91
        shl     ebx, 1
92
        setc    cl
92
        setc    cl
93
        mov     ecx, [esi+ecx*4]
93
        mov     ecx, [esi+ecx*4]
94
        and     ecx, edx
94
        and     ecx, edx
95
        and     edx, 0xFF000000
95
        and     edx, 0xFF000000
96
        or      edx, ecx
96
        or      edx, ecx
97
        mov     [edi], edx
97
        mov     [edi], edx
98
 
98
 
99
        add     edi, 4
99
        add     edi, 4
100
        dec     [counter]
100
        dec     [counter]
101
        jnz     @B
101
        jnz     @B
102
 
102
 
103
        add     [pBits], 4
103
        add     [pBits], 4
104
        add     [pAnd], 4
104
        add     [pAnd], 4
105
        mov     edi, [rBase]
105
        mov     edi, [rBase]
106
        sub     edi, 128
106
        sub     edi, 128
107
        mov     [rBase], edi
107
        mov     [rBase], edi
108
        sub     [height], 1
108
        sub     [height], 1
109
        jnz     .l21
109
        jnz     .l21
110
        ret
110
        ret
111
;--------------------------------------
111
;--------------------------------------
112
align 4
112
align 4
113
.img_4:
113
.img_4:
114
        add     eax, [esi]
114
        add     eax, [esi]
115
        mov     [pQuad], eax
115
        mov     [pQuad], eax
116
        add     eax, 64
116
        add     eax, 64
117
        mov     [pBits], eax
117
        mov     [pBits], eax
118
        add     eax, 0x200
118
        add     eax, 0x200
119
        mov     [pAnd], eax
119
        mov     [pAnd], eax
120
        mov     eax, [esi+4]
120
        mov     eax, [esi+4]
121
        mov     [width], eax
121
        mov     [width], eax
122
        mov     ebx, [esi+8]
122
        mov     ebx, [esi+8]
123
        shr     ebx, 1
123
        shr     ebx, 1
124
        mov     [height], ebx
124
        mov     [height], ebx
125
 
125
 
126
        mov     edi, [dst]
126
        mov     edi, [dst]
127
        add     edi, 32*31*4
127
        add     edi, 32*31*4
128
        mov     [rBase], edi
128
        mov     [rBase], edi
129
 
129
 
130
        mov     esi, [pQuad]
130
        mov     esi, [pQuad]
131
        mov     ebx, [pBits]
131
        mov     ebx, [pBits]
132
;--------------------------------------
132
;--------------------------------------
133
align 4
133
align 4
134
.l4:
134
.l4:
135
        mov     eax, [pAnd]
135
        mov     eax, [pAnd]
136
        mov     eax, [eax]
136
        mov     eax, [eax]
137
        bswap   eax
137
        bswap   eax
138
        mov     [counter], 16
138
        mov     [counter], 16
139
;--------------------------------------
139
;--------------------------------------
140
align 4
140
align 4
141
@@:
141
@@:
142
        xor     edx, edx
142
        xor     edx, edx
143
        shl     eax, 1
143
        shl     eax, 1
144
        setc    dl
144
        setc    dl
145
        dec     edx
145
        dec     edx
146
 
146
 
147
        movzx   ecx, byte [ebx]
147
        movzx   ecx, byte [ebx]
148
        and     cl, 0xF0
148
        and     cl, 0xF0
149
        shr     ecx, 2
149
        shr     ecx, 2
150
        mov     ecx, [esi+ecx]
150
        mov     ecx, [esi+ecx]
151
        and     ecx, edx
151
        and     ecx, edx
152
        and     edx, 0xFF000000
152
        and     edx, 0xFF000000
153
        or      edx, ecx
153
        or      edx, ecx
154
        mov     [edi], edx
154
        mov     [edi], edx
155
 
155
 
156
        xor     edx, edx
156
        xor     edx, edx
157
        shl     eax, 1
157
        shl     eax, 1
158
        setc    dl
158
        setc    dl
159
        dec     edx
159
        dec     edx
160
 
160
 
161
        movzx   ecx, byte [ebx]
161
        movzx   ecx, byte [ebx]
162
        and     cl, 0x0F
162
        and     cl, 0x0F
163
        mov     ecx, [esi+ecx*4]
163
        mov     ecx, [esi+ecx*4]
164
        and     ecx, edx
164
        and     ecx, edx
165
        and     edx, 0xFF000000
165
        and     edx, 0xFF000000
166
        or      edx, ecx
166
        or      edx, ecx
167
        mov     [edi+4], edx
167
        mov     [edi+4], edx
168
 
168
 
169
        inc     ebx
169
        inc     ebx
170
        add     edi, 8
170
        add     edi, 8
171
        dec     [counter]
171
        dec     [counter]
172
        jnz     @B
172
        jnz     @B
173
 
173
 
174
        add     [pAnd], 4
174
        add     [pAnd], 4
175
        mov     edi, [rBase]
175
        mov     edi, [rBase]
176
        sub     edi, 128
176
        sub     edi, 128
177
        mov     [rBase], edi
177
        mov     [rBase], edi
178
        sub     [height], 1
178
        sub     [height], 1
179
        jnz     .l4
179
        jnz     .l4
180
        ret
180
        ret
181
;--------------------------------------
181
;--------------------------------------
182
align 4
182
align 4
183
.img_8:
183
.img_8:
184
        add     eax, [esi]
184
        add     eax, [esi]
185
        mov     [pQuad], eax
185
        mov     [pQuad], eax
186
        add     eax, 1024
186
        add     eax, 1024
187
        mov     [pBits], eax
187
        mov     [pBits], eax
188
        add     eax, 1024
188
        add     eax, 1024
189
        mov     [pAnd], eax
189
        mov     [pAnd], eax
190
        mov     eax, [esi+4]
190
        mov     eax, [esi+4]
191
        mov     [width], eax
191
        mov     [width], eax
192
        mov     ebx, [esi+8]
192
        mov     ebx, [esi+8]
193
        shr     ebx, 1
193
        shr     ebx, 1
194
        mov     [height], ebx
194
        mov     [height], ebx
195
 
195
 
196
        mov     edi, [dst]
196
        mov     edi, [dst]
197
        add     edi, 32*31*4
197
        add     edi, 32*31*4
198
        mov     [rBase], edi
198
        mov     [rBase], edi
199
 
199
 
200
        mov     esi, [pQuad]
200
        mov     esi, [pQuad]
201
        mov     ebx, [pBits]
201
        mov     ebx, [pBits]
202
;--------------------------------------
202
;--------------------------------------
203
align 4
203
align 4
204
.l81:
204
.l81:
205
        mov     eax, [pAnd]
205
        mov     eax, [pAnd]
206
        mov     eax, [eax]
206
        mov     eax, [eax]
207
        bswap   eax
207
        bswap   eax
208
        mov     [counter], 32
208
        mov     [counter], 32
209
;--------------------------------------
209
;--------------------------------------
210
align 4
210
align 4
211
@@:
211
@@:
212
        xor     edx, edx
212
        xor     edx, edx
213
        shl     eax, 1
213
        shl     eax, 1
214
        setc    dl
214
        setc    dl
215
        dec     edx
215
        dec     edx
216
 
216
 
217
        movzx   ecx, byte [ebx]
217
        movzx   ecx, byte [ebx]
218
        mov     ecx, [esi+ecx*4]
218
        mov     ecx, [esi+ecx*4]
219
        and     ecx, edx
219
        and     ecx, edx
220
        and     edx, 0xFF000000
220
        and     edx, 0xFF000000
221
        or      edx, ecx
221
        or      edx, ecx
222
        mov     [edi], edx
222
        mov     [edi], edx
223
 
223
 
224
        inc     ebx
224
        inc     ebx
225
        add     edi, 4
225
        add     edi, 4
226
        dec     [counter]
226
        dec     [counter]
227
        jnz     @B
227
        jnz     @B
228
 
228
 
229
        add     [pAnd], 4
229
        add     [pAnd], 4
230
        mov     edi, [rBase]
230
        mov     edi, [rBase]
231
        sub     edi, 128
231
        sub     edi, 128
232
        mov     [rBase], edi
232
        mov     [rBase], edi
233
        sub     [height], 1
233
        sub     [height], 1
234
        jnz     .l81
234
        jnz     .l81
235
        ret
235
        ret
236
;--------------------------------------
236
;--------------------------------------
237
align 4
237
align 4
238
.img_24:
238
.img_24:
239
        add     eax, [esi]
239
        add     eax, [esi]
240
        mov     [pQuad], eax
240
        mov     [pQuad], eax
241
        add     eax, 0xC00
241
        add     eax, 0xC00
242
        mov     [pAnd], eax
242
        mov     [pAnd], eax
243
        mov     eax, [esi+BITMAPINFOHEADER.Width]
243
        mov     eax, [esi+BITMAPINFOHEADER.Width]
244
        mov     [width], eax
244
        mov     [width], eax
245
        mov     ebx, [esi+BITMAPINFOHEADER.Height]
245
        mov     ebx, [esi+BITMAPINFOHEADER.Height]
246
        shr     ebx, 1
246
        shr     ebx, 1
247
        mov     [height], ebx
247
        mov     [height], ebx
248
 
248
 
249
        mov     edi, [dst]
249
        mov     edi, [dst]
250
        add     edi, 32*31*4
250
        add     edi, 32*31*4
251
        mov     [rBase], edi
251
        mov     [rBase], edi
252
 
252
 
253
        mov     esi, [pAnd]
253
        mov     esi, [pAnd]
254
        mov     ebx, [pQuad]
254
        mov     ebx, [pQuad]
255
;--------------------------------------
255
;--------------------------------------
256
align 4
256
align 4
257
.row_24:
257
.row_24:
258
        mov     eax, [esi]
258
        mov     eax, [esi]
259
        bswap   eax
259
        bswap   eax
260
        mov     [counter], 32
260
        mov     [counter], 32
261
;--------------------------------------
261
;--------------------------------------
262
align 4
262
align 4
263
@@:
263
@@:
264
        xor     edx, edx
264
        xor     edx, edx
265
        shl     eax, 1
265
        shl     eax, 1
266
        setc    dl
266
        setc    dl
267
        dec     edx
267
        dec     edx
268
 
268
 
269
        mov     ecx, [ebx]
269
        mov     ecx, [ebx]
270
        and     ecx, 0x00FFFFFF
270
        and     ecx, 0x00FFFFFF
271
        and     ecx, edx
271
        and     ecx, edx
272
        and     edx, 0xFF000000
272
        and     edx, 0xFF000000
273
        or      edx, ecx
273
        or      edx, ecx
274
        mov     [edi], edx
274
        mov     [edi], edx
275
        add     ebx, 3
275
        add     ebx, 3
276
        add     edi, 4
276
        add     edi, 4
277
        dec     [counter]
277
        dec     [counter]
278
        jnz     @B
278
        jnz     @B
279
 
279
 
280
        add     esi, 4
280
        add     esi, 4
281
        mov     edi, [rBase]
281
        mov     edi, [rBase]
282
        sub     edi, 128
282
        sub     edi, 128
283
        mov     [rBase], edi
283
        mov     [rBase], edi
284
        sub     [height], 1
284
        sub     [height], 1
285
        jnz     .row_24
285
        jnz     .row_24
286
        ret
286
        ret
287
endp
287
endp
288
;------------------------------------------------------------------------------
288
;------------------------------------------------------------------------------
289
align 4
289
align 4
290
proc set_cursor stdcall, hcursor:dword
290
proc set_cursor stdcall, hcursor:dword
291
        mov     eax, [hcursor]
291
        mov     eax, [hcursor]
292
        cmp     [eax+CURSOR.magic], 'CURS'
292
        cmp     [eax+CURSOR.magic], 'CURS'
293
        jne     .fail
293
        jne     .fail
294
;           cmp [eax+CURSOR.size], CURSOR_SIZE
294
;           cmp [eax+CURSOR.size], CURSOR_SIZE
295
;           jne .fail
295
;           jne .fail
296
        mov     ebx, [current_slot]
296
        mov     ebx, [current_slot]
297
        xchg    eax, [ebx+APPDATA.cursor]
297
        xchg    eax, [ebx+APPDATA.cursor]
298
        jmp     .end
298
        jmp     .end
299
;--------------------------------------
299
;--------------------------------------
300
align 4
300
align 4
301
.fail:
301
.fail:
302
        mov     eax, [def_cursor]
302
        mov     eax, [def_cursor]
303
        mov     ebx, [current_slot]
303
        mov     ebx, [current_slot]
304
        xchg    eax, [ebx+APPDATA.cursor]
304
        xchg    eax, [ebx+APPDATA.cursor]
305
align 4
305
align 4
306
.end:
306
.end:
307
        mov     [redrawmouse_unconditional], 1
307
        mov     [redrawmouse_unconditional], 1
308
        call    __sys_draw_pointer
308
        call    __sys_draw_pointer
309
        ret
309
        ret
310
endp
310
endp
311
;------------------------------------------------------------------------------
311
;------------------------------------------------------------------------------
312
align 4
312
align 4
313
; param
313
; param
314
;  eax= pid
314
;  eax= pid
315
;  ebx= src
315
;  ebx= src
316
;  ecx= flags
316
;  ecx= flags
317
 
317
 
318
create_cursor:
318
create_cursor:
319
.src     equ esp
319
.src     equ esp
320
.flags   equ esp+4
320
.flags   equ esp+4
321
.hcursor equ esp+8
321
.hcursor equ esp+8
322
 
322
 
323
        sub     esp, 4         ;space for .hcursor
323
        sub     esp, 4         ;space for .hcursor
324
        push    ecx
324
        push    ecx
325
        push    ebx
325
        push    ebx
326
 
326
 
327
        mov     ebx, eax
327
        mov     ebx, eax
328
        mov     eax, sizeof.CURSOR
328
        mov     eax, sizeof.CURSOR
329
        call    create_kernel_object
329
        call    create_kernel_object
330
        test    eax, eax
330
        test    eax, eax
331
        jz      .fail
331
        jz      .fail
332
 
332
 
333
        mov     [.hcursor], eax
333
        mov     [.hcursor], eax
334
 
334
 
335
        xor     ebx, ebx
335
        xor     ebx, ebx
336
        mov     [eax+CURSOR.magic], 'CURS'
336
        mov     [eax+CURSOR.magic], 'CURS'
337
        mov     [eax+CURSOR.destroy], destroy_cursor
337
        mov     [eax+CURSOR.destroy], destroy_cursor
338
        mov     [eax+CURSOR.hot_x], ebx
338
        mov     [eax+CURSOR.hot_x], ebx
339
        mov     [eax+CURSOR.hot_y], ebx
339
        mov     [eax+CURSOR.hot_y], ebx
340
 
340
 
341
        stdcall kernel_alloc, 0x1000
341
        stdcall kernel_alloc, 0x1000
342
        test    eax, eax
342
        test    eax, eax
343
        jz      .fail
343
        jz      .fail
344
 
344
 
345
        mov     edi, [.hcursor]
345
        mov     edi, [.hcursor]
346
        mov     [edi+CURSOR.base], eax
346
        mov     [edi+CURSOR.base], eax
347
 
347
 
348
        mov     esi, [.src]
348
        mov     esi, [.src]
349
        mov     ebx, [.flags]
349
        mov     ebx, [.flags]
350
        cmp     bx, LOAD_INDIRECT
350
        cmp     bx, LOAD_INDIRECT
351
        je      .indirect
351
        je      .indirect
352
 
352
 
353
        movzx   ecx, word [esi+10]
353
        movzx   ecx, word [esi+10]
354
        movzx   edx, word [esi+12]
354
        movzx   edx, word [esi+12]
355
        mov     [edi+CURSOR.hot_x], ecx
355
        mov     [edi+CURSOR.hot_x], ecx
356
        mov     [edi+CURSOR.hot_y], edx
356
        mov     [edi+CURSOR.hot_y], edx
357
 
357
 
358
        stdcall init_cursor, eax, esi
358
        stdcall init_cursor, eax, esi
359
 
359
 
360
align 4
360
align 4
361
.add_cursor:
361
.add_cursor:
362
        mov     ecx, [.hcursor]
362
        mov     ecx, [.hcursor]
363
        lea     ecx, [ecx+CURSOR.list_next]
363
        lea     ecx, [ecx+CURSOR.list_next]
364
        lea     edx, [_display.cr_list.next]
364
        lea     edx, [_display.cr_list.next]
365
 
365
 
366
        pushfd
366
        pushfd
367
        cli
367
        cli
368
        list_add ecx, edx   ;list_add_tail(new, head)
368
        list_add ecx, edx   ;list_add_tail(new, head)
369
        popfd
369
        popfd
370
 
370
 
371
        mov     eax, [.hcursor]
371
        mov     eax, [.hcursor]
372
        cmp     [_display.init_cursor], 0
372
        cmp     [_display.init_cursor], 0
373
        je      .fail
373
        je      .fail
374
 
374
 
375
        push    eax
375
        push    eax
376
        call    [_display.init_cursor]
376
        call    [_display.init_cursor]
377
        add     esp, 4
377
        add     esp, 4
378
 
378
 
379
        mov     eax, [.hcursor]
379
        mov     eax, [.hcursor]
380
;--------------------------------------
380
;--------------------------------------
381
align 4
381
align 4
382
.fail:
382
.fail:
383
        add     esp, 12
383
        add     esp, 12
384
        ret
384
        ret
385
;--------------------------------------
385
;--------------------------------------
386
align 4
386
align 4
387
.indirect:
387
.indirect:
388
        shr     ebx, 16
388
        shr     ebx, 16
389
        movzx   ecx, bh
389
        movzx   ecx, bh
390
        movzx   edx, bl
390
        movzx   edx, bl
391
        mov     [edi+CURSOR.hot_x], ecx
391
        mov     [edi+CURSOR.hot_x], ecx
392
        mov     [edi+CURSOR.hot_y], edx
392
        mov     [edi+CURSOR.hot_y], edx
393
 
393
 
394
        xchg    edi, eax
394
        xchg    edi, eax
395
        mov     ecx, 1024
395
        mov     ecx, 1024
396
        cld
396
        cld
397
        rep movsd
397
        rep movsd
398
        jmp     .add_cursor
398
        jmp     .add_cursor
399
;------------------------------------------------------------------------------
399
;------------------------------------------------------------------------------
400
align 4
400
align 4
401
proc load_cursor stdcall, src:dword, flags:dword
401
proc load_cursor stdcall, src:dword, flags:dword
402
           locals
402
           locals
403
             handle  dd ?
403
             handle  dd ?
404
           endl
404
           endl
405
 
405
 
406
        xor     eax, eax
406
        xor     eax, eax
407
        cmp     [create_cursor], eax
407
        cmp     [create_cursor], eax
408
        je      .fail2
408
        je      .fail2
409
 
409
 
410
        mov     [handle], eax
410
        mov     [handle], eax
411
        cmp     word [flags], LOAD_FROM_FILE
411
        cmp     word [flags], LOAD_FROM_FILE
412
        jne     @F
412
        jne     @F
413
 
413
 
414
        stdcall load_file, [src]
414
        stdcall load_file, [src]
415
        test    eax, eax
415
        test    eax, eax
416
        jz      .fail
416
        jz      .fail
417
        mov     [src], eax
417
        mov     [src], eax
418
;--------------------------------------
418
;--------------------------------------
419
align 4
419
align 4
420
@@:
420
@@:
421
        push    ebx
421
        push    ebx
422
        push    esi
422
        push    esi
423
        push    edi
423
        push    edi
424
 
424
 
425
        mov     eax, [CURRENT_TASK]
425
        mov     eax, [CURRENT_TASK]
426
        shl     eax, 5
426
        shl     eax, 5
427
        mov     eax, [CURRENT_TASK+eax+4]
427
        mov     eax, [CURRENT_TASK+eax+4]
428
        mov     ebx, [src]
428
        mov     ebx, [src]
429
        mov     ecx, [flags]
429
        mov     ecx, [flags]
430
        call    create_cursor    ;eax, ebx, ecx
430
        call    create_cursor    ;eax, ebx, ecx
431
        mov     [handle], eax
431
        mov     [handle], eax
432
 
432
 
433
        cmp     word [flags], LOAD_FROM_FILE
433
        cmp     word [flags], LOAD_FROM_FILE
434
        jne     .exit
434
        jne     .exit
435
        stdcall kernel_free, [src]
435
        stdcall kernel_free, [src]
436
;--------------------------------------
436
;--------------------------------------
437
align 4
437
align 4
438
.exit:
438
.exit:
439
        pop     edi
439
        pop     edi
440
        pop     esi
440
        pop     esi
441
        pop     ebx
441
        pop     ebx
442
;--------------------------------------
442
;--------------------------------------
443
align 4
443
align 4
444
.fail:
444
.fail:
445
        mov     eax, [handle]
445
        mov     eax, [handle]
446
;--------------------------------------
446
;--------------------------------------
447
align 4
447
align 4
448
.fail2:
448
.fail2:
449
        ret
449
        ret
450
endp
450
endp
451
;------------------------------------------------------------------------------
451
;------------------------------------------------------------------------------
452
align 4
452
align 4
453
proc delete_cursor stdcall, hcursor:dword
453
proc delete_cursor stdcall, hcursor:dword
454
 
454
 
455
;        DEBUGF 1,'K : delete_cursor %x\n', [hcursor]
455
;        DEBUGF 1,'K : delete_cursor %x\n', [hcursor]
456
 
456
 
457
        mov     esi, [hcursor]
457
        mov     esi, [hcursor]
458
 
458
 
459
        cmp     [esi+CURSOR.magic], 'CURS'
459
        cmp     [esi+CURSOR.magic], 'CURS'
460
        jne     .fail
460
        jne     .fail
461
 
461
 
462
        mov     ebx, [CURRENT_TASK]
462
        mov     ebx, [CURRENT_TASK]
463
        shl     ebx, 5
463
        shl     ebx, 5
464
        mov     ebx, [CURRENT_TASK+ebx+4]
464
        mov     ebx, [CURRENT_TASK+ebx+4]
465
        cmp     ebx, [esi+CURSOR.pid]
465
        cmp     ebx, [esi+CURSOR.pid]
466
        jne     .fail
466
        jne     .fail
467
 
467
 
468
        mov     ebx, [current_slot]
468
        mov     ebx, [current_slot]
469
        cmp     esi, [ebx+APPDATA.cursor]
469
        cmp     esi, [ebx+APPDATA.cursor]
470
        jne     @F
470
        jne     @F
471
        mov     eax, [def_cursor]
471
        mov     eax, [def_cursor]
472
        mov     [ebx+APPDATA.cursor], eax
472
        mov     [ebx+APPDATA.cursor], eax
473
;--------------------------------------
473
;--------------------------------------
474
align 4
474
align 4
475
@@:
475
@@:
476
        mov     eax, [hcursor]
476
        mov     eax, [hcursor]
477
        call    [eax+APPOBJ.destroy]
477
        call    [eax+APPOBJ.destroy]
478
;--------------------------------------
478
;--------------------------------------
479
align 4
479
align 4
480
.fail:
480
.fail:
481
        ret
481
        ret
482
endp
482
endp
483
;------------------------------------------------------------------------------
483
;------------------------------------------------------------------------------
484
align 4
484
align 4
485
; param
485
; param
486
;  eax= cursor
486
;  eax= cursor
487
destroy_cursor:
487
destroy_cursor:
488
 
488
 
489
        push    eax
489
        push    eax
490
        stdcall kernel_free, [eax+CURSOR.base]
490
        stdcall kernel_free, [eax+CURSOR.base]
491
 
491
 
492
        mov     eax, [esp]
492
        mov     eax, [esp]
493
        lea     eax, [eax+CURSOR.list_next]
493
        lea     eax, [eax+CURSOR.list_next]
494
 
494
 
495
        pushfd
495
        pushfd
496
        cli
496
        cli
497
        list_del eax
497
        list_del eax
498
        popfd
498
        popfd
499
 
499
 
500
        pop     eax
500
        pop     eax
501
        call    destroy_kernel_object
501
        call    destroy_kernel_object
502
        ret
502
        ret
503
;------------------------------------------------------------------------------
503
;------------------------------------------------------------------------------
504
align 4
504
align 4
505
select_cursor:
505
select_cursor:
506
        mov     eax, [esp+4]
506
        mov     eax, [esp+4]
507
        mov     [_display.cursor], eax
507
        mov     [_display.cursor], eax
508
        ret     4
508
        ret     4
509
;------------------------------------------------------------------------------
509
;------------------------------------------------------------------------------
510
align 4
510
align 4
511
proc restore_24 stdcall, x:dword, y:dword
511
proc restore_24 stdcall, x:dword, y:dword
512
 
512
 
513
        push    ebx
513
        push    ebx
514
 
514
 
515
        mov     ebx, [cur_saved_base]
515
        mov     ebx, [cur_saved_base]
516
        mov     edx, [cur.h]
516
        mov     edx, [cur.h]
517
        test    edx, edx
517
        test    edx, edx
518
        jz      .ret
518
        jz      .ret
519
 
519
 
520
        push    esi
520
        push    esi
521
        push    edi
521
        push    edi
522
 
522
 
523
        mov     esi, cur_saved_data
523
        mov     esi, cur_saved_data
524
        mov     ecx, [cur.w]
524
        mov     ecx, [cur.w]
525
        lea     ecx, [ecx+ecx*2]
525
        lea     ecx, [ecx+ecx*2]
526
        push    ecx
526
        push    ecx
527
;--------------------------------------
527
;--------------------------------------
528
align 4
528
align 4
529
@@:
529
@@:
530
        mov     edi, ebx
530
        mov     edi, ebx
531
        add     ebx, [_display.lfb_pitch]
531
        add     ebx, [_display.lfb_pitch]
532
 
532
 
533
        mov     ecx, [esp]
533
        mov     ecx, [esp]
534
        rep movsb
534
        rep movsb
535
        dec     edx
535
        dec     edx
536
        jnz     @B
536
        jnz     @B
537
 
537
 
538
        pop     ecx
538
        pop     ecx
539
        pop     edi
539
        pop     edi
540
        pop     esi
540
        pop     esi
541
;--------------------------------------
541
;--------------------------------------
542
align 4
542
align 4
543
.ret:
543
.ret:
544
        pop     ebx
544
        pop     ebx
545
        ret
545
        ret
546
endp
546
endp
547
;------------------------------------------------------------------------------
547
;------------------------------------------------------------------------------
548
align 4
548
align 4
549
proc restore_32 stdcall, x:dword, y:dword
549
proc restore_32 stdcall, x:dword, y:dword
550
 
550
 
551
        push    ebx
551
        push    ebx
552
 
552
 
553
        mov     ebx, [cur_saved_base]
553
        mov     ebx, [cur_saved_base]
554
        mov     edx, [cur.h]
554
        mov     edx, [cur.h]
555
        test    edx, edx
555
        test    edx, edx
556
        jz      .ret
556
        jz      .ret
557
 
557
 
558
        push    esi
558
        push    esi
559
        push    edi
559
        push    edi
560
 
560
 
561
        mov     esi, cur_saved_data
561
        mov     esi, cur_saved_data
562
;--------------------------------------
562
;--------------------------------------
563
align 4
563
align 4
564
@@:
564
@@:
565
        mov     edi, ebx
565
        mov     edi, ebx
566
        add     ebx, [_display.lfb_pitch]
566
        add     ebx, [_display.lfb_pitch]
567
 
567
 
568
        mov     ecx, [cur.w]
568
        mov     ecx, [cur.w]
569
        rep movsd
569
        rep movsd
570
        dec     edx
570
        dec     edx
571
        jnz     @B
571
        jnz     @B
572
 
572
 
573
        pop     edi
573
        pop     edi
-
 
574
        pop     esi
-
 
575
 
574
;--------------------------------------
576
;--------------------------------------
575
align 4
577
align 4
576
.ret:
578
.ret:
577
        pop     esi
-
 
578
        pop     ebx
579
        pop     ebx
579
        ret
580
        ret
580
endp
581
endp
581
;------------------------------------------------------------------------------
582
;------------------------------------------------------------------------------
582
align 4
583
align 4
583
proc restore_16 stdcall, x:dword, y:dword
584
proc restore_16 stdcall, x:dword, y:dword
584
 
585
 
585
        push    ebx
586
        push    ebx
586
 
587
 
587
        mov     ebx, [cur_saved_base]
588
        mov     ebx, [cur_saved_base]
588
        mov     edx, [cur.h]
589
        mov     edx, [cur.h]
589
        test    edx, edx
590
        test    edx, edx
590
        jz      .ret
591
        jz      .ret
591
 
592
 
592
        push    esi
593
        push    esi
593
        push    edi
594
        push    edi
594
 
595
 
595
        mov     esi, cur_saved_data
596
        mov     esi, cur_saved_data
596
;--------------------------------------
597
;--------------------------------------
597
align 4
598
align 4
598
@@:
599
@@:
599
        mov     edi, ebx
600
        mov     edi, ebx
600
        add     ebx, [_display.lfb_pitch]
601
        add     ebx, [_display.lfb_pitch]
601
 
602
 
602
        mov     ecx, [cur.w]
603
        mov     ecx, [cur.w]
603
        rep movsw
604
        rep movsw
604
        dec     edx
605
        dec     edx
605
        jnz     @B
606
        jnz     @B
606
 
607
 
607
        pop     edi
608
        pop     edi
-
 
609
        pop     esi
-
 
610
 
608
;--------------------------------------
611
;--------------------------------------
609
align 4
612
align 4
610
.ret:
613
.ret:
611
        pop     esi
-
 
612
        pop     ebx
614
        pop     ebx
613
        ret
615
        ret
614
endp
616
endp
615
;------------------------------------------------------------------------------
617
;------------------------------------------------------------------------------
616
align 4
618
align 4
617
proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
619
proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword
618
           locals
620
           locals
619
             h      dd ?
621
             h      dd ?
620
             _dx     dd ?
622
             _dx     dd ?
621
             _dy     dd ?
623
             _dy     dd ?
622
           endl
624
           endl
623
 
625
 
624
        mov     esi, [hcursor]
626
        mov     esi, [hcursor]
625
        mov     ecx, [x]
627
        mov     ecx, [x]
626
        mov     eax, [y]
628
        mov     eax, [y]
627
;        mov     ebx, [BytesPerScanLine]
629
;        mov     ebx, [BytesPerScanLine]
628
 
630
 
629
        xor     edx, edx
631
        xor     edx, edx
630
        sub     ecx, [esi+CURSOR.hot_x]
632
        sub     ecx, [esi+CURSOR.hot_x]
631
        lea     ebx, [ecx+32-1]
633
        lea     ebx, [ecx+32-1]
632
        mov     [x], ecx
634
        mov     [x], ecx
633
        sets    dl
635
        sets    dl
634
        dec     edx
636
        dec     edx
635
        and     ecx, edx      ;clip x to 0<=x
637
        and     ecx, edx      ;clip x to 0<=x
636
        mov     [cur.left], ecx
638
        mov     [cur.left], ecx
637
        mov     edi, ecx
639
        mov     edi, ecx
638
        sub     edi, [x]
640
        sub     edi, [x]
639
        mov     [_dx], edi
641
        mov     [_dx], edi
640
 
642
 
641
        xor     edx, edx
643
        xor     edx, edx
642
        sub     eax, [esi+CURSOR.hot_y]
644
        sub     eax, [esi+CURSOR.hot_y]
643
        lea     edi, [eax+32-1]
645
        lea     edi, [eax+32-1]
644
        mov     [y], eax
646
        mov     [y], eax
645
        sets    dl
647
        sets    dl
646
        dec     edx
648
        dec     edx
647
        and     eax, edx      ;clip y to 0<=y
649
        and     eax, edx      ;clip y to 0<=y
648
        mov     [cur.top], eax
650
        mov     [cur.top], eax
649
        mov     edx, eax
651
        mov     edx, eax
650
        sub     edx, [y]
652
        sub     edx, [y]
651
        mov     [_dy], edx
653
        mov     [_dy], edx
652
 
654
 
653
;        mul     dword [BytesPerScanLine]
655
;        mul     dword [BytesPerScanLine]
654
        mov     eax, [BPSLine_calc_area+eax*4]
656
        mov     eax, [BPSLine_calc_area+eax*4]
655
        lea     edx, [LFB_BASE+ecx*3]
657
        lea     edx, [LFB_BASE+ecx*3]
656
        add     edx, eax
658
        add     edx, eax
657
        mov     [cur_saved_base], edx
659
        mov     [cur_saved_base], edx
658
 
660
 
659
        cmp     ebx, [_display.width]
661
        cmp     ebx, [_display.width]
660
        jb      @F
662
        jb      @F
661
        mov     ebx, [_display.width]
663
        mov     ebx, [_display.width]
662
;--------------------------------------
664
;--------------------------------------
663
align 4
665
align 4
664
@@:
666
@@:
665
        cmp     edi, [_display.height]
667
        cmp     edi, [_display.height]
666
        jb      @F
668
        jb      @F
667
        mov     edi, [_display.height]
669
        mov     edi, [_display.height]
668
;--------------------------------------
670
;--------------------------------------
669
align 4
671
align 4
670
@@:
672
@@:
671
 
673
 
672
        sub     ebx, [x]
674
        sub     ebx, [x]
673
        sub     edi, [y]
675
        sub     edi, [y]
674
        sub     ebx, [_dx]
676
        sub     ebx, [_dx]
675
        sub     edi, [_dy]
677
        sub     edi, [_dy]
676
 
678
 
677
        mov     [cur.w], ebx
679
        mov     [cur.w], ebx
678
        mov     [cur.h], edi
680
        mov     [cur.h], edi
679
        mov     [h], edi
681
        mov     [h], edi
680
 
682
 
681
        mov     eax, edi
683
        mov     eax, edi
682
        mov     edi, cur_saved_data
684
        mov     edi, cur_saved_data
683
;--------------------------------------
685
;--------------------------------------
684
align 4
686
align 4
685
@@:
687
@@:
686
        mov     esi, edx
688
        mov     esi, edx
687
        add     edx, [_display.lfb_pitch]
689
        add     edx, [_display.lfb_pitch]
688
        mov     ecx, [cur.w]
690
        mov     ecx, [cur.w]
689
        lea     ecx, [ecx+ecx*2]
691
        lea     ecx, [ecx+ecx*2]
690
        rep movsb
692
        rep movsb
691
        dec     eax
693
        dec     eax
692
        jnz     @B
694
        jnz     @B
693
 
695
 
694
;draw cursor
696
;draw cursor
695
        mov     ebx, [cur_saved_base]
697
        mov     ebx, [cur_saved_base]
696
        mov     eax, [_dy]
698
        mov     eax, [_dy]
697
        shl     eax, 5
699
        shl     eax, 5
698
        add     eax, [_dx]
700
        add     eax, [_dx]
699
 
701
 
700
        mov     esi, [hcursor]
702
        mov     esi, [hcursor]
701
        mov     esi, [esi+CURSOR.base]
703
        mov     esi, [esi+CURSOR.base]
702
        lea     edx, [esi+eax*4]
704
        lea     edx, [esi+eax*4]
703
;--------------------------------------
705
;--------------------------------------
704
align 4
706
align 4
705
.row:
707
.row:
706
        mov     ecx, [cur.w]
708
        mov     ecx, [cur.w]
707
        mov     esi, edx
709
        mov     esi, edx
708
        mov     edi, ebx
710
        mov     edi, ebx
709
        add     edx, 32*4
711
        add     edx, 32*4
710
        add     ebx, [_display.lfb_pitch]
712
        add     ebx, [_display.lfb_pitch]
711
;--------------------------------------
713
;--------------------------------------
712
align 4
714
align 4
713
.pix:
715
.pix:
714
        lodsd
716
        lodsd
715
        test    eax, 0xFF000000
717
        test    eax, 0xFF000000
716
        jz      @F
718
        jz      @F
717
        mov     [edi], ax
719
        mov     [edi], ax
718
        shr     eax, 16
720
        shr     eax, 16
719
        mov     [edi+2], al
721
        mov     [edi+2], al
720
;--------------------------------------
722
;--------------------------------------
721
align 4
723
align 4
722
@@:
724
@@:
723
        add     edi, 3
725
        add     edi, 3
724
        dec     ecx
726
        dec     ecx
725
        jnz     .pix
727
        jnz     .pix
726
 
728
 
727
        dec     [h]
729
        dec     [h]
728
        jnz     .row
730
        jnz     .row
729
        ret
731
        ret
730
endp
732
endp
731
;------------------------------------------------------------------------------
733
;------------------------------------------------------------------------------
732
align 4
734
align 4
733
proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
735
proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword
734
           locals
736
           locals
735
             h      dd ?
737
             h      dd ?
736
             _dx     dd ?
738
             _dx     dd ?
737
             _dy     dd ?
739
             _dy     dd ?
738
           endl
740
           endl
739
 
741
 
740
        mov     esi, [hcursor]
742
        mov     esi, [hcursor]
741
        mov     ecx, [x]
743
        mov     ecx, [x]
742
        mov     eax, [y]
744
        mov     eax, [y]
743
 
745
 
744
        xor     edx, edx
746
        xor     edx, edx
745
        sub     ecx, [esi+CURSOR.hot_x]
747
        sub     ecx, [esi+CURSOR.hot_x]
746
        lea     ebx, [ecx+32-1]
748
        lea     ebx, [ecx+32-1]
747
        mov     [x], ecx
749
        mov     [x], ecx
748
        sets    dl
750
        sets    dl
749
        dec     edx
751
        dec     edx
750
        and     ecx, edx      ;clip x to 0<=x
752
        and     ecx, edx      ;clip x to 0<=x
751
        mov     [cur.left], ecx
753
        mov     [cur.left], ecx
752
        mov     edi, ecx
754
        mov     edi, ecx
753
        sub     edi, [x]
755
        sub     edi, [x]
754
        mov     [_dx], edi
756
        mov     [_dx], edi
755
 
757
 
756
        xor     edx, edx
758
        xor     edx, edx
757
        sub     eax, [esi+CURSOR.hot_y]
759
        sub     eax, [esi+CURSOR.hot_y]
758
        lea     edi, [eax+32-1]
760
        lea     edi, [eax+32-1]
759
        mov     [y], eax
761
        mov     [y], eax
760
        sets    dl
762
        sets    dl
761
        dec     edx
763
        dec     edx
762
        and     eax, edx      ;clip y to 0<=y
764
        and     eax, edx      ;clip y to 0<=y
763
        mov     [cur.top], eax
765
        mov     [cur.top], eax
764
        mov     edx, eax
766
        mov     edx, eax
765
        sub     edx, [y]
767
        sub     edx, [y]
766
        mov     [_dy], edx
768
        mov     [_dy], edx
767
 
769
 
768
;        mul     dword [BytesPerScanLine]
770
;        mul     dword [BytesPerScanLine]
769
        mov     eax, [BPSLine_calc_area+eax*4]
771
        mov     eax, [BPSLine_calc_area+eax*4]
770
        lea     edx, [LFB_BASE+eax+ecx*4]
772
        lea     edx, [LFB_BASE+eax+ecx*4]
771
        mov     [cur_saved_base], edx
773
        mov     [cur_saved_base], edx
772
 
774
 
773
        cmp     ebx, [_display.width]
775
        cmp     ebx, [_display.width]
774
        jb      @F
776
        jb      @F
775
        mov     ebx, [_display.width]
777
        mov     ebx, [_display.width]
776
;--------------------------------------
778
;--------------------------------------
777
align 4
779
align 4
778
@@:
780
@@:
779
        cmp     edi, [_display.height]
781
        cmp     edi, [_display.height]
780
        jb      @F
782
        jb      @F
781
        mov     edi, [_display.height]
783
        mov     edi, [_display.height]
782
;--------------------------------------
784
;--------------------------------------
783
align 4
785
align 4
784
@@:
786
@@:
785
        sub     ebx, [x]
787
        sub     ebx, [x]
786
        sub     edi, [y]
788
        sub     edi, [y]
787
        sub     ebx, [_dx]
789
        sub     ebx, [_dx]
788
        sub     edi, [_dy]
790
        sub     edi, [_dy]
789
 
791
 
790
        mov     [cur.w], ebx
792
        mov     [cur.w], ebx
791
        mov     [cur.h], edi
793
        mov     [cur.h], edi
792
        mov     [h], edi
794
        mov     [h], edi
793
 
795
 
794
        mov     eax, edi
796
        mov     eax, edi
795
        mov     edi, cur_saved_data
797
        mov     edi, cur_saved_data
796
;--------------------------------------
798
;--------------------------------------
797
align 4
799
align 4
798
@@:
800
@@:
799
        mov     esi, edx
801
        mov     esi, edx
800
        add     edx, [_display.lfb_pitch]
802
        add     edx, [_display.lfb_pitch]
801
        mov     ecx, [cur.w]
803
        mov     ecx, [cur.w]
802
        rep movsd
804
        rep movsd
803
        dec     eax
805
        dec     eax
804
        jnz     @B
806
        jnz     @B
805
 
807
 
806
;draw cursor
808
;draw cursor
807
        mov     ebx, [cur_saved_base]
809
        mov     ebx, [cur_saved_base]
808
        mov     eax, [_dy]
810
        mov     eax, [_dy]
809
        shl     eax, 5
811
        shl     eax, 5
810
        add     eax, [_dx]
812
        add     eax, [_dx]
811
 
813
 
812
        mov     esi, [hcursor]
814
        mov     esi, [hcursor]
813
        mov     esi, [esi+CURSOR.base]
815
        mov     esi, [esi+CURSOR.base]
814
        lea     edx, [esi+eax*4]
816
        lea     edx, [esi+eax*4]
815
;--------------------------------------
817
;--------------------------------------
816
align 4
818
align 4
817
.row:
819
.row:
818
        mov     ecx, [cur.w]
820
        mov     ecx, [cur.w]
819
        mov     esi, edx
821
        mov     esi, edx
820
        mov     edi, ebx
822
        mov     edi, ebx
821
        add     edx, 32*4
823
        add     edx, 32*4
822
        add     ebx, [_display.lfb_pitch]
824
        add     ebx, [_display.lfb_pitch]
823
;--------------------------------------
825
;--------------------------------------
824
align 4
826
align 4
825
.pix:
827
.pix:
826
        lodsd
828
        lodsd
827
        test    eax, 0xFF000000
829
        test    eax, 0xFF000000
828
        jz      @F
830
        jz      @F
829
        mov     [edi], eax
831
        mov     [edi], eax
830
;--------------------------------------
832
;--------------------------------------
831
align 4
833
align 4
832
@@:
834
@@:
833
        add     edi, 4
835
        add     edi, 4
834
        dec     ecx
836
        dec     ecx
835
        jnz     .pix
837
        jnz     .pix
836
 
838
 
837
        dec     [h]
839
        dec     [h]
838
        jnz     .row
840
        jnz     .row
839
        ret
841
        ret
840
endp
842
endp
841
;------------------------------------------------------------------------------
843
;------------------------------------------------------------------------------
842
align 4
844
align 4
843
proc move_cursor_16 stdcall, hcursor:dword, x:dword, y:dword
845
proc move_cursor_16 stdcall, hcursor:dword, x:dword, y:dword
844
           locals
846
           locals
845
             h      dd ?
847
             h      dd ?
846
             _dx     dd ?
848
             _dx     dd ?
847
             _dy     dd ?
849
             _dy     dd ?
848
           endl
850
           endl
849
 
851
 
850
        mov     esi, [hcursor]
852
        mov     esi, [hcursor]
851
        mov     ecx, [x]
853
        mov     ecx, [x]
852
        mov     eax, [y]
854
        mov     eax, [y]
853
 
855
 
854
        xor     edx, edx
856
        xor     edx, edx
855
        sub     ecx, [esi+CURSOR.hot_x]
857
        sub     ecx, [esi+CURSOR.hot_x]
856
        lea     ebx, [ecx+32-1]
858
        lea     ebx, [ecx+32-1]
857
        mov     [x], ecx
859
        mov     [x], ecx
858
        sets    dl
860
        sets    dl
859
        dec     edx
861
        dec     edx
860
        and     ecx, edx      ;clip x to 0<=x
862
        and     ecx, edx      ;clip x to 0<=x
861
        mov     [cur.left], ecx
863
        mov     [cur.left], ecx
862
        mov     edi, ecx
864
        mov     edi, ecx
863
        sub     edi, [x]
865
        sub     edi, [x]
864
        mov     [_dx], edi
866
        mov     [_dx], edi
865
 
867
 
866
        xor     edx, edx
868
        xor     edx, edx
867
        sub     eax, [esi+CURSOR.hot_y]
869
        sub     eax, [esi+CURSOR.hot_y]
868
        lea     edi, [eax+32-1]
870
        lea     edi, [eax+32-1]
869
        mov     [y], eax
871
        mov     [y], eax
870
        sets    dl
872
        sets    dl
871
        dec     edx
873
        dec     edx
872
        and     eax, edx      ;clip y to 0<=y
874
        and     eax, edx      ;clip y to 0<=y
873
        mov     [cur.top], eax
875
        mov     [cur.top], eax
874
        mov     edx, eax
876
        mov     edx, eax
875
        sub     edx, [y]
877
        sub     edx, [y]
876
        mov     [_dy], edx
878
        mov     [_dy], edx
877
 
879
 
878
;        mul     dword [BytesPerScanLine]
880
;        mul     dword [BytesPerScanLine]
879
        mov     eax, [BPSLine_calc_area+eax*4]
881
        mov     eax, [BPSLine_calc_area+eax*4]
880
        lea     edx, [LFB_BASE+eax+ecx*2]
882
        lea     edx, [LFB_BASE+eax+ecx*2]
881
        mov     [cur_saved_base], edx
883
        mov     [cur_saved_base], edx
882
 
884
 
883
        cmp     ebx, [_display.width]
885
        cmp     ebx, [_display.width]
884
        jb      @F
886
        jb      @F
885
        mov     ebx, [_display.width]
887
        mov     ebx, [_display.width]
886
;--------------------------------------
888
;--------------------------------------
887
align 4
889
align 4
888
@@:
890
@@:
889
        cmp     edi, [_display.height]
891
        cmp     edi, [_display.height]
890
        jb      @F
892
        jb      @F
891
        mov     edi, [_display.height]
893
        mov     edi, [_display.height]
892
;--------------------------------------
894
;--------------------------------------
893
align 4
895
align 4
894
@@:
896
@@:
895
        sub     ebx, [x]
897
        sub     ebx, [x]
896
        sub     edi, [y]
898
        sub     edi, [y]
897
        sub     ebx, [_dx]
899
        sub     ebx, [_dx]
898
        sub     edi, [_dy]
900
        sub     edi, [_dy]
899
 
901
 
900
        mov     [cur.w], ebx
902
        mov     [cur.w], ebx
901
        mov     [cur.h], edi
903
        mov     [cur.h], edi
902
        mov     [h], edi
904
        mov     [h], edi
903
 
905
 
904
        mov     eax, edi
906
        mov     eax, edi
905
        mov     edi, cur_saved_data
907
        mov     edi, cur_saved_data
906
;--------------------------------------
908
;--------------------------------------
907
align 4
909
align 4
908
@@:
910
@@:
909
        mov     esi, edx
911
        mov     esi, edx
910
        add     edx, [_display.lfb_pitch]
912
        add     edx, [_display.lfb_pitch]
911
        mov     ecx, [cur.w]
913
        mov     ecx, [cur.w]
912
 
914
 
913
        rep movsw
915
        rep movsw
914
        dec     eax
916
        dec     eax
915
        jnz     @B
917
        jnz     @B
916
 
918
 
917
;draw cursor
919
;draw cursor
918
        mov     ebx, [cur_saved_base]
920
        mov     ebx, [cur_saved_base]
919
        mov     eax, [_dy]
921
        mov     eax, [_dy]
920
        shl     eax, 5
922
        shl     eax, 5
921
        add     eax, [_dx]
923
        add     eax, [_dx]
922
 
924
 
923
        mov     esi, [hcursor]
925
        mov     esi, [hcursor]
924
        mov     esi, [esi+CURSOR.base]
926
        mov     esi, [esi+CURSOR.base]
925
        lea     edx, [esi+eax*4]
927
        lea     edx, [esi+eax*4]
926
;--------------------------------------
928
;--------------------------------------
927
align 4
929
align 4
928
.row:
930
.row:
929
        mov     ecx, [cur.w]
931
        mov     ecx, [cur.w]
930
        mov     esi, edx
932
        mov     esi, edx
931
        mov     edi, ebx
933
        mov     edi, ebx
932
        add     edx, 32*4
934
        add     edx, 32*4
933
        add     ebx, [_display.lfb_pitch]
935
        add     ebx, [_display.lfb_pitch]
934
;--------------------------------------
936
;--------------------------------------
935
align 4
937
align 4
936
.pix:
938
.pix:
937
        lodsd
939
        lodsd
938
        test    eax, 0xFF000000
940
        test    eax, 0xFF000000
939
        jz      @F
941
        jz      @F
940
; convert to 16 bpp and store to real LFB
942
; convert to 16 bpp and store to real LFB
941
        and     eax, 00000000111110001111110011111000b
943
        and     eax, 00000000111110001111110011111000b
942
        shr     ah, 2
944
        shr     ah, 2
943
        shr     ax, 3
945
        shr     ax, 3
944
        ror     eax, 8
946
        ror     eax, 8
945
        add     al, ah
947
        add     al, ah
946
        rol     eax, 8
948
        rol     eax, 8
947
        mov     [edi], ax
949
        mov     [edi], ax
948
;--------------------------------------
950
;--------------------------------------
949
align 4
951
align 4
950
@@:
952
@@:
951
        add     edi, 2
953
        add     edi, 2
952
        dec     ecx
954
        dec     ecx
953
        jnz     .pix
955
        jnz     .pix
954
 
956
 
955
        dec     [h]
957
        dec     [h]
956
        jnz     .row
958
        jnz     .row
957
        ret
959
        ret
958
endp
960
endp
959
;------------------------------------------------------------------------------
961
;------------------------------------------------------------------------------
960
align 4
962
align 4
961
check_mouse_area_for_getpixel_new:
963
check_mouse_area_for_getpixel_new:
962
; in:
964
; in:
963
; eax = x
965
; eax = x
964
; ebx = y
966
; ebx = y
965
; out:
967
; out:
966
; ecx = new color
968
; ecx = new color
967
;--------------------------------------
969
;--------------------------------------
968
; check for Y
970
; check for Y
969
        cmp     bx, [Y_UNDER_subtraction_CUR_hot_y]
971
        cmp     bx, [Y_UNDER_subtraction_CUR_hot_y]
970
        jb      .no_mouse_area
972
        jb      .no_mouse_area
971
 
973
 
972
        cmp     bx, [Y_UNDER_sub_CUR_hot_y_add_curh]
974
        cmp     bx, [Y_UNDER_sub_CUR_hot_y_add_curh]
973
        jae     .no_mouse_area
975
        jae     .no_mouse_area
974
;--------------------------------------
976
;--------------------------------------
975
; check for X
977
; check for X
976
        cmp     ax, [X_UNDER_subtraction_CUR_hot_x]
978
        cmp     ax, [X_UNDER_subtraction_CUR_hot_x]
977
        jb      .no_mouse_area
979
        jb      .no_mouse_area
978
 
980
 
979
        cmp     ax, [X_UNDER_sub_CUR_hot_x_add_curh]
981
        cmp     ax, [X_UNDER_sub_CUR_hot_x_add_curh]
980
        jae     .no_mouse_area
982
        jae     .no_mouse_area
981
;--------------------------------------
983
;--------------------------------------
982
        push    eax ebx
984
        push    eax ebx
983
; offset X
985
; offset X
984
        movzx   ecx, word [X_UNDER_subtraction_CUR_hot_x]
986
        movzx   ecx, word [X_UNDER_subtraction_CUR_hot_x]
985
        sub     eax, ecx        ; x1
987
        sub     eax, ecx        ; x1
986
; offset Y
988
; offset Y
987
        movzx   ecx, word [Y_UNDER_subtraction_CUR_hot_y]
989
        movzx   ecx, word [Y_UNDER_subtraction_CUR_hot_y]
988
        sub     ebx, ecx        ; y1
990
        sub     ebx, ecx        ; y1
989
;--------------------------------------
991
;--------------------------------------
990
; ebx = offset y
992
; ebx = offset y
991
; eax = offset x
993
; eax = offset x
992
        imul    ebx, [cur.w]     ;y
994
        imul    ebx, [cur.w]     ;y
993
        add     eax, ebx
995
        add     eax, ebx
994
        mov     ebx, eax
996
        mov     ebx, eax
995
        shl     eax, 2
997
        shl     eax, 2
996
        cmp     byte [_display.bits_per_pixel], 32
998
        cmp     byte [_display.bits_per_pixel], 32
997
        je      @f
999
        je      @f
998
        sub     eax, ebx
1000
        sub     eax, ebx
999
        cmp     byte [_display.bits_per_pixel], 24
1001
        cmp     byte [_display.bits_per_pixel], 24
1000
        je      @f
1002
        je      @f
1001
        sub     eax, ebx
1003
        sub     eax, ebx
1002
;--------------------------------------
1004
;--------------------------------------
1003
align 4
1005
align 4
1004
@@:
1006
@@:
1005
        add     eax, cur_saved_data
1007
        add     eax, cur_saved_data
1006
        mov     ecx, [eax]
1008
        mov     ecx, [eax]
1007
        and     ecx, 0xffffff
1009
        and     ecx, 0xffffff
1008
        add     ecx, 0xff000000
1010
        add     ecx, 0xff000000
1009
        pop     ebx eax
1011
        pop     ebx eax
1010
        ret
1012
        ret
1011
;--------------------------------------
1013
;--------------------------------------
1012
align 4
1014
align 4
1013
.no_mouse_area:
1015
.no_mouse_area:
1014
        xor     ecx, ecx
1016
        xor     ecx, ecx
1015
        ret
1017
        ret
1016
;-----------------------------------------------------------------------------
1018
;-----------------------------------------------------------------------------
1017
align 4
1019
align 4
1018
check_mouse_area_for_putpixel_new:
1020
check_mouse_area_for_putpixel_new:
1019
; in:
1021
; in:
1020
; ecx = x shl 16 + y
1022
; ecx = x shl 16 + y
1021
; eax = color
1023
; eax = color
1022
; out:
1024
; out:
1023
; eax = new color
1025
; eax = new color
1024
;--------------------------------------
1026
;--------------------------------------
1025
; check for Y
1027
; check for Y
1026
        cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
1028
        cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
1027
        jae     .no_mouse_area
1029
        jae     .no_mouse_area
1028
 
1030
 
1029
        sub     cx, [Y_UNDER_subtraction_CUR_hot_y]
1031
        sub     cx, [Y_UNDER_subtraction_CUR_hot_y]
1030
        jb      .no_mouse_area
1032
        jb      .no_mouse_area
1031
 
1033
 
1032
        rol     ecx, 16
1034
        rol     ecx, 16
1033
;--------------------------------------
1035
;--------------------------------------
1034
; check for X
1036
; check for X
1035
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
1037
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
1036
        jae     .no_mouse_area
1038
        jae     .no_mouse_area
1037
 
1039
 
1038
        sub     cx, [X_UNDER_subtraction_CUR_hot_x]
1040
        sub     cx, [X_UNDER_subtraction_CUR_hot_x]
1039
        jb      .no_mouse_area
1041
        jb      .no_mouse_area
1040
 
1042
 
1041
        ror     ecx, 16
1043
        ror     ecx, 16
1042
;--------------------------------------
1044
;--------------------------------------
1043
align 4
1045
align 4
1044
.1:
1046
.1:
1045
        push    eax
1047
        push    eax
1046
;--------------------------------------
1048
;--------------------------------------
1047
; ecx = (offset x) shl 16 + (offset y)
1049
; ecx = (offset x) shl 16 + (offset y)
1048
        push    ebx
1050
        push    ebx
1049
        mov     ebx, ecx
1051
        mov     ebx, ecx
1050
        shr     ebx, 16        ; x
1052
        shr     ebx, 16        ; x
1051
        and     ecx, 0xffff    ; y
1053
        and     ecx, 0xffff    ; y
1052
 
1054
 
1053
        cmp     ecx, [cur.h]
1055
        cmp     ecx, [cur.h]
1054
        jae     @f
1056
        jae     @f
1055
 
1057
 
1056
        cmp     ebx, [cur.w]
1058
        cmp     ebx, [cur.w]
1057
        jb      .ok
1059
        jb      .ok
1058
;--------------------------------------
1060
;--------------------------------------
1059
align 4
1061
align 4
1060
@@:
1062
@@:
1061
;        DEBUGF  1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
1063
;        DEBUGF  1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
1062
        pop     ebx
1064
        pop     ebx
1063
        jmp     .sh   ; SORRY! SHIT HAPPENS!
1065
        jmp     .sh   ; SORRY! SHIT HAPPENS!
1064
;--------------------------------------
1066
;--------------------------------------
1065
align 4
1067
align 4
1066
.ok:
1068
.ok:
1067
; ecx = offset y
1069
; ecx = offset y
1068
; ebx = offset x
1070
; ebx = offset x
1069
        push    ebx ecx
1071
        push    ebx ecx
1070
        imul    ecx, [cur.w]    ;y
1072
        imul    ecx, [cur.w]    ;y
1071
        add     ecx, ebx
1073
        add     ecx, ebx
1072
        mov     ebx, ecx
1074
        mov     ebx, ecx
1073
        shl     ecx, 2
1075
        shl     ecx, 2
1074
        cmp     byte [_display.bits_per_pixel], 16
1076
        cmp     byte [_display.bits_per_pixel], 16
1075
        je      .16
1077
        je      .16
1076
        cmp     byte [_display.bits_per_pixel], 24
1078
        cmp     byte [_display.bits_per_pixel], 24
1077
        je      .24
1079
        je      .24
1078
        and     eax, 0xFFFFFF
1080
        and     eax, 0xFFFFFF
1079
        mov     [ecx + cur_saved_data], eax   ;store new color  to
1081
        mov     [ecx + cur_saved_data], eax   ;store new color  to
1080
        jmp     @f
1082
        jmp     @f
1081
;--------------------------------------
1083
;--------------------------------------
1082
align 4
1084
align 4
1083
.16:
1085
.16:
1084
        sub     ecx, ebx
1086
        sub     ecx, ebx
1085
        sub     ecx, ebx
1087
        sub     ecx, ebx
1086
; convert to 16 bpp and store to real LFB
1088
; convert to 16 bpp and store to real LFB
1087
        and     eax, 00000000111110001111110011111000b
1089
        and     eax, 00000000111110001111110011111000b
1088
        shr     ah, 2
1090
        shr     ah, 2
1089
        shr     ax, 3
1091
        shr     ax, 3
1090
        ror     eax, 8
1092
        ror     eax, 8
1091
        add     al, ah
1093
        add     al, ah
1092
        rol     eax, 8
1094
        rol     eax, 8
1093
        mov     [ecx + cur_saved_data], ax      ;store new color  to
1095
        mov     [ecx + cur_saved_data], ax      ;store new color  to
1094
        jmp     @f
1096
        jmp     @f
1095
;--------------------------------------
1097
;--------------------------------------
1096
align 4
1098
align 4
1097
.24:
1099
.24:
1098
        sub     ecx, ebx
1100
        sub     ecx, ebx
1099
        mov     [ecx + cur_saved_data], ax      ;store new color  to
1101
        mov     [ecx + cur_saved_data], ax      ;store new color  to
1100
        shr     eax, 16
1102
        shr     eax, 16
1101
        mov     [ecx + cur_saved_data + 2], al  ;store new color  to
1103
        mov     [ecx + cur_saved_data + 2], al  ;store new color  to
1102
;--------------------------------------
1104
;--------------------------------------
1103
align 4
1105
align 4
1104
@@:
1106
@@:
1105
        pop     ecx ebx
1107
        pop     ecx ebx
1106
 
1108
 
1107
        shl     ecx, 5
1109
        shl     ecx, 5
1108
        add     ecx, ebx
1110
        add     ecx, ebx
1109
 
1111
 
1110
        mov     eax, [current_cursor]
1112
        mov     eax, [current_cursor]
1111
        mov     eax, [eax+CURSOR.base]
1113
        mov     eax, [eax+CURSOR.base]
1112
        lea     eax, [eax+ecx*4]
1114
        lea     eax, [eax+ecx*4]
1113
        mov     eax, [eax]
1115
        mov     eax, [eax]
1114
 
1116
 
1115
        pop     ebx
1117
        pop     ebx
1116
 
1118
 
1117
        test    eax, 0xFF000000
1119
        test    eax, 0xFF000000
1118
        jz      @f
1120
        jz      @f
1119
 
1121
 
1120
        add     esp, 4
1122
        add     esp, 4
1121
        ret
1123
        ret
1122
;--------------------------------------
1124
;--------------------------------------
1123
align 4
1125
align 4
1124
.sh:
1126
.sh:
1125
        mov     ecx, -1
1127
        mov     ecx, -1
1126
;--------------------------------------
1128
;--------------------------------------
1127
align 4
1129
align 4
1128
@@:
1130
@@:
1129
        pop     eax
1131
        pop     eax
1130
;--------------------------------------
1132
;--------------------------------------
1131
align 4
1133
align 4
1132
.no_mouse_area:
1134
.no_mouse_area:
1133
        ret
1135
        ret
1134
;------------------------------------------------------------------------------
1136
;------------------------------------------------------------------------------
1135
align 4
1137
align 4
1136
get_display:
1138
get_display:
1137
        mov     eax, _display
1139
        mov     eax, _display
1138
        ret
1140
        ret
1139
;------------------------------------------------------------------------------
1141
;------------------------------------------------------------------------------
1140
align 4
1142
align 4
1141
init_display:
1143
init_display:
1142
        xor     eax, eax
1144
        xor     eax, eax
1143
        mov     edi, _display
1145
        mov     edi, _display
1144
 
1146
 
1145
        mov     [edi+display_t.init_cursor], eax
1147
        mov     [edi+display_t.init_cursor], eax
1146
        mov     [edi+display_t.select_cursor], eax
1148
        mov     [edi+display_t.select_cursor], eax
1147
        mov     [edi+display_t.show_cursor], eax
1149
        mov     [edi+display_t.show_cursor], eax
1148
        mov     [edi+display_t.move_cursor], eax
1150
        mov     [edi+display_t.move_cursor], eax
1149
        mov     [edi+display_t.restore_cursor], eax
1151
        mov     [edi+display_t.restore_cursor], eax
1150
 
1152
 
1151
        lea     ecx, [edi+display_t.cr_list.next]
1153
        lea     ecx, [edi+display_t.cr_list.next]
1152
        mov     [edi+display_t.cr_list.next], ecx
1154
        mov     [edi+display_t.cr_list.next], ecx
1153
        mov     [edi+display_t.cr_list.prev], ecx
1155
        mov     [edi+display_t.cr_list.prev], ecx
1154
 
1156
 
1155
        cmp     [SCR_MODE], word 0x13
1157
        cmp     [SCR_MODE], word 0x13
1156
        jbe     .fail
1158
        jbe     .fail
1157
 
1159
 
1158
        test    word [SCR_MODE], 0x4000
1160
        test    word [SCR_MODE], 0x4000
1159
        jz      .fail
1161
        jz      .fail
1160
 
1162
 
1161
        mov     ebx, restore_32
1163
        mov     ebx, restore_32
1162
        mov     ecx, move_cursor_32
1164
        mov     ecx, move_cursor_32
1163
        mov     edx, Vesa20_putpixel32_new
1165
        mov     edx, Vesa20_putpixel32_new
1164
        mov     eax, [_display.bits_per_pixel]
1166
        mov     eax, [_display.bits_per_pixel]
1165
        cmp     al, 32
1167
        cmp     al, 32
1166
        jne     .not_32bpp
1168
        jne     .not_32bpp
1167
 
1169
 
1168
.set:
1170
.set:
1169
        mov     [_display.select_cursor], select_cursor
1171
        mov     [_display.select_cursor], select_cursor
1170
        mov     [_display.move_cursor], ecx
1172
        mov     [_display.move_cursor], ecx
1171
        mov     [_display.restore_cursor], ebx
1173
        mov     [_display.restore_cursor], ebx
1172
        mov     [_display.check_mouse], check_mouse_area_for_putpixel_new
1174
        mov     [_display.check_mouse], check_mouse_area_for_putpixel_new
1173
        mov     [_display.check_m_pixel], check_mouse_area_for_getpixel_new
1175
        mov     [_display.check_m_pixel], check_mouse_area_for_getpixel_new
1174
 
1176
 
1175
        cmp     [PUTPIXEL], dword VGA_putpixel
1177
        cmp     [PUTPIXEL], dword VGA_putpixel
1176
        je      @f
1178
        je      @f
1177
        mov     [PUTPIXEL], edx
1179
        mov     [PUTPIXEL], edx
1178
@@:
1180
@@:
1179
        stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM
1181
        stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM
1180
        mov     [def_cursor_clock], eax
1182
        mov     [def_cursor_clock], eax
1181
        stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
1183
        stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
1182
        mov     [def_cursor], eax
1184
        mov     [def_cursor], eax
1183
        ret
1185
        ret
1184
 
1186
 
1185
.not_32bpp:
1187
.not_32bpp:
1186
        cmp     al, 24
1188
        cmp     al, 24
1187
        jne     .not_24bpp
1189
        jne     .not_24bpp
1188
 
1190
 
1189
        mov     ebx, restore_24
1191
        mov     ebx, restore_24
1190
        mov     ecx, move_cursor_24
1192
        mov     ecx, move_cursor_24
1191
        mov     edx, Vesa20_putpixel24_new
1193
        mov     edx, Vesa20_putpixel24_new
1192
        jmp     .set
1194
        jmp     .set
1193
 
1195
 
1194
.not_24bpp:
1196
.not_24bpp:
1195
        cmp     al, 16
1197
        cmp     al, 16
1196
        jne     .not_16bpp
1198
        jne     .not_16bpp
1197
        mov     ebx, restore_16
1199
        mov     ebx, restore_16
1198
        mov     ecx, move_cursor_16
1200
        mov     ecx, move_cursor_16
1199
        mov     edx, Vesa20_putpixel16_new
1201
        mov     edx, Vesa20_putpixel16_new
1200
        jmp     .set
1202
        jmp     .set
1201
 
1203
 
1202
.not_16bpp:
1204
.not_16bpp:
1203
;        cmp     al, 15
1205
;        cmp     al, 15
1204
;        jne     .fail
1206
;        jne     .fail
1205
;        mov     ebx, restore_15
1207
;        mov     ebx, restore_15
1206
;        mov     ecx, move_cursor_15
1208
;        mov     ecx, move_cursor_15
1207
;        mov     edx, Vesa20_putpixel15_new
1209
;        mov     edx, Vesa20_putpixel15_new
1208
;        jmp     .set
1210
;        jmp     .set
1209
 
1211
 
1210
.fail:
1212
.fail:
1211
        xor     eax, eax
1213
        xor     eax, eax
1212
        mov     [_display.select_cursor], eax
1214
        mov     [_display.select_cursor], eax
1213
        mov     [_display.move_cursor], eax
1215
        mov     [_display.move_cursor], eax
1214
        ret
1216
        ret
1215
;------------------------------------------------------------------------------
1217
;------------------------------------------------------------------------------
1216
align 4
1218
align 4
1217
def_arrow:
1219
def_arrow:
1218
  file 'arrow.cur'
1220
  file 'arrow.cur'
1219
;------------------------------------------------------------------------------
1221
;------------------------------------------------------------------------------
1220
align 4
1222
align 4
1221
clock_arrow:
1223
clock_arrow:
1222
  file 'arrow_clock.cur'
1224
  file 'arrow_clock.cur'
1223
;------------------------------------------------------------------------------
1225
;------------------------------------------------------------------------------
1224
>
1226
>
1225
>
1227
>
1226
>
1228
>
1227
>
1229
>
1228
>
1230
>
1229
>
1231
>