deleting cross registers in system calls, part 2

git-svn-id: svn://kolibrios.org@684 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2007-12-17 11:04:07 +00:00
parent 296ab7feb5
commit e02112ea70
9 changed files with 417 additions and 496 deletions

View File

@ -22,11 +22,11 @@ endg
sysfn_saveramdisk: ; 18.6 = SAVE FLOPPY IMAGE (HD version only) sysfn_saveramdisk: ; 18.6 = SAVE FLOPPY IMAGE (HD version only)
call restorefatchain call restorefatchain
mov eax, saverd_fileinfo mov eax, saverd_fileinfo
mov [saverd_fileinfo.name], ebx mov [saverd_fileinfo.name], ecx
pushad pushad
push eax push eax
call file_system_lfn call file_system_lfn
pop eax pop eax
popad popad
mov [esp+36], eax mov [esp+32], eax
ret ret

View File

@ -70,10 +70,10 @@ debug_terminate:
; in: ebx=pid ; in: ebx=pid
call get_debuggee_slot call get_debuggee_slot
jc debug_detach.ret jc debug_detach.ret
mov ebx, eax mov ecx, eax
shr ebx, 5 shr ecx, 5
push 2 push 2
pop eax pop ebx
jmp sys_system jmp sys_system
debug_suspend: debug_suspend:

View File

@ -760,8 +760,8 @@ term9:
jnz @f jnz @f
and dword [ecx], 0 and dword [ecx], 0
pushad pushad
xchg eax, ebx xchg eax, ecx
mov eax, 2 mov ebx, 2
call sys_system call sys_system
popad popad
@@: @@:

View File

@ -103,25 +103,25 @@ iglobal
align 4 align 4
servetable: servetable:
dd sys_drawwindow ; 0-DrawWindow
dd syscall_setpixel ; 1-SetPixel
dd 0
dd 0
dd syscall_writetext ; 4-WriteText
dd delay_hs ; 5-DelayHs
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
dd 0
dd sys_button ; 8-DefineButton
dd sys_cpuusage ; 9-GetProcessInfo
dd 0 dd 0
dd 0 dd 0
dd 0 dd 0
dd 0 dd 0
dd 0 dd 0
dd sys_background ; 15-bgr
dd 0 dd 0
dd 0 dd 0
dd sys_system ; 18-System Services dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0 dd 0
dd sys_midi ; 20-ResetMidi and OutputMidi dd sys_midi ; 20-ResetMidi and OutputMidi
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,. dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
@ -183,25 +183,25 @@ iglobal
align 4 align 4
servetable2: servetable2:
dd cross_order ; 0-DrawWindow dd sys_drawwindow ; 0-DrawWindow
dd cross_order ; 1-SetPixel dd syscall_setpixel ; 1-SetPixel
dd sys_getkey ; 2-GetKey dd sys_getkey ; 2-GetKey
dd sys_clock ; 3-GetTime dd sys_clock ; 3-GetTime
dd cross_order ; 4-WriteText dd syscall_writetext ; 4-WriteText
dd cross_order ; 5-DelayHs dd delay_hs ; 5-DelayHs
dd cross_order ; 6-OpenRamdiskFile dd syscall_openramdiskfile ; 6-OpenRamdiskFile
dd syscall_putimage ; 7-PutImage dd syscall_putimage ; 7-PutImage
dd cross_order ; 8-DefineButton dd sys_button ; 8-DefineButton
dd cross_order ; 9-GetProcessInfo dd sys_cpuusage ; 9-GetProcessInfo
dd sys_waitforevent ; 10-WaitForEvent dd sys_waitforevent ; 10-WaitForEvent
dd sys_getevent ; 11-CheckForEvent dd sys_getevent ; 11-CheckForEvent
dd sys_redrawstat ; 12-BeginDraw and EndDraw dd sys_redrawstat ; 12-BeginDraw and EndDraw
dd syscall_drawrect ; 13-DrawRect dd syscall_drawrect ; 13-DrawRect
dd syscall_getscreensize ; 14-GetScreenSize dd syscall_getscreensize ; 14-GetScreenSize
dd cross_order ; 15-bgr dd sys_background ; 15-bgr
dd sys_cachetodiskette ; 16-FlushFloppyCache dd sys_cachetodiskette ; 16-FlushFloppyCache
dd sys_getbutton ; 17-GetButton dd sys_getbutton ; 17-GetButton
dd cross_order ; 18-System Services dd sys_system ; 18-System Services
dd paleholder ; 19-reserved dd paleholder ; 19-reserved
dd cross_order ; 20-ResetMidi and OutputMidi dd cross_order ; 20-ResetMidi and OutputMidi
dd cross_order ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,. dd cross_order ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.

View File

@ -76,34 +76,34 @@ drawbuttonframes:
push ecx push ecx
push edx push edx
shr eax,16
shr ebx,16 shr ebx,16
mov edx,[TASK_BASE] shr ecx,16
mov eax,[TASK_BASE]
add eax,[edx-twdw + WDATA.box.left] add ebx,[eax-twdw + WDATA.box.left]
add ebx,[edx-twdw + WDATA.box.top] add ecx,[eax-twdw + WDATA.box.top]
mov cx,ax mov eax, ebx
mov dx,bx shl eax, 16
shl eax,16 mov ax, bx
shl ebx,16 add ax, word [esp+8]
mov ax,cx mov ebx, ecx
mov bx,dx shl ebx, 16
add ax,word [esp+12] mov bx, cx
mov esi,ebx push ebx
mov edi,0 xor edi, edi
mov ecx,[esp+0] mov ecx, esi
call incecx call incecx
call [draw_line] call [draw_line]
movzx edx,word [esp+8] movzx edx,word [esp+4+4]
add ebx,edx add ebx,edx
shl edx,16 shl edx,16
add ebx,edx add ebx,edx
mov ecx,[esp+0] mov ecx,esi
call dececx call dececx
call [draw_line] call [draw_line]
mov ebx,esi pop ebx
push edx push edx
mov edx,eax mov edx,eax
shr edx,16 shr edx,16
@ -111,22 +111,19 @@ drawbuttonframes:
mov edx,ebx mov edx,ebx
shr edx,16 shr edx,16
mov bx,dx mov bx,dx
mov dx,[esp+8+4] mov dx,[esp+4+4]
add bx,dx add bx,dx
pop edx pop edx
mov edi,0 mov ecx,esi
mov ecx,[esp+0]
call incecx call incecx
call [draw_line] call [draw_line]
mov esi,edx mov dx,[esp+8]
mov dx,[esp+12]
add ax,dx add ax,dx
shl edx,16 shl edx,16
add eax,edx add eax,edx
add ebx,1*65536 add ebx,1*65536
mov edx,esi mov ecx,esi
mov ecx,[esp+0]
call dececx call dececx
call [draw_line] call [draw_line]
@ -173,61 +170,46 @@ button_dececx:
sys_button: sys_button:
push edi mov eax, [current_slot]
mov edi,[current_slot] rol ebx, 16
rol eax,16 add bx, word [eax+APPDATA.wnd_clientbox.left]
add ax,word[edi+APPDATA.wnd_clientbox.left] rol ebx, 16
rol eax,16 rol ecx, 16
rol ebx,16 add cx, word [eax+APPDATA.wnd_clientbox.top]
add bx,word[edi+APPDATA.wnd_clientbox.top] rol ecx, 16
rol ebx,16
pop edi
.forced: .forced:
test ecx,0x80000000 test edx, 0x80000000
jnz remove_button jnz remove_button
push esi or bx, bx
push edi
push eax ; <x,xs>
push ebx ; <y,ys>
push ecx ; <id>
push edx
or ax,ax
jle noaddbutt jle noaddbutt
or bx,bx or cx, cx
jle noaddbutt jle noaddbutt
test ecx,0x40000000 test edx, 0x40000000
jnz button_no_draw jnz button_no_draw
pushad ; button body pushad ; button body
push ebx movzx edi, cx
shr eax,16 shr ebx, 16
shr ebx,16 shr ecx, 16
mov edx,[TASK_BASE] mov eax, [TASK_BASE]
mov esi,[edx-twdw + WDATA.box.left] add ebx, [eax-twdw + WDATA.box.left]
mov edi,[edx-twdw + WDATA.box.top] add ecx, [eax-twdw + WDATA.box.top]
add eax,esi mov eax, ebx
add ebx,edi shl eax, 16
mov cx,ax mov ax, bx
mov dx,bx add ax, word [esp+16]
shl eax,16 mov ebx, ecx
shl ebx,16 shl ebx, 16
mov ax,cx mov bx, cx
mov bx,dx mov ecx, esi
movzx ecx,word [4+32+esp+12] cmp [buttontype], 0
add eax,ecx
mov ecx,[4+32+esp+0]
cmp [buttontype],dword 0
je @f je @f
call incecx2 call incecx2
@@: @@:
movzx edi,word [esp] mov edx, edi
pop edx
and edx, 0xFFFF
.newline: .newline:
call button_dececx call button_dececx
@ -235,7 +217,7 @@ sys_button:
xor edi, edi xor edi, edi
call [draw_line] call [draw_line]
pop edi pop edi
add ebx,1*65536+1 ; [ y start | y end ] add ebx, 1*65536+1 ; [ y start | y end ]
dec edx dec edx
jnz .newline jnz .newline
popad popad
@ -244,86 +226,68 @@ sys_button:
button_no_draw: button_no_draw:
and ecx,0xffff push edi
mov edi, [BTN_ADDR]
mov edi,[BTN_ADDR] movzx eax, word [edi]
movzx eax,word [edi] cmp eax, max_buttons
cmp eax,max_buttons
jge noaddbutt jge noaddbutt
inc eax inc eax
mov [edi],ax mov [edi], ax
shl eax,4 shl eax, 4
add eax,edi add edi, eax
mov bx,[CURRENT_TASK] mov ax, [CURRENT_TASK]
mov [eax],bx stosw
mov ax, dx
stosw ; button id number: bits 0-15
mov eax, ebx
rol eax, 16
stosd ; x start | x size
mov eax, ecx
rol eax, 16
stosd ; y start | y size
mov eax, edx
shr eax, 16
stosw ; button id number: bits 16-31
add eax,2 ; save button id number pop edi
mov ebx,[esp+4]
mov [eax],bx ; bits 0-15
shr ebx,16
mov [eax-2+0xc],bx; bits 16-31
add eax,2 ; x start
mov bx,[esp+12+2]
mov [eax],bx
add eax,2 ; x size
mov bx,[esp+12+0]
mov [eax],bx
add eax,2 ; y start
mov bx,[esp+8+2]
mov [eax],bx
add eax,2 ; y size
mov bx,[esp+8+0]
mov [eax],bx
noaddbutt: noaddbutt:
pop edx
pop ecx
pop ebx
pop eax
pop edi
pop esi
ret ret
remove_button: remove_button:
and ecx,0x7fffffff and edx, 0x7fffffff
rnewba2: rnewba2:
mov edi,[BTN_ADDR] mov edi, [BTN_ADDR]
mov eax,edi mov eax, edi
movzx ebx,word [edi] movzx ebx, word [edi]
inc bx inc ebx
rnewba: rnewba:
dec bx dec ebx
jz rnmba jz rnmba
add eax,0x10 add eax, 0x10
mov dx,[CURRENT_TASK] mov cx, [CURRENT_TASK]
cmp dx,[eax] cmp cx, [eax]
jnz rnewba
cmp dx, [eax+2]
jnz rnewba jnz rnewba
cmp cx,[eax+2] lea ecx, [ebx+1]
jnz rnewba shl ecx, 4
mov ebx, eax
pushad add eax, 0x10
mov ecx,ebx
inc ecx
shl ecx,4
mov ebx,eax
add eax,0x10
call memmove call memmove
dec dword [edi] dec dword [edi]
popad
jmp rnewba2 jmp rnewba2
rnmba: rnmba:
@ -618,11 +582,11 @@ checkbuttons:
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
;..................................... start 5/5 : modified by vhanla ............................. ;..................................... start 5/5 : modified by vhanla .............................
; check coordinates ; check coordinates
jmp @f iglobal
mx dw 0x0 ; keeps the x mouse's position when it was clicked mx dw 0x0 ; keeps the x mouse's position when it was clicked
my dw 0x0 ; keeps the y mouse's position when it was clicked my dw 0x0 ; keeps the y mouse's position when it was clicked
bPressedMouseXY_B db 0x0 bPressedMouseXY_B db 0x0
@@: endg
pusha pusha
; mouse x >= button x ? ; mouse x >= button x ?

View File

@ -10,41 +10,39 @@ $Revision$
align 4 align 4
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
; eax x & y ; ebx x & y
; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) ; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
; X = ABnnb: ; X = ABnnb:
; nn = font ; nn = font
; A = 0 <=> output edx characters; otherwise output ASCIIZ string ; A = 0 <=> output esi characters; otherwise output ASCIIZ string
; B = 1 <=> fill background with color esi ; B = 1 <=> fill background with color eax
; ecx start of text ; edx start of text
; edi 1 force ; edi 1 force
pushad pushad
call [disable_mouse] call [disable_mouse]
mov ebp, ecx ; ebp=pointer to text movsx eax, bx ; eax=y
mov ecx, ebx ; ecx=color sar ebx, 16 ; ebx=x
movsx ebx, ax ; ebx=y xchg eax, ebx ; eax=x, ebx=y
sar eax, 16 ; eax=x cmp esi, 255
cmp edx, 255
jb .loop jb .loop
mov edx, 255 mov esi, 255
.loop: .loop:
test ecx, ecx test ecx, ecx
js .test_asciiz js .test_asciiz
dec edx dec esi
js .end js .end
jmp @f jmp @f
.test_asciiz: .test_asciiz:
cmp byte [ebp], 0 cmp byte [edx], 0
jz .end jz .end
@@: @@:
push edx inc edx
movzx edx, byte [ebp] pushad
inc ebp movzx edx, byte [edx-1]
test ecx, 0x10000000 test ecx, 0x10000000
jnz .font2 jnz .font2
pushad
mov esi, 9 mov esi, 9
lea ebp, [FONT_I+8*edx+edx] lea ebp, [FONT_I+8*edx+edx]
.symloop1: .symloop1:
@ -60,7 +58,7 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
test ecx, 0x40000000 test ecx, 0x40000000
jz .pixloop1cont jz .pixloop1cont
push ecx push ecx
mov ecx, [esp+4+4] mov ecx, [esp+4+20h+1Ch]
call [putpixel] call [putpixel]
pop ecx pop ecx
.pixloop1cont: .pixloop1cont:
@ -74,10 +72,8 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
jnz .symloop1 jnz .symloop1
popad popad
add eax, 6 add eax, 6
pop edx
jmp .loop jmp .loop
.font2: .font2:
pushad
add edx, edx add edx, edx
lea ebp, [FONT_II+4*edx+edx+1] lea ebp, [FONT_II+4*edx+edx+1]
push 9 push 9
@ -94,7 +90,7 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
test ecx, 0x40000000 test ecx, 0x40000000
jz .pixloop2cont jz .pixloop2cont
push ecx push ecx
mov ecx, [esp+12+4] mov ecx, [esp+12+20h+1Ch]
call [putpixel] call [putpixel]
pop ecx pop ecx
.pixloop2cont: .pixloop2cont:
@ -110,7 +106,6 @@ dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
pop eax pop eax
add dword [esp+28], esi add dword [esp+28], esi
popad popad
pop edx
jmp .loop jmp .loop
.end: .end:
popad popad

View File

@ -1333,7 +1333,7 @@ checkwindows:
mov [WIN_TEMP_XY], esi mov [WIN_TEMP_XY], esi
pushad ; wait for putimages to finish pushad ; wait for putimages to finish
; mov eax,5 ; mov ebx,5
; call delay_hs ; call delay_hs
mov eax,[edi + WDATA.box.left] mov eax,[edi + WDATA.box.left]
mov [npx],eax mov [npx],eax

View File

@ -892,11 +892,11 @@ align 4
boot_log: boot_log:
pushad pushad
mov eax,10*65536 mov ebx,10*65536
mov ax,word [boot_y] mov bx,word [boot_y]
add [boot_y],dword 10 add [boot_y],dword 10
mov ebx,0x80ffffff ; ASCIIZ string with white color mov ecx,0x80ffffff ; ASCIIZ string with white color
mov ecx,esi mov edx,esi
mov edi,1 mov edi,1
call dtext call dtext
@ -1444,27 +1444,26 @@ division_64_bits:
ret ret
draw_num_text: draw_num_text:
mov edx,eax mov esi,eax
mov ecx,64+4 mov edx,64+4
sub ecx,eax sub edx,eax
add ecx,esp add edx,esp
mov eax,[esp+64+32-8+4] mov ebx,[esp+64+32-8+4]
push edx ; add window start x & y ; add window start x & y
mov edx,[TASK_BASE] mov ecx,[TASK_BASE]
mov edi,[CURRENT_TASK] mov edi,[CURRENT_TASK]
shl edi,8 shl edi,8
mov ebx,[edx-twdw+WDATA.box.left] mov eax,[ecx-twdw+WDATA.box.left]
add ebx,[edi+SLOT_BASE+APPDATA.wnd_clientbox.left] add eax,[edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
shl ebx,16 shl eax,16
add ebx,[edx-twdw+WDATA.box.top] add eax,[ecx-twdw+WDATA.box.top]
add ebx,[edi+SLOT_BASE+APPDATA.wnd_clientbox.top] add eax,[edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
add eax,ebx add ebx,eax
pop edx mov ecx,[esp+64+32-12+4]
mov ebx,[esp+64+32-12+4] and ecx, not 0x80000000 ; force counted string
and ebx, not 0x80000000 ; force counted string mov eax, [esp+64+8] ; background color (if given)
mov esi, [esp+64+4+4]
mov edi, [esp+64+4] mov edi, [esp+64+4]
jmp dtext jmp dtext
@ -2012,7 +2011,7 @@ sys_end:
mov [eax+TASKDATA.state], 3 ; terminate this program mov [eax+TASKDATA.state], 3 ; terminate this program
waitterm: ; wait here for termination waitterm: ; wait here for termination
mov eax,5 mov ebx,100
call delay_hs call delay_hs
jmp waitterm jmp waitterm
@ -2046,10 +2045,10 @@ sysfn_num = ($ - sys_system_table)/4
endg endg
sys_system: sys_system:
dec eax dec ebx
cmp eax, sysfn_num cmp ebx, sysfn_num
jae @f jae @f
jmp dword [sys_system_table + eax*4] jmp dword [sys_system_table + ebx*4]
@@: @@:
ret ret
@ -2061,27 +2060,27 @@ sysfn_shutdown: ; 18.1 = BOOT
add eax,2 add eax,2
mov [shutdown_processes],eax mov [shutdown_processes],eax
mov [SYS_SHUTDOWN],al mov [SYS_SHUTDOWN],al
and dword [esp+36], 0 and dword [esp+32], 0
ret ret
uglobal uglobal
shutdown_processes: dd 0x0 shutdown_processes: dd 0x0
endg endg
sysfn_terminate: ; 18.2 = TERMINATE sysfn_terminate: ; 18.2 = TERMINATE
cmp ebx,2 cmp ecx,2
jb noprocessterminate jb noprocessterminate
mov edx,[TASK_COUNT] mov edx,[TASK_COUNT]
cmp ebx,edx cmp ecx,edx
ja noprocessterminate ja noprocessterminate
mov eax,[TASK_COUNT] mov eax,[TASK_COUNT]
shl ebx,5 shl ecx,5
mov edx,[ebx+CURRENT_TASK+TASKDATA.pid] mov edx,[ecx+CURRENT_TASK+TASKDATA.pid]
add ebx,CURRENT_TASK+TASKDATA.state add ecx,CURRENT_TASK+TASKDATA.state
cmp byte [ebx], 9 cmp byte [ecx], 9
jz noprocessterminate jz noprocessterminate
;call MEM_Heap_Lock ;guarantee that process isn't working with heap ;call MEM_Heap_Lock ;guarantee that process isn't working with heap
mov [ebx],byte 3 ; clear possible i40's mov [ecx],byte 3 ; clear possible i40's
;call MEM_Heap_UnLock ;call MEM_Heap_UnLock
cmp edx,[application_table_status] ; clear app table stat cmp edx,[application_table_status] ; clear app table stat
@ -2102,38 +2101,38 @@ sysfn_terminate2:
jmp .table_status jmp .table_status
.stf: .stf:
call set_application_table_status call set_application_table_status
mov eax,ebx mov eax,ecx
call pid_to_slot call pid_to_slot
test eax,eax test eax,eax
jz .not_found jz .not_found
mov ebx,eax mov ecx,eax
cli cli
call sysfn_terminate call sysfn_terminate
mov [application_table_status],0 mov [application_table_status],0
sti sti
and dword [esp+36],0 and dword [esp+32],0
ret ret
.not_found: .not_found:
mov [application_table_status],0 mov [application_table_status],0
or dword [esp+36],-1 or dword [esp+32],-1
ret ret
sysfn_activate: ; 18.3 = ACTIVATE WINDOW sysfn_activate: ; 18.3 = ACTIVATE WINDOW
cmp ebx,2 cmp ecx,2
jb .nowindowactivate jb .nowindowactivate
cmp ebx,[TASK_COUNT] cmp ecx,[TASK_COUNT]
ja .nowindowactivate ja .nowindowactivate
mov [window_minimize], 2 ; restore window if minimized mov [window_minimize], 2 ; restore window if minimized
movzx esi, word [WIN_STACK + ebx*2] movzx esi, word [WIN_STACK + ecx*2]
cmp esi, [TASK_COUNT] cmp esi, [TASK_COUNT]
je .nowindowactivate ; already active je .nowindowactivate ; already active
mov edi, ebx mov edi, ecx
shl edi, 5 shl edi, 5
add edi, window_data add edi, window_data
movzx esi, word [WIN_STACK + ebx * 2] movzx esi, word [WIN_STACK + ecx * 2]
lea esi, [WIN_POS + esi * 2] lea esi, [WIN_POS + esi * 2]
call waredraw call waredraw
.nowindowactivate: .nowindowactivate:
@ -2141,12 +2140,12 @@ sysfn_activate: ; 18.3 = ACTIVATE WINDOW
sysfn_getidletime: ; 18.4 = GET IDLETIME sysfn_getidletime: ; 18.4 = GET IDLETIME
mov eax,[idleusesec] mov eax,[idleusesec]
mov [esp+36], eax mov [esp+32], eax
ret ret
sysfn_getcpuclock: ; 18.5 = GET TSC/SEC sysfn_getcpuclock: ; 18.5 = GET TSC/SEC
mov eax,[CPU_FREQ] mov eax,[CPU_FREQ]
mov [esp+36], eax mov [esp+32], eax
ret ret
; SAVE ramdisk to /hd/1/menuet.img ; SAVE ramdisk to /hd/1/menuet.img
@ -2157,28 +2156,28 @@ sysfn_getcpuclock: ; 18.5 = GET TSC/SEC
sysfn_getactive: ; 18.7 = get active window sysfn_getactive: ; 18.7 = get active window
mov eax, [TASK_COUNT] mov eax, [TASK_COUNT]
movzx eax, word [WIN_POS + eax*2] movzx eax, word [WIN_POS + eax*2]
mov [esp+36],eax mov [esp+32],eax
ret ret
sysfn_sound_flag: ; 18.8 = get/set sound_flag sysfn_sound_flag: ; 18.8 = get/set sound_flag
cmp ebx,1 cmp ecx,1
jne nogetsoundflag jne nogetsoundflag
movzx eax,byte [sound_flag] ; get sound_flag movzx eax,byte [sound_flag] ; get sound_flag
mov [esp+36],eax mov [esp+32],eax
ret ret
nogetsoundflag: nogetsoundflag:
cmp ebx,2 cmp ecx,2
jnz nosoundflag jnz nosoundflag
xor byte [sound_flag], 1 xor byte [sound_flag], 1
nosoundflag: nosoundflag:
ret ret
sysfn_shutdown_param: ; 18.9 = system shutdown with param sysfn_shutdown_param: ; 18.9 = system shutdown with param
cmp ebx,1 cmp ecx,1
jl exit_for_anyone jl exit_for_anyone
cmp ebx,4 cmp ecx,4
jg exit_for_anyone jg exit_for_anyone
mov [BOOT_VAR+0x9030],bl mov [BOOT_VAR+0x9030],cl
jmp for_shutdown_parameter jmp for_shutdown_parameter
sysfn_minimize: ; 18.10 = minimize window sysfn_minimize: ; 18.10 = minimize window
@ -2187,7 +2186,7 @@ sysfn_minimize: ; 18.10 = minimize window
ret ret
sysfn_getdiskinfo: ; 18.11 = get disk info table sysfn_getdiskinfo: ; 18.11 = get disk info table
cmp ebx,1 cmp ecx,1
jnz full_table jnz full_table
small_table: small_table:
call for_all_tables call for_all_tables
@ -2196,13 +2195,11 @@ sysfn_getdiskinfo: ; 18.11 = get disk info table
rep movsb rep movsb
ret ret
for_all_tables: for_all_tables:
mov edi,[TASK_BASE] mov edi,edx
mov edi,[edi+TASKDATA.mem_start]
add edi,ecx
mov esi,DRIVE_DATA mov esi,DRIVE_DATA
ret ret
full_table: full_table:
cmp ebx,2 cmp ecx,2
jnz exit_for_anyone jnz exit_for_anyone
call for_all_tables call for_all_tables
mov ecx,16384 mov ecx,16384
@ -2211,16 +2208,13 @@ sysfn_getdiskinfo: ; 18.11 = get disk info table
ret ret
sysfn_lastkey: ; 18.12 = return 0 (backward compatibility) sysfn_lastkey: ; 18.12 = return 0 (backward compatibility)
and dword [esp+36], 0 and dword [esp+32], 0
ret ret
sysfn_getversion: ; 18.13 = get kernel ID and version sysfn_getversion: ; 18.13 = get kernel ID and version
mov edi,[TASK_BASE] mov edi,ebx
mov edi,[edi+TASKDATA.mem_start]
add edi,ebx
mov esi,version_inf mov esi,version_inf
mov ecx,version_end-version_inf mov ecx,version_end-version_inf
cld
rep movsb rep movsb
ret ret
@ -2232,49 +2226,49 @@ sysfn_waitretrace: ; 18.14 = sys wait retrace
in al,dx in al,dx
test al,1000b test al,1000b
jz WaitRetrace_loop jz WaitRetrace_loop
mov [esp+36],dword 0 and [esp+32],dword 0
ret ret
sysfn_centermouse: ; 18.15 = mouse centered sysfn_centermouse: ; 18.15 = mouse centered
call mouse_centered call mouse_centered
mov [esp+36],dword 0 and [esp+32],dword 0
ret ret
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
cmp ebx,0 ; get mouse speed factor cmp ecx,0 ; get mouse speed factor
jnz .set_mouse_acceleration jnz .set_mouse_acceleration
xor eax,eax xor eax,eax
mov ax,[mouse_speed_factor] mov ax,[mouse_speed_factor]
mov [esp+36],eax mov [esp+32],eax
ret ret
.set_mouse_acceleration: .set_mouse_acceleration:
cmp ebx,1 ; set mouse speed factor cmp ecx,1 ; set mouse speed factor
jnz .get_mouse_delay jnz .get_mouse_delay
mov [mouse_speed_factor],cx mov [mouse_speed_factor],dx
ret ret
.get_mouse_delay: .get_mouse_delay:
cmp ebx,2 ; get mouse delay cmp ecx,2 ; get mouse delay
jnz .set_mouse_delay jnz .set_mouse_delay
mov eax,[mouse_delay] mov eax,[mouse_delay]
mov [esp+36],eax mov [esp+32],eax
ret ret
.set_mouse_delay: .set_mouse_delay:
cmp ebx,3 ; set mouse delay cmp ecx,3 ; set mouse delay
jnz .set_pointer_position jnz .set_pointer_position
mov [mouse_delay],ecx mov [mouse_delay],edx
ret ret
.set_pointer_position: .set_pointer_position:
cmp ebx,4 ; set mouse pointer position cmp ecx,4 ; set mouse pointer position
jnz .set_mouse_button jnz .set_mouse_button
mov [MOUSE_Y],cx ;y mov [MOUSE_Y],dx ;y
ror ecx,16 ror edx,16
mov [MOUSE_X],cx ;x mov [MOUSE_X],dx ;x
rol ecx,16 rol edx,16
ret ret
.set_mouse_button: .set_mouse_button:
cmp ebx,5 ; set mouse button features cmp ecx,5 ; set mouse button features
jnz .end jnz .end
mov [BTN_DOWN],cl mov [BTN_DOWN],dl
mov [mouse_active],1 mov [mouse_active],1
.end: .end:
ret ret
@ -2282,26 +2276,26 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
sysfn_getfreemem: sysfn_getfreemem:
mov eax, [pg_data.pages_free] mov eax, [pg_data.pages_free]
shl eax, 2 shl eax, 2
mov [esp+36],eax mov [esp+32],eax
ret ret
sysfn_getallmem: sysfn_getallmem:
mov eax,[MEM_AMOUNT] mov eax,[MEM_AMOUNT]
shr eax, 10 shr eax, 10
mov [esp+36],eax mov [esp+32],eax
ret ret
; // Alver, 2007-22-08 // { ; // Alver, 2007-22-08 // {
sysfn_pid_to_slot: sysfn_pid_to_slot:
mov eax, ebx mov eax, ecx
call pid_to_slot call pid_to_slot
mov [esp+36], eax mov [esp+32], eax
ret ret
sysfn_min_rest_window: sysfn_min_rest_window:
pushad pushad
mov eax, ecx ; ebx - operating mov eax, edx ; ebx - operating
shr ebx, 1 shr ecx, 1
jnc @f jnc @f
call pid_to_slot call pid_to_slot
@@: @@:
@ -2309,10 +2303,8 @@ sysfn_min_rest_window:
jz .error jz .error
cmp eax, 255 ; varify maximal slot number cmp eax, 255 ; varify maximal slot number
ja .error ja .error
xor ecx, ecx movzx eax, word [WIN_STACK + eax*2]
mov cx, [WIN_STACK + eax*2] ; ecx - window number shr ecx, 1
mov eax, ecx
shr ebx, 1
jc .restore jc .restore
; .minimize: ; .minimize:
call minimize_window call minimize_window
@ -2322,13 +2314,13 @@ sysfn_min_rest_window:
.exit: .exit:
popad popad
xor eax, eax xor eax, eax
mov [esp+36], eax mov [esp+32], eax
ret ret
.error: .error:
popad popad
xor eax, eax xor eax, eax
dec eax dec eax
mov [esp+36], eax mov [esp+32], eax
ret ret
; } \\ Alver, 2007-22-08 \\ ; } \\ Alver, 2007-22-08 \\
@ -2379,12 +2371,12 @@ endg
sys_background: sys_background:
cmp eax,1 ; BACKGROUND SIZE cmp ebx,1 ; BACKGROUND SIZE
jnz nosb1 jnz nosb1
cmp ebx,0
je sbgrr
cmp ecx,0 cmp ecx,0
je sbgrr je sbgrr
cmp edx,0
je sbgrr
@@: @@:
mov al, 1 mov al, 1
xchg [bgrlock], al xchg [bgrlock], al
@ -2393,8 +2385,8 @@ sys_background:
call change_task call change_task
jmp @b jmp @b
@@: @@:
mov [BgrDataWidth],ebx mov [BgrDataWidth],ecx
mov [BgrDataHeight],ecx mov [BgrDataHeight],edx
; mov [bgrchanged],1 ; mov [bgrchanged],1
pushad pushad
@ -2429,25 +2421,21 @@ sys_background:
nosb1: nosb1:
cmp eax,2 ; SET PIXEL cmp ebx,2 ; SET PIXEL
jnz nosb2 jnz nosb2
mov edx,[mem_BACKGROUND] cmp ecx,[mem_BACKGROUND]
cmp edx,ebx jae nosb2
jbe nosb2
mov edx,[ebx]
and edx,0xFF000000 ;255*256*256*256
and ecx,0x00FFFFFF ;255*256*256+255*256+255
add edx,ecx
;mov [ebx+IMG_BACKGROUND],edx
push eax
mov eax,[img_background] mov eax,[img_background]
mov [ebx+eax],edx mov ebx,[eax+ecx]
pop eax and ebx,0xFF000000 ;255*256*256*256
and edx,0x00FFFFFF ;255*256*256+255*256+255
add edx,ebx
mov [eax+ecx],edx
; mov [bgrchanged],1 ; mov [bgrchanged],1
ret ret
nosb2: nosb2:
cmp eax,3 ; DRAW BACKGROUND cmp ebx,3 ; DRAW BACKGROUND
jnz nosb3 jnz nosb3
draw_background_temp: draw_background_temp:
; cmp [bgrchanged],1 ;0 ; cmp [bgrchanged],1 ;0
@ -2460,29 +2448,29 @@ draw_background_temp:
ret ret
nosb3: nosb3:
cmp eax,4 ; TILED / STRETCHED cmp ebx,4 ; TILED / STRETCHED
jnz nosb4 jnz nosb4
cmp ebx,[BgrDrawMode] cmp ecx,[BgrDrawMode]
je nosb41 je nosb41
mov [BgrDrawMode],ebx mov [BgrDrawMode],ecx
; mov [bgrchanged],1 ; mov [bgrchanged],1
nosb41: nosb41:
ret ret
nosb4: nosb4:
cmp eax,5 ; BLOCK MOVE TO BGR cmp ebx,5 ; BLOCK MOVE TO BGR
jnz nosb5 jnz nosb5
; bughere ; bughere
mov eax, ebx mov eax, ecx
mov ebx, ecx mov ebx, edx
add ebx, [img_background] ;IMG_BACKGROUND add ebx, [img_background] ;IMG_BACKGROUND
mov ecx, edx mov ecx, esi
call memmove call memmove
.fin: .fin:
ret ret
nosb5: nosb5:
cmp eax, 6 cmp ebx, 6
jnz nosb6 jnz nosb6
@@: @@:
mov al, 1 mov al, 1
@ -2495,7 +2483,7 @@ draw_background_temp:
mov eax, [CURRENT_TASK] mov eax, [CURRENT_TASK]
mov [bgrlockpid], eax mov [bgrlockpid], eax
stdcall user_alloc, [mem_BACKGROUND] stdcall user_alloc, [mem_BACKGROUND]
mov [esp+36], eax mov [esp+32], eax
test eax, eax test eax, eax
jz .nomem jz .nomem
mov ebx, eax mov ebx, eax
@ -2526,14 +2514,15 @@ draw_background_temp:
and [bgrlockpid], 0 and [bgrlockpid], 0
mov [bgrlock], 0 mov [bgrlock], 0
nosb6: nosb6:
cmp eax, 7 cmp ebx, 7
jnz nosb7 jnz nosb7
cmp [bgrlock], 0 cmp [bgrlock], 0
jz .err jz .err
mov eax, [CURRENT_TASK] mov eax, [CURRENT_TASK]
cmp [bgrlockpid], eax cmp [bgrlockpid], eax
jnz .err jnz .err
mov eax, ebx mov eax, ecx
mov ebx, ecx
shr eax, 12 shr eax, 12
mov ecx, [page_tabs+(eax-1)*4] mov ecx, [page_tabs+(eax-1)*4]
test cl, USED_BLOCK+DONT_FREE_BLOCK test cl, USED_BLOCK+DONT_FREE_BLOCK
@ -2551,12 +2540,12 @@ nosb6:
pop eax pop eax
and dword [page_tabs+(eax-1)*4], not DONT_FREE_BLOCK and dword [page_tabs+(eax-1)*4], not DONT_FREE_BLOCK
stdcall user_free, ebx stdcall user_free, ebx
mov [esp+36], eax mov [esp+32], eax
and [bgrlockpid], 0 and [bgrlockpid], 0
mov [bgrlock], 0 mov [bgrlock], 0
ret ret
.err: .err:
and dword [esp+36], 0 and dword [esp+32], 0
ret ret
nosb7: nosb7:
@ -2679,112 +2668,84 @@ sys_cpuusage:
; +30 dword PID , process idenfification number ; +30 dword PID , process idenfification number
; ;
mov edi,[TASK_BASE] ; eax = return area cmp ecx,-1 ; who am I ?
add eax,[edi + TASKDATA.mem_start] jne .no_who_am_i
mov ecx,[CURRENT_TASK]
.no_who_am_i:
cmp ecx, max_processes
ja .nofillbuf
cmp ebx,-1 ; who am I ? ; +4: word: position of the window of thread in the window stack
jne no_who_am_i mov ax, [WIN_STACK + ecx * 2]
mov ebx,[CURRENT_TASK] mov [ebx+4], ax
no_who_am_i: ; +6: word: number of the thread slot, which window has in the window stack
; position ecx (has no relation to the specific thread)
mov ax, [WIN_POS + ecx * 2]
mov [ebx+6], ax
push eax ; return area shl ecx, 5
push ebx ; process number
push ebx ; +0: dword: memory usage
push ebx mov eax, [ecx+CURRENT_TASK+TASKDATA.cpu_usage]
push eax mov [ebx], eax
; +10: 11 bytes: name of the process
; return memory usage push ecx
lea eax, [ecx*8+SLOT_BASE+APPDATA.app_name]
xor edx,edx add ebx, 10
mov eax,0x20 mov ecx, 11
mul ebx
add eax,CURRENT_TASK+TASKDATA.cpu_usage
mov ebx,eax
pop eax
mov ecx,[ebx]
mov [eax],ecx
pop ebx
mov cx, [WIN_STACK + ebx * 2]
mov [eax+4],cx
mov cx, [WIN_POS + ebx * 2]
mov [eax+6],cx
push eax
mov eax,ebx
shl eax,8
add eax,SLOT_BASE+APPDATA.app_name
pop ebx
add ebx,10
mov ecx,11
call memmove call memmove
pop ecx
; memory usage ; +22: address of the process in memory
; +26: size of used memory - 1
push edi
lea edi, [ebx+12]
xor eax, eax
mov edx, 0x100000*16
cmp ecx, 1 shl 5
je .os_mem
mov edx, [SLOT_BASE+ecx*8+APPDATA.mem_size]
mov eax, std_application_base_address
.os_mem:
stosd
lea eax, [edx-1]
stosd
xor eax,eax ; +30: PID/TID
mov edx,0x100000*16 mov eax, [ecx+CURRENT_TASK+TASKDATA.pid]
pop ecx ; get gdt of tss stosd
cmp ecx,1
je os_mem
shl ecx,8
mov edx,[SLOT_BASE+ecx+APPDATA.mem_size] ;0x8c
mov eax,std_application_base_address
; eax run base -> edx used memory
os_mem:
dec edx
mov [ebx+12],eax
mov [ebx+16],edx
; PID (+30)
mov eax,[esp]
shl eax,5
add eax,CURRENT_TASK+TASKDATA.pid
mov eax,[eax]
mov [ebx+20],eax
; window position and size ; window position and size
push esi
mov esi,[esp] lea esi, [ecx + window_data + WDATA.box]
shl esi,5 movsd
add esi,window_data + WDATA.box movsd
mov edi,[esp+4] movsd
add edi,34 movsd
mov ecx,4
cld
rep movsd
; Process state (+50) ; Process state (+50)
mov eax, dword [ecx+CURRENT_TASK+TASKDATA.state]
mov eax,[esp] stosd
shl eax,5
add eax,CURRENT_TASK+TASKDATA.state
mov eax,[eax]
mov [ebx+40],ax
; Window client area box ; Window client area box
lea esi, [ecx*8 + SLOT_BASE + APPDATA.wnd_clientbox]
mov esi,[esp] movsd
shl esi,8 movsd
add esi,SLOT_BASE+APPDATA.wnd_clientbox movsd
lea edi,[ebx+44] movsd
mov ecx,4
rep movsd
; Window state ; Window state
mov al, [ecx+window_data+WDATA.fl_wstate]
stosb
mov esi,[esp] pop esi
shl esi,5 pop edi
add esi,window_data + WDATA.box
mov al,[esi+WDATA.fl_wstate]
mov [edi],al
pop ebx
pop eax
.nofillbuf:
; return number of processes ; return number of processes
mov eax,[TASK_COUNT] mov eax,[TASK_COUNT]
mov [esp+36],eax mov [esp+32],eax
ret ret
align 4 align 4
@ -2920,11 +2881,11 @@ sys_redrawstat:
sys_drawwindow: sys_drawwindow:
mov edi,ecx mov eax,edx
shr edi,16+8 shr eax,16+8
and edi,15 and eax,15
cmp edi,0 ; type I - original style ; cmp eax,0 ; type I - original style
jne nosyswI jne nosyswI
inc [mouse_pause] inc [mouse_pause]
call [disable_mouse] call [disable_mouse]
@ -2937,7 +2898,7 @@ sys_drawwindow:
jmp draw_window_caption.2 jmp draw_window_caption.2
nosyswI: nosyswI:
cmp edi,1 ; type II - only reserve area, no draw cmp al,1 ; type II - only reserve area, no draw
jne nosyswII jne nosyswII
inc [mouse_pause] inc [mouse_pause]
call [disable_mouse] call [disable_mouse]
@ -2949,7 +2910,7 @@ sys_drawwindow:
ret ret
nosyswII: nosyswII:
cmp edi,2 ; type III - new style cmp al,2 ; type III - new style
jne nosyswIII jne nosyswIII
inc [mouse_pause] inc [mouse_pause]
call [disable_mouse] call [disable_mouse]
@ -2962,9 +2923,9 @@ sys_drawwindow:
jmp draw_window_caption.2 jmp draw_window_caption.2
nosyswIII: nosyswIII:
cmp edi,3 ; type IV - skinned window cmp al,3 ; type IV - skinned window
je draw_skin_window je draw_skin_window
cmp edi,4 ; type V - skinned window not sized! {not_sized_skin_window} cmp al,4 ; type V - skinned window not sized! {not_sized_skin_window}
jne nosyswV jne nosyswV
draw_skin_window: draw_skin_window:
@ -2972,13 +2933,12 @@ sys_drawwindow:
call [disable_mouse] call [disable_mouse]
call sys_set_window call sys_set_window
call [disable_mouse] call [disable_mouse]
push 0 mov eax, [TASK_COUNT]
mov edi, [TASK_COUNT] movzx eax, word [WIN_POS + eax*2]
movzx edi, word [WIN_POS + edi*2] cmp eax, [CURRENT_TASK]
cmp edi, [CURRENT_TASK] setz al
jne @f movzx eax, al
inc dword [esp] push eax
@@:
call drawwindow_IV call drawwindow_IV
;dec [mouse_pause] ;dec [mouse_pause]
;call [draw_pointer] ;call [draw_pointer]
@ -3036,10 +2996,9 @@ draw_window_caption:
shl edi,5 shl edi,5
test [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION test [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION
jz @f jz @f
mov ecx,[edi*8+SLOT_BASE+APPDATA.wnd_caption] mov edx,[edi*8+SLOT_BASE+APPDATA.wnd_caption]
or ecx,ecx or edx,edx
jz @f jz @f
add ecx,[edi+CURRENT_TASK+TASKDATA.mem_start]
movzx eax,[edi+window_data+WDATA.fl_wstyle] movzx eax,[edi+window_data+WDATA.fl_wstyle]
and al,0x0F and al,0x0F
@ -3055,22 +3014,24 @@ draw_window_caption:
movzx eax,word[edi+window_data+WDATA.box.width] movzx eax,word[edi+window_data+WDATA.box.width]
sub ax,[_skinmargins.left] sub ax,[_skinmargins.left]
sub ax,[_skinmargins.right] sub ax,[_skinmargins.right]
push edx
cwde cwde
cdq cdq
mov ebx,6 mov ebx,6
idiv ebx idiv ebx
pop edx
or eax,eax or eax,eax
js @f js @f
mov edx,eax mov esi,eax
mov eax,dword[_skinmargins.left-2] mov ebx,dword[_skinmargins.left-2]
mov ax,word[_skinh] mov bx,word[_skinh]
sub ax,[_skinmargins.bottom] sub bx,[_skinmargins.bottom]
sub ax,[_skinmargins.top] sub bx,[_skinmargins.top]
sar ax,1 sar bx,1
adc ax,0 adc bx,0
add ax,[_skinmargins.top] add bx,[_skinmargins.top]
add ax,-3 add bx,-3
add eax,ebp add ebx,ebp
jmp .dodraw jmp .dodraw
.not_skinned: .not_skinned:
@ -3081,18 +3042,20 @@ draw_window_caption:
mov bp,word[edi+window_data+WDATA.box.top] mov bp,word[edi+window_data+WDATA.box.top]
movzx eax,word[edi+window_data+WDATA.box.width] movzx eax,word[edi+window_data+WDATA.box.width]
sub eax,16 sub eax,16
push edx
cwde cwde
cdq cdq
mov ebx,6 mov ebx,6
idiv ebx idiv ebx
pop edx
or eax,eax or eax,eax
js @f js @f
mov edx,eax mov esi,eax
mov eax,0x00080007 mov ebx,0x00080007
add eax,ebp add ebx,ebp
.dodraw: .dodraw:
mov ebx,[common_colours+16];0x00FFFFFF mov ecx,[common_colours+16];0x00FFFFFF
or ebx, 0x80000000 or ecx, 0x80000000
xor edi,edi xor edi,edi
call dtext call dtext
@ -3161,31 +3124,31 @@ set_window_clientbox:
sys_set_window: sys_set_window:
mov edi,[CURRENT_TASK] mov eax,[CURRENT_TASK]
shl edi,5 shl eax,5
add edi,window_data add eax,window_data
; colors ; colors
mov [edi+WDATA.cl_workarea],ecx mov [eax+WDATA.cl_workarea],edx
mov [edi+WDATA.cl_titlebar],edx mov [eax+WDATA.cl_titlebar],esi
mov [edi+WDATA.cl_frames],esi mov [eax+WDATA.cl_frames],edi
mov edi, eax
; check flag (?) ; check flag (?)
test [edi+WDATA.fl_wdrawn],1 test [edi+WDATA.fl_wdrawn],1
jnz newd jnz newd
push eax
mov eax,[timer_ticks] ;[0xfdf0] mov eax,[timer_ticks] ;[0xfdf0]
add eax,100 add eax,100
mov [new_window_starting],eax mov [new_window_starting],eax
pop eax
mov word[edi+WDATA.box.width],ax mov word[edi+WDATA.box.width],bx
mov word[edi+WDATA.box.height],bx mov word[edi+WDATA.box.height],cx
sar eax,16
sar ebx,16 sar ebx,16
mov word[edi+WDATA.box.left],ax sar ecx,16
mov word[edi+WDATA.box.top],bx mov word[edi+WDATA.box.left],bx
mov word[edi+WDATA.box.top],cx
call check_window_position call check_window_position
@ -3194,7 +3157,8 @@ sys_set_window:
push ecx esi edi ; save for window fullscreen/resize push ecx esi edi ; save for window fullscreen/resize
;mov esi,edi ;mov esi,edi
mov cl,[edi+WDATA.fl_wstyle] mov cl, [edi+WDATA.fl_wstyle]
mov eax, [edi+WDATA.cl_frames]
sub edi,window_data sub edi,window_data
shl edi,3 shl edi,3
@ -3209,7 +3173,7 @@ sys_set_window:
jmp @f jmp @f
set_APPDATA_wnd_caption: set_APPDATA_wnd_caption:
mov [edi+APPDATA.wnd_caption],esi mov [edi+APPDATA.wnd_caption],eax
@@: mov esi,[esp+0] @@: mov esi,[esp+0]
add edi, APPDATA.saved_box add edi, APPDATA.saved_box
@ -3224,8 +3188,7 @@ sys_set_window:
lea esi, [WIN_POS+esi*2] lea esi, [WIN_POS+esi*2]
call waredraw call waredraw
push eax ebx ecx edx ;;; mov ebx, 1
;;; mov eax, 1
;;; call delay_hs ;;; call delay_hs
mov eax, [edi+WDATA.box.left] mov eax, [edi+WDATA.box.left]
mov ebx, [edi+WDATA.box.top] mov ebx, [edi+WDATA.box.top]
@ -3234,7 +3197,6 @@ sys_set_window:
add ecx, eax add ecx, eax
add edx, ebx add edx, ebx
call calculatescreen call calculatescreen
pop edx ecx ebx eax
mov [KEY_COUNT],byte 0 ; empty keyboard buffer mov [KEY_COUNT],byte 0 ; empty keyboard buffer
mov [BTN_COUNT],byte 0 ; empty button buffer mov [BTN_COUNT],byte 0 ; empty button buffer
@ -3635,7 +3597,7 @@ redrawscreen:
pushad pushad
push eax push eax
;;; mov eax,2 ;;; mov ebx,2
;;; call delay_hs ;;; call delay_hs
;mov ecx,0 ; redraw flags for apps ;mov ecx,0 ; redraw flags for apps
@ -3795,17 +3757,17 @@ set_app_param:
delay_hs: ; delay in 1/100 secs delay_hs: ; delay in 1/100 secs
push eax ; ebx = delay time
push ecx push ecx
push edx push edx
mov edx,[timer_ticks] mov edx,[timer_ticks]
add edx,eax
newtic: newtic:
mov ecx,[timer_ticks] mov ecx,[timer_ticks]
cmp edx,ecx sub ecx,edx
jbe zerodelay cmp ecx,ebx
jae zerodelay
call change_task call change_task
@ -3814,7 +3776,6 @@ delay_hs: ; delay in 1/100 secs
zerodelay: zerodelay:
pop edx pop edx
pop ecx pop ecx
pop eax
ret ret
@ -4855,15 +4816,17 @@ align 4 ; system functions
syscall_setpixel: ; SetPixel syscall_setpixel: ; SetPixel
mov eax, ebx
mov edx,[TASK_BASE] mov ebx, ecx
add eax,[edx-twdw+WDATA.box.left] mov ecx, edx
add ebx,[edx-twdw+WDATA.box.top] mov edx, [TASK_BASE]
mov edi,[current_slot] add eax, [edx-twdw+WDATA.box.left]
add eax,[edi+APPDATA.wnd_clientbox.left] add ebx, [edx-twdw+WDATA.box.top]
add ebx,[edi+APPDATA.wnd_clientbox.top] mov edi, [current_slot]
xor edi,edi ; no force add eax, [edi+APPDATA.wnd_clientbox.left]
; mov edi,1 add ebx, [edi+APPDATA.wnd_clientbox.top]
xor edi, edi ; no force
; mov edi, 1
call [disable_mouse] call [disable_mouse]
jmp [putpixel] jmp [putpixel]
@ -4871,17 +4834,17 @@ align 4
syscall_writetext: ; WriteText syscall_writetext: ; WriteText
mov edi,[TASK_BASE] mov eax,[TASK_BASE]
mov ebp,[edi-twdw+WDATA.box.left] mov ebp,[eax-twdw+WDATA.box.left]
push esi push esi
mov esi,[current_slot] mov esi,[current_slot]
add ebp,[esi+APPDATA.wnd_clientbox.left] add ebp,[esi+APPDATA.wnd_clientbox.left]
shl ebp,16 shl ebp,16
add ebp,[edi-twdw+WDATA.box.top] add ebp,[eax-twdw+WDATA.box.top]
add bp,word[esi+APPDATA.wnd_clientbox.top] add bp,word[esi+APPDATA.wnd_clientbox.top]
pop esi pop esi
add ecx,[edi+TASKDATA.mem_start] add ebx,ebp
add eax,ebp mov eax,edi
xor edi,edi xor edi,edi
jmp dtext jmp dtext
@ -4889,14 +4852,13 @@ align 4
syscall_openramdiskfile: ; OpenRamdiskFile syscall_openramdiskfile: ; OpenRamdiskFile
mov eax, ebx
mov edi,[TASK_BASE] mov ebx, ecx
add edi,TASKDATA.mem_start mov ecx, edx
add eax,[edi] mov edx, esi
add edx,[edi] mov esi, 12
mov esi,12
call fileread call fileread
mov [esp+36],ebx mov [esp+32], eax
ret ret
align 4 align 4

View File

@ -32,10 +32,10 @@ $Revision$
; push esi ; push esi
; mov esi,.__xyz1 ; mov esi,.__xyz1
; call sys_msg_board_str ; call sys_msg_board_str
; push eax ; push ebx
; mov eax,1 ; mov ebx,1
; call delay_hs ; call delay_hs
; pop eax ; pop ebx
; jmp .__xyz2 ; jmp .__xyz2
;.__xyz1: ;.__xyz1:
; db X ; db X