Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1300 → Rev 1299

/kernel/trunk/kernel.asm
349,20 → 349,14
; mov [0xF604],byte 1 ;al
mov al, [BOOT_VAR+0x901F] ; DMA access
mov [allow_dma_access], al
movzx eax, byte [BOOT_VAR+0x9000] ; bpp
mov al,[BOOT_VAR+0x9000] ; bpp
mov [ScreenBPP],al
 
mov [_display.bpp], eax
mov [_display.vrefresh], 60
mov [_display.disable_mouse], __sys_disable_mouse
 
movzx eax,word [BOOT_VAR+0x900A] ; X max
mov [_display.width], eax
dec eax
mov [Screen_Max_X],eax
mov [screen_workarea.right],eax
movzx eax,word [BOOT_VAR+0x900C] ; Y max
mov [_display.height], eax
dec eax
mov [Screen_Max_Y],eax
mov [screen_workarea.bottom],eax
375,14 → 369,9
je @f
cmp [SCR_MODE],word 0x12 ; VGA 640x480
je @f
movzx eax, word[BOOT_VAR+0x9001] ; for other modes
mov ax,[BOOT_VAR+0x9001] ; for other modes
mov [BytesPerScanLine],ax
mov [_display.pitch], eax
@@:
mov eax, [_display.width]
mul [_display.height]
mov [_WinMapSize], eax
 
mov esi, BOOT_VAR+0x9080
movzx ecx, byte [esi-1]
mov [NumBiosDisks], ecx
552,9 → 541,6
mov [graph_data_l+4],al
mov [graph_data_l+7],ah
 
stdcall kernel_alloc, [_WinMapSize]
mov [_WinMapAddress], eax
 
xor eax,eax
inc eax
mov [CURRENT_TASK],eax ;dword 1
563,7 → 549,8
mov [current_slot], SLOT_BASE+256
 
; set background
 
; xor eax,eax
; inc eax
mov [BgrDrawMode],eax
mov [BgrDataWidth],eax
mov [BgrDataHeight],eax
1818,6 → 1805,7
ret
 
app_load_cursor:
; add ebx, new_app_base
cmp ecx, OS_BASE
jae msset
stdcall load_cursor, ecx, edx
2906,9 → 2894,9
; cmp eax,0 ; type I - original style
jne nosyswI
inc [mouse_pause]
call [_display.disable_mouse]
call [disable_mouse]
call sys_set_window
call [_display.disable_mouse]
call [disable_mouse]
call drawwindow_I
;dec [mouse_pause]
;call [draw_pointer]
2919,9 → 2907,9
cmp al,1 ; type II - only reserve area, no draw
jne nosyswII
inc [mouse_pause]
call [_display.disable_mouse]
call [disable_mouse]
call sys_set_window
call [_display.disable_mouse]
call [disable_mouse]
call sys_window_mouse
dec [mouse_pause]
call [draw_pointer]
2931,9 → 2919,9
cmp al,2 ; type III - new style
jne nosyswIII
inc [mouse_pause]
call [_display.disable_mouse]
call [disable_mouse]
call sys_set_window
call [_display.disable_mouse]
call [disable_mouse]
call drawwindow_III
;dec [mouse_pause]
;call [draw_pointer]
2948,9 → 2936,9
draw_skin_window:
 
inc [mouse_pause]
call [_display.disable_mouse]
call [disable_mouse]
call sys_set_window
call [_display.disable_mouse]
call [disable_mouse]
mov eax, [TASK_COUNT]
movzx eax, word [WIN_POS + eax*2]
cmp eax, [CURRENT_TASK]
2969,7 → 2957,7
 
draw_window_caption:
inc [mouse_pause]
call [_display.disable_mouse]
call [disable_mouse]
 
xor eax,eax
mov edx,[TASK_COUNT]
3507,8 → 3495,7
mov edx,[Screen_Max_X] ; screen x size
inc edx
imul edx, ebx
add eax, [_WinMapAddress]
mov dl, [eax+edx] ; lea eax, [...]
mov dl, [eax+edx+display_data] ; lea eax, [...]
 
xor ecx, ecx
mov eax, [CURRENT_TASK]
3597,7 → 3584,7
 
no_mark_system_shutdown:
 
call [_display.disable_mouse]
call [disable_mouse]
 
dec byte [SYS_SHUTDOWN]
je system_shutdown
3755,10 → 3742,9
 
calculatebackground: ; background
 
mov edi, [_WinMapAddress] ; set os to use all pixels
mov edi,display_data ; set os to use all pixels
mov eax,0x01010101
mov ecx, [_WinMapSize]
shr ecx, 2
mov ecx,1280*1024 / 4
rep stosd
 
mov byte [REDRAW_BACKGROUND], 0 ; do not draw background!
5107,7 → 5093,7
add ebx, [edi+APPDATA.wnd_clientbox.top]
xor edi, edi ; no force
; mov edi, 1
call [_display.disable_mouse]
call [disable_mouse]
jmp [putpixel]
 
align 4
5261,7 → 5247,7
pushad
inc [mouse_pause]
; Check of use of the hardware cursor.
cmp [_display.disable_mouse],__sys_disable_mouse
cmp [disable_mouse],__sys_disable_mouse
jne @f
; Since the test for the coordinates of the mouse should not be used,
; then use the call [disable_mouse] is not possible!
5325,7 → 5311,7
jnz .start_y
dec [mouse_pause]
; Check of use of the hardware cursor.
cmp [_display.disable_mouse],__sys_disable_mouse
cmp [disable_mouse],__sys_disable_mouse
jne @f
call [draw_pointer]
@@:
5447,33 → 5433,18
 
mov [Screen_Max_X], eax
mov [Screen_Max_Y], edx
mov [BytesPerScanLine], ecx
 
mov [screen_workarea.right],eax
mov [screen_workarea.bottom], edx
 
inc eax
shl eax, 2 ;32 bpp
mov [BytesPerScanLine], eax
push ebx
push esi
push edi
 
pushad
 
stdcall kernel_free, [_WinMapAddress]
 
mov eax, [_display.width]
mul [_display.height]
mov [_WinMapSize], eax
 
stdcall kernel_alloc, eax
mov [_WinMapAddress], eax
test eax, eax
jz .epic_fail
 
popad
 
call repos_windows
xor eax, eax
xor ebx, ebx
mov eax, 0
mov ebx, 0
mov ecx, [Screen_Max_X]
mov edx, [Screen_Max_Y]
call calculatescreen
5484,9 → 5455,6
popfd
ret
 
.epic_fail:
hlt ; Houston, we've had a problem
 
; --------------- APM ---------------------
apm_entry dp 0
apm_vf dd 0