Subversion Repositories Kolibri OS

Rev

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

Rev 2439 Rev 2465
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. 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
;;  VESA20.INC                                                  ;;
6
;;  VESA20.INC                                                  ;;
7
;;                                                              ;;
7
;;                                                              ;;
8
;;  Vesa 2.0 functions for MenuetOS                             ;;
8
;;  Vesa 2.0 functions for MenuetOS                             ;;
Line 15... Line 15...
15
;;                                                              ;;
15
;;                                                              ;;
16
;;  See file COPYING for details                                ;;
16
;;  See file COPYING for details                                ;;
17
;;                                                              ;;
17
;;                                                              ;;
18
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 19... Line 19...
19
 
19
 
Line 20... Line 20...
20
$Revision: 2439 $
20
$Revision: 2465 $
21
 
21
 
Line 51... Line 51...
51
align 4
51
align 4
52
Vesa20_getpixel24:
52
Vesa20_getpixel24:
53
; eax = x
53
; eax = x
54
; ebx = y
54
; ebx = y
55
;--------------------------------------
55
;--------------------------------------
-
 
56
; check for hardware cursor
-
 
57
        cmp     [_display.select_cursor], select_cursor
-
 
58
        je      @f
-
 
59
        cmp     [_display.select_cursor], 0
-
 
60
        jne     .no_mouseunder
-
 
61
;--------------------------------------
-
 
62
align 4
-
 
63
@@:
56
; check mouse area for putpixel
64
; check mouse area for putpixel
57
        test    ecx, 0x04000000  ; don't load to mouseunder area
65
        test    ecx, 0x04000000  ; don't load to mouseunder area
58
        jnz     .no_mouseunder
66
        jnz     .no_mouseunder
59
        call    [_display.check_m_pixel]
67
        call    [_display.check_m_pixel]
60
        test    ecx, ecx        ;0xff000000
68
        test    ecx, ecx        ;0xff000000
61
        jnz     @f
69
        jnz     @f
-
 
70
;--------------------------------------
-
 
71
align 4
62
.no_mouseunder:
72
.no_mouseunder:
63
;--------------------------------------
73
;--------------------------------------
64
        imul    ebx, [BytesPerScanLine] ; ebx = y * y multiplier
74
;        imul    ebx, [BytesPerScanLine] ; ebx = y * y multiplier
-
 
75
        mov     ebx, [d_width_calc_area + ebx*4]
-
 
76
        lea     ebx, [ebx + ebx*2]
65
        lea     edi, [eax+eax*2]; edi = x*3
77
        lea     edi, [eax+eax*2]; edi = x*3
66
        add     edi, ebx      ; edi = x*3+(y*y multiplier)
78
        add     edi, ebx      ; edi = x*3+(y*y multiplier)
67
        mov     ecx, [LFB_BASE+edi]
79
        mov     ecx, [LFB_BASE+edi]
68
;--------------------------------------
80
;--------------------------------------
69
align 4
81
align 4
Line 72... Line 84...
72
        ret
84
        ret
73
;-----------------------------------------------------------------------------
85
;-----------------------------------------------------------------------------
74
align 4
86
align 4
75
Vesa20_getpixel32:
87
Vesa20_getpixel32:
76
;--------------------------------------
88
;--------------------------------------
-
 
89
; check for hardware cursor
-
 
90
        cmp     [_display.select_cursor], select_cursor
-
 
91
        je      @f
-
 
92
        cmp     [_display.select_cursor], 0
-
 
93
        jne     .no_mouseunder
-
 
94
;--------------------------------------
-
 
95
align 4
-
 
96
@@:
77
; check mouse area for putpixel
97
; check mouse area for putpixel
78
        test    ecx, 0x04000000  ; don't load to mouseunder area
98
        test    ecx, 0x04000000  ; don't load to mouseunder area
79
        jnz     .no_mouseunder
99
        jnz     .no_mouseunder
80
        call    [_display.check_m_pixel]
100
        call    [_display.check_m_pixel]
81
        test    ecx, ecx        ;0xff000000
101
        test    ecx, ecx        ;0xff000000
82
        jnz     @f
102
        jnz     @f
-
 
103
;--------------------------------------
-
 
104
align 4
83
.no_mouseunder:
105
.no_mouseunder:
84
;--------------------------------------
106
;--------------------------------------
85
        imul    ebx, [BytesPerScanLine] ; ebx = y * y multiplier
107
;        imul    ebx, [BytesPerScanLine] ; ebx = y * y multiplier
-
 
108
        mov     ebx, [d_width_calc_area + ebx*4]
-
 
109
        shl     ebx, 2
86
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
110
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
87
        mov     ecx, [LFB_BASE+edi]
111
        mov     ecx, [LFB_BASE+edi]
88
;--------------------------------------
112
;--------------------------------------
89
align 4
113
align 4
90
@@:
114
@@:
Line 216... Line 240...
216
        mov     [putimg.screen_newline], eax
240
        mov     [putimg.screen_newline], eax
217
; pointer to image
241
; pointer to image
218
        mov     esi, [putimg.pti]
242
        mov     esi, [putimg.pti]
219
; pointer to screen
243
; pointer to screen
220
        mov     edx, [putimg.abs_cy]
244
        mov     edx, [putimg.abs_cy]
221
        imul    edx, [BytesPerScanLine]
245
;        imul    edx, [BytesPerScanLine]
-
 
246
 
-
 
247
        mov     edx, [d_width_calc_area + edx*4]
-
 
248
        cmp     bl, 4
-
 
249
        je      .32
-
 
250
        lea     edx, [edx+edx*2]
-
 
251
        jmp     @f
-
 
252
;-------------------------------------
-
 
253
align 4
-
 
254
.32:
-
 
255
        shl     edx, 2
-
 
256
;-------------------------------------
-
 
257
align 4
-
 
258
@@:
222
        mov     eax, [putimg.abs_cx]
259
        mov     eax, [putimg.abs_cx]
223
        movzx   ebx, byte [ScreenBPP]
260
;        movzx   ebx, byte [ScreenBPP]
224
        shr     ebx, 3
261
;        shr     ebx, 3
225
        imul    eax, ebx
262
        imul    eax, ebx
226
        add     edx, eax
263
        add     edx, eax
227
; pointer to pixel map
264
; pointer to pixel map
228
        mov     eax, [putimg.abs_cy]
265
        mov     eax, [putimg.abs_cy]
229
        imul    eax, [Screen_Max_X]
266
;        imul    eax, [Screen_Max_X]
230
        add     eax, [putimg.abs_cy]
267
;        add     eax, [putimg.abs_cy]
-
 
268
        mov     eax, [d_width_calc_area + eax*4]
-
 
269
 
231
        add     eax, [putimg.abs_cx]
270
        add     eax, [putimg.abs_cx]
232
        add     eax, [_WinMapAddress]
271
        add     eax, [_WinMapAddress]
233
        xchg    eax, ebp
272
        xchg    eax, ebp
234
;--------------------------------------
273
;--------------------------------------
235
        mov     ecx, [putimg.real_sx]
274
        mov     ecx, [putimg.real_sx]
Line 244... Line 283...
244
        cmp     byte [ScreenBPP], 32
283
        cmp     byte [ScreenBPP], 32
245
        je      put_image_end_32
284
        je      put_image_end_32
246
;--------------------------------------
285
;--------------------------------------
247
put_image_end_24:
286
put_image_end_24:
248
        mov     edi, [putimg.real_sy]
287
        mov     edi, [putimg.real_sy]
-
 
288
;--------------------------------------
-
 
289
; check for hardware cursor
249
        cmp     [_display.select_cursor], 0
290
        mov     ecx, [_display.select_cursor]
-
 
291
        cmp     ecx, select_cursor
250
        jne     put_image_end_24_new
292
        je      put_image_end_24_new
-
 
293
        cmp     ecx, 0
-
 
294
        je      put_image_end_24_old
-
 
295
;--------------------------------------
-
 
296
align 4
-
 
297
.new_line:
-
 
298
        mov     ecx, [putimg.real_sx]
-
 
299
;--------------------------------------
-
 
300
align 4
-
 
301
.new_x:
-
 
302
        push    [putimg.edi]
-
 
303
        mov     eax, [putimg.ebp+4]
-
 
304
        call    eax
-
 
305
        cmp     [ebp], bl
-
 
306
        jne     .skip
-
 
307
;--------------------------------------
-
 
308
; store to real LFB
-
 
309
        mov     [LFB_BASE+edx], ax
-
 
310
        shr     eax, 16
-
 
311
        mov     [LFB_BASE+edx+2], al
-
 
312
;--------------------------------------
-
 
313
align 4
-
 
314
.skip:
-
 
315
        add     edx, 3
-
 
316
        inc     ebp
-
 
317
        dec     ecx
-
 
318
        jnz     .new_x
-
 
319
 
-
 
320
        add     esi, [putimg.line_increment]
-
 
321
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
-
 
322
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
-
 
323
 
-
 
324
        cmp     [putimg.ebp], putimage_get1bpp
-
 
325
        jz      .correct
-
 
326
        cmp     [putimg.ebp], putimage_get2bpp
-
 
327
        jz      .correct
-
 
328
        cmp     [putimg.ebp], putimage_get4bpp
-
 
329
        jnz     @f
-
 
330
;--------------------------------------
-
 
331
align 4
-
 
332
.correct:
-
 
333
        mov     eax, [putimg.edi]
-
 
334
        mov     byte [eax], 80h
-
 
335
;--------------------------------------
-
 
336
align 4
-
 
337
@@:
-
 
338
        dec     edi
-
 
339
        jnz     .new_line
-
 
340
;--------------------------------------
-
 
341
align 4
-
 
342
.finish:
-
 
343
        add     esp, putimg.stack_data
-
 
344
        popad
-
 
345
        ret
-
 
346
;------------------------------------------------------------------------------
-
 
347
align 4
-
 
348
put_image_end_24_old:
251
;--------------------------------------
349
;--------------------------------------
252
align 4
350
align 4
253
.new_line:
351
.new_line:
254
        mov     ecx, [putimg.real_sx]
352
        mov     ecx, [putimg.real_sx]
255
;--------------------------------------
353
;--------------------------------------
Line 302... Line 400...
302
;--------------------------------------
400
;--------------------------------------
303
align 4
401
align 4
304
@@:
402
@@:
305
        dec     edi
403
        dec     edi
306
        jnz     .new_line
404
        jnz     .new_line
307
;--------------------------------------
-
 
308
align 4
-
 
309
.finish:
-
 
310
        add     esp, putimg.stack_data
405
        jmp     put_image_end_24.finish
311
        popad
-
 
312
        ret
-
 
313
;--------------------------------------
406
;------------------------------------------------------------------------------
314
align 4
407
align 4
315
put_image_end_24_new:
408
put_image_end_24_new:
316
;--------------------------------------
409
;--------------------------------------
317
align 4
410
align 4
318
.new_line:
411
.new_line:
Line 389... Line 482...
389
        jmp     put_image_end_24.finish
482
        jmp     put_image_end_24.finish
390
;------------------------------------------------------------------------------
483
;------------------------------------------------------------------------------
391
align 4
484
align 4
392
put_image_end_32:
485
put_image_end_32:
393
        mov     edi, [putimg.real_sy]
486
        mov     edi, [putimg.real_sy]
-
 
487
;--------------------------------------
-
 
488
; check for hardware cursor
394
        cmp     [_display.select_cursor], 0
489
        mov     ecx, [_display.select_cursor]
-
 
490
        cmp     ecx, select_cursor
395
        jne     put_image_end_32_new
491
        je      put_image_end_32_new
-
 
492
        cmp     ecx, 0
-
 
493
        je      put_image_end_32_old
396
;--------------------------------------
494
;--------------------------------------
397
align 4
495
align 4
398
.new_line:
496
.new_line:
399
        mov     ecx, [putimg.real_sx]
497
        mov     ecx, [putimg.real_sx]
400
;--------------------------------------
498
;--------------------------------------
Line 404... Line 502...
404
        mov     eax, [putimg.ebp+4]
502
        mov     eax, [putimg.ebp+4]
405
        call    eax
503
        call    eax
406
        cmp     [ebp], bl
504
        cmp     [ebp], bl
407
        jne     .skip
505
        jne     .skip
408
;--------------------------------------
506
;--------------------------------------
409
        push    ecx
-
 
410
 
-
 
411
        neg     ecx
-
 
412
        add     ecx, [putimg.real_sx_and_abs_cx + 4]
-
 
413
        shl     ecx, 16
-
 
414
        add     ecx, [putimg.real_sy_and_abs_cy + 4]
-
 
415
        sub     ecx, edi
-
 
416
 
-
 
417
; check mouse area for putpixel
-
 
418
        call    check_mouse_area_for_putpixel
-
 
419
        pop     ecx
-
 
420
; store to real LFB
507
; store to real LFB
421
        mov     [LFB_BASE+edx], eax
508
        mov     [LFB_BASE+edx], eax
422
;--------------------------------------
509
;--------------------------------------
423
align 4
510
align 4
424
.skip:
511
.skip:
Line 458... Line 545...
458
;--------------------------------------
545
;--------------------------------------
459
align 4
546
align 4
460
@@:
547
@@:
461
        mov     [EGA_counter], 1
548
        mov     [EGA_counter], 1
462
        ret
549
        ret
-
 
550
;------------------------------------------------------------------------------
-
 
551
align 4
-
 
552
put_image_end_32_old:
-
 
553
;--------------------------------------
-
 
554
align 4
-
 
555
.new_line:
-
 
556
        mov     ecx, [putimg.real_sx]
-
 
557
;--------------------------------------
-
 
558
align 4
-
 
559
.new_x:
-
 
560
        push    [putimg.edi]
-
 
561
        mov     eax, [putimg.ebp+4]
-
 
562
        call    eax
-
 
563
        cmp     [ebp], bl
-
 
564
        jne     .skip
-
 
565
;--------------------------------------
-
 
566
        push    ecx
-
 
567
 
-
 
568
        neg     ecx
-
 
569
        add     ecx, [putimg.real_sx_and_abs_cx + 4]
-
 
570
        shl     ecx, 16
-
 
571
        add     ecx, [putimg.real_sy_and_abs_cy + 4]
-
 
572
        sub     ecx, edi
-
 
573
 
-
 
574
; check mouse area for putpixel
-
 
575
        call    check_mouse_area_for_putpixel
-
 
576
        pop     ecx
-
 
577
; store to real LFB
-
 
578
        mov     [LFB_BASE+edx], eax
-
 
579
;--------------------------------------
-
 
580
align 4
-
 
581
.skip:
-
 
582
        add     edx, 4
-
 
583
        inc     ebp
-
 
584
        dec     ecx
-
 
585
        jnz     .new_x
-
 
586
 
-
 
587
        add     esi, [putimg.line_increment]
-
 
588
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
-
 
589
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
-
 
590
 
-
 
591
        cmp     [putimg.ebp], putimage_get1bpp
-
 
592
        jz      .correct
-
 
593
        cmp     [putimg.ebp], putimage_get2bpp
-
 
594
        jz      .correct
-
 
595
        cmp     [putimg.ebp], putimage_get4bpp
-
 
596
        jnz     @f
-
 
597
;--------------------------------------
-
 
598
align 4
-
 
599
.correct:
-
 
600
        mov     eax, [putimg.edi]
-
 
601
        mov     byte [eax], 80h
463
;--------------------------------------
602
;--------------------------------------
464
align 4
603
align 4
-
 
604
@@:
-
 
605
        dec     edi
-
 
606
        jnz     .new_line
-
 
607
        jmp     put_image_end_32.finish
-
 
608
;------------------------------------------------------------------------------
-
 
609
align 4
465
put_image_end_32_new:
610
put_image_end_32_new:
466
;--------------------------------------
611
;--------------------------------------
467
align 4
612
align 4
468
.new_line:
613
.new_line:
469
        mov     ecx, [putimg.real_sx]
614
        mov     ecx, [putimg.real_sx]
Line 592... Line 737...
592
; ebx = y
737
; ebx = y
593
        mov     ecx, eax
738
        mov     ecx, eax
594
        shl     ecx, 16
739
        shl     ecx, 16
595
        mov     cx, bx
740
        mov     cx, bx
Line 596... Line 741...
596
 
741
 
-
 
742
;        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
-
 
743
        mov     ebx, [d_width_calc_area + ebx*4]
-
 
744
        lea     ebx, [ebx + ebx*2]
597
        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
745
 
598
        lea     edi, [eax+eax*2]; edi = x*3
746
        lea     edi, [eax+eax*2]; edi = x*3
599
        mov     eax, [esp+32-8+4]
747
        mov     eax, [esp+32-8+4]
-
 
748
;--------------------------------------
-
 
749
; check for hardware cursor
-
 
750
        cmp     [_display.select_cursor], 0
600
;--------------------------------------
751
        jne     @f
601
; check mouse area for putpixel
752
; check mouse area for putpixel
602
        test    eax, 0x04000000
753
        test    eax, 0x04000000
603
        jnz     @f
754
        jnz     @f
604
        call    check_mouse_area_for_putpixel
755
        call    check_mouse_area_for_putpixel
Line 617... Line 768...
617
; ebx = y
768
; ebx = y
618
        mov     ecx, eax
769
        mov     ecx, eax
619
        shl     ecx, 16
770
        shl     ecx, 16
620
        mov     cx, bx
771
        mov     cx, bx
Line 621... Line 772...
621
 
772
 
-
 
773
;        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
-
 
774
        mov     ebx, [d_width_calc_area + ebx*4]
-
 
775
        lea     ebx, [ebx + ebx*2]
622
        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
776
 
623
        lea     edi, [eax+eax*2]; edi = x*3
777
        lea     edi, [eax+eax*2]; edi = x*3
624
        mov     eax, [esp+32-8+4]
778
        mov     eax, [esp+32-8+4]
-
 
779
;--------------------------------------
-
 
780
; check for hardware cursor
-
 
781
        cmp     [_display.select_cursor], select_cursor
625
;--------------------------------------
782
        jne     @f
626
; check mouse area for putpixel
783
; check mouse area for putpixel
627
        test    eax, 0x04000000
784
        test    eax, 0x04000000
628
        jnz     @f
785
        jnz     @f
629
;--------------------------------------
786
;--------------------------------------
Line 659... Line 816...
659
; ebx = y
816
; ebx = y
660
        mov     ecx, eax
817
        mov     ecx, eax
661
        shl     ecx, 16
818
        shl     ecx, 16
662
        mov     cx, bx
819
        mov     cx, bx
Line 663... Line 820...
663
 
820
 
-
 
821
;        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
-
 
822
        mov     ebx, [d_width_calc_area + ebx*4]
-
 
823
        shl     ebx, 2
664
        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
824
 
665
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
825
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
666
        mov     eax, [esp+32-8+4]; eax = color
826
        mov     eax, [esp+32-8+4]; eax = color
-
 
827
;--------------------------------------
-
 
828
; check for hardware cursor
-
 
829
        cmp     [_display.select_cursor], 0
667
;--------------------------------------
830
        jne     @f
668
; check mouse area for putpixel
831
; check mouse area for putpixel
669
        test    eax, 0x04000000
832
        test    eax, 0x04000000
670
        jnz     @f
833
        jnz     @f
671
        call    check_mouse_area_for_putpixel
834
        call    check_mouse_area_for_putpixel
Line 683... Line 846...
683
; ebx = y
846
; ebx = y
684
        mov     ecx, eax
847
        mov     ecx, eax
685
        shl     ecx, 16
848
        shl     ecx, 16
686
        mov     cx, bx
849
        mov     cx, bx
Line 687... Line 850...
687
 
850
 
-
 
851
;        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
-
 
852
        mov     ebx, [d_width_calc_area + ebx*4]
-
 
853
        shl     ebx, 2
688
        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
854
 
689
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
855
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
690
        mov     eax, [esp+32-8+4]; eax = color
856
        mov     eax, [esp+32-8+4]; eax = color
-
 
857
;--------------------------------------
-
 
858
; check for hardware cursor
-
 
859
        cmp     [_display.select_cursor], select_cursor
691
;--------------------------------------
860
        jne     @f
692
; check mouse area for putpixel
861
; check mouse area for putpixel
693
        test    eax, 0x04000000
862
        test    eax, 0x04000000
694
        jnz     @f
863
        jnz     @f
695
;--------------------------------------
864
;--------------------------------------
Line 718... Line 887...
718
        mov     [LFB_BASE+edi], eax
887
        mov     [LFB_BASE+edi], eax
719
        ret
888
        ret
720
;-----------------------------------------------------------------------------
889
;-----------------------------------------------------------------------------
721
align 4
890
align 4
722
calculate_edi:
891
calculate_edi:
723
        mov     edi, ebx
892
;        mov     edi, ebx
724
        imul    edi, [Screen_Max_X]
893
;        imul    edi, [Screen_Max_X]
725
        add     edi, ebx
894
;        add     edi, ebx
-
 
895
        mov     edi, [d_width_calc_area + ebx*4]
726
        add     edi, eax
896
        add     edi, eax
727
        ret
897
        ret
728
;-----------------------------------------------------------------------------
898
;-----------------------------------------------------------------------------
729
; DRAWLINE
899
; DRAWLINE
730
;-----------------------------------------------------------------------------
900
;-----------------------------------------------------------------------------
Line 858... Line 1028...
858
.y_rules:
1028
.y_rules:
859
        mov     eax, [dl_x1]
1029
        mov     eax, [dl_x1]
860
        mov     ebx, [dl_y1]
1030
        mov     ebx, [dl_y1]
861
        shl     eax, 16
1031
        shl     eax, 16
862
        shl     ebx, 16
1032
        shl     ebx, 16
-
 
1033
 
-
 
1034
        and     ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
863
;-----------------------------------------------------------------------------
1035
;-----------------------------------------------------------------------------
864
align 4
1036
align 4
865
.draw:
1037
.draw:
866
        push    eax ebx
1038
        push    eax ebx
867
;--------------------------------------
1039
;--------------------------------------
Line 882... Line 1054...
882
;--------------------------------------
1054
;--------------------------------------
883
align 4
1055
align 4
884
@@:
1056
@@:
885
;--------------------------------------
1057
;--------------------------------------
886
        shr     ebx, 16
1058
        shr     ebx, 16
887
        and     ecx, 0xFBFFFFFF  ;negate 0x04000000 save to mouseunder area
1059
;        and     ecx, 0xFBFFFFFF  ;negate 0x04000000 save to mouseunder area
888
        call    [putpixel]
1060
;        call    [putpixel]
-
 
1061
        call    __sys_putpixel
889
        pop     ebx eax
1062
        pop     ebx eax
890
        add     ebx, ebp     ; y = y+dy
1063
        add     ebx, ebp     ; y = y+dy
891
        add     eax, esi     ; x = x+dx
1064
        add     eax, esi     ; x = x+dx
892
        dec     edx
1065
        dec     edx
893
        jnz     .draw
1066
        jnz     .draw
894
; force last drawn pixel to be at (x2,y2)
1067
; force last drawn pixel to be at (x2,y2)
895
        mov     eax, [dl_x2]
1068
        mov     eax, [dl_x2]
896
        mov     ebx, [dl_y2]
1069
        mov     ebx, [dl_y2]
897
        and     ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
1070
;        and     ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
898
        call    [putpixel]
1071
;        call    [putpixel]
-
 
1072
        call    __sys_putpixel
899
;--------------------------------------
1073
;--------------------------------------
900
align 4
1074
align 4
901
.exit:
1075
.exit:
902
        add     esp, 6*4
1076
        add     esp, 6*4
903
        popa
1077
        popa
Line 918... Line 1092...
918
        xchg    eax, edx
1092
        xchg    eax, edx
919
;--------------------------------------
1093
;--------------------------------------
920
align 4
1094
align 4
921
@@:
1095
@@:
922
        and     ecx, 0xFBFFFFFF  ;negate 0x04000000 save to mouseunder area
1096
        and     ecx, 0xFBFFFFFF  ;negate 0x04000000 save to mouseunder area
-
 
1097
;--------------------------------------
-
 
1098
align 4
-
 
1099
@@:
923
        call    [putpixel]
1100
;        call    [putpixel]
-
 
1101
        call    __sys_putpixel
924
        inc     eax
1102
        inc     eax
925
        cmp     eax, edx
1103
        cmp     eax, edx
926
        jle     @b
1104
        jle     @b
927
        pop     edx eax
1105
        pop     edx eax
928
        ret
1106
        ret
Line 941... Line 1119...
941
        xchg    ebx, edx
1119
        xchg    ebx, edx
942
;--------------------------------------
1120
;--------------------------------------
943
align 4
1121
align 4
944
@@:
1122
@@:
945
        and     ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
1123
        and     ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
-
 
1124
;--------------------------------------
-
 
1125
align 4
-
 
1126
@@:
946
        call    [putpixel]
1127
;        call    [putpixel]
-
 
1128
        call    __sys_putpixel
947
        inc     ebx
1129
        inc     ebx
948
        cmp     ebx, edx
1130
        cmp     ebx, edx
949
        jle     @b
1131
        jle     @b
950
        pop     edx ebx
1132
        pop     edx ebx
951
        ret
1133
        ret
Line 1053... Line 1235...
1053
        neg     eax
1235
        neg     eax
1054
        add     eax, [BytesPerScanLine]
1236
        add     eax, [BytesPerScanLine]
1055
        mov     [drbar.line_inc_scr], eax
1237
        mov     [drbar.line_inc_scr], eax
1056
; pointer to screen
1238
; pointer to screen
1057
        mov     edx, [drbar.abs_cy]
1239
        mov     edx, [drbar.abs_cy]
1058
        imul    edx, [BytesPerScanLine]
1240
;        imul    edx, [BytesPerScanLine]
-
 
1241
 
-
 
1242
        mov     edx, [d_width_calc_area + edx*4]
-
 
1243
        cmp     bl, 4
-
 
1244
        je      .32
-
 
1245
        lea     edx, [edx+edx*2]
-
 
1246
        jmp     @f
-
 
1247
;-------------------------------------
-
 
1248
align 4
-
 
1249
.32:
-
 
1250
        shl     edx, 2
-
 
1251
;-------------------------------------
-
 
1252
align 4
-
 
1253
@@:
1059
        mov     eax, [drbar.abs_cx]
1254
        mov     eax, [drbar.abs_cx]
1060
;     movzx   ebx, byte [ScreenBPP]
-
 
1061
;     shr     ebx, 3
-
 
1062
        imul    eax, ebx
1255
        imul    eax, ebx
1063
        add     edx, eax
1256
        add     edx, eax
1064
; pointer to pixel map
1257
; pointer to pixel map
1065
        mov     eax, [drbar.abs_cy]
1258
        mov     eax, [drbar.abs_cy]
1066
        imul    eax, [Screen_Max_X]
1259
;        imul    eax, [Screen_Max_X]
1067
        add     eax, [drbar.abs_cy]
1260
;        add     eax, [drbar.abs_cy]
-
 
1261
        mov     eax, [d_width_calc_area + eax*4]
-
 
1262
 
1068
        add     eax, [drbar.abs_cx]
1263
        add     eax, [drbar.abs_cx]
1069
        add     eax, [_WinMapAddress]
1264
        add     eax, [_WinMapAddress]
1070
        xchg    eax, ebp
1265
        xchg    eax, ebp
1071
;--------------------------------------
1266
;--------------------------------------
1072
        mov     ebx, [drbar.real_sx]
1267
        mov     ebx, [drbar.real_sx]
Line 1077... Line 1272...
1077
        mov     [drbar.real_sy_and_abs_cy], ebx
1272
        mov     [drbar.real_sy_and_abs_cy], ebx
Line 1078... Line 1273...
1078
 
1273
 
1079
        add     edx, LFB_BASE
1274
        add     edx, LFB_BASE
1080
;--------------------------------------
1275
;--------------------------------------
-
 
1276
; get process number
1081
; get process number
1277
        mov     ebx, [CURRENT_TASK]  ; bl - process num
-
 
1278
        mov     esi, [drbar.real_sy]
-
 
1279
        mov     eax, [drbar.color] ; BBGGRR00
-
 
1280
        rol     eax, 8
-
 
1281
        mov     bh, al  ; 0x80 drawing gradient bars
1082
        mov     ebx, [CURRENT_TASK]
1282
        ror     eax, 8
1083
        cmp     byte [ScreenBPP], 24
1283
        cmp     byte [ScreenBPP], 24
1084
        jne     draw_bar_end_32
1284
        jne     draw_bar_end_32
1085
;--------------------------------------
1285
;--------------------------------------
1086
align 4
1286
align 4
1087
draw_bar_end_24:
-
 
1088
        mov     eax, [drbar.color] ;; BBGGRR00
-
 
1089
        mov     bh, al             ;; bh  = BB
-
 
1090
        shr     eax, 8             ;; eax = RRGG
1287
draw_bar_end_24:
1091
; eax - color high   RRGG
1288
; eax - color high   RRGGBB
1092
; bl - process num
-
 
1093
; bh - color low    BB
1289
; bl - process num
1094
; ecx - temp
1290
; ecx - temp
1095
; edx - pointer to screen
1291
; edx - pointer to screen
1096
; esi - counter
1292
; esi - counter
-
 
1293
; edi - counter
-
 
1294
;--------------------------------------
1097
; edi - counter
1295
; check for hardware cursor
1098
        mov     esi, [drbar.real_sy]
1296
        mov     ecx, [_display.select_cursor]
1099
        cmp     [_display.select_cursor], 0
1297
        cmp     ecx, select_cursor
-
 
1298
        je      draw_bar_end_24_new
-
 
1299
        cmp     ecx, 0
1100
        jne     draw_bar_end_24_new
1300
        je      draw_bar_end_24_old
1101
;--------------------------------------
1301
;--------------------------------------
1102
align 4
1302
align 4
1103
.new_y:
1303
.new_y:
1104
        mov     edi, [drbar.real_sx]
1304
        mov     edi, [drbar.real_sx]
1105
;--------------------------------------
1305
;--------------------------------------
1106
align 4
1306
align 4
1107
.new_x:
1307
.new_x:
1108
        cmp     byte [ebp], bl
1308
        cmp     byte [ebp], bl
1109
        jne     .skip
1309
        jne     .skip
1110
;--------------------------------------
-
 
1111
        push    eax
-
 
1112
 
-
 
1113
        mov     ecx, [drbar.real_sx_and_abs_cx + 4]
-
 
1114
        sub     ecx, edi
-
 
1115
        shl     ecx, 16
-
 
1116
        add     ecx, [drbar.real_sy_and_abs_cy + 4]
-
 
1117
        sub     ecx, esi
-
 
1118
 
-
 
1119
        shl     eax, 8
-
 
1120
        mov     al, bh
-
 
1121
; check mouse area for putpixel
-
 
1122
        call    check_mouse_area_for_putpixel
1310
;--------------------------------------
1123
; store to real LFB
1311
; store to real LFB
1124
        mov     [edx], ax
1312
        mov     [edx], ax
1125
        shr     eax, 16
1313
        shr     eax, 16
1126
        mov     [edx + 2], al
-
 
1127
        pop     eax
1314
        mov     [edx + 2], al
1128
;--------------------------------------
1315
;--------------------------------------
1129
align 4
1316
align 4
1130
.skip:
1317
.skip:
1131
; add pixel
1318
; add pixel
Line 1134... Line 1321...
1134
        dec     edi
1321
        dec     edi
1135
        jnz     .new_x
1322
        jnz     .new_x
1136
; add line
1323
; add line
1137
        add     edx, [drbar.line_inc_scr]
1324
        add     edx, [drbar.line_inc_scr]
1138
        add     ebp, [drbar.line_inc_map]
1325
        add     ebp, [drbar.line_inc_map]
1139
;  drawing gradient bars
1326
; drawing gradient bars
1140
        test    eax, 0x00800000
1327
        test    bh, 0x80
1141
        jz      @f
1328
        jz      @f
1142
        test    bh, bh
1329
        test    al, al
1143
        jz      @f
1330
        jz      @f
1144
        dec     bh
1331
        dec     al
1145
;--------------------------------------
1332
;--------------------------------------
1146
align 4
1333
align 4
1147
@@:
1334
@@:
1148
; 
-
 
1149
        dec     esi
1335
        dec     esi
1150
        jnz     .new_y
1336
        jnz     .new_y
1151
;--------------------------------------
1337
;--------------------------------------
1152
align 4
1338
align 4
1153
.end:
1339
.end:
1154
        add     esp, drbar.stack_data
1340
        add     esp, drbar.stack_data
1155
        popad
1341
        popad
1156
        xor     eax, eax
1342
        xor     eax, eax
1157
        ret
1343
        ret
-
 
1344
;------------------------------------------------------------------------------
-
 
1345
align 4
-
 
1346
draw_bar_end_24_old:
-
 
1347
;--------------------------------------
-
 
1348
align 4
-
 
1349
.new_y:
-
 
1350
        mov     edi, [drbar.real_sx]
-
 
1351
;--------------------------------------
-
 
1352
align 4
-
 
1353
.new_x:
-
 
1354
        cmp     byte [ebp], bl
-
 
1355
        jne     .skip
-
 
1356
;--------------------------------------
-
 
1357
        mov     ecx, [drbar.real_sx_and_abs_cx]
-
 
1358
        sub     ecx, edi
-
 
1359
        shl     ecx, 16
-
 
1360
        add     ecx, [drbar.real_sy_and_abs_cy]
-
 
1361
        sub     ecx, esi
-
 
1362
; check mouse area for putpixel
-
 
1363
        call    check_mouse_area_for_putpixel
-
 
1364
; store to real LFB
-
 
1365
        mov     [edx], ax
-
 
1366
        shr     eax, 16
-
 
1367
        mov     [edx + 2], al
-
 
1368
        mov     eax, [drbar.color]
-
 
1369
;--------------------------------------
-
 
1370
align 4
-
 
1371
.skip:
-
 
1372
; add pixel
-
 
1373
        add     edx, 3
-
 
1374
        inc     ebp
-
 
1375
        dec     edi
-
 
1376
        jnz     .new_x
-
 
1377
; add line
-
 
1378
        add     edx, [drbar.line_inc_scr]
-
 
1379
        add     ebp, [drbar.line_inc_map]
-
 
1380
; drawing gradient bars
-
 
1381
        test    bh, 0x80
-
 
1382
        jz      @f
-
 
1383
        test    al, al
-
 
1384
        jz      @f
-
 
1385
        dec     al
1158
;--------------------------------------
1386
;--------------------------------------
1159
align 4
1387
align 4
-
 
1388
@@:
-
 
1389
        dec     esi
-
 
1390
        jnz     .new_y
-
 
1391
        jmp     draw_bar_end_24.end
-
 
1392
;------------------------------------------------------------------------------
-
 
1393
align 4
1160
draw_bar_end_24_new:
1394
draw_bar_end_24_new:
1161
;--------------------------------------
1395
;--------------------------------------
1162
align 4
1396
align 4
1163
.new_y:
1397
.new_y:
1164
        mov     edi, [drbar.real_sx]
1398
        mov     edi, [drbar.real_sx]
Line 1188... Line 1422...
1188
 
1422
 
1189
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
1423
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
1190
        jae     .no_mouse_area
1424
        jae     .no_mouse_area
1191
;--------------------------------------
1425
;--------------------------------------
1192
; check mouse area for putpixel
-
 
1193
        push    eax
-
 
1194
 
-
 
1195
        shl     eax, 8
-
 
1196
        mov     al, bh
-
 
1197
 
1426
; check mouse area for putpixel
1198
        call    check_mouse_area_for_putpixel_new.1
-
 
1199
; store to real LFB
1427
        call    check_mouse_area_for_putpixel_new.1
1200
        mov     [edx], ax
1428
        mov     [edx], ax
1201
        shr     eax, 16
1429
        shr     eax, 16
1202
        mov     [edx + 2], al
1430
        mov     [edx + 2], al
1203
        pop     eax
1431
        mov     eax, [drbar.color]
1204
        jmp     .skip
1432
        jmp     .skip
1205
; store to real LFB
1433
; store to real LFB
1206
;--------------------------------------
1434
;--------------------------------------
1207
align 4
1435
align 4
1208
.no_mouse_area:
1436
.no_mouse_area:
-
 
1437
        mov     [edx], ax
1209
        mov     [edx], bh
1438
        ror     eax, 16
-
 
1439
        mov     [edx + 2], al
1210
        mov     [edx + 1], ax
1440
        rol     eax, 16
1211
;--------------------------------------
1441
;--------------------------------------
1212
align 4
1442
align 4
1213
.skip:
1443
.skip:
1214
; add pixel
1444
; add pixel
Line 1217... Line 1447...
1217
        dec     edi
1447
        dec     edi
1218
        jnz     .new_x
1448
        jnz     .new_x
1219
; add line
1449
; add line
1220
        add     edx, [drbar.line_inc_scr]
1450
        add     edx, [drbar.line_inc_scr]
1221
        add     ebp, [drbar.line_inc_map]
1451
        add     ebp, [drbar.line_inc_map]
1222
;  drawing gradient bars
1452
; drawing gradient bars
1223
        test    eax, 0x00800000
1453
        test    bh, 0x80
1224
        jz      @f
1454
        jz      @f
1225
        test    bh, bh
1455
        test    al, al
1226
        jz      @f
1456
        jz      @f
1227
        dec     bh
1457
        dec     al
1228
;--------------------------------------
1458
;--------------------------------------
1229
align 4
1459
align 4
1230
@@:
1460
@@:
1231
; 
-
 
1232
        dec     esi
1461
        dec     esi
1233
        jnz     .new_y
1462
        jnz     .new_y
1234
        jmp     draw_bar_end_24.end
1463
        jmp     draw_bar_end_24.end
1235
;--------------------------------------
1464
;------------------------------------------------------------------------------
1236
align 4
1465
align 4
1237
draw_bar_end_32:
1466
draw_bar_end_32:
1238
        mov     eax, [drbar.color] ;; BBGGRR00
1467
; eax - color high   RRGGBB
-
 
1468
; bl - process num
-
 
1469
; ecx - temp
-
 
1470
; edx - pointer to screen
-
 
1471
; esi - counter
-
 
1472
; edi - counter
-
 
1473
;--------------------------------------
-
 
1474
; check for hardware cursor
1239
        mov     esi, [drbar.real_sy]
1475
        mov     ecx, [_display.select_cursor]
1240
        cmp     [_display.select_cursor], 0
1476
        cmp     ecx, select_cursor
1241
        jne     draw_bar_end_32_new
1477
        je      draw_bar_end_32_new
-
 
1478
        cmp     ecx, 0
-
 
1479
        je      draw_bar_end_32_old
1242
;--------------------------------------
1480
;--------------------------------------
1243
align 4
1481
align 4
1244
.new_y:
1482
.new_y:
1245
        mov     edi, [drbar.real_sx]
1483
        mov     edi, [drbar.real_sx]
1246
;--------------------------------------
1484
;--------------------------------------
1247
align 4
1485
align 4
1248
.new_x:
1486
.new_x:
1249
        cmp     byte [ebp], bl
1487
        cmp     byte [ebp], bl
1250
        jne     .skip
1488
        jne     .skip
1251
;--------------------------------------
1489
;--------------------------------------
1252
        push    eax
-
 
1253
 
-
 
1254
        mov     ecx, [drbar.real_sx_and_abs_cx + 4]
-
 
1255
        sub     ecx, edi
-
 
1256
        shl     ecx, 16
-
 
1257
        add     ecx, [drbar.real_sy_and_abs_cy + 4]
-
 
1258
        sub     ecx, esi
-
 
1259
 
-
 
1260
; check mouse area for putpixel
-
 
1261
        call    check_mouse_area_for_putpixel
-
 
1262
; store to real LFB
1490
; store to real LFB
1263
        mov     [edx], eax
1491
        mov     [edx], eax
1264
        pop     eax
1492
        mov     eax, [drbar.color]
1265
;--------------------------------------
1493
;--------------------------------------
1266
align 4
1494
align 4
1267
.skip:
1495
.skip:
1268
; add pixel
1496
; add pixel
1269
        add     edx, 4
1497
        add     edx, 4
Line 1271... Line 1499...
1271
        dec     edi
1499
        dec     edi
1272
        jnz     .new_x
1500
        jnz     .new_x
1273
; add line
1501
; add line
1274
        add     edx, [drbar.line_inc_scr]
1502
        add     edx, [drbar.line_inc_scr]
1275
        add     ebp, [drbar.line_inc_map]
1503
        add     ebp, [drbar.line_inc_map]
1276
;  drawing gradient bars
1504
; drawing gradient bars
1277
        test    eax, 0x80000000
1505
        test    bh, 0x80
1278
        jz      @f
1506
        jz      @f
1279
        test    al, al
1507
        test    al, al
1280
        jz      @f
1508
        jz      @f
1281
        dec     al
1509
        dec     al
1282
;--------------------------------------
1510
;--------------------------------------
1283
align 4
1511
align 4
1284
@@:
1512
@@:
1285
; 
-
 
1286
        dec     esi
1513
        dec     esi
1287
        jnz     .new_y
1514
        jnz     .new_y
1288
;--------------------------------------
1515
;--------------------------------------
1289
align 4
1516
align 4
1290
.end:
1517
.end:
Line 1297... Line 1524...
1297
align 4
1524
align 4
1298
@@:
1525
@@:
1299
        xor     eax, eax
1526
        xor     eax, eax
1300
        mov     [EGA_counter], 1
1527
        mov     [EGA_counter], 1
1301
        ret
1528
        ret
-
 
1529
;------------------------------------------------------------------------------
-
 
1530
align 4
-
 
1531
draw_bar_end_32_old:
-
 
1532
;--------------------------------------
-
 
1533
align 4
-
 
1534
.new_y:
-
 
1535
        mov     edi, [drbar.real_sx]
-
 
1536
;--------------------------------------
-
 
1537
align 4
-
 
1538
.new_x:
-
 
1539
        cmp     byte [ebp], bl
-
 
1540
        jne     .skip
-
 
1541
;--------------------------------------
-
 
1542
        mov     ecx, [drbar.real_sx_and_abs_cx]
-
 
1543
        sub     ecx, edi
-
 
1544
        shl     ecx, 16
-
 
1545
        add     ecx, [drbar.real_sy_and_abs_cy]
-
 
1546
        sub     ecx, esi
-
 
1547
 
-
 
1548
; check mouse area for putpixel
-
 
1549
        call    check_mouse_area_for_putpixel
-
 
1550
; store to real LFB
-
 
1551
        mov     [edx], eax
-
 
1552
        mov     eax, [drbar.color]
-
 
1553
;--------------------------------------
-
 
1554
align 4
-
 
1555
.skip:
-
 
1556
; add pixel
-
 
1557
        add     edx, 4
-
 
1558
        inc     ebp
-
 
1559
        dec     edi
-
 
1560
        jnz     .new_x
-
 
1561
; add line
-
 
1562
        add     edx, [drbar.line_inc_scr]
-
 
1563
        add     ebp, [drbar.line_inc_map]
-
 
1564
; drawing gradient bars
-
 
1565
        test    bh, 0x80
-
 
1566
        jz      @f
-
 
1567
        test    al, al
-
 
1568
        jz      @f
-
 
1569
        dec     al
1302
;--------------------------------------
1570
;--------------------------------------
1303
align 4
1571
align 4
-
 
1572
@@:
-
 
1573
        dec     esi
-
 
1574
        jnz     .new_y
-
 
1575
        jmp     draw_bar_end_32.end
-
 
1576
;------------------------------------------------------------------------------
-
 
1577
align 4
1304
draw_bar_end_32_new:
1578
draw_bar_end_32_new:
1305
;--------------------------------------
1579
;--------------------------------------
1306
align 4
1580
align 4
1307
.new_y:
1581
.new_y:
1308
        mov     edi, [drbar.real_sx]
1582
        mov     edi, [drbar.real_sx]
Line 1332... Line 1606...
1332
 
1606
 
1333
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
1607
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
1334
        jae     .no_mouse_area
1608
        jae     .no_mouse_area
1335
;--------------------------------------
1609
;--------------------------------------
1336
; check mouse area for putpixel
-
 
1337
        push    eax
1610
; check mouse area for putpixel
1338
        call    check_mouse_area_for_putpixel_new.1
1611
        call    check_mouse_area_for_putpixel_new.1
1339
        mov     [edx], eax
1612
        mov     [edx], eax
1340
        pop     eax
1613
        mov     eax, [drbar.color]
1341
        jmp     .skip
1614
        jmp     .skip
1342
; store to real LFB
1615
; store to real LFB
1343
;--------------------------------------
1616
;--------------------------------------
1344
align 4
1617
align 4
Line 1353... Line 1626...
1353
        dec     edi
1626
        dec     edi
1354
        jnz     .new_x
1627
        jnz     .new_x
1355
; add line
1628
; add line
1356
        add     edx, [drbar.line_inc_scr]
1629
        add     edx, [drbar.line_inc_scr]
1357
        add     ebp, [drbar.line_inc_map]
1630
        add     ebp, [drbar.line_inc_map]
1358
;  drawing gradient bars
1631
; drawing gradient bars
1359
        test    eax, 0x80000000
1632
        test    bh, 0x80
1360
        jz      @f
1633
        jz      @f
1361
        test    al, al
1634
        test    al, al
1362
        jz      @f
1635
        jz      @f
1363
        dec     al
1636
        dec     al
1364
;--------------------------------------
1637
;--------------------------------------
1365
align 4
1638
align 4
1366
@@:
1639
@@:
1367
; 
-
 
1368
        dec     esi
1640
        dec     esi
1369
        jnz     .new_y
1641
        jnz     .new_y
1370
        jmp     draw_bar_end_32.end
1642
        jmp     draw_bar_end_32.end
1371
;------------------------------------------------------------------------------
1643
;------------------------------------------------------------------------------
1372
align 4
1644
align 4
Line 1378... Line 1650...
1378
align 4
1650
align 4
1379
dp2:
1651
dp2:
1380
        mov     ebp, [draw_data+32+RECT.left]   ; x start
1652
        mov     ebp, [draw_data+32+RECT.left]   ; x start
1381
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
1653
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
1382
;                       and LFB data (output for our function) [edi]
1654
;                       and LFB data (output for our function) [edi]
1383
        mov     eax, [BytesPerScanLine]
1655
;        mov     eax, [BytesPerScanLine]
1384
        mul     ebx
1656
;        mul     ebx
-
 
1657
        mov     eax, [d_width_calc_area + ebx*4]
-
 
1658
        cmp     [ScreenBPP], byte 32
-
 
1659
        je      .32
-
 
1660
        lea     eax, [eax+eax*2]
-
 
1661
        jmp     @f
-
 
1662
;-------------------------------------
-
 
1663
align 4
-
 
1664
.32:
-
 
1665
        shl     eax, 2
-
 
1666
;-------------------------------------
-
 
1667
align 4
-
 
1668
@@:
1385
        xchg    ebp, eax
1669
        xchg    ebp, eax
1386
        add     ebp, eax
1670
        add     ebp, eax
1387
        add     ebp, eax
1671
        add     ebp, eax
1388
        add     ebp, eax
1672
        add     ebp, eax
1389
        cmp     [ScreenBPP], byte 24    ; 24 or 32 bpp ? - x size
1673
        cmp     [ScreenBPP], byte 24    ; 24 or 32 bpp ? - x size
Line 1435... Line 1719...
1435
        mov     ecx, eax
1719
        mov     ecx, eax
1436
        shl     ecx, 16
1720
        shl     ecx, 16
1437
        add     ecx, ebx
1721
        add     ecx, ebx
Line 1438... Line 1722...
1438
 
1722
 
-
 
1723
        mov     eax, [esi]
-
 
1724
 
-
 
1725
; check for hardware cursor
-
 
1726
        cmp     [_display.select_cursor], select_cursor
-
 
1727
        je      @f
-
 
1728
        cmp     [_display.select_cursor], 0
-
 
1729
        jne     .no_mouseunder
-
 
1730
;--------------------------------------
-
 
1731
align 4
1439
        mov     eax, [esi]
1732
@@:
1440
        and     eax, 0xffffff
1733
        and     eax, 0xffffff
1441
; check mouse area for putpixel
1734
; check mouse area for putpixel
-
 
1735
        call    [_display.check_mouse]
-
 
1736
;--------------------------------------
-
 
1737
align 4
1442
        call    [_display.check_mouse]
1738
.no_mouseunder:
1443
; store to real LFB
1739
; store to real LFB
1444
        mov     [edi], ax
1740
        mov     [edi], ax
1445
        shr     eax, 16
1741
        shr     eax, 16
Line 1511... Line 1807...
1511
; External loop for all y from start to end
1807
; External loop for all y from start to end
1512
        mov     ebx, [draw_data+32+RECT.top]    ; y start
1808
        mov     ebx, [draw_data+32+RECT.top]    ; y start
1513
        mov     ebp, [draw_data+32+RECT.left]   ; x start
1809
        mov     ebp, [draw_data+32+RECT.left]   ; x start
1514
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
1810
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
1515
;                       and LFB data (output for our function) [edi]
1811
;                       and LFB data (output for our function) [edi]
1516
        mov     eax, [BytesPerScanLine]
1812
;        mov     eax, [BytesPerScanLine]
1517
        mul     ebx
1813
;        mul     ebx
-
 
1814
        mov     eax, [d_width_calc_area + ebx*4]
-
 
1815
        cmp     [ScreenBPP], byte 32
-
 
1816
        je      .32
-
 
1817
        lea     eax, [eax+eax*2]
-
 
1818
        jmp     @f
-
 
1819
;-------------------------------------
-
 
1820
align 4
-
 
1821
.32:
-
 
1822
        shl     eax, 2
-
 
1823
;-------------------------------------
-
 
1824
align 4
-
 
1825
@@:
-
 
1826
 
1518
        xchg    ebp, eax
1827
        xchg    ebp, eax
1519
        add     ebp, eax
1828
        add     ebp, eax
1520
        add     ebp, eax
1829
        add     ebp, eax
1521
        add     ebp, eax
1830
        add     ebp, eax
1522
        cmp     [ScreenBPP], byte 24    ; 24 or 32 bpp ? - x size
1831
        cmp     [ScreenBPP], byte 24    ; 24 or 32 bpp ? - x size
Line 1612... Line 1921...
1612
        call    [overlapping_of_points_ptr]
1921
        call    [overlapping_of_points_ptr]
1613
;--------------------------------------
1922
;--------------------------------------
1614
align 4
1923
align 4
1615
.novert:
1924
.novert:
1616
        push    ecx
1925
        push    ecx
-
 
1926
; check for hardware cursor
-
 
1927
        cmp     [_display.select_cursor], select_cursor
-
 
1928
        je      @f
-
 
1929
        cmp     [_display.select_cursor], 0
-
 
1930
        jne     .no_mouseunder
-
 
1931
;--------------------------------------
-
 
1932
align 4
-
 
1933
@@:
1617
        mov     ecx, [esp+20+4]        ;x
1934
        mov     ecx, [esp+20+4]        ;x
1618
        shl     ecx, 16
1935
        shl     ecx, 16
1619
        add     ecx, [esp+24+4]        ;y
1936
        add     ecx, [esp+24+4]        ;y
1620
; check mouse area for putpixel
1937
; check mouse area for putpixel
1621
        call    [_display.check_mouse]
1938
        call    [_display.check_mouse]
-
 
1939
;--------------------------------------
-
 
1940
align 4
-
 
1941
.no_mouseunder:
1622
; store to real LFB
1942
; store to real LFB
1623
        mov     [LFB_BASE+edi], ax
1943
        mov     [LFB_BASE+edi], ax
1624
        shr     eax, 16
1944
        shr     eax, 16
1625
        mov     [LFB_BASE+edi+2], al
1945
        mov     [LFB_BASE+edi+2], al
1626
        pop     ecx
1946
        pop     ecx