Subversion Repositories Kolibri OS

Rev

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

Rev 214 Rev 221
Line 356... Line 356...
356
      no_mode_0x12:
356
      no_mode_0x12:
Line 357... Line 357...
357
 
357
 
Line 358... Line 358...
358
; MEMORY MODEL
358
; MEMORY MODEL
-
 
359
 
359
 
360
           call mem_test
Line 360... Line 361...
360
           call mem_test
361
 
361
           mov [MEM_AMOUNT], eax
362
           mov [MEM_AMOUNT], eax
Line 392... Line 393...
392
;           btr [cpu_caps], CAPS_FXSR   ;test: disable sse support
393
;           btr [cpu_caps], CAPS_FXSR   ;test: disable sse support
393
                                        ;all sse commands rise #UD exption
394
                                        ;all sse commands rise #UD exption
394
;           btr [cpu_caps], CAPS_PSE    ;test: don't use large pages
395
;           btr [cpu_caps], CAPS_PSE    ;test: don't use large pages
395
;           btr [cpu_caps], CAPS_PGE    ;test: don't use global pages
396
;           btr [cpu_caps], CAPS_PGE    ;test: don't use global pages
396
;           btr [cpu_caps], CAPS_MTRR   ;test: don't use MTRR
397
;           btr [cpu_caps], CAPS_MTRR   ;test: don't use MTRR
397
;           bts [cpu_caps], CAPS_TSC    ;test: don't use TSC
398
           bts [cpu_caps], CAPS_TSC     ;force use rdtsc
Line 398... Line 399...
398
 
399
 
399
           call init_memEx
400
           call init_memEx
Line 400... Line 401...
400
           call init_page_map
401
           call init_page_map
Line 547... Line 548...
547
 
548
 
548
        mov   esi,boot_setmouse
549
        mov   esi,boot_setmouse
549
        call  boot_log
550
        call  boot_log
Line -... Line 551...
-
 
551
        call  setmouse
-
 
552
 
550
        call  setmouse
553
        call init_cursors
551
 
554
 
Line 552... Line 555...
552
        mov  [pci_access_enabled],1
555
;        mov  [pci_access_enabled],1
Line 553... Line 556...
553
        stdcall get_service, szHMouse
556
;        stdcall get_service, szCURSOR
554
 
557
 
Line 587... Line 590...
587
        mov  dword [0x80000+APPDATA.sse_handler], 0
590
        mov  dword [0x80000+APPDATA.sse_handler], 0
Line 588... Line 591...
588
 
591
 
589
        ; name for OS/IDLE process
592
        ; name for OS/IDLE process
590
        mov  dword [0x80000+256+APPDATA.app_name],   dword 'OS/I'
593
        mov  dword [0x80000+256+APPDATA.app_name],   dword 'OS/I'
-
 
594
        mov  dword [0x80000+256+APPDATA.app_name+4], dword 'DLE '
-
 
595
        mov ebx, [def_cursor]
-
 
596
        mov dword [0x80000+256+APPDATA.cursor], ebx
591
        mov  dword [0x80000+256+APPDATA.app_name+4], dword 'DLE '
597
 
592
        mov  dword [0x80000+256+APPDATA.fpu_handler], 0
598
        mov  dword [0x80000+256+APPDATA.fpu_handler], 0
Line 593... Line 599...
593
        mov  dword [0x80000+256+APPDATA.sse_handler], 0
599
        mov  dword [0x80000+256+APPDATA.sse_handler], 0
594
 
600
 
595
;set fpu save area
601
;set fpu save area
596
        mov esi, eax
602
        mov esi, eax
Line 597... Line 603...
597
        bt [cpu_caps], CAPS_FXSR
603
        bt [cpu_caps], CAPS_SSE
598
        jnc .no_sse
604
        jnc .no_sse
599
 
605
 
600
        lea edi, [eax+512]
606
        lea edi, [eax+512]
601
        mov  dword [0x80000+256+APPDATA.fpu_state], edi
607
        mov  dword [PROC_BASE+256+APPDATA.fpu_state], edi
602
        mov ecx, 512/4
608
        mov ecx, 512/4
603
        jmp @F
609
        jmp @F
604
.no_sse:
610
.no_sse:
605
        lea edi, [eax+112]
611
        lea edi, [eax+112]
606
        mov  dword [0x80000+256+APPDATA.fpu_state], edi
612
        mov  dword [PROC_BASE+256+APPDATA.fpu_state], edi
Line 607... Line 613...
607
        mov ecx, 112/4
613
        mov ecx, 112/4
Line 1710... Line 1716...
1710
     mov  [esp+36],dword 1
1716
     mov  [esp+36],dword 1
1711
     ret
1717
     ret
Line 1712... Line 1718...
1712
 
1718
 
-
 
1719
 
-
 
1720
align 4
-
 
1721
mousefn dd msscreen, mswin, msbutton, msset
-
 
1722
        dd app_load_cursor
Line 1713... Line 1723...
1713
 
1723
        dd app_set_cursor
Line 1714... Line 1724...
1714
align 4
1724
        dd msset    ;app_delete_cursor
1715
 
1725
 
1716
readmousepos:
1726
readmousepos:
-
 
1727
 
-
 
1728
; eax=0 screen relative
-
 
1729
; eax=1 window relative
-
 
1730
; eax=2 buttons pressed
Line 1717... Line 1731...
1717
 
1731
; eax=3 set mouse pos   ; reserved
1718
; eax=0 screen relative
1732
; eax=4 load cursor
-
 
1733
; eax=5 set cursor
-
 
1734
; eax=6 delete cursor   ; reserved
1719
; eax=1 window relative
1735
 
1720
; eax=2 buttons pressed
1736
           cmp eax, 6
1721
 
1737
           ja msset
1722
    test eax,eax
1738
           jmp [mousefn+eax*4]
1723
    jnz  nosr
1739
msscreen:
1724
    mov  eax,[0xfb0a]
1740
           mov  eax,[0xfb0a]
1725
    shl  eax,16
-
 
1726
    mov  ax,[0xfb0c]
-
 
1727
    mov  [esp+36],eax
-
 
1728
    ret
1741
           shl  eax,16
1729
  nosr:
1742
           mov  ax,[0xfb0c]
1730
 
1743
           mov  [esp+36],eax
1731
    cmp  eax,1
1744
           ret
1732
    jnz  nowr
1745
mswin:
1733
    mov  eax,[0xfb0a]
1746
           mov  eax,[0xfb0a]
1734
    shl  eax,16
1747
           shl  eax,16
1735
    mov  ax,[0xfb0c]
1748
           mov  ax,[0xfb0c]
Line 1736... Line 1749...
1736
    mov  esi,[0x3010]
1749
           mov  esi,[0x3010]
1737
    mov  bx, word [esi-twdw+WDATA.box.left]
1750
           mov  bx, word [esi-twdw+WDATA.box.left]
1738
    shl  ebx,16
1751
           shl  ebx,16
1739
    mov  bx, word [esi-twdw+WDATA.box.top]
1752
           mov  bx, word [esi-twdw+WDATA.box.top]
1740
    sub  eax,ebx
1753
           sub  eax,ebx
1741
 
1754
 
1742
        mov     edi,[0x3000]
-
 
1743
        shl     edi,8
1755
           mov  edi,[CURRENT_TASK]
1744
        sub     ax,word[edi+0x80000+APPDATA.wnd_clientbox.top]
1756
           shl  edi,8
1745
        rol     eax,16
1757
           sub  ax,word[edi+PROC_BASE+APPDATA.wnd_clientbox.top]
1746
        sub     ax,word[edi+0x80000+APPDATA.wnd_clientbox.left]
-
 
1747
        rol     eax,16
-
 
1748
 
-
 
1749
    mov  [esp+36],eax
1758
           rol  eax,16
1750
    ret
-
 
1751
  nowr:
1759
           sub  ax,word[edi+PROC_BASE+APPDATA.wnd_clientbox.left]
-
 
1760
           rol  eax,16
-
 
1761
           mov  [esp+36],eax
-
 
1762
           ret
-
 
1763
msbutton:
-
 
1764
           movzx eax,byte [0xfb40]
-
 
1765
           mov  [esp+36],eax
-
 
1766
           ret
-
 
1767
msset:
-
 
1768
           ret
-
 
1769
 
-
 
1770
app_load_cursor:
Line -... Line 1771...
-
 
1771
           add ebx, new_app_base
-
 
1772
           cmp ebx, new_app_base
-
 
1773
           jb msset
1752
 
1774
           stdcall load_cursor, ebx, ecx
Line -... Line 1775...
-
 
1775
           mov [esp+36], eax
1753
    cmp   eax,2
1776
           ret
Line 1754... Line 1777...
1754
    jnz   nomb
1777
 
1755
    movzx eax,byte [0xfb40]
1778
app_set_cursor:
1756
  nomb:
1779
           stdcall set_cursor, ebx
Line 3072... Line 3095...
3072
        mov   ebx, [edi + WDATA.box.top]
3095
        mov   ebx, [edi + WDATA.box.top]
3073
        mov   ecx, [edi + WDATA.box.width]
3096
        mov   ecx, [edi + WDATA.box.width]
3074
        mov   edx, [edi + WDATA.box.height]
3097
        mov   edx, [edi + WDATA.box.height]
3075
        add   ecx,eax
3098
        add   ecx,eax
3076
        add   edx,ebx
3099
        add   edx,ebx
-
 
3100
 
3077
        call  calculatescreen
3101
        call  calculatescreen
3078
        popad
3102
        popad
Line 3079... Line 3103...
3079
 
3103
 
3080
        pop   edx                   ; calculcate screen at old position
3104
        pop   edx                   ; calculcate screen at old position
Line 3249... Line 3273...
3249
        inc  edx
3273
        inc  edx
3250
        imul edx, ebx
3274
        imul edx, ebx
3251
        mov  dl, [eax+edx+display_data] ; lea eax, [...]
3275
        mov  dl, [eax+edx+display_data] ; lea eax, [...]
Line 3252... Line 3276...
3252
 
3276
 
3253
        xor  ecx, ecx
3277
        xor  ecx, ecx
3254
        mov  eax, [0x3000]
3278
        mov  eax, [CURRENT_TASK]
3255
        cmp  al, dl
3279
        cmp  al, dl
Line 3256... Line 3280...
3256
        setne cl
3280
        setne cl
3257
 
3281
 
Line 4864... Line 4888...
4864
;      pop   edi
4888
;      pop   edi
Line 4865... Line 4889...
4865
 
4889
 
Line 4866... Line -...
4866
;      ret
-
 
4867
 
-
 
4868
 
4890
;      ret
Line 4869... Line 4891...
4869
 
4891
 
4870
 
4892
 
4871
keymap:
4893
keymap: