Subversion Repositories Kolibri OS

Rev

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

Rev 2434 Rev 2439
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: 2434 $
20
$Revision: 2439 $
21
 
21
 
Line 241... Line 241...
241
;--------------------------------------
241
;--------------------------------------
242
; get process number
242
; get process number
243
        mov     ebx, [CURRENT_TASK]
243
        mov     ebx, [CURRENT_TASK]
244
        cmp     byte [ScreenBPP], 32
244
        cmp     byte [ScreenBPP], 32
245
        je      put_image_end_32
245
        je      put_image_end_32
-
 
246
;--------------------------------------
246
;put_image_end_24:
247
put_image_end_24:
247
        mov     edi, [putimg.real_sy]
248
        mov     edi, [putimg.real_sy]
-
 
249
        cmp     [_display.select_cursor], 0
-
 
250
        jne     put_image_end_24_new
248
;--------------------------------------
251
;--------------------------------------
249
align 4
252
align 4
250
.new_line:
253
.new_line:
251
        mov     ecx, [putimg.real_sx]
254
        mov     ecx, [putimg.real_sx]
252
;     push    ebp edx
-
 
253
;--------------------------------------
255
;--------------------------------------
254
align 4
256
align 4
255
.new_x:
257
.new_x:
256
        push    [putimg.edi]
258
        push    [putimg.edi]
257
        mov     eax, [putimg.ebp+4]
259
        mov     eax, [putimg.ebp+4]
Line 266... Line 268...
266
        shl     ecx, 16
268
        shl     ecx, 16
267
        add     ecx, [putimg.real_sy_and_abs_cy + 4]
269
        add     ecx, [putimg.real_sy_and_abs_cy + 4]
268
        sub     ecx, edi
270
        sub     ecx, edi
Line 269... Line 271...
269
 
271
 
270
; check mouse area for putpixel
272
; check mouse area for putpixel
271
        call    [_display.check_mouse]
273
        call    check_mouse_area_for_putpixel
272
        pop     ecx
274
        pop     ecx
273
; store to real LFB
275
; store to real LFB
274
        mov     [LFB_BASE+edx], ax
276
        mov     [LFB_BASE+edx], ax
275
        shr     eax, 16
277
        shr     eax, 16
276
        mov     [LFB_BASE+edx+2], al
278
        mov     [LFB_BASE+edx+2], al
277
;--------------------------------------
279
;--------------------------------------
278
align 4
280
align 4
279
.skip:
-
 
280
;     add     esi, 3 ;[putimg.source_bpp]
281
.skip:
281
        add     edx, 3
282
        add     edx, 3
282
        inc     ebp
283
        inc     ebp
283
        dec     ecx
284
        dec     ecx
284
        jnz     .new_x
-
 
-
 
285
        jnz     .new_x
285
;     pop     edx ebp
286
 
286
        add     esi, [putimg.line_increment]
287
        add     esi, [putimg.line_increment]
287
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
288
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
288
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
-
 
-
 
289
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
289
;     inc     ebp
290
 
290
        cmp     [putimg.ebp], putimage_get1bpp
291
        cmp     [putimg.ebp], putimage_get1bpp
291
        jz      .correct
292
        jz      .correct
292
        cmp     [putimg.ebp], putimage_get2bpp
293
        cmp     [putimg.ebp], putimage_get2bpp
293
        jz      .correct
294
        jz      .correct
Line 307... Line 308...
307
align 4
308
align 4
308
.finish:
309
.finish:
309
        add     esp, putimg.stack_data
310
        add     esp, putimg.stack_data
310
        popad
311
        popad
311
        ret
312
        ret
-
 
313
;--------------------------------------
-
 
314
align 4
-
 
315
put_image_end_24_new:
-
 
316
;--------------------------------------
-
 
317
align 4
-
 
318
.new_line:
-
 
319
        mov     ecx, [putimg.real_sx]
-
 
320
;--------------------------------------
-
 
321
align 4
-
 
322
.new_x:
-
 
323
        push    [putimg.edi]
-
 
324
        mov     eax, [putimg.ebp+4]
-
 
325
        call    eax
-
 
326
        cmp     [ebp], bl
-
 
327
        jne     .skip
-
 
328
;--------------------------------------
-
 
329
        push    ecx
-
 
330
        mov     ecx, [putimg.real_sy_and_abs_cy + 4]
-
 
331
        sub     ecx, edi
-
 
332
;--------------------------------------
-
 
333
; check for Y
-
 
334
        cmp     cx, [Y_UNDER_subtraction_CUR_hot_y]
-
 
335
        jb      .no_mouse_area
-
 
336
 
-
 
337
        cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
-
 
338
        jae     .no_mouse_area
-
 
339
 
-
 
340
        rol     ecx, 16
-
 
341
        add     ecx, [putimg.real_sx_and_abs_cx + 4]
-
 
342
        sub     ecx, [esp]
-
 
343
;--------------------------------------
-
 
344
; check for X
-
 
345
        cmp     cx, [X_UNDER_subtraction_CUR_hot_x]
-
 
346
        jb      .no_mouse_area
-
 
347
 
-
 
348
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
-
 
349
        jae     .no_mouse_area
-
 
350
;--------------------------------------
-
 
351
; check mouse area for putpixel
-
 
352
        call    check_mouse_area_for_putpixel_new.1
-
 
353
;--------------------------------------
-
 
354
align 4
-
 
355
.no_mouse_area:
-
 
356
        pop     ecx
-
 
357
; store to real LFB
-
 
358
        mov     [LFB_BASE+edx], ax
-
 
359
        shr     eax, 16
-
 
360
        mov     [LFB_BASE+edx+2], al
-
 
361
;--------------------------------------
-
 
362
align 4
-
 
363
.skip:
-
 
364
        add     edx, 3
-
 
365
        inc     ebp
-
 
366
        dec     ecx
-
 
367
        jnz     .new_x
-
 
368
 
-
 
369
        add     esi, [putimg.line_increment]
-
 
370
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
-
 
371
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
-
 
372
 
-
 
373
        cmp     [putimg.ebp], putimage_get1bpp
-
 
374
        jz      .correct
-
 
375
        cmp     [putimg.ebp], putimage_get2bpp
-
 
376
        jz      .correct
-
 
377
        cmp     [putimg.ebp], putimage_get4bpp
-
 
378
        jnz     @f
-
 
379
;--------------------------------------
-
 
380
align 4
-
 
381
.correct:
-
 
382
        mov     eax, [putimg.edi]
-
 
383
        mov     byte [eax], 80h
-
 
384
;--------------------------------------
-
 
385
align 4
-
 
386
@@:
-
 
387
        dec     edi
-
 
388
        jnz     .new_line
-
 
389
        jmp     put_image_end_24.finish
312
;------------------------------------------------------------------------------
390
;------------------------------------------------------------------------------
313
align 4
391
align 4
314
put_image_end_32:
392
put_image_end_32:
315
        mov     edi, [putimg.real_sy]
393
        mov     edi, [putimg.real_sy]
-
 
394
        cmp     [_display.select_cursor], 0
-
 
395
        jne     put_image_end_32_new
316
;--------------------------------------
396
;--------------------------------------
317
align 4
397
align 4
318
.new_line:
398
.new_line:
319
        mov     ecx, [putimg.real_sx]
399
        mov     ecx, [putimg.real_sx]
320
;     push    ebp edx
-
 
321
;--------------------------------------
400
;--------------------------------------
322
align 4
401
align 4
323
.new_x:
402
.new_x:
324
        push    [putimg.edi]
403
        push    [putimg.edi]
325
        mov     eax, [putimg.ebp+4]
404
        mov     eax, [putimg.ebp+4]
Line 334... Line 413...
334
        shl     ecx, 16
413
        shl     ecx, 16
335
        add     ecx, [putimg.real_sy_and_abs_cy + 4]
414
        add     ecx, [putimg.real_sy_and_abs_cy + 4]
336
        sub     ecx, edi
415
        sub     ecx, edi
Line 337... Line 416...
337
 
416
 
338
; check mouse area for putpixel
417
; check mouse area for putpixel
339
        call    [_display.check_mouse]
418
        call    check_mouse_area_for_putpixel
340
        pop     ecx
419
        pop     ecx
341
; store to real LFB
420
; store to real LFB
342
        mov     [LFB_BASE+edx], eax
421
        mov     [LFB_BASE+edx], eax
343
;--------------------------------------
422
;--------------------------------------
344
align 4
423
align 4
345
.skip:
-
 
346
;     add     esi, [putimg.source_bpp]
424
.skip:
347
        add     edx, 4
425
        add     edx, 4
348
        inc     ebp
426
        inc     ebp
349
        dec     ecx
427
        dec     ecx
350
        jnz     .new_x
-
 
-
 
428
        jnz     .new_x
351
;     pop     edx ebp
429
 
352
        add     esi, [putimg.line_increment]
430
        add     esi, [putimg.line_increment]
353
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
431
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
354
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
-
 
-
 
432
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
355
;     inc     ebp
433
 
356
        cmp     [putimg.ebp], putimage_get1bpp
434
        cmp     [putimg.ebp], putimage_get1bpp
357
        jz      .correct
435
        jz      .correct
358
        cmp     [putimg.ebp], putimage_get2bpp
436
        cmp     [putimg.ebp], putimage_get2bpp
359
        jz      .correct
437
        jz      .correct
Line 372... Line 450...
372
;--------------------------------------
450
;--------------------------------------
373
align 4
451
align 4
374
.finish:
452
.finish:
375
        add     esp, putimg.stack_data
453
        add     esp, putimg.stack_data
376
        popad
454
        popad
-
 
455
        cmp     [SCR_MODE], dword 0x12
-
 
456
        jne     @f
377
        call    VGA__putimage
457
        call    VGA__putimage
-
 
458
;--------------------------------------
-
 
459
align 4
-
 
460
@@:
378
        mov     [EGA_counter], 1
461
        mov     [EGA_counter], 1
379
        ret
462
        ret
-
 
463
;--------------------------------------
-
 
464
align 4
-
 
465
put_image_end_32_new:
-
 
466
;--------------------------------------
-
 
467
align 4
-
 
468
.new_line:
-
 
469
        mov     ecx, [putimg.real_sx]
-
 
470
;--------------------------------------
-
 
471
align 4
-
 
472
.new_x:
-
 
473
        push    [putimg.edi]
-
 
474
        mov     eax, [putimg.ebp+4]
-
 
475
        call    eax
-
 
476
        cmp     [ebp], bl
-
 
477
        jne     .skip
-
 
478
;--------------------------------------
-
 
479
        push    ecx
-
 
480
        mov     ecx, [putimg.real_sy_and_abs_cy + 4]
-
 
481
        sub     ecx, edi
-
 
482
;--------------------------------------
-
 
483
; check for Y
-
 
484
        cmp     cx, [Y_UNDER_subtraction_CUR_hot_y]
-
 
485
        jb      .no_mouse_area
-
 
486
 
-
 
487
        cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
-
 
488
        jae     .no_mouse_area
-
 
489
 
-
 
490
        rol     ecx, 16
-
 
491
        add     ecx, [putimg.real_sx_and_abs_cx + 4]
-
 
492
        sub     ecx, [esp]
-
 
493
;--------------------------------------
-
 
494
; check for X
-
 
495
        cmp     cx, [X_UNDER_subtraction_CUR_hot_x]
-
 
496
        jb      .no_mouse_area
-
 
497
 
-
 
498
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
-
 
499
        jae     .no_mouse_area
-
 
500
;--------------------------------------
-
 
501
; check mouse area for putpixel
-
 
502
        call    check_mouse_area_for_putpixel_new.1
-
 
503
;--------------------------------------
-
 
504
align 4
-
 
505
.no_mouse_area:
-
 
506
        pop     ecx
-
 
507
; store to real LFB
-
 
508
        mov     [LFB_BASE+edx], eax
-
 
509
;--------------------------------------
-
 
510
align 4
-
 
511
.skip:
-
 
512
        add     edx, 4
-
 
513
        inc     ebp
-
 
514
        dec     ecx
-
 
515
        jnz     .new_x
-
 
516
 
-
 
517
        add     esi, [putimg.line_increment]
-
 
518
        add     edx, [putimg.screen_newline];[BytesPerScanLine]
-
 
519
        add     ebp, [putimg.winmap_newline];[Screen_Max_X]
-
 
520
 
-
 
521
        cmp     [putimg.ebp], putimage_get1bpp
-
 
522
        jz      .correct
-
 
523
        cmp     [putimg.ebp], putimage_get2bpp
-
 
524
        jz      .correct
-
 
525
        cmp     [putimg.ebp], putimage_get4bpp
-
 
526
        jnz     @f
-
 
527
;--------------------------------------
-
 
528
align 4
-
 
529
.correct:
-
 
530
        mov     eax, [putimg.edi]
-
 
531
        mov     byte [eax], 80h
-
 
532
;--------------------------------------
-
 
533
align 4
-
 
534
@@:
-
 
535
        dec     edi
-
 
536
        jnz     .new_line
-
 
537
        jmp     put_image_end_32.finish
380
;------------------------------------------------------------------------------
538
;------------------------------------------------------------------------------
381
align 4
539
align 4
382
__sys_putpixel:
540
__sys_putpixel:
Line 383... Line 541...
383
 
541
 
Line 396... Line 554...
396
        jb      .exit
554
        jb      .exit
397
        test    edi, 1           ; force ?
555
        test    edi, 1           ; force ?
398
        jnz     .forced
556
        jnz     .forced
Line 399... Line 557...
399
 
557
 
400
; not forced:
-
 
401
 
-
 
402
        push    eax
558
; not forced:
403
        mov     edx, [_display.width]; screen x size
-
 
404
        imul    edx, ebx
559
        mov     edx, [d_width_calc_area + ebx*4]
405
        add     eax, [_WinMapAddress]
560
        add     edx, [_WinMapAddress]
406
        movzx   edx, byte [eax+edx]
561
        movzx   edx, byte [eax+edx]
407
        cmp     edx, [CURRENT_TASK]
-
 
408
        pop     eax
562
        cmp     edx, [CURRENT_TASK]
409
        jne     .exit
563
        jne     .exit
410
;--------------------------------------
564
;--------------------------------------
411
align 4
565
align 4
412
.forced:
566
.forced:
Line 445... Line 599...
445
        mov     eax, [esp+32-8+4]
599
        mov     eax, [esp+32-8+4]
446
;--------------------------------------
600
;--------------------------------------
447
; check mouse area for putpixel
601
; check mouse area for putpixel
448
        test    eax, 0x04000000
602
        test    eax, 0x04000000
449
        jnz     @f
603
        jnz     @f
450
        call    [_display.check_mouse]
604
        call    check_mouse_area_for_putpixel
451
;--------------------------------------
605
;--------------------------------------
452
align 4
606
align 4
453
@@:
607
@@:
454
; store to real LFB
608
; store to real LFB
455
        mov     [LFB_BASE+ebx+edi], ax
609
        mov     [LFB_BASE+ebx+edi], ax
456
        shr     eax, 16
610
        shr     eax, 16
457
        mov     [LFB_BASE+ebx+edi+2], al
611
        mov     [LFB_BASE+ebx+edi+2], al
-
 
612
        ret
-
 
613
;-----------------------------------------------------------------------------
-
 
614
align 4
-
 
615
Vesa20_putpixel24_new:
-
 
616
; eax = x
-
 
617
; ebx = y
-
 
618
        mov     ecx, eax
-
 
619
        shl     ecx, 16
-
 
620
        mov     cx, bx
-
 
621
 
-
 
622
        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
-
 
623
        lea     edi, [eax+eax*2]; edi = x*3
-
 
624
        mov     eax, [esp+32-8+4]
-
 
625
;--------------------------------------
-
 
626
; check mouse area for putpixel
-
 
627
        test    eax, 0x04000000
-
 
628
        jnz     @f
-
 
629
;--------------------------------------
-
 
630
; check for Y
-
 
631
        cmp     cx, [Y_UNDER_subtraction_CUR_hot_y]
-
 
632
        jb      @f
-
 
633
 
-
 
634
        cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
-
 
635
        jae     @f
-
 
636
 
-
 
637
        rol     ecx, 16
458
;--------------------------------------
638
;--------------------------------------
-
 
639
; check for X
-
 
640
        cmp     cx, [X_UNDER_subtraction_CUR_hot_x]
-
 
641
        jb      @f
-
 
642
 
-
 
643
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
-
 
644
        jae     @f
-
 
645
 
-
 
646
        call    check_mouse_area_for_putpixel_new.1
-
 
647
;--------------------------------------
-
 
648
align 4
-
 
649
@@:
-
 
650
; store to real LFB
-
 
651
        mov     [LFB_BASE+ebx+edi], ax
-
 
652
        shr     eax, 16
-
 
653
        mov     [LFB_BASE+ebx+edi+2], al
459
        ret
654
        ret
460
;-----------------------------------------------------------------------------
655
;-----------------------------------------------------------------------------
461
align 4
656
align 4
462
Vesa20_putpixel32:
657
Vesa20_putpixel32:
463
; eax = x
658
; eax = x
Line 471... Line 666...
471
        mov     eax, [esp+32-8+4]; eax = color
666
        mov     eax, [esp+32-8+4]; eax = color
472
;--------------------------------------
667
;--------------------------------------
473
; check mouse area for putpixel
668
; check mouse area for putpixel
474
        test    eax, 0x04000000
669
        test    eax, 0x04000000
475
        jnz     @f
670
        jnz     @f
476
        call    [_display.check_mouse]
671
        call    check_mouse_area_for_putpixel
477
;--------------------------------------
672
;--------------------------------------
478
align 4
673
align 4
479
@@:
674
@@:
480
        and     eax, 0xffffff
675
        and     eax, 0xffffff
481
; store to real LFB
676
; store to real LFB
482
        mov     [LFB_BASE+edi], eax
677
        mov     [LFB_BASE+edi], eax
-
 
678
        ret
-
 
679
;-----------------------------------------------------------------------------
-
 
680
align 4
-
 
681
Vesa20_putpixel32_new:
-
 
682
; eax = x
-
 
683
; ebx = y
-
 
684
        mov     ecx, eax
-
 
685
        shl     ecx, 16
-
 
686
        mov     cx, bx
-
 
687
 
-
 
688
        imul    ebx, [BytesPerScanLine]  ; ebx = y * y multiplier
-
 
689
        lea     edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
-
 
690
        mov     eax, [esp+32-8+4]; eax = color
-
 
691
;--------------------------------------
-
 
692
; check mouse area for putpixel
-
 
693
        test    eax, 0x04000000
-
 
694
        jnz     @f
-
 
695
;--------------------------------------
-
 
696
; check for Y
-
 
697
        cmp     cx, [Y_UNDER_subtraction_CUR_hot_y]
-
 
698
        jb      @f
-
 
699
 
-
 
700
        cmp     cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
-
 
701
        jae     @f
-
 
702
 
-
 
703
        rol     ecx, 16
483
;--------------------------------------
704
;--------------------------------------
-
 
705
; check for X
-
 
706
        cmp     cx, [X_UNDER_subtraction_CUR_hot_x]
-
 
707
        jb      @f
-
 
708
 
-
 
709
        cmp     cx, [X_UNDER_sub_CUR_hot_x_add_curh]
-
 
710
        jae     @f
-
 
711
 
-
 
712
        call    check_mouse_area_for_putpixel_new.1
-
 
713
;--------------------------------------
-
 
714
align 4
-
 
715
@@:
-
 
716
        and     eax, 0xffffff
-
 
717
; store to real LFB
-
 
718
        mov     [LFB_BASE+edi], eax
484
        ret
719
        ret
485
;-----------------------------------------------------------------------------
720
;-----------------------------------------------------------------------------
486
align 4
721
align 4
487
calculate_edi:
722
calculate_edi:
488
        mov     edi, ebx
723
        mov     edi, ebx
Line 1053... Line 1288...
1053
;--------------------------------------
1288
;--------------------------------------
1054
align 4
1289
align 4
1055
.end:
1290
.end:
1056
        add     esp, drbar.stack_data
1291
        add     esp, drbar.stack_data
1057
        popad
1292
        popad
-
 
1293
        cmp     [SCR_MODE], dword 0x12
-
 
1294
        jne     @f
1058
        call    VGA_draw_bar
1295
        call    VGA_draw_bar
-
 
1296
;--------------------------------------
-
 
1297
align 4
-
 
1298
@@:
1059
        xor     eax, eax
1299
        xor     eax, eax
1060
        mov     [EGA_counter], 1
1300
        mov     [EGA_counter], 1
1061
        ret
1301
        ret
1062
;--------------------------------------
1302
;--------------------------------------
1063
align 4
1303
align 4
Line 1236... Line 1476...
1236
        inc     ebx
1476
        inc     ebx
1237
        cmp     ebx, [draw_data+32+RECT.bottom]
1477
        cmp     ebx, [draw_data+32+RECT.bottom]
1238
        jbe     dp2
1478
        jbe     dp2
1239
        popad
1479
        popad
1240
        mov     [EGA_counter], 1
1480
        mov     [EGA_counter], 1
-
 
1481
        cmp     [SCR_MODE], dword 0x12
-
 
1482
        jne     @f
1241
        call    VGA_drawbackground
1483
        call    VGA_drawbackground
-
 
1484
;--------------------------------------
-
 
1485
align 4
-
 
1486
@@:
1242
        ret
1487
        ret
1243
;------------------------------------------------------------------------------
1488
;------------------------------------------------------------------------------
1244
align 4
1489
align 4
1245
vesa20_drawbackground_stretch:
1490
vesa20_drawbackground_stretch:
1246
        pushad
1491
        pushad
Line 1443... Line 1688...
1443
align 4
1688
align 4
1444
sdpdone:
1689
sdpdone:
1445
        add     esp, 44
1690
        add     esp, 44
1446
        popad
1691
        popad
1447
        mov     [EGA_counter], 1
1692
        mov     [EGA_counter], 1
-
 
1693
        cmp     [SCR_MODE], dword 0x12
-
 
1694
        jne     @f
1448
        call    VGA_drawbackground
1695
        call    VGA_drawbackground
-
 
1696
;--------------------------------------
-
 
1697
align 4
-
 
1698
@@:
1449
        ret
1699
        ret
Line 1450... Line 1700...
1450
 
1700
 
1451
uglobal
1701
uglobal
1452
;--------------------------------------
1702
;--------------------------------------