'Event 5' is changed now. Event returns after redrawing the background.

git-svn-id: svn://kolibrios.org@2513 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79)
2012-03-27 20:02:50 +00:00
parent 8a05d855b7
commit 659824c952
6 changed files with 212 additions and 139 deletions

View File

@@ -255,7 +255,7 @@ SYS_SHUTDOWN equ (OS_BASE+0x000FF00)
TASK_ACTIVATE equ (OS_BASE+0x000FF01)
REDRAW_BACKGROUND equ (OS_BASE+0x000FFF0)
BACKGROUND_CHANGED equ (OS_BASE+0x000FFF1)
BANK_RW equ (OS_BASE+0x000FFF2)
MOUSE_BACKGROUND equ (OS_BASE+0x000FFF4)
DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5)

View File

@@ -4497,10 +4497,7 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>㭪樥<E3ADAA> 17)
* 4 = <20><><EFBFBD>ࢨ஢<E0A2A8><E0AEA2><EFBFBD> (<28><>饩 ॠ<><E0A5A0><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><E5AEA4> <20><><EFBFBD><EFBFBD>
<20><><EFBFBD><><E0A0A7>᪨஢<E1AAA8><E0AEA2> <20>㭪樥<E3ADAA> 40)
* 5 = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ뢠<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䮭 ࠡ<><EFBFBD> <20><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD><20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2>, ⠪ <20><><EFBFBD> <20><20><> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2>
<> <20>ணࠬ<E0AEA3><E0A0AC> <20><> <20><><EFBFBD><EFBFBD> <20> <20><> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD>, <20><> <20><EFBFBD><><E1AEA1><EFBFBD><EFBFBD>
<20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
* 5 = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><><EFBFBD> <20><EFBFBD>
* 6 = ᮡ<><20><> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><E7A8AB><EFBFBD> - <20><><EFBFBD><EFBFBD><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
<20><><EFBFBD> <20><><EFBFBD><EFBFBD><E9A5AD>; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E2A5AD>)
* 7 = <20><EFBFBD><E0AEA8>諮 ᮡ<>⨥ IPC (ᬮ<><E1ACAE><EFBFBD> <20><EFBFBD><E3ADAA><EFBFBD> 60 - Inter Process

View File

@@ -4463,9 +4463,7 @@ Codes of events:
are read out by function 17)
* 4 = reserved (in current implementation never comes even after
unmasking by function 40)
* 5 = the desktop background is redrawed (is reset automatically
after redraw, so if in redraw time program does not wait and
does not check events, it will not remark this event)
* 5 = kernel finished redrawing of the desktop background
* 6 = mouse event (something happened - button pressing or moving;
is reset at reading)
* 7 = IPC event (see function 60 -

View File

@@ -23,6 +23,7 @@ endg
EV_SPACE = 512
FreeEvents = event_start-EVENT.fd ; "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
; FreeEvents.fd=event_start <EFBFBD> FreeEvents.bk=event_end
;-----------------------------------------------------------------------------
align 4
init_events: ;; used from kernel.asm
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
@@ -32,6 +33,8 @@ init_events: ;; used from kernel.asm
mov ecx, EV_SPACE ; current - in allocated space
mov ebx, FreeEvents ; previos - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
push ebx ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;--------------------------------------
align 4
@@:
mov [ebx+EVENT.fd], eax
mov [eax+EVENT.bk], ebx
@@ -41,14 +44,16 @@ init_events: ;; used from kernel.asm
pop eax ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [ebx+EVENT.fd], eax
mov [eax+EVENT.bk], ebx
;--------------------------------------
align 4
.fail:
ret
;-----------------------------------------------------------------------------
EVENT_WATCHED equ 0x10000000 ;<EFBFBD><EFBFBD><EFBFBD> 28
EVENT_SIGNALED equ 0x20000000 ;<EFBFBD><EFBFBD><EFBFBD> 29
MANUAL_RESET equ 0x40000000 ;<EFBFBD><EFBFBD><EFBFBD> 30
MANUAL_DESTROY equ 0x80000000 ;<EFBFBD><EFBFBD><EFBFBD> 31
;-----------------------------------------------------------------------------
align 4
create_event: ;; EXPORT use
;info:
@@ -67,7 +72,8 @@ create_event: ;; EXPORT use
mov edx, [edx+TASKDATA.pid]
pushfd
cli
;--------------------------------------
align 4
set_event: ;; INTERNAL use !!! don't use for Call
;info:
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> event <20><> FreeEvents, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ecx,edx,esi
@@ -89,6 +95,8 @@ set_event: ;; INTERNAL use !!! don't use
call init_events
popad
jz RemoveEventTo.break ; POPF+RET
;--------------------------------------
align 4
@@:
mov eax, [eax+EVENT.fd]
mov [eax+EVENT.magic], 'EVNT'
@@ -103,7 +111,8 @@ set_event: ;; INTERNAL use !!! don't use
mov ecx, (sizeof.EVENT -EVENT.code)/4
cld
rep movsd
;--------------------------------------
align 4
RemoveEventTo: ;; INTERNAL use !!! don't use for Call
;param:
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> event, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -118,10 +127,12 @@ RemoveEventTo: ;; INTERNAL use !!! don't use
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight
mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight
mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft
;--------------------------------------
align 4
.break:
popfd
ret
;-----------------------------------------------------------------------------
align 4
NotDummyTest: ;; INTERNAL use (not returned for fail !!!)
pop edi
@@ -129,6 +140,8 @@ NotDummyTest: ;; INTERNAL use (not returned
mov ebx, eax
mov eax, [ebx+EVENT.pid]
push edi
;--------------------------------------
align 4
.small: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD>...
pop edi
pushfd
@@ -137,7 +150,7 @@ NotDummyTest: ;; INTERNAL use (not returned
shl eax, 8
jz RemoveEventTo.break ; POPF+RET
jmp edi ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;-----------------------------------------------------------------------------
align 4
raise_event: ;; EXPORT use
;info:
@@ -158,6 +171,8 @@ raise_event: ;; EXPORT use
mov ecx, (sizeof.EVENT -EVENT.code)/4
cld
rep movsd
;--------------------------------------
align 4
@@:
test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
jnz RemoveEventTo.break ; POPF+RET
@@ -165,12 +180,14 @@ raise_event: ;; EXPORT use
jnc @f
test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24
jz RemoveEventTo.break ; POPF+RET
;--------------------------------------
align 4
@@:
or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24
add eax, SLOT_BASE+APP_EV_OFFSET
xchg eax, ebx
jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4
clear_event: ;; EXPORT use
;info:
@@ -184,7 +201,7 @@ clear_event: ;; EXPORT use
and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24)
xchg eax, ebx
jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4
send_event: ;; EXPORT use
;info:
@@ -207,7 +224,7 @@ send_event: ;; EXPORT use
lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET]
mov ecx, EVENT_SIGNALED
jmp set_event
;-----------------------------------------------------------------------------
align 4
DummyTest: ;; INTERNAL use (not returned for fail !!!)
;param:
@@ -217,16 +234,21 @@ DummyTest: ;; INTERNAL use (not returned
jne @f
cmp [eax+EVENT.id], ebx
je .ret
;--------------------------------------
align 4
@@:
pop eax
xor eax, eax
;--------------------------------------
align 4
.ret:
ret
;-----------------------------------------------------------------------------
align 4
Wait_events:
or ebx, -1; infinite timeout
;--------------------------------------
align 4
Wait_events_ex:
;info:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 5-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
@@ -260,9 +282,11 @@ Wait_events_ex:
mov [eax+TASKDATA.state], 5
call change_task
mov eax, [esi+APPDATA.wait_param]
;--------------------------------------
align 4
@@:
ret
;-----------------------------------------------------------------------------
align 4
wait_event: ;; EXPORT use
;info:
@@ -281,7 +305,7 @@ wait_event: ;; EXPORT use
mov edx, get_event_alone ; wait_test
call Wait_events ; timeout ignored
jmp wait_finish
;-----------------------------------------------------------------------------
align 4
get_event_ex: ;; f68:14
;info:
@@ -303,6 +327,8 @@ get_event_ex: ;; f68:14
cld
rep movsd
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field
;--------------------------------------
align 4
wait_finish:
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24
jnz get_event_queue.ret ; RET
@@ -314,7 +340,7 @@ wait_finish:
pushfd
cli
jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4
destroy_event: ;; EXPORT use
;info:
@@ -326,6 +352,8 @@ destroy_event: ;; EXPORT use
; eax - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EVENT (=0 => fail)
;scratched: ebx,ecx
call DummyTest ; not returned for fail !!!
;--------------------------------------
align 4
.internal:
xor ecx, ecx ; clear common header
pushfd
@@ -336,7 +364,7 @@ destroy_event: ;; EXPORT use
mov [eax+EVENT.id], ecx
mov ebx, FreeEvents
jmp RemoveEventTo
;-----------------------------------------------------------------------------
align 4
get_event_queue:
;info:
@@ -353,9 +381,11 @@ get_event_queue:
mov eax, [ebx+APPOBJ.bk] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FIFO
cmp eax, ebx ; empty ???
je get_event_alone.ret0
;--------------------------------------
align 4
.ret:
ret
;-----------------------------------------------------------------------------
align 4
get_event_alone:
;info:
@@ -372,11 +402,15 @@ get_event_alone:
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24
jnz .ret
or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24
;--------------------------------------
align 4
.ret0:
xor eax, eax; NO event!!!
;--------------------------------------
align 4
.ret:
ret
;-----------------------------------------------------------------------------
align 4
sys_sendwindowmsg: ;; f72
dec ebx
@@ -387,6 +421,8 @@ sys_sendwindowmsg: ;; f72
je .sendkey
dec ecx
jnz .retf
;--------------------------------------
align 4
.sendbtn:
cmp byte[BTN_COUNT], 1
jae .result ;overflow
@@ -394,19 +430,27 @@ sys_sendwindowmsg: ;; f72
shl edx, 8
mov [BTN_BUFF], edx
jmp .result
;--------------------------------------
align 4
.sendkey:
movzx eax, byte[KEY_COUNT]
cmp al, 120
jae .result ;overflow
inc byte[KEY_COUNT]
mov [KEY_COUNT+1+eax], dl
;--------------------------------------
align 4
.result:
setae byte[esp+32] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: dword[esp+32]==72
;--------------------------------------
align 4
.retf:
popfd
;--------------------------------------
align 4
.ret:
ret
;-----------------------------------------------------------------------------
align 4
sys_getevent: ;; f11
mov ebx, [current_slot];<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..........
@@ -416,16 +460,18 @@ sys_getevent: ;; f11
popfd
mov [esp+32], eax
ret
;-----------------------------------------------------------------------------
align 4
sys_waitforevent: ;; f10
or ebx, -1; infinite timeout
;--------------------------------------
align 4
sys_wait_event_timeout: ;; f23
mov edx, get_event_for_app; wait_test
call Wait_events_ex ; ebx - timeout
mov [esp+32], eax
ret
;-----------------------------------------------------------------------------
align 4
get_event_for_app: ;; used from f10,f11,f23
;info:
@@ -443,6 +489,8 @@ get_event_for_app: ;; used from f10,f11,f23
add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE]
mov ecx, [edi+TASKDATA.event_mask]
and ecx, 0x7FFFFFFF
;--------------------------------------
align 4
.loop: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bsr eax, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (31 -> 0)
jz .no_events ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ???
@@ -455,14 +503,19 @@ get_event_for_app: ;; used from f10,f11,f23
ja .FlagAutoReset ; eax=[4..8], retvals=eax+1
cmp eax, 1
jae .BtKy ; eax=[1,2], retvals=eax+1
;--------------------------------------
align 4
.WndRedraw: ; eax=0, retval WndRedraw=1
cmp [edi-twdw+WDATA.fl_redraw], al;al==0
jne .result
jmp .loop
;--------------------------------------
align 4
.no_events:
xor eax, eax
ret
;--------------------------------------
align 4
.FlagAutoReset: ; retvals: BgrRedraw=5, Mouse=6, IPC=7, Stack=8, Debug=9
cmp eax, 5; Mouse 5+1=6
jne .no_mouse_check
@@ -473,6 +526,8 @@ get_event_for_app: ;; used from f10,f11,f23
jz @f
pop eax
jmp .no_mouse_check
;--------------------------------------
align 4
@@:
; If the window is captured and moved by the user, then no mouse events!!!
mov al, [mouse.active_sys_window.action]
@@ -480,16 +535,24 @@ get_event_for_app: ;; used from f10,f11,f23
test al, al
pop eax
jnz .loop
;--------------------------------------
align 4
.no_mouse_check:
btr [ebx+APPDATA.event_mask], eax
jnc .loop
;--------------------------------------
align 4
.result: ; retval = eax+1
inc eax
ret
;--------------------------------------
align 4
.BtKy:
movzx edx, bh
movzx edx, word[WIN_STACK+edx*2]
je .Keys ; eax=1, retval Keys=2
;--------------------------------------
align 4
.Buttons: ; eax=2, retval Buttons=3
cmp byte[BTN_COUNT], 0
je .loop ; empty ???
@@ -502,13 +565,19 @@ get_event_for_app: ;; used from f10,f11,f23
mov [window_minimize], 1
dec byte[BTN_COUNT]
jmp .loop
;--------------------------------------
align 4
.Keys: ; eax==1
cmp edx, [TASK_COUNT]
jne @f ; not Top ???
cmp [KEY_COUNT], al; al==1
jae .result ; not empty ???
;--------------------------------------
align 4
@@:
mov edx, hotkey_buffer
;--------------------------------------
align 4
@@:
cmp [edx], bh ; bh - slot for testing
je .result
@@ -517,3 +586,4 @@ get_event_for_app: ;; used from f10,f11,f23
jb @b
jmp .loop
;end.
;-----------------------------------------------------------------------------

View File

@@ -2511,12 +2511,7 @@ nosb2:
cmp ebx, 3 ; DRAW BACKGROUND
jnz nosb3
draw_background_temp:
; cmp [bgrchanged],1 ;0
; je nosb31
;draw_background_temp:
; mov [bgrchanged],1 ;0
mov [background_defined], 1
mov byte[BACKGROUND_CHANGED], 1
call force_redraw_background
nosb31:
ret
@@ -2527,7 +2522,6 @@ draw_background_temp:
cmp ecx, [BgrDrawMode]
je nosb41
mov [BgrDrawMode], ecx
; mov [bgrchanged],1
nosb41:
ret
nosb4:
@@ -3139,12 +3133,9 @@ endg
uglobal
background_defined db 0 ; diamond, 11.04.2006
endg
;-----------------------------------------------------------------------------
align 4
; check misc
checkmisc:
cmp [ctrl_alt_del], 1
jne nocpustart
@@ -3152,7 +3143,8 @@ checkmisc:
call fs_execute_from_sysdir
mov [ctrl_alt_del], 0
;--------------------------------------
align 4
nocpustart:
cmp [mouse_active], 1
jne mouse_not_active
@@ -3168,7 +3160,7 @@ nocpustart:
movzx eax, word [MOUSE_X]
movzx edx, word [MOUSE_Y]
;--------------------------------------
align 4
.set_mouse_event:
add edi, 256
@@ -3178,7 +3170,8 @@ align 4
cmp edi, [esp] ; skip if filtration active
jne .skip
;--------------------------------------
align 4
.pos_filter:
test [ebx+TASKDATA.event_mask], 0x40000000
jz .set
@@ -3196,50 +3189,53 @@ align 4
add esi, [ebx-twdw+WDATA.box.height]
cmp edx, esi
ja .skip
;--------------------------------------
align 4
.set:
or [edi+SLOT_BASE+APPDATA.event_mask], 100000b
or [edi+SLOT_BASE+APPDATA.event_mask], 100000b ; set event 6
;--------------------------------------
align 4
.skip:
loop .set_mouse_event
pop eax
;--------------------------------------
align 4
mouse_not_active:
cmp byte[BACKGROUND_CHANGED], 0
jz no_set_bgr_event
xor edi, edi
mov ecx, [TASK_COUNT]
set_bgr_event:
add edi, 256
or [edi+SLOT_BASE+APPDATA.event_mask], 16
loop set_bgr_event
mov byte[BACKGROUND_CHANGED], 0
no_set_bgr_event:
cmp byte[REDRAW_BACKGROUND], 0 ; background update ?
jz nobackgr
cmp [background_defined], 0
jz nobackgr
; mov [draw_data+32 + RECT.left],dword 0
; mov [draw_data+32 + RECT.top],dword 0
; mov eax,[Screen_Max_X]
; mov ebx,[Screen_Max_Y]
; mov [draw_data+32 + RECT.right],eax
; mov [draw_data+32 + RECT.bottom],ebx
;--------------------------------------
align 4
@@:
call drawbackground
;--------- set event 5 start ----------
push ecx edi
xor edi, edi
mov ecx, [TASK_COUNT]
;--------------------------------------
align 4
set_bgr_event:
add edi, 256
or [edi+SLOT_BASE+APPDATA.event_mask], 10000b ; set event 5
loop set_bgr_event
pop edi ecx
;--------- set event 5 stop -----------
xor eax, eax
xchg al, [REDRAW_BACKGROUND]
test al, al ; got new update request?
jnz @b
mov [draw_data+32 + RECT.left], eax
mov [draw_data+32 + RECT.top], eax
mov [draw_data+32 + RECT.right], eax
mov [draw_data+32 + RECT.bottom], eax
mov [MOUSE_BACKGROUND], byte 0
;--------------------------------------
align 4
nobackgr:
; system shutdown request
cmp [SYS_SHUTDOWN], byte 0
je noshutdown
@@ -3251,28 +3247,31 @@ nobackgr:
lea ecx, [edx-1]
mov edx, OS_BASE+0x3040
jecxz @f
;--------------------------------------
align 4
markz:
mov [edx+TASKDATA.state], byte 3
add edx, 0x20
loop markz
;--------------------------------------
align 4
@@:
no_mark_system_shutdown:
dec byte [SYS_SHUTDOWN]
je system_shutdown
;--------------------------------------
align 4
noshutdown:
mov eax, [TASK_COUNT] ; termination
mov ebx, TASK_DATA+TASKDATA.state
mov esi, 1
;--------------------------------------
align 4
newct:
mov cl, [ebx]
cmp cl, byte 3
jz terminate
cmp cl, byte 4
jz terminate
@@ -3281,11 +3280,9 @@ newct:
dec eax
jnz newct
ret
; redraw screen
;-----------------------------------------------------------------------------
align 4
redrawscreen:
; eax , if process window_data base is eax, do not set flag/limits
pushad
@@ -3296,8 +3293,9 @@ redrawscreen:
;mov ecx,0 ; redraw flags for apps
xor ecx, ecx
;--------------------------------------
align 4
newdw2:
inc ecx
push ecx
@@ -3342,45 +3340,58 @@ redrawscreen:
mov eax, [draw_limits.left] ; eax = area x start ecx = window x end
cmp ecx, eax
jb ricino
;--------------------------------------
align 4
bgli:
cmp dword[esp], 1
jnz .az
; cmp byte[BACKGROUND_CHANGED], 0
; jnz newdw8
cmp byte[REDRAW_BACKGROUND], 0
jz .az
mov dl, 0
lea eax, [edi+draw_data-window_data]
mov ebx, [draw_limits.left]
cmp ebx, [eax+RECT.left]
jae @f
mov [eax+RECT.left], ebx
mov dl, 1
;--------------------------------------
align 4
@@:
mov ebx, [draw_limits.top]
cmp ebx, [eax+RECT.top]
jae @f
mov [eax+RECT.top], ebx
mov dl, 1
;--------------------------------------
align 4
@@:
mov ebx, [draw_limits.right]
cmp ebx, [eax+RECT.right]
jbe @f
mov [eax+RECT.right], ebx
mov dl, 1
;--------------------------------------
align 4
@@:
mov ebx, [draw_limits.bottom]
cmp ebx, [eax+RECT.bottom]
jbe @f
mov [eax+RECT.bottom], ebx
mov dl, 1
;--------------------------------------
align 4
@@:
add byte[REDRAW_BACKGROUND], dl
jmp newdw8
;--------------------------------------
align 4
.az:
mov eax, edi
add eax, draw_data-window_data
@@ -3398,16 +3409,16 @@ redrawscreen:
cmp dword [esp], 1
jne nobgrd
inc byte[REDRAW_BACKGROUND]
;--------------------------------------
align 4
newdw8:
nobgrd:
mov [eax + WDATA.fl_redraw], byte 1 ; mark as redraw
;--------------------------------------
align 4
ricino:
not_this_task:
pop ecx
cmp ecx, [TASK_COUNT]
@@ -3415,11 +3426,10 @@ redrawscreen:
pop eax
popad
ret
;-----------------------------------------------------------------------------
align 4
calculatebackground: ; background
mov edi, [_WinMapAddress] ; set os to use all pixels
mov eax, 0x01010101
mov ecx, [_WinMapSize]
@@ -3427,19 +3437,14 @@ calculatebackground: ; background
rep stosd
mov byte[REDRAW_BACKGROUND], 0 ; do not draw background!
mov byte[BACKGROUND_CHANGED], 0
ret
;-----------------------------------------------------------------------------
uglobal
imax dd 0x0
endg
;-----------------------------------------------------------------------------
align 4
delay_ms: ; delay in 1/1000 sec
push eax
push ecx
@@ -3453,7 +3458,8 @@ delay_ms: ; delay in 1/1000 sec
and al, 0x10
mov ah, al
cld
;--------------------------------------
align 4
cnt1:
in al, 0x61
and al, 0x10
@@ -3465,9 +3471,8 @@ delay_ms: ; delay in 1/1000 sec
pop ecx
pop eax
ret
;-----------------------------------------------------------------------------
align 4
set_app_param:
mov edi, [TASK_BASE]
@@ -3478,16 +3483,16 @@ set_app_param:
xchg eax, [edi + TASKDATA.event_mask] ; set new event mask
mov [esp+32], eax ; return old mask value
ret
;-----------------------------------------------------------------------------
align 4
delay_hs: ; delay in 1/100 secs
; ebx = delay time
push ecx
push edx
mov edx, [timer_ticks]
;--------------------------------------
align 4
newtic:
mov ecx, [timer_ticks]
sub ecx, edx
@@ -3497,16 +3502,15 @@ delay_hs: ; delay in 1/100 secs
call change_task
jmp newtic
;--------------------------------------
align 4
zerodelay:
pop edx
pop ecx
ret
;-----------------------------------------------------------------------------
align 16 ;very often call this subrutine
memmove: ; memory move in bytes
; eax = from
; ebx = to
; ecx = no of bytes
@@ -3527,15 +3531,19 @@ memmove: ; memory move in bytes
pop ecx
and ecx, 11b
jz .finish
;--------------------------------------
align 4
@@:
rep movsb
;--------------------------------------
align 4
.finish:
pop ecx edi esi
;--------------------------------------
align 4
.ret:
ret
;-----------------------------------------------------------------------------
; <diamond> Sysfunction 34, read_floppy_file, is obsolete. Use 58 or 70 function instead.
;align 4
;

View File

@@ -137,7 +137,7 @@
; FF00 byte 1 = system shutdown request
; FF01 byte task activation request?
; FFF0 byte >0 if redraw background request from app
; FFF1 byte >0 if background changed
; FFF1 byte free
; FFF2 write and read bank in screen
; FFF4 byte 0 if first mouse draw & do not return picture under
; FFF5 byte 1 do not draw pointer