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)
call restorefatchain
mov eax, saverd_fileinfo
mov [saverd_fileinfo.name], ebx
mov [saverd_fileinfo.name], ecx
pushad
push eax
call file_system_lfn
pop eax
popad
mov [esp+36], eax
mov [esp+32], eax
ret

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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