Subversion Repositories Kolibri OS

Rev

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

Rev 1290 Rev 1300
Line 55... Line 55...
55
;;
55
;;
56
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 57... Line 57...
57
 
57
 
Line 58... Line 58...
58
include 'macros.inc'
58
include 'macros.inc'
Line 59... Line 59...
59
 
59
 
Line 60... Line 60...
60
$Revision: 1290 $
60
$Revision: 1300 $
Line 347... Line 347...
347
; -----------------------------------------
347
; -----------------------------------------
348
;        movzx eax,byte [BOOT_VAR+0x9010]	; mouse port
348
;        movzx eax,byte [BOOT_VAR+0x9010]	; mouse port
349
;        mov   [0xF604],byte 1  ;al
349
;        mov   [0xF604],byte 1  ;al
350
		mov	al, [BOOT_VAR+0x901F]   	; DMA access
350
		mov	al, [BOOT_VAR+0x901F]   	; DMA access
351
        mov	[allow_dma_access], al
351
        mov	[allow_dma_access], al
352
        mov al,[BOOT_VAR+0x9000]        ; bpp
352
        movzx eax, byte [BOOT_VAR+0x9000]        ; bpp
353
        mov [ScreenBPP],al
353
        mov [ScreenBPP],al
Line -... Line 354...
-
 
354
 
-
 
355
        mov [_display.bpp], eax
-
 
356
        mov [_display.vrefresh], 60
-
 
357
        mov [_display.disable_mouse],  __sys_disable_mouse
354
 
358
 
-
 
359
        movzx eax,word [BOOT_VAR+0x900A]  ; X max
355
        movzx eax,word [BOOT_VAR+0x900A]  ; X max
360
        mov [_display.width], eax
356
        dec   eax
361
        dec   eax
357
        mov   [Screen_Max_X],eax
362
        mov   [Screen_Max_X],eax
358
        mov   [screen_workarea.right],eax
363
        mov   [screen_workarea.right],eax
-
 
364
        movzx eax,word [BOOT_VAR+0x900C]  ; Y max
359
        movzx eax,word [BOOT_VAR+0x900C]  ; Y max
365
        mov [_display.height], eax
360
        dec   eax
366
        dec   eax
361
        mov   [Screen_Max_Y],eax
367
        mov   [Screen_Max_Y],eax
362
        mov   [screen_workarea.bottom],eax
368
        mov   [screen_workarea.bottom],eax
363
        movzx eax,word [BOOT_VAR+0x9008]  ; screen mode
369
        movzx eax,word [BOOT_VAR+0x9008]  ; screen mode
Line 367... Line 373...
367
        mov   [BytesPerScanLine],word 640*4         ; Bytes PerScanLine
373
        mov   [BytesPerScanLine],word 640*4         ; Bytes PerScanLine
368
        cmp   [SCR_MODE],word 0x13          ; 320x200
374
        cmp   [SCR_MODE],word 0x13          ; 320x200
369
        je    @f
375
        je    @f
370
        cmp   [SCR_MODE],word 0x12          ; VGA 640x480
376
        cmp   [SCR_MODE],word 0x12          ; VGA 640x480
371
        je    @f
377
        je    @f
372
        mov   ax,[BOOT_VAR+0x9001]        ; for other modes
378
        movzx eax, word[BOOT_VAR+0x9001]        ; for other modes
373
        mov   [BytesPerScanLine],ax
379
        mov   [BytesPerScanLine],ax
-
 
380
        mov [_display.pitch], eax
374
@@:
381
@@:
-
 
382
        mov eax, [_display.width]
-
 
383
        mul [_display.height]
-
 
384
        mov [_WinMapSize], eax
-
 
385
 
375
        mov     esi, BOOT_VAR+0x9080
386
        mov     esi, BOOT_VAR+0x9080
376
        movzx   ecx, byte [esi-1]
387
        movzx   ecx, byte [esi-1]
377
        mov     [NumBiosDisks], ecx
388
        mov     [NumBiosDisks], ecx
378
        mov     edi, BiosDisksData
389
        mov     edi, BiosDisksData
379
        rep     movsd
390
        rep     movsd
Line 539... Line 550...
539
        mov     [graph_data_l+2],ax
550
        mov     [graph_data_l+2],ax
540
        shr     eax,16
551
        shr     eax,16
541
        mov     [graph_data_l+4],al
552
        mov     [graph_data_l+4],al
542
        mov     [graph_data_l+7],ah
553
        mov     [graph_data_l+7],ah
Line -... Line 554...
-
 
554
 
-
 
555
        stdcall kernel_alloc, [_WinMapSize]
-
 
556
        mov [_WinMapAddress], eax
543
 
557
 
544
        xor  eax,eax
558
        xor  eax,eax
545
        inc  eax
559
        inc  eax
546
        mov [CURRENT_TASK],eax		;dword 1
560
        mov [CURRENT_TASK],eax		;dword 1
547
        mov [TASK_COUNT],eax		;dword 1
561
        mov [TASK_COUNT],eax		;dword 1
548
        mov [TASK_BASE],dword TASK_DATA
562
        mov [TASK_BASE],dword TASK_DATA
Line 549... Line 563...
549
        mov [current_slot], SLOT_BASE+256
563
        mov [current_slot], SLOT_BASE+256
550
 
-
 
551
; set background
-
 
-
 
564
 
552
;        xor  eax,eax
565
; set background
553
;        inc  eax
566
 
554
        mov   [BgrDrawMode],eax
567
        mov   [BgrDrawMode],eax
555
        mov   [BgrDataWidth],eax
568
        mov   [BgrDataWidth],eax
556
        mov   [BgrDataHeight],eax
569
        mov   [BgrDataHeight],eax
Line 1803... Line 1816...
1803
;           ret
1816
;           ret
1804
msset:
1817
msset:
1805
           ret
1818
           ret
Line 1806... Line 1819...
1806
 
1819
 
1807
app_load_cursor:
-
 
1808
      ;     add ebx, new_app_base
1820
app_load_cursor:
1809
           cmp ecx, OS_BASE
1821
           cmp ecx, OS_BASE
1810
           jae msset
1822
           jae msset
1811
           stdcall load_cursor, ecx, edx
1823
           stdcall load_cursor, ecx, edx
1812
           mov [esp+36-4], eax
1824
           mov [esp+36-4], eax
Line 2892... Line 2904...
2892
    and   eax,15
2904
    and   eax,15
Line 2893... Line 2905...
2893
 
2905
 
2894
;    cmp   eax,0   ; type I    - original style
2906
;    cmp   eax,0   ; type I    - original style
2895
    jne   nosyswI
2907
    jne   nosyswI
2896
    inc   [mouse_pause]
2908
    inc   [mouse_pause]
2897
    call  [disable_mouse]
2909
    call  [_display.disable_mouse]
2898
    call  sys_set_window
2910
    call  sys_set_window
2899
    call  [disable_mouse]
2911
    call  [_display.disable_mouse]
2900
    call  drawwindow_I
2912
    call  drawwindow_I
2901
    ;dec   [mouse_pause]
2913
    ;dec   [mouse_pause]
2902
    ;call   [draw_pointer]
2914
    ;call   [draw_pointer]
2903
    ;ret
2915
    ;ret
2904
    jmp   draw_window_caption.2
2916
    jmp   draw_window_caption.2
Line 2905... Line 2917...
2905
  nosyswI:
2917
  nosyswI:
2906
 
2918
 
2907
    cmp   al,1    ; type II   - only reserve area, no draw
2919
    cmp   al,1    ; type II   - only reserve area, no draw
2908
    jne   nosyswII
2920
    jne   nosyswII
2909
    inc   [mouse_pause]
2921
    inc   [mouse_pause]
2910
    call  [disable_mouse]
2922
    call  [_display.disable_mouse]
2911
    call  sys_set_window
2923
    call  sys_set_window
2912
    call  [disable_mouse]
2924
    call  [_display.disable_mouse]
2913
    call  sys_window_mouse
2925
    call  sys_window_mouse
2914
    dec   [mouse_pause]
2926
    dec   [mouse_pause]
2915
    call   [draw_pointer]
2927
    call   [draw_pointer]
Line 2916... Line 2928...
2916
    ret
2928
    ret
2917
  nosyswII:
2929
  nosyswII:
2918
 
2930
 
2919
    cmp   al,2    ; type III  - new style
2931
    cmp   al,2    ; type III  - new style
2920
    jne   nosyswIII
2932
    jne   nosyswIII
2921
    inc   [mouse_pause]
2933
    inc   [mouse_pause]
2922
    call  [disable_mouse]
2934
    call  [_display.disable_mouse]
2923
    call  sys_set_window
2935
    call  sys_set_window
2924
    call  [disable_mouse]
2936
    call  [_display.disable_mouse]
2925
    call  drawwindow_III
2937
    call  drawwindow_III
2926
    ;dec   [mouse_pause]
2938
    ;dec   [mouse_pause]
Line 2934... Line 2946...
2934
    cmp   al,4    ; type V - skinned window not sized! {not_sized_skin_window}
2946
    cmp   al,4    ; type V - skinned window not sized! {not_sized_skin_window}
2935
    jne   nosyswV
2947
    jne   nosyswV
2936
  draw_skin_window:
2948
  draw_skin_window:
Line 2937... Line 2949...
2937
 
2949
 
2938
    inc   [mouse_pause]
2950
    inc   [mouse_pause]
2939
    call  [disable_mouse]
2951
    call  [_display.disable_mouse]
2940
    call  sys_set_window
2952
    call  sys_set_window
2941
    call  [disable_mouse]
2953
    call  [_display.disable_mouse]
2942
    mov   eax, [TASK_COUNT]
2954
    mov   eax, [TASK_COUNT]
2943
    movzx eax, word [WIN_POS + eax*2]
2955
    movzx eax, word [WIN_POS + eax*2]
2944
    cmp   eax, [CURRENT_TASK]
2956
    cmp   eax, [CURRENT_TASK]
2945
    setz  al
2957
    setz  al
Line 2955... Line 2967...
2955
    ret
2967
    ret
Line 2956... Line 2968...
2956
 
2968
 
2957
 
2969
 
2958
draw_window_caption:
2970
draw_window_caption:
Line 2959... Line 2971...
2959
        inc     [mouse_pause]
2971
        inc     [mouse_pause]
2960
        call    [disable_mouse]
2972
        call    [_display.disable_mouse]
2961
 
2973
 
2962
        xor     eax,eax
2974
        xor     eax,eax
Line 3493... Line 3505...
3493
        push eax edx
3505
        push eax edx
Line 3494... Line 3506...
3494
 
3506
 
3495
        mov  edx,[Screen_Max_X]     ; screen x size
3507
        mov  edx,[Screen_Max_X]     ; screen x size
3496
        inc  edx
3508
        inc  edx
-
 
3509
        imul edx, ebx
3497
        imul edx, ebx
3510
        add  eax, [_WinMapAddress]
Line 3498... Line 3511...
3498
        mov  dl, [eax+edx+display_data] ; lea eax, [...]
3511
        mov  dl, [eax+edx] ; lea eax, [...]
3499
 
3512
 
3500
        xor  ecx, ecx
3513
        xor  ecx, ecx
3501
        mov  eax, [CURRENT_TASK]
3514
        mov  eax, [CURRENT_TASK]
Line 3582... Line 3595...
3582
    loop  markz
3595
    loop  markz
3583
@@:
3596
@@:
Line 3584... Line 3597...
3584
 
3597
 
Line 3585... Line 3598...
3585
  no_mark_system_shutdown:
3598
  no_mark_system_shutdown:
Line 3586... Line 3599...
3586
 
3599
 
3587
    call [disable_mouse]
3600
    call [_display.disable_mouse]
Line 3588... Line 3601...
3588
 
3601
 
Line 3740... Line 3753...
3740
 
3753
 
Line 3741... Line 3754...
3741
         ret
3754
         ret
Line 3742... Line 3755...
3742
 
3755
 
3743
calculatebackground:   ; background
3756
calculatebackground:   ; background
3744
 
3757
 
-
 
3758
        mov   edi, [_WinMapAddress]                ; set os to use all pixels
3745
        mov   edi,display_data              ; set os to use all pixels
3759
        mov   eax,0x01010101
Line 3746... Line 3760...
3746
        mov   eax,0x01010101
3760
        mov   ecx, [_WinMapSize]
Line 3747... Line 3761...
3747
        mov   ecx,1280*1024 / 4
3761
        shr   ecx, 2
Line 5091... Line 5105...
5091
        mov     edi, [current_slot]
5105
        mov     edi, [current_slot]
5092
        add     eax, [edi+APPDATA.wnd_clientbox.left]
5106
        add     eax, [edi+APPDATA.wnd_clientbox.left]
5093
        add     ebx, [edi+APPDATA.wnd_clientbox.top]
5107
        add     ebx, [edi+APPDATA.wnd_clientbox.top]
5094
        xor     edi, edi ; no force
5108
        xor     edi, edi ; no force
5095
;       mov     edi, 1
5109
;       mov     edi, 1
5096
        call    [disable_mouse]
5110
        call    [_display.disable_mouse]
5097
        jmp     [putpixel]
5111
        jmp     [putpixel]
Line 5098... Line 5112...
5098
 
5112
 
Line 5099... Line 5113...
5099
align 4
5113
align 4
Line 5245... Line 5259...
5245
;ecx = [size x]*65536 + [size y]
5259
;ecx = [size x]*65536 + [size y]
5246
;edx = [start x]*65536 + [start y]
5260
;edx = [start x]*65536 + [start y]
5247
     pushad
5261
     pushad
5248
         inc   [mouse_pause]
5262
         inc   [mouse_pause]
5249
; Check of use of the hardware cursor.
5263
; Check of use of the hardware cursor.
5250
      cmp  [disable_mouse],__sys_disable_mouse
5264
      cmp  [_display.disable_mouse],__sys_disable_mouse
5251
          jne  @f
5265
          jne  @f
5252
; Since the test for the coordinates of the mouse should not be used,
5266
; Since the test for the coordinates of the mouse should not be used,
5253
; then use the call [disable_mouse] is not possible!
5267
; then use the call [disable_mouse] is not possible!
5254
      cmp  dword [MOUSE_VISIBLE],dword 0
5268
      cmp  dword [MOUSE_VISIBLE],dword 0
5255
      jne  @f
5269
      jne  @f
Line 5309... Line 5323...
5309
         dec   ebx
5323
         dec   ebx
5310
     dec   edx
5324
     dec   edx
5311
     jnz   .start_y
5325
     jnz   .start_y
5312
     dec        [mouse_pause]
5326
     dec        [mouse_pause]
5313
; Check of use of the hardware cursor.
5327
; Check of use of the hardware cursor.
5314
      cmp  [disable_mouse],__sys_disable_mouse
5328
      cmp  [_display.disable_mouse],__sys_disable_mouse
5315
          jne  @f
5329
          jne  @f
5316
         call  [draw_pointer]
5330
         call  [draw_pointer]
5317
@@:
5331
@@:
5318
     popad
5332
     popad
5319
     ret
5333
     ret
Line 5431... Line 5445...
5431
        pushfd
5445
        pushfd
5432
        cli
5446
        cli
Line 5433... Line 5447...
5433
 
5447
 
5434
        mov [Screen_Max_X], eax
5448
        mov [Screen_Max_X], eax
-
 
5449
        mov [Screen_Max_Y], edx
Line 5435... Line 5450...
5435
        mov [Screen_Max_Y], edx
5450
        mov [BytesPerScanLine], ecx
5436
 
5451
 
5437
        mov [screen_workarea.right],eax
5452
        mov [screen_workarea.right],eax
5438
        mov [screen_workarea.bottom], edx
-
 
5439
        inc eax
-
 
5440
        shl eax, 2                      ;32 bpp
5453
        mov [screen_workarea.bottom], edx
5441
        mov [BytesPerScanLine], eax
5454
 
5442
        push ebx
5455
        push ebx
-
 
5456
        push esi
-
 
5457
        push edi
-
 
5458
 
-
 
5459
        pushad
-
 
5460
 
-
 
5461
        stdcall kernel_free, [_WinMapAddress]
-
 
5462
 
-
 
5463
        mov eax, [_display.width]
-
 
5464
        mul [_display.height]
-
 
5465
        mov [_WinMapSize], eax
-
 
5466
 
-
 
5467
        stdcall kernel_alloc, eax
-
 
5468
        mov [_WinMapAddress], eax
-
 
5469
        test eax, eax
-
 
5470
        jz .epic_fail
-
 
5471
 
5443
        push esi
5472
        popad
5444
        push edi
5473
 
5445
        call    repos_windows
5474
        call    repos_windows
5446
        mov     eax, 0
5475
        xor eax, eax
5447
        mov     ebx, 0
5476
        xor ebx, ebx
5448
        mov     ecx, [Screen_Max_X]
5477
        mov     ecx, [Screen_Max_X]
5449
        mov     edx, [Screen_Max_Y]
5478
        mov     edx, [Screen_Max_Y]
5450
        call    calculatescreen
5479
        call    calculatescreen
5451
        pop edi
5480
        pop edi
Line 5452... Line 5481...
5452
        pop esi
5481
        pop esi
5453
        pop ebx
5482
        pop ebx
Line -... Line 5483...
-
 
5483
 
-
 
5484
        popfd
-
 
5485
        ret
5454
 
5486
 
5455
        popfd
5487
.epic_fail:
5456
        ret
5488
        hlt                     ; Houston, we've had a problem
5457
 
5489
 
5458
; --------------- APM ---------------------
5490
; --------------- APM ---------------------