Rev 380 | Rev 389 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 380 | Rev 381 | ||
---|---|---|---|
Line 41... | Line 41... | ||
41 | ; return old picture |
41 | ; return old picture |
Line 42... | Line 42... | ||
42 | 42 | ||
43 | cmp [set_hw_cursor], 0 |
43 | cmp [set_hw_cursor], 0 |
44 | jz @F |
44 | jz @F |
45 | pushad |
45 | pushad |
46 | movzx eax,word [0xfb4a] |
46 | movzx eax,word [X_UNDER] |
47 | movzx ebx,word [0xfb4c] |
47 | movzx ebx,word [Y_UNDER] |
48 | stdcall [hw_restore], eax, ebx |
48 | stdcall [hw_restore], eax, ebx |
49 | popad |
49 | popad |
50 | ret |
50 | ret |
51 | @@: |
51 | @@: |
52 | pushad |
52 | pushad |
53 | xor ecx,ecx |
53 | xor ecx,ecx |
54 | xor edx,edx |
54 | xor edx,edx |
55 | align 4 |
55 | align 4 |
56 | mres: |
56 | mres: |
57 | movzx eax,word [0xfb4a] |
57 | movzx eax,word [X_UNDER] |
58 | movzx ebx,word [0xfb4c] |
58 | movzx ebx,word [Y_UNDER] |
59 | add eax,ecx |
59 | add eax,ecx |
60 | add ebx,edx |
60 | add ebx,edx |
61 | push ecx |
61 | push ecx |
62 | push edx |
62 | push edx |
Line 88... | Line 88... | ||
88 | 88 | ||
89 | cmp [set_hw_cursor], 0 |
89 | cmp [set_hw_cursor], 0 |
90 | jz @F |
90 | jz @F |
Line 91... | Line 91... | ||
91 | pushad |
91 | pushad |
92 | 92 | ||
93 | mov [0xfb4a],ax |
93 | mov [X_UNDER],ax |
94 | mov [0xfb4c],bx |
94 | mov [Y_UNDER],bx |
95 | movzx eax,word [0xfb0c] |
95 | movzx eax,word [MOUSE_Y] |
96 | movzx ebx,word [0xfb0a] |
96 | movzx ebx,word [MOUSE_X] |
Line 97... | Line 97... | ||
97 | push eax |
97 | push eax |
98 | push ebx |
98 | push ebx |
99 | 99 | ||
100 | mov ecx, [0xfe00] |
100 | mov ecx, [ScreenWidth] |
101 | inc ecx |
101 | inc ecx |
102 | mul ecx |
102 | mul ecx |
Line 121... | Line 121... | ||
121 | ret |
121 | ret |
Line 122... | Line 122... | ||
122 | 122 | ||
123 | @@: |
123 | @@: |
124 | pushad |
124 | pushad |
125 | ; save & draw |
125 | ; save & draw |
126 | mov [0xfb4a],ax |
126 | mov [X_UNDER],ax |
127 | mov [0xfb4c],bx |
127 | mov [Y_UNDER],bx |
128 | push eax |
128 | push eax |
129 | push ebx |
129 | push ebx |
130 | mov ecx,0 |
130 | mov ecx,0 |
131 | mov edx,0 |
131 | mov edx,0 |
Line 139... | Line 139... | ||
139 | push ecx |
139 | push ecx |
140 | add eax,ecx ; save picture under mouse |
140 | add eax,ecx ; save picture under mouse |
141 | add ebx,edx |
141 | add ebx,edx |
142 | push ecx |
142 | push ecx |
143 | call getpixel |
143 | call getpixel |
144 | mov [0xfb30],ecx |
144 | mov [COLOR_TEMP],ecx |
145 | pop ecx |
145 | pop ecx |
146 | mov eax,edx |
146 | mov eax,edx |
147 | shl eax,6 |
147 | shl eax,6 |
148 | shl ecx,2 |
148 | shl ecx,2 |
149 | add eax,ecx |
149 | add eax,ecx |
150 | add eax,mouseunder |
150 | add eax,mouseunder |
151 | mov ebx,[0xfb30] |
151 | mov ebx,[COLOR_TEMP] |
152 | mov [eax],ebx |
152 | mov [eax],ebx |
153 | pop ecx |
153 | pop ecx |
154 | mov edi,edx ; y cycle |
154 | mov edi,edx ; y cycle |
155 | shl edi,4 ; *16 bytes per row |
155 | shl edi,4 ; *16 bytes per row |
156 | add edi,ecx ; x cycle |
156 | add edi,ecx ; x cycle |
157 | mov esi, edi |
157 | mov esi, edi |
158 | add edi, esi |
158 | add edi, esi |
159 | add edi, esi ; *3 |
159 | add edi, esi ; *3 |
160 | add edi,[0xf200] ; we have our str address |
160 | add edi,[MOUSE_PICTURE] ; we have our str address |
161 | mov esi, edi |
161 | mov esi, edi |
162 | add esi, 16*24*3 |
162 | add esi, 16*24*3 |
163 | push ecx |
163 | push ecx |
164 | mov ecx, [0xfb30] |
164 | mov ecx, [COLOR_TEMP] |
165 | call combine_colors |
165 | call combine_colors |
166 | mov [0xfb10], ecx |
166 | mov [MOUSE_COLOR_MEM], ecx |
167 | pop ecx |
167 | pop ecx |
168 | pop edx |
168 | pop edx |
169 | pop ecx |
169 | pop ecx |
170 | pop ebx |
170 | pop ebx |
171 | pop eax |
171 | pop eax |
172 | add eax,ecx ; we have x coord+cycle |
172 | add eax,ecx ; we have x coord+cycle |
173 | add ebx,edx ; and y coord+cycle |
173 | add ebx,edx ; and y coord+cycle |
174 | push ecx |
174 | push ecx |
175 | mov ecx, [0xfb10] |
175 | mov ecx, [MOUSE_COLOR_MEM] |
176 | mov edi, 1 |
176 | mov edi, 1 |
177 | call [putpixel] |
177 | call [putpixel] |
178 | pop ecx |
178 | pop ecx |
179 | mov ebx,[esp+0] ; pure y coord again |
179 | mov ebx,[esp+0] ; pure y coord again |
180 | mov eax,[esp+4] ; and x |
180 | mov eax,[esp+4] ; and x |
Line 258... | Line 258... | ||
258 | pop eax |
258 | pop eax |
259 | ret |
259 | ret |
Line 260... | Line 260... | ||
260 | 260 | ||
261 | 261 | ||
262 | __sys_disable_mouse: |
262 | __sys_disable_mouse: |
263 | cmp dword [0xf204],dword 0 |
263 | cmp dword [MOUSE_VISIBLE],dword 0 |
264 | je @f |
264 | je @f |
265 | ret |
265 | ret |
266 | @@: |
266 | @@: |
267 | pushad |
267 | pushad |
268 | cmp [CURRENT_TASK],dword 1 |
268 | cmp [CURRENT_TASK],dword 1 |
269 | je disable_m |
269 | je disable_m |
270 | mov edx,[CURRENT_TASK] |
270 | mov edx,[CURRENT_TASK] |
271 | shl edx,5 |
271 | shl edx,5 |
272 | add edx,window_data |
272 | add edx,window_data |
273 | movzx eax, word [0xfb0a] |
273 | movzx eax, word [MOUSE_X] |
274 | movzx ebx, word [0xfb0c] |
274 | movzx ebx, word [MOUSE_Y] |
275 | mov ecx,[0xfe00] |
275 | mov ecx,[ScreenWidth] |
276 | inc ecx |
276 | inc ecx |
277 | imul ecx,ebx |
277 | imul ecx,ebx |
278 | add ecx,eax |
278 | add ecx,eax |
Line 282... | Line 282... | ||
282 | cmp eax,ebx |
282 | cmp eax,ebx |
283 | je yes_mouse_disable |
283 | je yes_mouse_disable |
284 | movzx ebx, byte [ecx+16] |
284 | movzx ebx, byte [ecx+16] |
285 | cmp eax,ebx |
285 | cmp eax,ebx |
286 | je yes_mouse_disable |
286 | je yes_mouse_disable |
287 | mov ebx,[0xfe00] |
287 | mov ebx,[ScreenWidth] |
288 | inc ebx |
288 | inc ebx |
289 | imul ebx,10 |
289 | imul ebx,10 |
290 | add ecx,ebx |
290 | add ecx,ebx |
291 | movzx ebx, byte [ecx] |
291 | movzx ebx, byte [ecx] |
292 | cmp eax,ebx |
292 | cmp eax,ebx |
Line 297... | Line 297... | ||
297 | jmp no_mouse_disable |
297 | jmp no_mouse_disable |
298 | yes_mouse_disable: |
298 | yes_mouse_disable: |
299 | mov edx,[CURRENT_TASK] |
299 | mov edx,[CURRENT_TASK] |
300 | shl edx,5 |
300 | shl edx,5 |
301 | add edx,window_data |
301 | add edx,window_data |
302 | movzx eax, word [0xfb0a] |
302 | movzx eax, word [MOUSE_X] |
303 | movzx ebx, word [0xfb0c] |
303 | movzx ebx, word [MOUSE_Y] |
304 | mov ecx,[edx+0] ; mouse inside the area ? |
304 | mov ecx,[edx+0] ; mouse inside the area ? |
305 | add eax,14 |
305 | add eax,14 |
306 | cmp eax,ecx |
306 | cmp eax,ecx |
307 | jb no_mouse_disable |
307 | jb no_mouse_disable |
308 | sub eax,14 |
308 | sub eax,14 |
Line 316... | Line 316... | ||
316 | sub ebx,20 |
316 | sub ebx,20 |
317 | add ecx,[edx+12] |
317 | add ecx,[edx+12] |
318 | cmp ebx,ecx |
318 | cmp ebx,ecx |
319 | jg no_mouse_disable |
319 | jg no_mouse_disable |
320 | disable_m: |
320 | disable_m: |
321 | cmp dword [0xf204],dword 0 |
321 | cmp dword [MOUSE_VISIBLE],dword 0 |
322 | jne no_mouse_disable |
322 | jne no_mouse_disable |
323 | cli |
323 | cli |
324 | call draw_mouse_under |
324 | call draw_mouse_under |
325 | sti |
325 | sti |
326 | mov [0xf204],dword 1 |
326 | mov [MOUSE_VISIBLE],dword 1 |
327 | no_mouse_disable: |
327 | no_mouse_disable: |
328 | popad |
328 | popad |
329 | ret |
329 | ret |
Line 330... | Line 330... | ||
330 | 330 | ||
Line 343... | Line 343... | ||
343 | @@: |
343 | @@: |
344 | mov eax,[timer_ticks] |
344 | mov eax,[timer_ticks] |
345 | mov [MouseTickCounter],eax |
345 | mov [MouseTickCounter],eax |
346 | pop eax |
346 | pop eax |
347 | pushad |
347 | pushad |
348 | cmp dword [0xf204],dword 0 ; mouse visible ? |
348 | cmp dword [MOUSE_VISIBLE],dword 0 ; mouse visible ? |
349 | je chms00 |
349 | je chms00 |
350 | mov [0xf204], dword 0 |
350 | mov [MOUSE_VISIBLE], dword 0 |
351 | movzx ebx,word [0xfb0c] |
351 | movzx ebx,word [MOUSE_Y] |
352 | movzx eax,word [0xfb0a] |
352 | movzx eax,word [MOUSE_X] |
353 | cli |
353 | cli |
354 | call save_draw_mouse |
354 | call save_draw_mouse |
355 | sti |
355 | sti |
356 | nodmu2: |
356 | nodmu2: |
357 | popad |
357 | popad |
358 | ret |
358 | ret |
359 | chms00: |
359 | chms00: |
360 | movzx ecx,word [0xfb4a] |
360 | movzx ecx,word [X_UNDER] |
361 | movzx edx,word [0xfb4c] |
361 | movzx edx,word [Y_UNDER] |
362 | movzx ebx,word [0xfb0c] |
362 | movzx ebx,word [MOUSE_Y] |
363 | movzx eax,word [0xfb0a] |
363 | movzx eax,word [MOUSE_X] |
364 | cmp eax,ecx |
364 | cmp eax,ecx |
365 | jne redrawmouse |
365 | jne redrawmouse |
366 | cmp ebx,edx |
366 | cmp ebx,edx |
367 | jne redrawmouse |
367 | jne redrawmouse |
368 | jmp nodmp |
368 | jmp nodmp |