[KERNEL] Move sysfn 1, 4, 13, 38 implementations from kernel.asm to window.inc

Fix comments style in window.inc
Cleanup some outdated & unused commented stuff in data32.inc

git-svn-id: svn://kolibrios.org@9477 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2021-12-26 13:18:33 +00:00
parent d92af710b5
commit f7761a485b
3 changed files with 247 additions and 323 deletions

View File

@ -199,23 +199,6 @@ MAX_DEFAULT_DLL_ADDR = 0x80000000
MIN_DEFAULT_DLL_ADDR = 0x70000000 MIN_DEFAULT_DLL_ADDR = 0x70000000
dll_cur_addr dd MIN_DEFAULT_DLL_ADDR dll_cur_addr dd MIN_DEFAULT_DLL_ADDR
; supported videomodes
; mike.dld {
;db 0
;dd servetable-0x10000
;align 4
;draw_line dd __sys_draw_line
;draw_pointer dd __sys_draw_pointer
;//mike.dld, 2006-08-02 [
;;drawbar dd __sys_drawbar
;;drawbar dd __sys_drawbar.forced
;drawbar dd vesa20_drawbar
;//mike.dld, 2006-08-02 ]
;putpixel dd __sys_putpixel
; } mike.dld
align 4 align 4
keyboard dd 1 keyboard dd 1

View File

@ -9,7 +9,7 @@
$Revision$ $Revision$
;============================================================================== ;==============================================================================
;///// public functions /////////////////////////////////////////////////////// ; public functions
;============================================================================== ;==============================================================================
window.BORDER_SIZE = 5 window.BORDER_SIZE = 5
@ -18,10 +18,11 @@ uglobal
common_colours rd 48 common_colours rd 48
draw_limits RECT draw_limits RECT
endg endg
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
syscall_draw_window: ;///// system function 0 ///////////////////////////////// align 4
;------------------------------------------------------------------------------ syscall_draw_window: ; system function 0
mov eax, edx mov eax, edx
shr eax, 24 shr eax, 24
and al, 0x0f and al, 0x0f
@ -69,8 +70,124 @@ syscall_draw_window: ;///// system function 0 /////////////////////////////////
.exit: .exit:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
syscall_display_settings: ;///// system function 48 ///////////////////////////
align 4
; system function 1
syscall_setpixel:
mov eax, ebx
mov ebx, ecx
mov ecx, edx
mov edx, [TASK_BASE]
add eax, [edx-twdw+WDATA.box.left]
add ebx, [edx-twdw+WDATA.box.top]
mov edi, [current_slot]
add eax, [edi+APPDATA.wnd_clientbox.left]
add ebx, [edi+APPDATA.wnd_clientbox.top]
xor edi, edi ; no force
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
jmp __sys_putpixel
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4
; system function 4
syscall_writetext:
push esi ;check pointer on kernel address.
test ecx, 0x80000000
jz @f
xor esi, esi
@@:
stdcall is_region_userspace, edx, esi
pop esi
jnz .err
mov eax, [TASK_BASE]
mov ebp, [eax-twdw+WDATA.box.left]
push esi
mov esi, [current_slot]
add ebp, [esi+APPDATA.wnd_clientbox.left]
shl ebp, 16
add ebp, [eax-twdw+WDATA.box.top]
add bp, word[esi+APPDATA.wnd_clientbox.top]
pop esi
test ecx, 0x08000000 ; redirect the output to the user area
jnz @f
add ebx, ebp
align 4
@@:
mov eax, edi
test ecx, 0x08000000 ; redirect the output to the user area
jnz @f
xor edi, edi
jmp dtext
@@: ; check pointer
stdcall is_region_userspace, edi, 0
jnz .err
jmp dtext
.err:
ret
;------------------------------------------------------------------------------
align 4
; system function 13
syscall_drawrect:
mov edi, edx ; color + gradient
and edi, 0x80FFFFFF
test bx, bx ; x.size
je .drectr
test cx, cx ; y.size
je .drectr
mov eax, ebx ; bad idea
mov ebx, ecx
movzx ecx, ax ; ecx - x.size
shr eax, 16 ; eax - x.coord
movzx edx, bx ; edx - y.size
shr ebx, 16 ; ebx - y.coord
mov esi, [current_slot]
add eax, [esi + APPDATA.wnd_clientbox.left]
add ebx, [esi + APPDATA.wnd_clientbox.top]
add ecx, eax
add edx, ebx
jmp vesa20_drawbar
.drectr:
ret
;------------------------------------------------------------------------------
align 4
; system function 38
syscall_drawline:
mov edi, [TASK_BASE]
movzx eax, word[edi-twdw+WDATA.box.left]
mov ebp, eax
mov esi, [current_slot]
add ebp, [esi+APPDATA.wnd_clientbox.left]
add ax, word[esi+APPDATA.wnd_clientbox.left]
add ebp, ebx
shl eax, 16
movzx ebx, word[edi-twdw+WDATA.box.top]
add eax, ebp
mov ebp, ebx
add ebp, [esi+APPDATA.wnd_clientbox.top]
add bx, word[esi+APPDATA.wnd_clientbox.top]
add ebp, ecx
shl ebx, 16
xor edi, edi
add ebx, ebp
mov ecx, edx
jmp __sys_draw_line
;------------------------------------------------------------------------------
align 4
; system function 48
syscall_display_settings:
cmp ebx, 13 cmp ebx, 13
ja .ret ja .ret
jmp dword[.ftable + ebx*4] jmp dword[.ftable + ebx*4]
@ -280,16 +397,17 @@ dd .setSkinUnicode
jmp .redrawScreen jmp .redrawScreen
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
syscall_set_window_shape: ;///// system function 50 ///////////////////////////
;------------------------------------------------------------------------------ align 4
; system function 50
;; Set window shape address: ;; Set window shape address:
;> ebx = 0 ;> ebx = 0
;> ecx = shape data address ;> ecx = shape data address
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; --------------------------
;; Set window shape scale: ;; Set window shape scale:
;> ebx = 1 ;> ebx = 1
;> ecx = scale power (resulting scale is 2^ebx) ;> ecx = scale power (resulting scale is 2^ebx)
;------------------------------------------------------------------------------ syscall_set_window_shape:
mov edi, [current_slot] mov edi, [current_slot]
test ebx, ebx test ebx, ebx
@ -306,12 +424,10 @@ align 4
.exit: .exit:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; system function 67
syscall_move_window: ;///// system function 67 //////////////////////////////// syscall_move_window:
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
mov edi, [current_slot_idx] mov edi, [current_slot_idx]
shl edi, 5 shl edi, 5
add edi, window_data add edi, window_data
@ -365,8 +481,9 @@ align 4
.exit: .exit:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
syscall_window_settings: ;///// system function 71 ////////////////////////////
;------------------------------------------------------------------------------ ; system function 71
syscall_window_settings:
mov edi, [current_slot_idx] mov edi, [current_slot_idx]
shl edi, 5 shl edi, 5
or [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION or [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION
@ -382,9 +499,9 @@ syscall_window_settings: ;///// system function 71 ////////////////////////////
mov [edi*8 + SLOT_BASE + APPDATA.captionEncoding], dl mov [edi*8 + SLOT_BASE + APPDATA.captionEncoding], dl
jmp window._.draw_window_caption jmp window._.draw_window_caption
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
set_window_defaults: ;///////////////////////////////////////////////////////// set_window_defaults:
;------------------------------------------------------------------------------
mov byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable mov byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable
push eax ecx push eax ecx
xor eax, eax xor eax, eax
@ -405,17 +522,13 @@ align 4
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
calculatescreen: ;/////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? Scan all windows from bottom to top, calling `setscreen` for each one ;? Scan all windows from bottom to top, calling `setscreen` for each one
;? intersecting given screen area ;? intersecting given screen area
;------------------------------------------------------------------------------
;> eax = left ;> eax = left
;> ebx = top ;> ebx = top
;> ecx = right ;> ecx = right
;> edx = bottom ;> edx = bottom
;------------------------------------------------------------------------------ calculatescreen:
push esi push esi
pushfd pushfd
cli cli
@ -526,12 +639,10 @@ align 4
pop esi pop esi
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ repos_windows:
repos_windows: ;///////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
mov ecx, [thread_count] mov ecx, [thread_count]
mov edi, window_data + sizeof.WDATA * 2 mov edi, window_data + sizeof.WDATA * 2
call force_redraw_background call force_redraw_background
@ -602,17 +713,16 @@ align 4
mov [edi + WDATA.box.height], eax mov [edi + WDATA.box.height], eax
jmp .fix_client_box jmp .fix_client_box
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
draw_rectangle: ;//////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;> eax = pack[16(left), 16(right)] ;> eax = pack[16(left), 16(right)]
;> ebx = pack[16(top), 16(bottom)] ;> ebx = pack[16(top), 16(bottom)]
;> esi = color ;> esi = color
; ?? RR GG BB ; 0x01000000 negation ; ?? RR GG BB ; 0x01000000 negation
; ; 0x02000000 used for draw_rectangle without top line ; ; 0x02000000 used for draw_rectangle without top line
; ; for example drawwindow_III and drawwindow_IV ; ; for example drawwindow_III and drawwindow_IV
;------------------------------------------------------------------------------ draw_rectangle:
push eax ebx ecx edi push eax ebx ecx edi
xor edi, edi xor edi, edi
@ -669,12 +779,10 @@ align 4
inc edi inc edi
jmp .flags_set jmp .flags_set
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ drawwindow_I_caption:
drawwindow_I_caption: ;////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
push [edx + WDATA.cl_titlebar] push [edx + WDATA.cl_titlebar]
mov esi, edx mov esi, edx
@ -724,12 +832,10 @@ align 4
pop [esi + WDATA.cl_titlebar] pop [esi + WDATA.cl_titlebar]
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ drawwindow_I:
drawwindow_I: ;////////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
pushad pushad
; window border ; window border
@ -772,12 +878,10 @@ align 4
popad popad
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ drawwindow_III_caption:
drawwindow_III_caption: ;/////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
mov ecx, [edx + WDATA.cl_titlebar] mov ecx, [edx + WDATA.cl_titlebar]
push ecx push ecx
mov esi, edx mov esi, edx
@ -833,12 +937,10 @@ align 4
pop [esi + WDATA.cl_titlebar] pop [esi + WDATA.cl_titlebar]
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ drawwindow_III:
drawwindow_III: ;//////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
pushad pushad
; window border ; window border
@ -906,12 +1008,11 @@ align 4
popad popad
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
waredraw: ;////////////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? Activate window, redrawing if necessary ;? Activate window, redrawing if necessary
;------------------------------------------------------------------------------ waredraw:
push -1 push -1
mov eax, [thread_count] mov eax, [thread_count]
lea eax, [WIN_POS + eax * 2] lea eax, [WIN_POS + eax * 2]
@ -970,8 +1071,9 @@ align 4
inc eax inc eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
minimize_all_window: minimize_all_window:
push ebx ecx edx esi edi push ebx ecx edx esi edi
pushfd pushfd
@ -1021,12 +1123,10 @@ align 4
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
minimize_window: ;/////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;> eax = window number on screen ;> eax = window number on screen
;------------------------------------------------------------------------------
;# corrupts [dl*] ;# corrupts [dl*]
;------------------------------------------------------------------------------ minimize_window:
push edi push edi
pushfd pushfd
cli cli
@ -1081,14 +1181,12 @@ align 4
pop edi pop edi
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
restore_minimized_window: ;////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;> eax = window number on screen ;> eax = window number on screen
;------------------------------------------------------------------------------
;# corrupts [dl*] ;# corrupts [dl*]
;------------------------------------------------------------------------------ restore_minimized_window:
pushad pushad
pushfd pushfd
cli cli
@ -1134,10 +1232,9 @@ align 4
align 4 align 4
; TODO: remove this proc ; TODO: remove this proc
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
window_check_events: ;/////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description> window_check_events:
;------------------------------------------------------------------------------
; do we have window minimize/restore request? ; do we have window minimize/restore request?
cmp [window_minimize], 0 cmp [window_minimize], 0
je .exit je .exit
@ -1159,14 +1256,11 @@ align 4
.exit: .exit:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
sys_window_maximize_handler: ;/////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> esi = process slot ;> esi = process slot
;------------------------------------------------------------------------------ sys_window_maximize_handler:
mov edi, esi mov edi, esi
shl edi, 5 shl edi, 5
add edi, window_data add edi, window_data
@ -1227,14 +1321,11 @@ align 4
inc [_display.mask_seqno] inc [_display.mask_seqno]
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
sys_window_rollup_handler: ;///////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> esi = process slot ;> esi = process slot
;------------------------------------------------------------------------------ sys_window_rollup_handler:
mov edx, esi mov edx, esi
shl edx, 8 shl edx, 8
add edx, SLOT_BASE add edx, SLOT_BASE
@ -1281,7 +1372,7 @@ align 4
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
;sys_window_start_moving_handler: ;///////////////////////////////////////////// ;sys_window_start_moving_handler:
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
;? <description> ;? <description>
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -1292,16 +1383,13 @@ align 4
; call window._.draw_negative_box ; call window._.draw_negative_box
; ret ; ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
sys_window_end_moving_handler: ;///////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> eax = old (original) window box ;> eax = old (original) window box
;> ebx = new (final) window box ;> ebx = new (final) window box
;> esi = process slot ;> esi = process slot
;------------------------------------------------------------------------------ sys_window_end_moving_handler:
; mov edi, ebx ; mov edi, ebx
; call window._.end_moving__box ; call window._.end_moving__box
@ -1323,23 +1411,24 @@ sys_window_end_moving_handler: ;///////////////////////////////////////////////
call window._.set_window_box call window._.set_window_box
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
sys_window_moving_handler: ;///////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> eax = old (from previous call) window box ;> eax = old (from previous call) window box
;> ebx = new (current) window box ;> ebx = new (current) window box
;> esi = process_slot ;> esi = process_slot
;------------------------------------------------------------------------------ sys_window_moving_handler:
mov edi, eax mov edi, eax
call window._.draw_negative_box call window._.draw_negative_box
mov edi, ebx mov edi, ebx
call window._.draw_negative_box call window._.draw_negative_box
ret ret
;============================================================================== ;==============================================================================
;///// private functions ////////////////////////////////////////////////////// ; private functions
;============================================================================== ;==============================================================================
iglobal iglobal
@ -1353,16 +1442,13 @@ window_topleft dd \
endg endg
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.invalidate_screen: ;//////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> eax = old (original) window box ;> eax = old (original) window box
;> ebx = new (final) window box ;> ebx = new (final) window box
;> edi = pointer to WDATA struct ;> edi = pointer to WDATA struct
;------------------------------------------------------------------------------ window._.invalidate_screen:
push eax ebx push eax ebx
; TODO: do we really need `draw_limits`? ; TODO: do we really need `draw_limits`?
@ -1405,16 +1491,13 @@ window._.invalidate_screen: ;//////////////////////////////////////////////////
pop ebx eax pop ebx eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.set_window_box: ;/////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> eax = pointer to BOX struct ;> eax = pointer to BOX struct
;> bl = new window state flags ;> bl = new window state flags
;> edi = pointer to WDATA struct ;> edi = pointer to WDATA struct
;------------------------------------------------------------------------------ window._.set_window_box:
push eax ebx esi push eax ebx esi
; don't do anything if the new box is identical to the old ; don't do anything if the new box is identical to the old
@ -1486,14 +1569,11 @@ align 4
pop esi ebx eax pop esi ebx eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.set_window_clientbox: ;///////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> edi = pointer to WDATA struct ;> edi = pointer to WDATA struct
;------------------------------------------------------------------------------ window._.set_window_clientbox:
push eax ecx edi push eax ecx edi
mov eax, [_skinh] mov eax, [_skinh]
@ -1544,14 +1624,11 @@ align 4
pop edi ecx eax pop edi ecx eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.sys_set_window: ;/////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;< edx = pointer to WDATA struct ;< edx = pointer to WDATA struct
;------------------------------------------------------------------------------ window._.sys_set_window:
mov eax, [current_slot_idx] mov eax, [current_slot_idx]
shl eax, 5 shl eax, 5
add eax, window_data add eax, window_data
@ -1637,14 +1714,12 @@ align 4
mov edx, edi mov edx, edi
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.check_window_position: ;//////////////////////////////////////////////
;------------------------------------------------------------------------------
;? Check if window is inside screen area ;? Check if window is inside screen area
;------------------------------------------------------------------------------
;> edi = pointer to WDATA ;> edi = pointer to WDATA
;------------------------------------------------------------------------------ window._.check_window_position:
push eax ebx ecx edx esi push eax ebx ecx edx esi
mov eax, [edi + WDATA.box.left] mov eax, [edi + WDATA.box.left]
@ -1725,14 +1800,11 @@ align 4
mov [edi + WDATA.box.top], ebx mov [edi + WDATA.box.top], ebx
jmp .exit jmp .exit
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.get_titlebar_height: ;////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> edi = pointer to WDATA ;> edi = pointer to WDATA
;------------------------------------------------------------------------------ window._.get_titlebar_height:
mov al, [edi + WDATA.fl_wstyle] mov al, [edi + WDATA.fl_wstyle]
and al, 0x0f and al, 0x0f
cmp al, 0x03 cmp al, 0x03
@ -1745,14 +1817,11 @@ align 4
mov eax, 21 mov eax, 21
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.get_rolledup_height: ;////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
;> edi = pointer to WDATA ;> edi = pointer to WDATA
;------------------------------------------------------------------------------ window._.get_rolledup_height:
mov al, [edi + WDATA.fl_wstyle] mov al, [edi + WDATA.fl_wstyle]
and al, 0x0f and al, 0x0f
cmp al, 0x03 cmp al, 0x03
@ -1773,18 +1842,16 @@ align 4
mov eax, 21 + 2 mov eax, 21 + 2
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------
window._.set_screen: ;/////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? Reserve window area in screen buffer ;? Reserve window area in screen buffer
;------------------------------------------------------------------------------
;> eax = left ;> eax = left
;> ebx = top ;> ebx = top
;> ecx = right ;> ecx = right
;> edx = bottom ;> edx = bottom
;> esi = process number ;> esi = process number
;------------------------------------------------------------------------------ window._.set_screen:
virtual at esp virtual at esp
ff_x dd ? ff_x dd ?
ff_y dd ? ff_y dd ?
@ -1955,14 +2022,12 @@ align 4
pop esi edx ecx eax pop esi edx ecx eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; Activate window
window._.window_activate: ;//////////////////////////////////////////////////// ; esi = pointer to WIN_POS+ window data
;------------------------------------------------------------------------------ window._.window_activate:
;? Activate window
;------------------------------------------------------------------------------
;> esi = pointer to WIN_POS+ window data
;------------------------------------------------------------------------------
push eax ebx push eax ebx
; if type of current active window is 3 or 4, it must be redrawn ; if type of current active window is 3 or 4, it must be redrawn
@ -2041,12 +2106,11 @@ align 4
pop ebx eax pop ebx eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
window._.window_deactivate: ;////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? Deactivate window ; Deactivate window
;------------------------------------------------------------------------------ ; esi = pointer to WIN_POS+ window data
;> esi = pointer to WIN_POS+ window data window._.window_deactivate:
;------------------------------------------------------------------------------
push eax ebx push eax ebx
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -2094,14 +2158,12 @@ align 4
pop ebx eax pop ebx eax
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; Check if window is necessary to draw
window._.check_window_draw: ;////////////////////////////////////////////////// ; edi = pointer to WDATA
;------------------------------------------------------------------------------ window._.check_window_draw:
;? Check if window is necessary to draw
;------------------------------------------------------------------------------
;> edi = pointer to WDATA
;------------------------------------------------------------------------------
mov cl, [edi + WDATA.fl_wstyle] mov cl, [edi + WDATA.fl_wstyle]
and cl, 0x0f and cl, 0x0f
cmp cl, 3 cmp cl, 3
@ -2168,13 +2230,13 @@ align 4
pop esi edx ebx eax pop esi edx ebx eax
xor ecx, ecx xor ecx, ecx
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ window._.draw_window_caption:
window._.draw_window_caption: ;////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
xor eax, eax xor eax, eax
mov edx, [thread_count] mov edx, [thread_count]
movzx edx, word[WIN_POS + edx * 2] movzx edx, word[WIN_POS + edx * 2]
@ -2286,14 +2348,12 @@ align 4
.exit: .exit:
jmp __sys_draw_pointer jmp __sys_draw_pointer
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; Draw negative box
window._.draw_negative_box: ;////////////////////////////////////////////////// ; edi = pointer to BOX struct
;------------------------------------------------------------------------------ window._.draw_negative_box:
;? Draw negative box
;------------------------------------------------------------------------------
;> edi = pointer to BOX struct
;------------------------------------------------------------------------------
push eax ebx esi push eax ebx esi
mov esi, 0x01000000 mov esi, 0x01000000
;-------------------------------------- ;--------------------------------------
@ -2321,14 +2381,12 @@ align 4
; xor esi, esi ; xor esi, esi
; jmp window._.draw_negative_box.1 ; jmp window._.draw_negative_box.1
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; void __fastcall get_window_rect(struct RECT* rc);
window._.get_rect: ;///////////////////////////////////////////////////// ; ecx = pointer to RECT
;------------------------------------------------------------------------------ window._.get_rect:
;? <description> void __fastcall get_window_rect(struct RECT* rc);
;------------------------------------------------------------------------------
;> ecx = pointer to RECT
;------------------------------------------------------------------------------
mov eax, [TASK_BASE] mov eax, [TASK_BASE]
mov edx, [eax-twdw + WDATA.box.left] mov edx, [eax-twdw + WDATA.box.left]
@ -2344,36 +2402,31 @@ window._.get_rect: ;/////////////////////////////////////////////////////
mov [ecx+RECT.bottom], edx mov [ecx+RECT.bottom], edx
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; redraw all windows one above the window
window._.redraw_top_wnd: ;////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? redraw all windows one above the window
;------------------------------------------------------------------------------
;> eax = left ;> eax = left
;> ebx = top ;> ebx = top
;> ecx = right ;> ecx = right
;> edx = bottom ;> edx = bottom
;> esi = process number ;> esi = process number
;! corrupted edi ;! corrupted edi
;------------------------------------------------------------------------------ window._.redraw_top_wnd:
push 0 push 0
jmp window._.set_top_wnd.go jmp window._.set_top_wnd.go
;------------------------------------------------------------------------------
align 4 align 4
;------------------------------------------------------------------------------ ; call set_screen for all windows one above the window
window._.set_top_wnd: ;////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? call set_screen for all windows one above the window
;------------------------------------------------------------------------------
;> eax = left ;> eax = left
;> ebx = top ;> ebx = top
;> ecx = right ;> ecx = right
;> edx = bottom ;> edx = bottom
;> esi = process number ;> esi = process number
;! corrupted edi ;! corrupted edi
;------------------------------------------------------------------------------ window._.set_top_wnd:
push 1 push 1
.go: .go:
push esi push esi

View File

@ -5284,93 +5284,6 @@ sys_gs: ; direct screen access
mov [esp+32], eax mov [esp+32], eax
ret ret
align 4 ; system functions
syscall_setpixel: ; SetPixel
mov eax, ebx
mov ebx, ecx
mov ecx, edx
mov edx, [TASK_BASE]
add eax, [edx-twdw+WDATA.box.left]
add ebx, [edx-twdw+WDATA.box.top]
mov edi, [current_slot]
add eax, [edi+APPDATA.wnd_clientbox.left]
add ebx, [edi+APPDATA.wnd_clientbox.top]
xor edi, edi ; no force
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
; jmp [putpixel]
jmp __sys_putpixel
align 4
syscall_writetext: ; WriteText
push esi ;check pointer on kernel address.
test ecx, 0x80000000
jz @f
xor esi, esi
@@:
stdcall is_region_userspace, edx, esi
pop esi
jnz .err
mov eax, [TASK_BASE]
mov ebp, [eax-twdw+WDATA.box.left]
push esi
mov esi, [current_slot]
add ebp, [esi+APPDATA.wnd_clientbox.left]
shl ebp, 16
add ebp, [eax-twdw+WDATA.box.top]
add bp, word[esi+APPDATA.wnd_clientbox.top]
pop esi
test ecx, 0x08000000 ; redirect the output to the user area
jnz @f
add ebx, ebp
align 4
@@:
mov eax, edi
test ecx, 0x08000000 ; redirect the output to the user area
jnz @f
xor edi, edi
jmp dtext
@@: ; check pointer
stdcall is_region_userspace, edi, 0
jnz .err
jmp dtext
.err:
ret
align 4
syscall_drawrect: ; DrawRect
mov edi, edx ; color + gradient
and edi, 0x80FFFFFF
test bx, bx ; x.size
je .drectr
test cx, cx ; y.size
je .drectr
mov eax, ebx ; bad idea
mov ebx, ecx
movzx ecx, ax ; ecx - x.size
shr eax, 16 ; eax - x.coord
movzx edx, bx ; edx - y.size
shr ebx, 16 ; ebx - y.coord
mov esi, [current_slot]
add eax, [esi + APPDATA.wnd_clientbox.left]
add ebx, [esi + APPDATA.wnd_clientbox.top]
add ecx, eax
add edx, ebx
; jmp [drawbar]
jmp vesa20_drawbar
.drectr:
ret
align 4 align 4
syscall_getscreensize: ; GetScreenSize syscall_getscreensize: ; GetScreenSize
mov ax, word [_display.width] mov ax, word [_display.width]
@ -5646,31 +5559,6 @@ align 4
popad popad
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4
syscall_drawline: ; DrawLine
mov edi, [TASK_BASE]
movzx eax, word[edi-twdw+WDATA.box.left]
mov ebp, eax
mov esi, [current_slot]
add ebp, [esi+APPDATA.wnd_clientbox.left]
add ax, word[esi+APPDATA.wnd_clientbox.left]
add ebp, ebx
shl eax, 16
movzx ebx, word[edi-twdw+WDATA.box.top]
add eax, ebp
mov ebp, ebx
add ebp, [esi+APPDATA.wnd_clientbox.top]
add bx, word[esi+APPDATA.wnd_clientbox.top]
add ebp, ecx
shl ebx, 16
xor edi, edi
add ebx, ebp
mov ecx, edx
; jmp [draw_line]
jmp __sys_draw_line
align 4 align 4
syscall_threads: ; CreateThreads syscall_threads: ; CreateThreads