Subversion Repositories Kolibri OS

Rev

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

Rev 9911 Rev 9917
Line 75... Line 75...
75
format binary as "mnt"
75
format binary as "mnt"
Line 76... Line 76...
76
 
76
 
77
include 'macros.inc'
77
include 'macros.inc'
Line 78... Line 78...
78
include 'struct.inc'
78
include 'struct.inc'
Line 79... Line 79...
79
 
79
 
80
$Revision: 9911 $
80
$Revision: 9917 $
Line 2280... Line 2280...
2280
.exit:
2280
.exit:
2281
        ret
2281
        ret
2282
;------------------------------------------------------------------------------
2282
;------------------------------------------------------------------------------
2283
sysfn_getversion:       ; 18.13 = get kernel ID and version
2283
sysfn_getversion:       ; 18.13 = get kernel ID and version
2284
        ; if given memory address belongs to kernel then error
2284
        ; if given memory address belongs to kernel then error
2285
        stdcall is_region_userspace, ecx, version_end-version_inf
2285
        stdcall is_region_userspace, ecx, version_inf.size
2286
        jnz     .addr_error
2286
        jnz     .addr_error
Line 2287... Line 2287...
2287
 
2287
 
2288
        mov     edi, ecx
2288
        mov     edi, ecx
2289
        mov     esi, version_inf
2289
        mov     esi, version_inf
2290
        mov     ecx, version_end-version_inf
2290
        mov     ecx, version_inf.size
2291
        rep movsb
2291
        rep movsb
2292
        ret
2292
        ret
2293
.addr_error:    ; if given memory address is illegal
2293
.addr_error:    ; if given memory address is illegal
2294
        mov     dword [esp + SYSCALL_STACK.eax], -1
2294
        mov     dword [esp + SYSCALL_STACK.eax], -1
Line 2464... Line 2464...
2464
window_minimize db 0
2464
window_minimize db 0
2465
sound_flag      db 0
2465
sound_flag      db 0
Line 2466... Line 2466...
2466
 
2466
 
Line 2467... Line -...
2467
endg
-
 
2468
 
-
 
2469
;UID_NONE=0
-
 
2470
;UID_KOLIBRI=2    ;russian
2467
endg
2471
 
2468
 
2472
iglobal
2469
iglobal
2473
version_inf:
2470
version_inf:
2474
        db 0,7,7,0  ; version 0.7.7.0
2471
        db 0,7,7,0  ; version 0.7.7.0
2475
        db 0
2472
        db 0
2476
.rev    dd __REV__
2473
.rev    dd __REV__
2477
version_end:
2474
.size = $ - version_inf
2478
endg
2475
endg
2479
;------------------------------------------------------------------------------
2476
;------------------------------------------------------------------------------
2480
align 4
2477
align 4
Line 2644... Line 2641...
2644
 
2641
 
2645
        cmp     ebx, 2
2642
        cmp     ebx, 2
Line 2646... Line 2643...
2646
        jnz     .srl1
2643
        jnz     .srl1
2647
 
2644
 
2648
        mov     edx, [current_slot_idx]      ; return whole screen draw area for this app
2645
        mov     edx, [current_slot_idx]      ; return whole screen draw area for this app
2649
        shl     edx, 5     ;?
2646
        shl     edx, BSF sizeof.RECT
2650
        add     edx, draw_data
2647
        add     edx, draw_data
2651
        mov     [edx + RECT.left], 0
2648
        mov     [edx + RECT.left], 0
2652
        mov     [edx + RECT.top], 0
2649
        mov     [edx + RECT.top], 0
Line 2812... Line 2809...
2812
        xor     edi, edi
2809
        xor     edi, edi
2813
        mov     ebx, window_data
2810
        mov     ebx, window_data
Line 2814... Line 2811...
2814
 
2811
 
2815
        mov     ecx, [thread_count]
2812
        mov     ecx, [thread_count]
2816
        movzx   eax, word [WIN_POS + ecx*2]     ; active window
2813
        movzx   eax, word [WIN_POS + ecx*2]     ; active window
2817
        shl     eax, 8
2814
        shl     eax, BSF sizeof.APPDATA ;8
Line 2818... Line 2815...
2818
        push    eax
2815
        push    eax
2819
 
2816
 
2820
        movzx   eax, word [MOUSE_X]
2817
        movzx   eax, word [MOUSE_X]
2821
        movzx   edx, word [MOUSE_Y]
2818
        movzx   edx, word [MOUSE_Y]
2822
;--------------------------------------
2819
;--------------------------------------
2823
align 4
2820
align 4
2824
.set_mouse_event:
2821
.set_mouse_event:
2825
        add     edi, sizeof.APPDATA
2822
        add     edi, sizeof.APPDATA
2826
        add     ebx, sizeof.WDATA
2823
        add     ebx, sizeof.WDATA
Line 2827... Line 2824...
2827
        test    [SLOT_BASE + edi + APPDATA.event_mask], 0x80000000
2824
        test    [SLOT_BASE + edi + APPDATA.event_mask], EVM_MOUSE_FILTER
2828
        jz      .pos_filter
2825
        jz      .pos_filter
2829
 
2826
 
2830
        cmp     edi, [esp]                      ; skip if filtration active
2827
        cmp     edi, [esp]                      ; skip if filtration active
2831
        jne     .skip
2828
        jne     .skip
2832
;--------------------------------------
2829
;--------------------------------------
2833
align 4
2830
align 4
Line 2834... Line 2831...
2834
.pos_filter:
2831
.pos_filter:
2835
        test    [SLOT_BASE + edi + APPDATA.event_mask], 0x40000000
2832
        test    [SLOT_BASE + edi + APPDATA.event_mask], EVM_CURSOR_FILTER
2836
        jz      .set
2833
        jz      .set
Line 2867... Line 2864...
2867
        cmp     [background_defined], 0
2864
        cmp     [background_defined], 0
2868
        jz      nobackgr
2865
        jz      nobackgr
2869
;--------------------------------------
2866
;--------------------------------------
2870
align 4
2867
align 4
2871
backgr:
2868
backgr:
2872
        mov     eax, [draw_data + 32 + RECT.left]
2869
        mov     eax, [draw_data + sizeof.RECT + RECT.left]
2873
        shl     eax, 16
2870
        shl     eax, 16
2874
        add     eax, [draw_data + 32 + RECT.right]
2871
        add     eax, [draw_data + sizeof.RECT + RECT.right]
2875
        mov     [BG_Rect_X_left_right], eax ; [left]*65536 + [right]
2872
        mov     [BG_Rect_X_left_right], eax ; [left]*65536 + [right]
Line 2876... Line 2873...
2876
 
2873
 
2877
        mov     eax, [draw_data + 32 + RECT.top]
2874
        mov     eax, [draw_data + sizeof.RECT + RECT.top]
2878
        shl     eax, 16
2875
        shl     eax, 16
2879
        add     eax, [draw_data + 32 + RECT.bottom]
2876
        add     eax, [draw_data + sizeof.RECT + RECT.bottom]
Line 2880... Line 2877...
2880
        mov     [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
2877
        mov     [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
2881
 
2878
 
2882
        call    drawbackground
2879
        call    drawbackground
Line 2925... Line 2922...
2925
;--------- set event 5 stop -----------
2922
;--------- set event 5 stop -----------
2926
        dec     [REDRAW_BACKGROUND]     ; got new update request?
2923
        dec     [REDRAW_BACKGROUND]     ; got new update request?
2927
        jnz     backgr
2924
        jnz     backgr
Line 2928... Line 2925...
2928
 
2925
 
2929
        xor     eax, eax
2926
        xor     eax, eax
2930
        mov     [draw_data + 32 + RECT.left], eax
2927
        mov     [draw_data + sizeof.RECT + RECT.left], eax
2931
        mov     [draw_data + 32 + RECT.top], eax
2928
        mov     [draw_data + sizeof.RECT + RECT.top], eax
2932
        mov     [draw_data + 32 + RECT.right], eax
2929
        mov     [draw_data + sizeof.RECT + RECT.right], eax
2933
        mov     [draw_data + 32 + RECT.bottom], eax
2930
        mov     [draw_data + sizeof.RECT + RECT.bottom], eax
2934
;--------------------------------------
2931
;--------------------------------------
2935
align 4
2932
align 4
2936
nobackgr:
2933
nobackgr:
2937
; system shutdown request
2934
; system shutdown request
Line 3446... Line 3443...
3446
 
3443
 
3447
        test    ebx, ebx
3444
        test    ebx, ebx
Line 3448... Line 3445...
3448
        jnz     .free_port_area
3445
        jnz     .free_port_area
3449
 
3446
 
3450
        cmp     ecx, edx      ; beginning > end ?
3447
        cmp     ecx, edx      ; beginning > end ?
3451
        ja      .rpal1
3448
        ja      .err
3452
        cmp     edx, 65536    ;test ebx, not 0xffff
3449
        cmp     edx, 65536    ;test ebx, not 0xffff
3453
        jae     .rpal1
3450
        jae     .err
3454
        mov     eax, [RESERVED_PORTS]
3451
        mov     eax, [RESERVED_PORTS]
3455
        test    eax, eax      ; no reserved areas ?
3452
        test    eax, eax      ; no reserved areas ?
3456
        je      .rpal2
3453
        je      .rpal2
3457
        cmp     eax, 255      ; max reserved
3454
        cmp     eax, 255      ; max reserved
3458
        jae     .rpal1
3455
        jae     .err
3459
 .rpal3:
3456
 .rpal3:
3460
        mov     ebx, eax
3457
        mov     ebx, eax
3461
        shl     ebx, 4   ;16 byte is sizeof item in RESERVED_PORTS table
3458
        shl     ebx, 4   ;16 byte is sizeof item in RESERVED_PORTS table
3462
        add     ebx, RESERVED_PORTS
3459
        add     ebx, RESERVED_PORTS
3463
        cmp     ecx, [ebx+8]
3460
        cmp     ecx, [ebx+8]
3464
        ja      .rpal4
3461
        ja      .rpal4
3465
        cmp     edx, [ebx+4]
3462
        cmp     edx, [ebx+4]
3466
        jae     .rpal1
3463
        jae     .err
3467
 .rpal4:
3464
 .rpal4:
3468
        dec     eax
3465
        dec     eax
3469
        jnz     .rpal3
3466
        jnz     .rpal3
3470
        jmp     .rpal2
3467
        jmp     .rpal2
3471
   .rpal1:
3468
.err:
3472
        xor     eax, eax
3469
        xor     eax, eax
-
 
3470
        inc     eax
3473
        inc     eax
3471
        ret
3474
        ret
3472
 
3475
   .rpal2:
3473
   .rpal2:
3476
     ; enable port access at port IO map
3474
     ; enable port access at port IO map
3477
        pushad                        ; start enable io map
3475
        pushad                        ; start enable io map
Line 3482... Line 3480...
3482
        call    set_io_access_rights
3480
        call    set_io_access_rights
Line 3483... Line 3481...
3483
 
3481
 
3484
        inc     eax
3482
        inc     eax
3485
        cmp     eax, edx
3483
        cmp     eax, edx
3486
        jbe     .new_port_access
3484
        jbe     .new_port_access
3487
;no_unmask_io:
3485
 
3488
        sti
3486
        sti
Line 3489... Line 3487...
3489
        popad                         ; end enable io map
3487
        popad                         ; end enable io map
3490
 
3488
 
Line 3549... Line 3547...
3549
        call    set_io_access_rights
3547
        call    set_io_access_rights
Line 3550... Line 3548...
3550
 
3548
 
3551
        inc     eax
3549
        inc     eax
3552
        cmp     eax, edx
3550
        cmp     eax, edx
3553
        jbe     .new_port_access_disable
3551
        jbe     .new_port_access_disable
3554
;no_mask_io:                         ; end disable io map
3552
                                    ; end disable io map
3555
        xor     eax, eax
3553
        xor     eax, eax
3556
        ret
3554
        ret
3557
;-----------------------------------------------------------------------------
3555
;-----------------------------------------------------------------------------
3558
align 4
3556
align 4