Subversion Repositories Kolibri OS

Rev

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

Rev 5350 Rev 5351
Line 69... Line 69...
69
format binary as "mnt"
69
format binary as "mnt"
Line 70... Line 70...
70
 
70
 
71
include 'macros.inc'
71
include 'macros.inc'
Line 72... Line 72...
72
include 'struct.inc'
72
include 'struct.inc'
Line 73... Line 73...
73
 
73
 
74
$Revision: 5350 $
74
$Revision: 5351 $
Line 459... Line 459...
459
        je      @f
459
        je      @f
460
        cmp     [SCR_MODE], word 0x12               ; VGA 640x480
460
        cmp     [SCR_MODE], word 0x12               ; VGA 640x480
461
        je      @f
461
        je      @f
462
        movzx   eax, word[BOOT_VARS+BOOT_PITCH]      ; for other modes
462
        movzx   eax, word[BOOT_VARS+BOOT_PITCH]      ; for other modes
463
@@:
463
@@:
464
        mov     [_display.pitch], eax
464
        mov     [_display.lfb_pitch], eax
465
        mov     eax, [_display.width]
465
        mov     eax, [_display.width]
466
        mul     [_display.height]
466
        mul     [_display.height]
467
        mov     [_WinMapSize], eax
467
        mov     [_display.win_map_size], eax
Line 468... Line 468...
468
 
468
 
469
        call    calculate_fast_getting_offset_for_WinMapAddress
469
        call    calculate_fast_getting_offset_for_WinMapAddress
470
; for Qemu or non standart video cards
470
; for Qemu or non standart video cards
471
; Unfortunately [BytesPerScanLine] does not always
471
; Unfortunately [BytesPerScanLine] does not always
Line 657... Line 657...
657
        mov     [graph_data_l+2], ax
657
        mov     [graph_data_l+2], ax
658
        shr     eax, 16
658
        shr     eax, 16
659
        mov     [graph_data_l+4], al
659
        mov     [graph_data_l+4], al
660
        mov     [graph_data_l+7], ah
660
        mov     [graph_data_l+7], ah
Line 661... Line 661...
661
 
661
 
662
        stdcall kernel_alloc, [_WinMapSize]
662
        stdcall kernel_alloc, [_display.win_map_size]
Line 663... Line 663...
663
        mov     [_WinMapAddress], eax
663
        mov     [_display.win_map], eax
664
 
664
 
Line 665... Line 665...
665
        xor     eax, eax
665
        xor     eax, eax
Line 2110... Line 2110...
2110
 
2110
 
2111
        movzx   eax, word [MOUSE_Y]
2111
        movzx   eax, word [MOUSE_Y]
2112
        movzx   ebx, word [MOUSE_X]
2112
        movzx   ebx, word [MOUSE_X]
Line 2113... Line 2113...
2113
        mov     eax, [d_width_calc_area + eax*4]
2113
        mov     eax, [d_width_calc_area + eax*4]
2114
 
2114
 
2115
        add     eax, [_WinMapAddress]
2115
        add     eax, [_display.win_map]
2116
        movzx   edx, byte [ebx+eax]
2116
        movzx   edx, byte [ebx+eax]
Line 2117... Line 2117...
2117
        shl     edx, 8
2117
        shl     edx, 8
Line 2537... Line 2537...
2537
        ja      .exit
2537
        ja      .exit
Line 2538... Line 2538...
2538
 
2538
 
2539
        pushfd
2539
        pushfd
2540
        cli
2540
        cli
2541
        mov     eax, ecx
2541
        mov     eax, ecx
2542
        mov     ecx, [_display.pitch]
2542
        mov     ecx, [_display.lfb_pitch]
2543
        mov     [_display.width], eax
2543
        mov     [_display.width], eax
2544
        dec     eax
2544
        dec     eax
2545
        mov     [_display.height], edx
2545
        mov     [_display.height], edx
2546
        dec     edx
2546
        dec     edx
Line 3821... Line 3821...
3821
;--------------------------------------
3821
;--------------------------------------
3822
align 4
3822
align 4
3823
.start_x:
3823
.start_x:
3824
        add     eax, ecx
3824
        add     eax, ecx
3825
        mov     ebp, [d_width_calc_area + ebx*4]
3825
        mov     ebp, [d_width_calc_area + ebx*4]
3826
        add     ebp, [_WinMapAddress]
3826
        add     ebp, [_display.win_map]
3827
        movzx   ebp, byte[eax+ebp] ; get value for current point
3827
        movzx   ebp, byte[eax+ebp] ; get value for current point
3828
        cmp     ebp, edi
3828
        cmp     ebp, edi
3829
        jne     @f
3829
        jne     @f
Line 3830... Line 3830...
3830
 
3830
 
Line 3866... Line 3866...
3866
        popad
3866
        popad
3867
        ret
3867
        ret
3868
;-----------------------------------------------------------------------------
3868
;-----------------------------------------------------------------------------
3869
align 4
3869
align 4
3870
calculatebackground:   ; background
3870
calculatebackground:   ; background
3871
        mov     edi, [_WinMapAddress]              ; set os to use all pixels
3871
        mov     edi, [_display.win_map]              ; set os to use all pixels
3872
        mov     eax, 0x01010101
3872
        mov     eax, 0x01010101
3873
        mov     ecx, [_WinMapSize]
3873
        mov     ecx, [_display.win_map_size]
3874
        shr     ecx, 2
3874
        shr     ecx, 2
3875
        rep stosd
3875
        rep stosd
Line 3876... Line 3876...
3876
 
3876
 
3877
        mov     byte[REDRAW_BACKGROUND], 0            ; do not draw background!
3877
        mov     byte[REDRAW_BACKGROUND], 0            ; do not draw background!
Line 5024... Line 5024...
5024
.2:                             ; bits per pixel
5024
.2:                             ; bits per pixel
5025
        mov     eax, [_display.bits_per_pixel]
5025
        mov     eax, [_display.bits_per_pixel]
5026
        mov     [esp+32], eax
5026
        mov     [esp+32], eax
5027
        ret
5027
        ret
5028
.3:                             ; bytes per scanline
5028
.3:                             ; bytes per scanline
5029
        mov     eax, [_display.pitch]
5029
        mov     eax, [_display.lfb_pitch]
5030
        mov     [esp+32], eax
5030
        mov     [esp+32], eax
5031
        ret
5031
        ret
Line 5032... Line 5032...
5032
 
5032
 
Line 5191... Line 5191...
5191
        jmp     .store
5191
        jmp     .store
5192
;--------------------------------------
5192
;--------------------------------------
5193
align 4
5193
align 4
5194
@@:
5194
@@:
5195
        mov     eax, [d_width_calc_area + ecx*4]
5195
        mov     eax, [d_width_calc_area + ecx*4]
5196
        add     eax, [_WinMapAddress]
5196
        add     eax, [_display.win_map]
5197
        movzx   eax, byte[eax+ebx]        ; get value for current point
5197
        movzx   eax, byte[eax+ebx]        ; get value for current point
5198
;--------------------------------------
5198
;--------------------------------------
5199
align 4
5199
align 4
5200
.store:
5200
.store:
5201
        mov     [esp + 32], eax
5201
        mov     [esp + 32], eax
Line 5330... Line 5330...
5330
        xor     cl, cl
5330
        xor     cl, cl
5331
        ror     ecx, 8
5331
        ror     ecx, 8
Line 5332... Line 5332...
5332
 
5332
 
5333
        pushad
5333
        pushad
5334
        mov     edx, [d_width_calc_area + ebx*4]
5334
        mov     edx, [d_width_calc_area + ebx*4]
5335
        add     edx, [_WinMapAddress]
5335
        add     edx, [_display.win_map]
5336
        movzx   edx, byte [eax+edx]
5336
        movzx   edx, byte [eax+edx]
5337
        cmp     dl, byte 1
5337
        cmp     dl, byte 1
Line 5338... Line 5338...
5338
        jne     @f
5338
        jne     @f
Line 5431... Line 5431...
5431
        mov     ecx, [_display.height]
5431
        mov     ecx, [_display.height]
5432
        mov     edi, BPSLine_calc_area
5432
        mov     edi, BPSLine_calc_area
5433
        cld
5433
        cld
5434
@@:
5434
@@:
5435
        stosd
5435
        stosd
5436
        add     eax, [_display.pitch]
5436
        add     eax, [_display.lfb_pitch]
5437
        dec     ecx
5437
        dec     ecx
5438
        jnz     @r
5438
        jnz     @r
5439
        ret
5439
        ret
5440
;------------------------------------------------------------------------------
5440
;------------------------------------------------------------------------------
5441
align 4
5441
align 4
Line 5446... Line 5446...
5446
; edx - new Screen_Max_Y
5446
; edx - new Screen_Max_Y
Line 5447... Line 5447...
5447
 
5447
 
5448
        pushfd
5448
        pushfd
Line 5449... Line 5449...
5449
        cli
5449
        cli
Line 5450... Line 5450...
5450
 
5450
 
5451
        mov     [_display.pitch], ecx
5451
        mov     [_display.lfb_pitch], ecx
Line 5452... Line 5452...
5452
 
5452
 
Line 5460... Line 5460...
5460
        pushad
5460
        pushad
Line 5461... Line 5461...
5461
 
5461
 
5462
        cmp     [do_not_touch_winmap], 1
5462
        cmp     [do_not_touch_winmap], 1
Line 5463... Line 5463...
5463
        je      @f
5463
        je      @f
Line 5464... Line 5464...
5464
 
5464
 
5465
        stdcall kernel_free, [_WinMapAddress]
5465
        stdcall kernel_free, [_display.win_map]
5466
 
5466
 
Line 5467... Line 5467...
5467
        mov     eax, [_display.width]
5467
        mov     eax, [_display.width]
5468
        mul     [_display.height]
5468
        mul     [_display.height]
5469
        mov     [_WinMapSize], eax
5469
        mov     [_display.win_map_size], eax
5470
 
5470
 
5471
        stdcall kernel_alloc, eax
5471
        stdcall kernel_alloc, eax
5472
        mov     [_WinMapAddress], eax
5472
        mov     [_display.win_map], eax
5473
        test    eax, eax
5473
        test    eax, eax