sys function 48 is run without cross registers call now.

git-svn-id: svn://kolibrios.org@1324 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2009-12-16 15:19:40 +00:00
parent 903ae397ab
commit e76fbc9647
3 changed files with 99 additions and 95 deletions

View File

@ -151,7 +151,7 @@ iglobal
dd 0 dd 0
dd 0 ; 46-ReservePortArea and FreePortArea dd 0 ; 46-ReservePortArea and FreePortArea
dd display_number ; 47-WriteNum dd display_number ; 47-WriteNum
dd display_settings ; 48-SetRedrawType and SetButtonType dd 0 ; 48-SetRedrawType and SetButtonType
dd sys_apm ; 49-Advanced Power Management (APM) dd sys_apm ; 49-Advanced Power Management (APM)
dd random_shaped_window ; 50-Window shape & scale dd random_shaped_window ; 50-Window shape & scale
dd syscall_threads ; 51-Threads dd syscall_threads ; 51-Threads
@ -230,7 +230,7 @@ iglobal
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
dd cross_order ; 47-WriteNum dd cross_order ; 47-WriteNum
dd cross_order ; 48-SetRedrawType and SetButtonType dd display_settings ; 48-SetRedrawType and SetButtonType
dd cross_order ; 49-Advanced Power Management (APM) dd cross_order ; 49-Advanced Power Management (APM)
dd cross_order ; 50-Window shape & scale dd cross_order ; 50-Window shape & scale
dd cross_order ; 51-Threads dd cross_order ; 51-Threads

View File

@ -314,128 +314,137 @@ popad
ret ret
iglobal
align 4
f48call:
dd display_settings.00
dd display_settings.01
dd display_settings.02
dd display_settings.03
dd display_settings.04
dd display_settings.05
dd display_settings.06
dd display_settings.07
dd display_settings.08
endg
display_settings: display_settings:
; eax = 0 ; DISPLAY redraw ; ebx = 0 ; DISPLAY redraw
; ebx = 0 ; all ; ebx = 0 ; all
; ;
; eax = 1 ; BUTTON type ; ebx = 1 ; BUTTON type
; ebx = 0 ; flat ; ebx = 0 ; flat
; ebx = 1 ; 3D ; ebx = 1 ; 3D
; eax = 2 ; set WINDOW colours ; ebx = 2 ; set WINDOW colours
; ebx = pointer to table ; ebx = pointer to table
; ecx = number of bytes define ; ecx = number of bytes define
; eax = 3 ; get WINDOW colours ; ebx = 3 ; get WINDOW colours
; ebx = pointer to table ; ebx = pointer to table
; ecx = number of bytes wanted ; ecx = number of bytes wanted
; eax = 4 ; get skin height ; ebx = 4 ; get skin height
; input : nothing ; input : nothing
; output : eax = skin height in pixel ; output : eax = skin height in pixel
; eax = 5 ; get screen workarea ; ebx = 5 ; get screen workarea
; input : nothing ; input : nothing
; output : eax = [left]*65536+[right] ; output : eax = [left]*65536+[right]
; ebx = [top]*65536+[bottom] ; ebx = [top]*65536+[bottom]
; eax = 6 ; set screen workarea ; ebx = 6 ; set screen workarea
; input : ecx = [left]*65536+[right] ; input : ecx = [left]*65536+[right]
; edx = [top]*65536+[bottom] ; edx = [top]*65536+[bottom]
; output : nothing ; output : nothing
; eax = 7 ; get skin margins ; ebx = 7 ; get skin margins
; input : nothing ; input : nothing
; output : eax = [left]*65536+[right] ; output : eax = [left]*65536+[right]
; ebx = [top]*65536+[bottom] ; ebx = [top]*65536+[bottom]
; eax = 8 ; set window skin ; ebx = 8 ; set window skin
; input : ecx = pointer to file info block ; input : ecx = pointer to file info block
; output : eax = FS error code ; output : eax = FS error code
cmp ebx,8
ja .fail
jmp dword [f48call+ebx*4]
.00:
; redraw display
pushad test ecx, ecx
jnz .01
test eax, eax ; redraw display inc ecx
jnz dspl0 cmp [windowtypechanged],dword ecx ;ebx=1
test ebx, ebx jne .fail
jnz dspl0 mov [windowtypechanged],dword ebx ;eax=0
cmp [windowtypechanged],dword 1 .redraw_screen_direct:
jne dspl00 xor eax,eax
mov [windowtypechanged],dword 0 mov [dlx],dword eax
redraw_screen_direct: mov [dly],dword eax
mov [dlx],dword 0
mov [dly],dword 0
mov eax,[Screen_Max_X] mov eax,[Screen_Max_X]
mov [dlxe],eax mov [dlxe],eax
mov eax,[Screen_Max_Y] mov eax,[Screen_Max_Y]
mov [dlye],eax mov [dlye],eax
mov eax,window_data mov eax,window_data
call redrawscreen ;maybe use jmp?
dspl00: ; call redrawscreen
popad jmp redrawscreen
.fail:
ret ret
dspl0: .01:
; button type
cmp eax,1 ; button type and ecx,1
jne dspl1 cmp ecx,[buttontype]
and ebx,1 je .01_ex
cmp ebx,[buttontype] mov [buttontype],ecx
je dspl9 mov [windowtypechanged],dword ebx ;eax=1
mov [buttontype],ebx .01_ex:
mov [windowtypechanged],dword 1
dspl9:
popad
ret ret
dspl1:
cmp eax,2 ; set common window colours .02:
jne no_com_colours ; set common window colours
mov [windowtypechanged],dword 1 dec ebx
mov [windowtypechanged],dword ebx ;eax=1
mov esi,[TASK_BASE] mov esi,[TASK_BASE]
add esi,TASKDATA.mem_start add esi,TASKDATA.mem_start
add ebx,[esi] add ecx,[esi]
mov esi,ebx mov esi,ecx
and edx,127
mov edi,common_colours mov edi,common_colours
and ecx,127 mov ecx,edx
cld ; cld not need because cld is set previous call
rep movsb rep movsb
popad
ret ret
no_com_colours:
cmp eax,3 ; get common window colours .03:
jne no_get_com ; get common window colours
mov esi,[TASK_BASE] mov esi,[TASK_BASE]
add esi,TASKDATA.mem_start add esi,TASKDATA.mem_start
add ebx,[esi] add ecx,[esi]
mov edi,ebx mov edi,ecx
and edx,127
mov esi,common_colours mov esi,common_colours
and ecx,127 mov ecx,edx
cld ; cld not need because cld is set previous call
rep movsb rep movsb
popad
ret ret
no_get_com:
cmp eax,4 ; get skin height .04:
jne no_skin_height ; get skin height
popad
mov eax,[_skinh] mov eax,[_skinh]
mov [esp+36],eax mov [esp+32],eax
ret ret
no_skin_height:
cmp eax,5 ; get screen workarea .05:
jne no_get_workarea ; get screen workarea
popad
mov eax,[screen_workarea.left-2] mov eax,[screen_workarea.left-2]
mov ax,word[screen_workarea.right] mov ax,word[screen_workarea.right]
mov [esp+36],eax mov [esp+32],eax
mov eax,[screen_workarea.top-2] mov eax,[screen_workarea.top-2]
mov ax,word[screen_workarea.bottom] mov ax,word[screen_workarea.bottom]
mov [esp+24],eax mov [esp+20],eax
ret ret
no_get_workarea:
cmp eax,6 ; set screen workarea .06:
jne no_set_workarea ; set screen workarea
movsx eax,word[esp+16+2] ; pushad
movsx ebx,word[esp+16] movsx eax,word[esp+16+2+12] ;ecx in the stack
movsx ebx,word[esp+16+12]
cmp eax,ebx cmp eax,ebx
jge .lp1 jge .lp1
or eax,eax;[Screen_Max_X] or eax,eax;[Screen_Max_X]
@ -444,7 +453,7 @@ display_settings:
@@: cmp ebx,[Screen_Max_X] @@: cmp ebx,[Screen_Max_X]
jg .lp1 jg .lp1
mov [screen_workarea.right],ebx mov [screen_workarea.right],ebx
.lp1: movsx eax,word[esp+24+2] .lp1: movsx eax,word[esp+24+2] ;edx in the stack
movsx ebx,word[esp+24] movsx ebx,word[esp+24]
cmp eax,ebx cmp eax,ebx
jge .lp2 jge .lp2
@ -455,31 +464,31 @@ display_settings:
jg .lp2 jg .lp2
mov [screen_workarea.bottom],ebx mov [screen_workarea.bottom],ebx
.lp2: call repos_windows .lp2: call repos_windows
mov eax, 0 xor eax, eax
mov ebx, 0 xor ebx, ebx
mov ecx, [Screen_Max_X] mov ecx, [Screen_Max_X]
mov edx, [Screen_Max_Y] mov edx, [Screen_Max_Y]
call calculatescreen ; call calculatescreen
jmp calculatescreen
; jmp redraw_screen_direct ; jmp redraw_screen_direct
.exit: ; .exit:
popad ; popad
ret ; ret
no_set_workarea:
cmp eax,7 ; get skin margins .07:
jne no_get_skinmargins ; get skin margins
popad
mov eax,dword[_skinmargins+0] mov eax,dword[_skinmargins+0]
mov [esp+36],eax mov [esp+32],eax
mov eax,dword[_skinmargins+4] mov eax,dword[_skinmargins+4]
mov [esp+24],eax mov [esp+20],eax
ret ret
no_get_skinmargins:
cmp eax,8 ; set window skin .08:
jne no_set_skin ; set window skin
mov ebx, ecx
call read_skin_file call read_skin_file
mov [esp+32+36], eax
mov [esp+32], eax
test eax, eax test eax, eax
jnz .ret jnz .ret
xor eax, eax xor eax, eax
@ -487,14 +496,9 @@ display_settings:
mov ecx, [Screen_Max_X] mov ecx, [Screen_Max_X]
mov edx, [Screen_Max_Y] mov edx, [Screen_Max_Y]
call calculatescreen call calculatescreen
jmp redraw_screen_direct jmp .redraw_screen_direct
.ret: .ret:
popad
ret ret
no_set_skin:
popad
ret
repos_windows: repos_windows:

View File

@ -119,7 +119,7 @@ use16
org 0x0 org 0x0
jmp start_of_code jmp start_of_code
version db 'Kolibri OS version 0.7.7.0 ',13,10,13,10,0 version db 'Kolibri OS version 0.7.7.0+ ',13,10,13,10,0
include "boot/bootstr.inc" ; language-independent boot messages include "boot/bootstr.inc" ; language-independent boot messages
include "boot/preboot.inc" include "boot/preboot.inc"