Rev 129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 129 | Rev 384 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | func color_24_to_4_bits |
1 | func color_24_to_4_bits |
2 | begin |
2 | begin |
3 | push edx |
3 | push edx |
4 | mov dl,0 |
4 | mov dl,0 |
5 | cmp al,85 ; blue |
5 | cmp al,85 ; blue |
6 | jbe .p13green |
6 | jbe .p13green |
7 | or dl,0x01 |
7 | or dl,0x01 |
8 | cmp al,170 |
8 | cmp al,170 |
9 | jbe .p13green |
9 | jbe .p13green |
10 | or dl,0x08 |
10 | or dl,0x08 |
11 | .p13green: |
11 | .p13green: |
12 | shr eax,8 |
12 | shr eax,8 |
13 | cmp al,85 ; green |
13 | cmp al,85 ; green |
14 | jbe .p13red |
14 | jbe .p13red |
15 | or dl,0x02 |
15 | or dl,0x02 |
16 | cmp al,170 |
16 | cmp al,170 |
17 | jbe .p13red |
17 | jbe .p13red |
18 | or dl,0x08 |
18 | or dl,0x08 |
19 | .p13red: |
19 | .p13red: |
20 | cmp ah,85 ; red |
20 | cmp ah,85 ; red |
21 | jbe .p13cont |
21 | jbe .p13cont |
22 | or dl,0x04 |
22 | or dl,0x04 |
23 | cmp ah,170 |
23 | cmp ah,170 |
24 | jbe .p13cont |
24 | jbe .p13cont |
25 | or dl,0x08 |
25 | or dl,0x08 |
Line 54... | Line 54... | ||
54 | mov eax,edi |
54 | mov eax,edi |
55 | call color_24_to_4_bits |
55 | call color_24_to_4_bits |
56 | mov edi,eax |
56 | mov edi,eax |
57 | pop eax |
57 | pop eax |
Line 58... | Line 58... | ||
58 | 58 | ||
59 | mov ebp,[0x3010] |
59 | mov ebp,[TASK_BASE] |
60 | movsx esi,word[ebp-0x3000+0] |
60 | movsx esi,word[ebp-CURRENT_TASK+0] |
61 | add eax,esi |
61 | add eax,esi |
62 | add ecx,esi |
62 | add ecx,esi |
63 | movsx esi,word[ebp-0x3000+4] |
63 | movsx esi,word[ebp-CURRENT_TASK+4] |
64 | add ebx,esi |
64 | add ebx,esi |
65 | add edx,esi |
65 | add edx,esi |
66 | ; add eax,[ebp-0x3000+0] |
66 | ; add eax,[ebp-CURRENT_TASK+0] |
67 | ; add ebx,[ebp-0x3000+4] |
67 | ; add ebx,[ebp-CURRENT_TASK+4] |
68 | ; add ecx,[ebp-0x3000+0] |
68 | ; add ecx,[ebp-CURRENT_TASK+0] |
Line 69... | Line 69... | ||
69 | ; add edx,[ebp-0x3000+4] |
69 | ; add edx,[ebp-CURRENT_TASK+4] |
70 | 70 | ||
71 | mov esi,[0x00003000] |
71 | mov esi,[CURRENT_TASK] |
72 | mov esi,[CLIP_RECTS+esi*4] |
72 | mov esi,[CLIP_RECTS+esi*4] |
73 | mov ebp,[esi] |
73 | mov ebp,[esi] |
74 | or ebp,ebp |
74 | or ebp,ebp |
Line 87... | Line 87... | ||
87 | mov ecx,[rr.right] |
87 | mov ecx,[rr.right] |
88 | @@: jif edx,l,[rr.bottom],@f |
88 | @@: jif edx,l,[rr.bottom],@f |
89 | mov edx,[rr.bottom] |
89 | mov edx,[rr.bottom] |
90 | @@: call is_intersect_rc |
90 | @@: call is_intersect_rc |
91 | jc .put |
91 | jc .put |
92 | cmp [mouse_invisible],0 |
92 | cmp byte[MOUSE_VISIBLE],0 |
93 | jne .put |
93 | je .put |
94 | call [SF.draw_mouse_under] |
94 | call [SF.draw_mouse_under] |
95 | mov [mouse_invisible],1 |
95 | mov byte[MOUSE_VISIBLE],0 |
96 | .put: sub edx,ebx |
96 | .put: sub edx,ebx |
97 | push edx edi ebx eax |
97 | push edx edi ebx eax |
98 | mov edi,ebx |
98 | mov edi,ebx |
99 | shl edi,6 |
99 | shl edi,6 |
100 | shl ebx,4 |
100 | shl ebx,4 |
101 | add edi,ebx |
101 | add edi,ebx |
102 | shr eax,3 |
102 | shr eax,3 |
103 | add edi,eax |
103 | add edi,eax |
104 | add edi,0x000A0000 |
104 | add edi,VGABasePtr |
105 | pop eax ebx |
105 | pop eax ebx |
Line 106... | Line 106... | ||
106 | 106 | ||
107 | mov ebx,eax |
107 | mov ebx,eax |
108 | mov esi,ecx |
108 | mov esi,ecx |
Line 112... | Line 112... | ||
112 | ;edi = Offset in VMem |
112 | ;edi = Offset in VMem |
113 | ;esi = Length |
113 | ;esi = Length |
114 | ;ebx = x |
114 | ;ebx = x |
115 | ; dx = Graphix Controller |
115 | ; dx = Graphix Controller |
Line 116... | Line 116... | ||
116 | 116 | ||
117 | mov cl,bl ; Get StartBit |
117 | mov cl,bl ; Get StartBit |
Line 118... | Line 118... | ||
118 | and ecx,07h |
118 | and ecx,07h |
119 | 119 | ||
120 | mov eax,esi |
120 | mov eax,esi |
121 | add eax,ecx |
121 | add eax,ecx |
122 | cmp eax,8 ; Is x+Length |
122 | cmp eax,8 ; Is x+Length |
123 | jb .D_One |
123 | jb .D_One |
124 | 124 | ||
125 | mov ax,0xff08 ; 11111111b | BitMask Register |
125 | mov ax,0xff08 ; 11111111b | BitMask Register |
126 | shr ah,cl ; BitMask |
126 | shr ah,cl ; BitMask |
127 | out dx,ax ; Write BitMask |
127 | out dx,ax ; Write BitMask |
128 | push ecx |
128 | push ecx |
129 | mov ah,[esp+4] |
129 | mov ah,[esp+4] |
130 | mov ecx,[esp+4+4] |
130 | mov ecx,[esp+4+4] |
131 | push edi |
131 | push edi |
132 | .D_LL: ; Draw Left of Box |
132 | .D_LL: ; Draw Left of Box |
133 | mov al,[edi] |
133 | mov al,[edi] |
134 | mov [edi],ah |
134 | mov [edi],ah |
135 | add edi,80 ; edi:=edi+80 |
135 | add edi,80 ; edi:=edi+80 |
136 | dec ecx |
136 | dec ecx |
137 | jnz .D_LL |
137 | jnz .D_LL |
138 | pop edi |
138 | pop edi |
139 | inc edi |
139 | inc edi |
140 | pop ecx |
140 | pop ecx |
141 | 141 | ||
142 | mov ax,0xFF08 ; BitMask Register |
142 | mov ax,0xFF08 ; BitMask Register |
143 | out dx,ax ; Write BitMask |
143 | out dx,ax ; Write BitMask |
144 | 144 | ||
145 | mov eax,esi |
145 | mov eax,esi |
146 | mov ch,8 |
146 | mov ch,8 |
147 | sub ch,cl |
147 | sub ch,cl |
148 | movzx ecx,ch |
148 | movzx ecx,ch |
Line 149... | Line 149... | ||
149 | sub eax,ecx |
149 | sub eax,ecx |
150 | shr eax,3 ; Length div 8 |
150 | shr eax,3 ; Length div 8 |
151 | 151 | ||
152 | push edi ebx |
152 | push edi ebx |
153 | mov ebx,[esp+8+4] |
153 | mov ebx,[esp+8+4] |
154 | mov edx,eax |
154 | mov edx,eax |
155 | mov al,[esp+8] |
155 | mov al,[esp+8] |
156 | .D_LC: |
156 | .D_LC: |
157 | mov ecx,edx |
157 | mov ecx,edx |
158 | rep stosb |
158 | rep stosb |
159 | add edi,80 |
159 | add edi,80 |
160 | sub edi,edx |
160 | sub edi,edx |
161 | dec ebx |
161 | dec ebx |
162 | jnz .D_LC |
162 | jnz .D_LC |
163 | pop ebx edi |
163 | pop ebx edi |
164 | add edi,edx |
164 | add edi,edx |
165 | 165 | ||
166 | mov ecx,ebx ; ecx:=x+Length |
166 | mov ecx,ebx ; ecx:=x+Length |
167 | add ecx,esi |
167 | add ecx,esi |
168 | and ecx,07h ; ecx and 07 |
168 | and ecx,07h ; ecx and 07 |
169 | mov ah,0ffh |
169 | mov ah,0ffh |
170 | shr ah,cl ; BitMask |
170 | shr ah,cl ; BitMask |
171 | jz .D_End |
171 | jz .D_End |
172 | 172 | ||
173 | not ah |
173 | not ah |
174 | mov al,8 ; BitMask Register |
174 | mov al,8 ; BitMask Register |
175 | mov dx,03ceh ; Graphics Controller |
175 | mov dx,03ceh ; Graphics Controller |
176 | out dx,ax ; Write BitMask |
176 | out dx,ax ; Write BitMask |
177 | mov ecx,[esp+4] |
177 | mov ecx,[esp+4] |
178 | mov al,[esp] |
178 | mov al,[esp] |
179 | .D_LR: |
179 | .D_LR: |
180 | mov ah,[edi] |
180 | mov ah,[edi] |
181 | mov [edi],al |
181 | mov [edi],al |
Line 182... | Line 182... | ||
182 | add edi,80 |
182 | add edi,80 |
Line 183... | Line 183... | ||
183 | dec ecx |
183 | dec ecx |
184 | jnz .D_LR |
184 | jnz .D_LR |
185 | 185 | ||
Line 186... | Line 186... | ||
186 | jmp .D_End |
186 | jmp .D_End |
187 | 187 | ||
188 | .D_One: |
188 | .D_One: |
189 | mov ah,0ffh |
189 | mov ah,0ffh |
190 | shr ah,cl ; Left BitMask |
190 | shr ah,cl ; Left BitMask |
191 | 191 | ||
192 | add ebx,esi |
192 | add ebx,esi |
193 | dec ebx |
193 | dec ebx |
194 | and ebx,07h |
194 | and ebx,07h |
195 | 195 | ||
196 | mov ecx,7 |
196 | mov ecx,7 |
197 | sub ecx,ebx |
197 | sub ecx,ebx |
198 | 198 | ||
199 | mov bl,0ffh |
199 | mov bl,0ffh |
200 | shl bl,cl ; Right BitMask |
200 | shl bl,cl ; Right BitMask |
201 | 201 | ||
202 | and ah,bl ; Full BitMask |
202 | and ah,bl ; Full BitMask |
203 | mov al,8 ; BitMask Register |
203 | mov al,8 ; BitMask Register |
204 | out dx,ax ; Write BitMask |
204 | out dx,ax ; Write BitMask |
205 | mov ecx,[esp+4] |
205 | mov ecx,[esp+4] |
206 | mov al,[esp] |
206 | mov al,[esp] |
207 | .D_L: |
207 | .D_L: |
208 | mov dl,[edi] ; Fill Latches |
208 | mov dl,[edi] ; Fill Latches |
209 | mov [edi],al ; Write Pixel |
209 | mov [edi],al ; Write Pixel |
210 | add edi,80 |
210 | add edi,80 |
211 | dec ecx |
211 | dec ecx |
Line 243... | Line 243... | ||
243 | 243 | ||
Line 244... | Line 244... | ||
244 | call get_cursor_rect |
244 | call get_cursor_rect |
245 | 245 | ||
246 | mov eax,ecx |
246 | mov eax,ecx |
247 | call color_24_to_4_bits |
247 | call color_24_to_4_bits |
Line 248... | Line 248... | ||
248 | ; mov [esp+4*8],ecx |
248 | ; mov [esp+4*8],ecx |
249 | mov [esp+4*8],al |
249 | mov [esp+4*8],al |
250 | 250 | ||
Line 272... | Line 272... | ||
272 | pop eax |
272 | pop eax |
273 | mov ecx,[esp+4*8] |
273 | mov ecx,[esp+4*8] |
Line 274... | Line 274... | ||
274 | 274 | ||
275 | test edi,1 |
275 | test edi,1 |
276 | jnz .forced |
276 | jnz .forced |
277 | mov esi,[0x00003000] |
277 | mov esi,[CURRENT_TASK] |
278 | mov esi,[CLIP_RECTS+esi*4] |
278 | mov esi,[CLIP_RECTS+esi*4] |
279 | mov edi,[esi] |
279 | mov edi,[esi] |
280 | or edi,edi |
280 | or edi,edi |
281 | jz .exit |
281 | jz .exit |
Line 296... | Line 296... | ||
296 | mov edx,[rr.bottom] |
296 | mov edx,[rr.bottom] |
297 | dec edx |
297 | dec edx |
298 | .draw: |
298 | .draw: |
299 | @@: call is_intersect_vln |
299 | @@: call is_intersect_vln |
300 | jc .put |
300 | jc .put |
301 | cmp [mouse_invisible],0 |
301 | cmp byte[MOUSE_VISIBLE],0 |
302 | jne .put |
302 | je .put |
303 | call [SF.draw_mouse_under] |
303 | call [SF.draw_mouse_under] |
304 | mov [mouse_invisible],1 |
304 | mov byte[MOUSE_VISIBLE],0 |
305 | .put: push ebx eax |
305 | .put: push ebx eax |
306 | mov ebp,ebx |
306 | mov ebp,ebx |
307 | shl ebp,6 |
307 | shl ebp,6 |
308 | shl ebx,4 |
308 | shl ebx,4 |
309 | add ebp,ebx |
309 | add ebp,ebx |
310 | shr eax,3 |
310 | shr eax,3 |
311 | add ebp,eax |
311 | add ebp,eax |
312 | add ebp,0x000A0000 |
312 | add ebp,VGABasePtr |
313 | pop eax ebx |
313 | pop eax ebx |
314 | @@: mov ch,[ebp] |
314 | @@: mov ch,[ebp] |
315 | mov [ebp],cl |
315 | mov [ebp],cl |
316 | add ebp,80 |
316 | add ebp,80 |
317 | inc ebx |
317 | inc ebx |
Line 347... | Line 347... | ||
347 | dl.horz_line: |
347 | dl.horz_line: |
348 | cld |
348 | cld |
349 | mov ecx,[esp+4*8] |
349 | mov ecx,[esp+4*8] |
350 | test edi,1 |
350 | test edi,1 |
351 | jnz .forced |
351 | jnz .forced |
352 | mov esi,[0x00003000] |
352 | mov esi,[CURRENT_TASK] |
353 | mov esi,[CLIP_RECTS+esi*4] |
353 | mov esi,[CLIP_RECTS+esi*4] |
354 | mov edi,[esi] |
354 | mov edi,[esi] |
355 | or edi,edi |
355 | or edi,edi |
356 | jz .exit |
356 | jz .exit |
357 | add esi,4 |
357 | add esi,4 |
Line 371... | Line 371... | ||
371 | mov edx,[rr.right] |
371 | mov edx,[rr.right] |
372 | dec edx |
372 | dec edx |
373 | .draw: |
373 | .draw: |
374 | @@: call is_intersect_hln |
374 | @@: call is_intersect_hln |
375 | jc .put |
375 | jc .put |
376 | cmp [mouse_invisible],0 |
376 | cmp byte[MOUSE_VISIBLE],0 |
377 | jne .put |
377 | je .put |
378 | call [SF.draw_mouse_under] |
378 | call [SF.draw_mouse_under] |
379 | mov [mouse_invisible],1 |
379 | mov byte[MOUSE_VISIBLE],0 |
380 | .put: push edi ebx eax |
380 | .put: push edi ebx eax |
381 | mov edi,eax |
381 | mov edi,eax |
382 | shl edi,6 |
382 | shl edi,6 |
383 | shl eax,4 |
383 | shl eax,4 |
384 | add edi,eax |
384 | add edi,eax |
385 | shr ebx,3 |
385 | shr ebx,3 |
386 | add edi,ebx |
386 | add edi,ebx |
387 | add edi,0x000A0000 |
387 | add edi,VGABasePtr |
388 | pop eax ebx |
388 | pop eax ebx |
Line 389... | Line 389... | ||
389 | 389 | ||
390 | push eax ebx edx esi ecx |
390 | push eax ebx edx esi ecx |
391 | mov esi,edx |
391 | mov esi,edx |
Line 394... | Line 394... | ||
394 | mov dx,0x03CE |
394 | mov dx,0x03CE |
395 | ;edi = Offset in VMem |
395 | ;edi = Offset in VMem |
396 | ;esi = Length |
396 | ;esi = Length |
397 | ;ebx = x |
397 | ;ebx = x |
398 | ; dx = Graphix Controller |
398 | ; dx = Graphix Controller |
399 | mov cl,bl ; Get StartBit |
399 | mov cl,bl ; Get StartBit |
400 | and ecx,07h |
400 | and ecx,07h |
Line 401... | Line 401... | ||
401 | 401 | ||
402 | mov eax,esi |
402 | mov eax,esi |
403 | add eax,ecx |
403 | add eax,ecx |
404 | cmp eax,8 ; Is x+Length |
404 | cmp eax,8 ; Is x+Length |
405 | jb .D_One |
405 | jb .D_One |
406 | 406 | ||
407 | mov ax,0xFF08 ; 11111111b | BitMask Register |
407 | mov ax,0xFF08 ; 11111111b | BitMask Register |
408 | shr ah,cl ; BitMask |
408 | shr ah,cl ; BitMask |
409 | out dx,ax ; Write BitMask |
409 | out dx,ax ; Write BitMask |
410 | mov al,[edi] |
410 | mov al,[edi] |
411 | mov eax,[esp] |
411 | mov eax,[esp] |
412 | mov [edi],al |
412 | mov [edi],al |
413 | inc edi |
413 | inc edi |
414 | 414 | ||
415 | mov ax,0xFF08 ; BitMask | BitMask Register |
415 | mov ax,0xFF08 ; BitMask | BitMask Register |
416 | out dx,ax ; Write BitMask |
416 | out dx,ax ; Write BitMask |
417 | 417 | ||
418 | mov eax,esi |
418 | mov eax,esi |
419 | mov ch,8 |
419 | mov ch,8 |
420 | sub ch,cl |
420 | sub ch,cl |
421 | mov cl,ch |
421 | mov cl,ch |
422 | xor ch,ch |
422 | xor ch,ch |
423 | sub eax,ecx |
423 | sub eax,ecx |
424 | shr eax,3 ; Length div 8 |
424 | shr eax,3 ; Length div 8 |
425 | mov ecx,eax |
425 | mov ecx,eax |
426 | mov eax,[esp] |
426 | mov eax,[esp] |
427 | rep stosb |
427 | rep stosb |
428 | 428 | ||
429 | mov ecx,ebx ; ecx:=x+Length |
429 | mov ecx,ebx ; ecx:=x+Length |
430 | add ecx,esi |
430 | add ecx,esi |
431 | and ecx,07h ; ecx and 07 |
431 | and ecx,07h ; ecx and 07 |
432 | mov ah,0ffh |
432 | mov ah,0ffh |
433 | shr ah,cl ; BitMask |
433 | shr ah,cl ; BitMask |
434 | jz .D_End |
434 | jz .D_End |
435 | 435 | ||
436 | not ah |
436 | not ah |
437 | mov al,8 ; BitMask Register |
437 | mov al,8 ; BitMask Register |
438 | out dx,ax ; Write BitMask |
438 | out dx,ax ; Write BitMask |
439 | mov cl,[edi] |
439 | mov cl,[edi] |
440 | mov eax,[esp] |
440 | mov eax,[esp] |
441 | mov [edi],al |
441 | mov [edi],al |
Line 442... | Line 442... | ||
442 | jmp .D_End |
442 | jmp .D_End |
443 | 443 | ||
444 | .D_One: |
444 | .D_One: |
Line 445... | Line 445... | ||
445 | mov ax,0xff08 ; | BitMask Register |
445 | mov ax,0xff08 ; | BitMask Register |
446 | shr ah,cl ; Left BitMask |
446 | shr ah,cl ; Left BitMask |
447 | 447 | ||
Line 448... | Line 448... | ||
448 | add ebx,esi |
448 | add ebx,esi |
449 | dec ebx |
449 | dec ebx |
Line 450... | Line 450... | ||
450 | and ebx,07h |
450 | and ebx,07h |
451 | 451 | ||
Line 452... | Line 452... | ||
452 | mov ecx,7 |
452 | mov ecx,7 |
453 | sub ecx,ebx |
453 | sub ecx,ebx |
Line 454... | Line 454... | ||
454 | 454 | ||
455 | mov bl,0ffh |
455 | mov bl,0ffh |
456 | shl bl,cl ; Right BitMask |
456 | shl bl,cl ; Right BitMask |
457 | 457 | ||
458 | and ah,bl ; Full BitMask |
458 | and ah,bl ; Full BitMask |
Line 459... | Line 459... | ||
459 | out dx,ax ; Write BitMask |
459 | out dx,ax ; Write BitMask |
460 | 460 | ||
461 | mov dl,[edi] ; Fill Latches |
461 | mov dl,[edi] ; Fill Latches |
462 | mov eax,[esp] |
462 | mov eax,[esp] |
463 | mov [edi],al ; Write Pixel |
463 | mov [edi],al ; Write Pixel |
464 | .D_End: |
464 | .D_End: |
465 | pop ecx esi edx ebx eax edi |
465 | pop ecx esi edx ebx eax edi |
466 | 466 | ||
467 | ; mov ebp,[bytes_per_scanline] |
467 | ; mov ebp,[BytesPerScanLine] |
468 | ; imul ebp,eax |
468 | ; imul ebp,eax |
469 | ; lea ebp,[ebp+ebx*4] |
469 | ; lea ebp,[ebp+ebx*4] |
470 | ; add ebp,[lfb_address] |
470 | ; add ebp,[LFBAddress] |
471 | ; @@: test ecx,0x01000000 |
471 | ; @@: test ecx,0x01000000 |
472 | ; jz .dr |
472 | ; jz .dr |
473 | ; mov ecx,[ebp] |
473 | ; mov ecx,[ebp] |
474 | ; not ecx |
474 | ; not ecx |
475 | ; or ecx,0x01000000 |
475 | ; or ecx,0x01000000 |
476 | ; .dr: mov [ebp],ecx |
476 | ; .dr: mov [ebp],ecx |
477 | ; add ebp,4 |
477 | ; add ebp,4 |
Line 516... | Line 516... | ||
516 | ; edi = 0x00000001 force |
516 | ; edi = 0x00000001 force |
517 | ;----------------------------------------------------------------------------- |
517 | ;----------------------------------------------------------------------------- |
518 | begin |
518 | begin |
519 | pushad |
519 | pushad |
520 | cli |
520 | cli |
521 | ; mov edx,[bytes_per_scanline] |
521 | ; mov edx,[BytesPerScanLine] |
522 | ; imul edx,ebx |
522 | ; imul edx,ebx |
523 | ; lea edx,[edx+eax*4] |
523 | ; lea edx,[edx+eax*4] |
524 | ; add edx,[lfb_address] |
524 | ; add edx,[LFBAddress] |
525 | ; test ecx,0x01000000 |
525 | ; test ecx,0x01000000 |
526 | ; jz @f |
526 | ; jz @f |
527 | ; mov ecx,[edx] |
527 | ; mov ecx,[edx] |
528 | ; not ecx |
528 | ; not ecx |
529 | @@: test edi,1 |
529 | @@: test edi,1 |
530 | jnz .forced |
530 | jnz .forced |
531 | mov esi,[0x00003000] |
531 | mov esi,[CURRENT_TASK] |
532 | mov esi,[CLIP_RECTS+esi*4] |
532 | mov esi,[CLIP_RECTS+esi*4] |
533 | mov edi,[esi] |
533 | mov edi,[esi] |
534 | or edi,edi |
534 | or edi,edi |
535 | jz .exit |
535 | jz .exit |
536 | add esi,4 |
536 | add esi,4 |
Line 539... | Line 539... | ||
539 | jif ebx,l,[rr.top],.skip |
539 | jif ebx,l,[rr.top],.skip |
540 | jif ebx,ge,[rr.bottom],.skip |
540 | jif ebx,ge,[rr.bottom],.skip |
541 | call get_cursor_rect |
541 | call get_cursor_rect |
542 | call is_intersect_pt |
542 | call is_intersect_pt |
543 | jc .put |
543 | jc .put |
544 | cmp [mouse_invisible],0 |
544 | cmp byte[MOUSE_VISIBLE],0 |
545 | jne .put |
545 | je .put |
546 | call [SF.draw_mouse_under] |
546 | call [SF.draw_mouse_under] |
547 | mov [mouse_invisible],1 |
547 | mov byte[MOUSE_VISIBLE],0 |
548 | .put:;mov [edx],ecx |
548 | .put:;mov [edx],ecx |
549 | ; mov ax,SegA000 {Calculate Offset} |
549 | ; mov ax,SegA000 {Calculate Offset} |
550 | ; mov es,ax |
550 | ; mov es,ax |
551 | ; mov bx,[y] |
551 | ; mov bx,[y] |
552 | mov edi,ebx |
552 | mov edi,ebx |
553 | shl edi,6 ; 80*y |
553 | shl edi,6 ; 80*y |
554 | shl ebx,4 |
554 | shl ebx,4 |
555 | add edi,ebx |
555 | add edi,ebx |
556 | 556 | ||
557 | push ecx |
557 | push ecx |
558 | mov cl,al |
558 | mov cl,al |
559 | shr eax,3 ; /8 |
559 | shr eax,3 ; /8 |
560 | add edi,eax ; 80*y + (x/8) |
560 | add edi,eax ; 80*y + (x/8) |
561 | 561 | ||
562 | and cl,7 ; Get Bit that Changes |
562 | and cl,7 ; Get Bit that Changes |
563 | mov ax,0x8008 |
563 | mov ax,0x8008 |
564 | shr ah,cl |
564 | shr ah,cl |
565 | mov dx,0x03CE |
565 | mov dx,0x03CE |
566 | out dx,ax |
566 | out dx,ax |
567 | add edi,0x000A0000 |
567 | add edi,VGABasePtr |
Line 568... | Line 568... | ||
568 | 568 | ||
569 | call color_24_to_4_bits |
569 | call color_24_to_4_bits |
570 | mov ah,[edi] ; dummy read |
570 | mov ah,[edi] ; dummy read |
Line 571... | Line 571... | ||
571 | mov [edi],al |
571 | mov [edi],al |
572 | 572 | ||
573 | .exit: |
573 | .exit: |
574 | sti |
574 | sti |
Line 586... | Line 586... | ||
586 | jif ebx,ge,[viewport.bottom],.exit |
586 | jif ebx,ge,[viewport.bottom],.exit |
Line 587... | Line 587... | ||
587 | 587 | ||
588 | ; mov ax,SegA000 {Calculate Offset} |
588 | ; mov ax,SegA000 {Calculate Offset} |
589 | ; mov es,ax |
589 | ; mov es,ax |
590 | ; mov bx,[y] |
590 | ; mov bx,[y] |
591 | mov edi,ebx |
591 | mov edi,ebx |
592 | shl edi,6 ; 80*y |
592 | shl edi,6 ; 80*y |
593 | shl ebx,4 |
593 | shl ebx,4 |
594 | add edi,ebx |
594 | add edi,ebx |
595 | 595 | ||
596 | push ecx |
596 | push ecx |
597 | mov cl,al |
597 | mov cl,al |
598 | shr eax,3 ; /8 |
598 | shr eax,3 ; /8 |
599 | add edi,eax ; 80*y + (x/8) |
599 | add edi,eax ; 80*y + (x/8) |
600 | 600 | ||
601 | and cl,7 ; Get Bit that Changes |
601 | and cl,7 ; Get Bit that Changes |
602 | mov ax,0x8008 |
602 | mov ax,0x8008 |
603 | shr ah,cl |
603 | shr ah,cl |
604 | mov dx,0x03CE |
604 | mov dx,0x03CE |
605 | out dx,ax |
605 | out dx,ax |
Line 606... | Line 606... | ||
606 | add edi,0x000A0000 |
606 | add edi,VGABasePtr |
607 | 607 | ||
608 | pop eax |
608 | pop eax |
609 | call color_24_to_4_bits |
609 | call color_24_to_4_bits |
Line 610... | Line 610... | ||
610 | mov ah,[edi] ; dummy read |
610 | mov ah,[edi] ; dummy read |
611 | mov [edi],al |
611 | mov [edi],al |
612 | 612 | ||
Line 630... | Line 630... | ||
630 | 630 | ||
631 | begin |
631 | begin |
632 | pushad |
632 | pushad |
Line 633... | Line 633... | ||
633 | cli |
633 | cli |
634 | 634 | ||
635 | mov edi,ebx |
635 | mov edi,ebx |
636 | shl edi,6 ; 80*y |
636 | shl edi,6 ; 80*y |
637 | shl ebx,4 |
637 | shl ebx,4 |
638 | add edi,ebx |
638 | add edi,ebx |
639 | mov cl,al |
639 | mov cl,al |
640 | shr eax,3 ; /8 |
640 | shr eax,3 ; /8 |
641 | add edi,eax ; 80*y + (x/8) |
641 | add edi,eax ; 80*y + (x/8) |
642 | add edi,0x000A0000 |
642 | add edi,VGABasePtr |
643 | 643 | ||
644 | and ecx,7 |
644 | and ecx,7 |
645 | neg ecx |
645 | neg ecx |
646 | add cl,7 |
646 | add cl,7 |
647 | mov dx,0x03CE |
647 | mov dx,0x03CE |
648 | xor bl,bl |
648 | xor bl,bl |
649 | mov ah,3 |
649 | mov ah,3 |
650 | @1: |
650 | @1: |
651 | mov al,4 |
651 | mov al,4 |
652 | out dx,al |
652 | out dx,al |
653 | inc dx |
653 | inc dx |
654 | mov al,ah |
654 | mov al,ah |
655 | out dx,al |
655 | out dx,al |
656 | dec dx |
656 | dec dx |
657 | mov al,[edi] |
657 | mov al,[edi] |
658 | shr al,cl |
658 | shr al,cl |
659 | and al,1 |
659 | and al,1 |
660 | xchg cl,ah |
660 | xchg cl,ah |
661 | shl al,cl |
661 | shl al,cl |
662 | xchg cl,ah |
662 | xchg cl,ah |
663 | or bl,al |
663 | or bl,al |
Line 664... | Line 664... | ||
664 | dec ah |
664 | dec ah |
665 | jns @1 |
665 | jns @1 |
666 | 666 | ||
Line 702... | Line 702... | ||
702 | movsx edx,word[esp+4*4] |
702 | movsx edx,word[esp+4*4] |
703 | lea edi,[ecx*3] |
703 | lea edi,[ecx*3] |
704 | push edi |
704 | push edi |
705 | add ecx,eax |
705 | add ecx,eax |
706 | add edx,ebx |
706 | add edx,ebx |
707 | mov edi,[0x00003010] |
707 | mov edi,[TASK_BASE] |
708 | movsx esi,word[edi-0x3000+0] |
708 | movsx esi,word[edi-CURRENT_TASK+0] |
709 | add eax,esi |
709 | add eax,esi |
710 | add ecx,esi |
710 | add ecx,esi |
711 | movsx esi,word[edi-0x3000+4] |
711 | movsx esi,word[edi-CURRENT_TASK+4] |
712 | add ebx,esi |
712 | add ebx,esi |
713 | add edx,esi |
713 | add edx,esi |
714 | ; add eax,[esi-0x3000+0] |
714 | ; add eax,[esi-CURRENT_TASK+0] |
715 | ; add ebx,[esi-0x3000+4] |
715 | ; add ebx,[esi-CURRENT_TASK+4] |
716 | ; add ecx,[esi-0x3000+0] |
716 | ; add ecx,[esi-CURRENT_TASK+0] |
717 | ; add edx,[esi-0x3000+4] |
717 | ; add edx,[esi-CURRENT_TASK+4] |
Line 718... | Line 718... | ||
718 | 718 | ||
719 | mov esi,[0x00003000] |
719 | mov esi,[CURRENT_TASK] |
720 | mov esi,[CLIP_RECTS+esi*4] |
720 | mov esi,[CLIP_RECTS+esi*4] |
721 | mov edi,[esi] |
721 | mov edi,[esi] |
722 | or edi,edi |
722 | or edi,edi |
723 | jz .exit |
723 | jz .exit |
Line 736... | Line 736... | ||
736 | mov ecx,[rr.right] |
736 | mov ecx,[rr.right] |
737 | @@: jif edx,l,[rr.bottom],@f |
737 | @@: jif edx,l,[rr.bottom],@f |
738 | mov edx,[rr.bottom] |
738 | mov edx,[rr.bottom] |
739 | @@: call is_intersect_rc |
739 | @@: call is_intersect_rc |
740 | jc .put |
740 | jc .put |
741 | cmp [mouse_invisible],0 |
741 | cmp byte[MOUSE_VISIBLE],0 |
742 | jne .put |
742 | je .put |
743 | call [SF.draw_mouse_under] |
743 | call [SF.draw_mouse_under] |
744 | mov [mouse_invisible],1 |
744 | mov byte[MOUSE_VISIBLE],0 |
745 | .put: |
745 | .put: |
746 | mov esi,ebx |
746 | mov esi,ebx |
747 | sub esi,[esp+4*4] |
747 | sub esi,[esp+4*4] |
748 | imul esi,[esp+4*8] |
748 | imul esi,[esp+4*8] |
749 | mov edi,eax |
749 | mov edi,eax |
750 | sub edi,[esp+4*7] |
750 | sub edi,[esp+4*7] |
751 | lea edi,[edi*3] |
751 | lea edi,[edi*3] |
752 | add esi,edi |
752 | add esi,edi |
753 | add esi,ebp |
753 | add esi,ebp |
754 | mov edi,ebx |
754 | mov edi,ebx |
755 | mov ebp,ebx |
755 | mov ebp,ebx |
756 | shl edi,6 ; 80*y |
756 | shl edi,6 ; 80*y |
757 | shl ebp,4 |
757 | shl ebp,4 |
758 | add edi,ebp |
758 | add edi,ebp |
759 | add edi,0x000A0000 |
759 | add edi,VGABasePtr |
760 | .xxx: push eax edx esi edi ebx eax |
760 | .xxx: push eax edx esi edi ebx eax |
761 | or ebp,-1 |
761 | or ebp,-1 |
762 | mov edx,0x03CE |
762 | mov edx,0x03CE |
763 | @@: mov eax,[esp] |
763 | @@: mov eax,[esp] |
764 | push ecx edi |
764 | push ecx edi |
765 | mov cl,al |
765 | mov cl,al |
766 | shr eax,3 ; /8 |
766 | shr eax,3 ; /8 |
767 | add edi,eax ; 80*y + (x/8) |
767 | add edi,eax ; 80*y + (x/8) |
768 | 768 | ||
769 | mov eax,0x8008 |
769 | mov eax,0x8008 |
770 | and cl,7 ; Get Bit that Changes |
770 | and cl,7 ; Get Bit that Changes |
771 | shr ah,cl |
771 | shr ah,cl |
772 | out dx,ax |
772 | out dx,ax |
Line 773... | Line 773... | ||
773 | 773 | ||
774 | lodsd |
774 | lodsd |
775 | dec esi |
775 | dec esi |
776 | and eax,0x00FFFFFF |
776 | and eax,0x00FFFFFF |
Line 781... | Line 781... | ||
781 | .ppp: |
781 | .ppp: |
782 | mov ebp,eax |
782 | mov ebp,eax |
783 | call color_24_to_4_bits |
783 | call color_24_to_4_bits |
784 | mov bl,al |
784 | mov bl,al |
785 | .ppp.2: |
785 | .ppp.2: |
786 | mov al,[edi] ; dummy read |
786 | mov al,[edi] ; dummy read |
787 | mov [edi],cl |
787 | mov [edi],cl |
788 | pop edi ecx |
788 | pop edi ecx |
789 | inc dword[esp] |
789 | inc dword[esp] |
790 | cmp [esp],ecx |
790 | cmp [esp],ecx |
791 | jl @b |
791 | jl @b |
792 | pop eax ebx edi esi edx eax |
792 | pop eax ebx edi esi edx eax |
Line 800... | Line 800... | ||
800 | add esi,SR |
800 | add esi,SR |
801 | dec edi |
801 | dec edi |
802 | jnz .nx |
802 | jnz .nx |
Line 803... | Line 803... | ||
803 | 803 | ||
804 | .exit: |
804 | .exit: |
805 | add esp,4 |
805 | add esp,4 |
806 | sti |
806 | sti |
807 | popad |
807 | popad |
808 | xor eax,eax |
808 | xor eax,eax |
809 | retn |
809 | retn |
Line 854... | Line 854... | ||
854 | mov ecx,[rr.right] |
854 | mov ecx,[rr.right] |
855 | @@: jif edx,l,[rr.bottom],@f |
855 | @@: jif edx,l,[rr.bottom],@f |
856 | mov edx,[rr.bottom] |
856 | mov edx,[rr.bottom] |
857 | @@: call is_intersect_rc |
857 | @@: call is_intersect_rc |
858 | jc .put |
858 | jc .put |
859 | cmp [mouse_invisible],0 |
859 | cmp byte[MOUSE_VISIBLE],0 |
860 | jne .put |
860 | je .put |
861 | call [SF.draw_mouse_under] |
861 | call [SF.draw_mouse_under] |
862 | mov [mouse_invisible],1 |
862 | mov byte[MOUSE_VISIBLE],0 |
863 | .put: sub edx,ebx |
863 | .put: sub edx,ebx |
864 | push edx edi ebx eax |
864 | push edx edi ebx eax |
865 | mov edi,ebx |
865 | mov edi,ebx |
866 | shl edi,6 |
866 | shl edi,6 |
867 | shl ebx,4 |
867 | shl ebx,4 |
868 | add edi,ebx |
868 | add edi,ebx |
869 | shr eax,3 |
869 | shr eax,3 |
870 | add edi,eax |
870 | add edi,eax |
871 | add edi,0x000A0000 |
871 | add edi,VGABasePtr |
872 | pop eax ebx |
872 | pop eax ebx |
Line 873... | Line 873... | ||
873 | 873 | ||
874 | mov ebx,eax |
874 | mov ebx,eax |
875 | mov esi,ecx |
875 | mov esi,ecx |
Line 879... | Line 879... | ||
879 | ;edi = Offset in VMem |
879 | ;edi = Offset in VMem |
880 | ;esi = Length |
880 | ;esi = Length |
881 | ;ebx = x |
881 | ;ebx = x |
882 | ; dx = Graphix Controller |
882 | ; dx = Graphix Controller |
Line 883... | Line 883... | ||
883 | 883 | ||
884 | mov cl,bl ; Get StartBit |
884 | mov cl,bl ; Get StartBit |
Line 885... | Line 885... | ||
885 | and ecx,07h |
885 | and ecx,07h |
886 | 886 | ||
887 | mov eax,esi |
887 | mov eax,esi |
888 | add eax,ecx |
888 | add eax,ecx |
889 | cmp eax,8 ; Is x+Length |
889 | cmp eax,8 ; Is x+Length |
890 | jb .D_One |
890 | jb .D_One |
891 | 891 | ||
892 | mov ax,0xff08 ; 11111111b | BitMask Register |
892 | mov ax,0xff08 ; 11111111b | BitMask Register |
893 | shr ah,cl ; BitMask |
893 | shr ah,cl ; BitMask |
894 | out dx,ax ; Write BitMask |
894 | out dx,ax ; Write BitMask |
895 | push ecx |
895 | push ecx |
896 | mov ah,[esp+4] |
896 | mov ah,[esp+4] |
897 | mov ecx,[esp+4+4] |
897 | mov ecx,[esp+4+4] |
898 | push edi |
898 | push edi |
899 | .D_LL: ; Draw Left of Box |
899 | .D_LL: ; Draw Left of Box |
900 | mov al,[edi] |
900 | mov al,[edi] |
901 | mov [edi],ah |
901 | mov [edi],ah |
902 | add edi,80 ; edi:=edi+80 |
902 | add edi,80 ; edi:=edi+80 |
903 | dec ecx |
903 | dec ecx |
904 | jnz .D_LL |
904 | jnz .D_LL |
905 | pop edi |
905 | pop edi |
906 | inc edi |
906 | inc edi |
907 | pop ecx |
907 | pop ecx |
908 | 908 | ||
909 | mov ax,0xFF08 ; BitMask Register |
909 | mov ax,0xFF08 ; BitMask Register |
910 | out dx,ax ; Write BitMask |
910 | out dx,ax ; Write BitMask |
911 | 911 | ||
912 | mov eax,esi |
912 | mov eax,esi |
913 | mov ch,8 |
913 | mov ch,8 |
914 | sub ch,cl |
914 | sub ch,cl |
915 | movzx ecx,ch |
915 | movzx ecx,ch |
Line 916... | Line 916... | ||
916 | sub eax,ecx |
916 | sub eax,ecx |
917 | shr eax,3 ; Length div 8 |
917 | shr eax,3 ; Length div 8 |
918 | 918 | ||
919 | push edi ebx |
919 | push edi ebx |
920 | mov ebx,[esp+8+4] |
920 | mov ebx,[esp+8+4] |
921 | mov edx,eax |
921 | mov edx,eax |
922 | mov al,[esp+8] |
922 | mov al,[esp+8] |
923 | .D_LC: |
923 | .D_LC: |
924 | mov ecx,edx |
924 | mov ecx,edx |
925 | rep stosb |
925 | rep stosb |
926 | add edi,80 |
926 | add edi,80 |
927 | sub edi,edx |
927 | sub edi,edx |
928 | dec ebx |
928 | dec ebx |
929 | jnz .D_LC |
929 | jnz .D_LC |
930 | pop ebx edi |
930 | pop ebx edi |
931 | add edi,edx |
931 | add edi,edx |
932 | 932 | ||
933 | mov ecx,ebx ; ecx:=x+Length |
933 | mov ecx,ebx ; ecx:=x+Length |
934 | add ecx,esi |
934 | add ecx,esi |
935 | and ecx,07h ; ecx and 07 |
935 | and ecx,07h ; ecx and 07 |
936 | mov ah,0ffh |
936 | mov ah,0ffh |
937 | shr ah,cl ; BitMask |
937 | shr ah,cl ; BitMask |
938 | jz .D_End |
938 | jz .D_End |
939 | 939 | ||
940 | not ah |
940 | not ah |
941 | mov al,8 ; BitMask Register |
941 | mov al,8 ; BitMask Register |
942 | mov dx,03ceh ; Graphics Controller |
942 | mov dx,03ceh ; Graphics Controller |
943 | out dx,ax ; Write BitMask |
943 | out dx,ax ; Write BitMask |
944 | mov ecx,[esp+4] |
944 | mov ecx,[esp+4] |
945 | mov al,[esp] |
945 | mov al,[esp] |
946 | .D_LR: |
946 | .D_LR: |
947 | mov ah,[edi] |
947 | mov ah,[edi] |
948 | mov [edi],al |
948 | mov [edi],al |
Line 949... | Line 949... | ||
949 | add edi,80 |
949 | add edi,80 |
Line 950... | Line 950... | ||
950 | dec ecx |
950 | dec ecx |
951 | jnz .D_LR |
951 | jnz .D_LR |
952 | 952 | ||
Line 953... | Line 953... | ||
953 | jmp .D_End |
953 | jmp .D_End |
954 | 954 | ||
955 | .D_One: |
955 | .D_One: |
956 | mov ah,0ffh |
956 | mov ah,0ffh |
957 | shr ah,cl ; Left BitMask |
957 | shr ah,cl ; Left BitMask |
958 | 958 | ||
959 | add ebx,esi |
959 | add ebx,esi |
960 | dec ebx |
960 | dec ebx |
961 | and ebx,07h |
961 | and ebx,07h |
962 | 962 | ||
963 | mov ecx,7 |
963 | mov ecx,7 |
964 | sub ecx,ebx |
964 | sub ecx,ebx |
965 | 965 | ||
966 | mov bl,0ffh |
966 | mov bl,0ffh |
967 | shl bl,cl ; Right BitMask |
967 | shl bl,cl ; Right BitMask |
968 | 968 | ||
969 | and ah,bl ; Full BitMask |
969 | and ah,bl ; Full BitMask |
970 | mov al,8 ; BitMask Register |
970 | mov al,8 ; BitMask Register |
971 | out dx,ax ; Write BitMask |
971 | out dx,ax ; Write BitMask |
972 | mov ecx,[esp+4] |
972 | mov ecx,[esp+4] |
973 | mov al,[esp] |
973 | mov al,[esp] |
974 | .D_L: |
974 | .D_L: |
975 | mov dl,[edi] ; Fill Latches |
975 | mov dl,[edi] ; Fill Latches |
976 | mov [edi],al ; Write Pixel |
976 | mov [edi],al ; Write Pixel |
977 | add edi,80 |
977 | add edi,80 |
978 | dec ecx |
978 | dec ecx |
Line 990... | Line 990... | ||
990 | sti |
990 | sti |
991 | popad |
991 | popad |
992 | retn |
992 | retn |
Line 993... | Line 993... | ||
993 | 993 | ||
994 | .tiled: |
994 | .tiled: |
995 | mov eax,bg_address |
995 | mov eax,IMG_BACKGROUND |
996 | mov ebx,[bg_width-2] |
996 | mov ebx,[bg_width-2] |
997 | mov bx,word[bg_height] |
997 | mov bx,word[bg_height] |
998 | xor ecx,ecx |
998 | xor ecx,ecx |
999 | xor edx,edx |
999 | xor edx,edx |
1000 | .lp1: push eax |
1000 | .lp1: push eax |
1001 | call vm_mike_put_image.04.direct |
1001 | call vm_mike_put_image.04.direct |
1002 | pop eax |
1002 | pop eax |
1003 | add edx,[bg_width] |
1003 | add edx,[bg_width] |
1004 | cmp edx,[screen_width] |
1004 | cmp edx,[ScreenWidth] |
1005 | jae @f |
1005 | jae @f |
1006 | shl edx,16 |
1006 | shl edx,16 |
1007 | add ecx,edx |
1007 | add ecx,edx |
1008 | shr edx,16 |
1008 | shr edx,16 |
1009 | jmp .lp1 |
1009 | jmp .lp1 |
1010 | @@: and ecx,0x0000FFFF |
1010 | @@: and ecx,0x0000FFFF |
1011 | xor edx,edx |
1011 | xor edx,edx |
1012 | add ecx,[bg_height] |
1012 | add ecx,[bg_height] |
1013 | cmp ecx,[screen_height] |
1013 | cmp ecx,[ScreenHeight] |
1014 | jb .lp1 |
1014 | jb .lp1 |
1015 | popad |
1015 | popad |
1016 | retn |
1016 | retn |
1017 | endf |
1017 | endf |