Rev 129 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 129 | Rev 384 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | align 4 |
|
- | 2 | init_events: |
|
- | 3 | stdcall kernel_alloc, 512*EVENT_SIZE |
|
- | 4 | mov [events], eax |
|
- | 5 | xor eax, eax |
|
- | 6 | mov [event_uid], eax |
|
- | 7 | not eax |
|
- | 8 | mov edi, event_map |
|
- | 9 | mov [event_start], edi |
|
- | 10 | mov ecx, 64/4 |
|
- | 11 | cld |
|
- | 12 | rep stosd |
|
- | 13 | mov [event_end], edi |
|
- | 14 | ret |
|
- | 15 | ||
- | 16 | align 4 |
|
- | 17 | proc alloc_event |
|
- | 18 | ||
- | 19 | pushfd |
|
- | 20 | cli |
|
- | 21 | mov ebx, [event_start] |
|
- | 22 | mov ecx, [event_end] |
|
- | 23 | .l1: |
|
- | 24 | bsf eax,[ebx] |
|
- | 25 | jnz .found |
|
- | 26 | add ebx,4 |
|
- | 27 | cmp ebx, ecx |
|
- | 28 | jb .l1 |
|
- | 29 | popfd |
|
- | 30 | xor eax,eax |
|
- | 31 | ret |
|
- | 32 | .found: |
|
- | 33 | btr [ebx], eax |
|
- | 34 | mov [event_start],ebx |
|
- | 35 | inc [event_uid] |
|
- | 36 | ||
- | 37 | sub ebx, event_map |
|
- | 38 | lea eax,[eax+ebx*8] |
|
- | 39 | ||
- | 40 | lea ebx, [eax+eax*4] |
|
- | 41 | shl eax,5 |
|
- | 42 | lea eax,[eax+ebx*4] ;eax*=52 (EVENT_SIZE) |
|
- | 43 | add eax, [events] |
|
- | 44 | mov ebx, [event_uid] |
|
- | 45 | popfd |
|
- | 46 | ret |
|
- | 47 | endp |
|
- | 48 | ||
- | 49 | align 4 |
|
- | 50 | free_event: |
|
- | 51 | sub eax, [events] |
|
- | 52 | mov ecx, EVENT_SIZE |
|
- | 53 | mov ebx, event_map |
|
- | 54 | cdq |
|
- | 55 | div ecx |
|
- | 56 | ||
- | 57 | pushfd |
|
- | 58 | cli |
|
- | 59 | bts [ebx], eax |
|
- | 60 | shr eax, 3 |
|
- | 61 | and eax, not 3 |
|
- | 62 | add eax, ebx |
|
- | 63 | cmp [event_start], eax |
|
- | 64 | ja @f |
|
- | 65 | popfd |
|
- | 66 | ret |
|
- | 67 | @@: |
|
- | 68 | mov [event_start], eax |
|
- | 69 | popfd |
|
- | 70 | ret |
|
- | 71 | ||
- | 72 | EVENT_WATCHED equ 0x10000000 |
|
- | 73 | EVENT_SIGNALED equ 0x20000000 |
|
- | 74 | MANUAL_RESET equ 0x40000000 |
|
- | 75 | MANUAL_DESTROY equ 0x80000000 |
|
- | 76 | ||
- | 77 | ||
- | 78 | ; param |
|
- | 79 | ; eax= event data |
|
- | 80 | ; ebx= flags |
|
- | 81 | ; |
|
- | 82 | ; retval |
|
- | 83 | ; eax= event |
|
- | 84 | ; edx= id |
|
- | 85 | ||
- | 86 | create_event: |
|
- | 87 | .flags equ esp+4 |
|
- | 88 | .data equ esp |
|
- | 89 | ||
- | 90 | push ebx |
|
- | 91 | push eax |
|
- | 92 | ||
- | 93 | call alloc_event |
|
- | 94 | test eax, eax |
|
- | 95 | jz .fail |
|
- | 96 | ||
- | 97 | mov [eax+APPOBJ.magic], 'EVNT' |
|
- | 98 | mov [eax+APPOBJ.destroy], destroy_event.internal |
|
- | 99 | mov [eax+EVENT.id], ebx |
|
- | 100 | ||
- | 101 | mov ebx, [CURRENT_TASK] |
|
- | 102 | shl ebx, 5 |
|
- | 103 | mov ebx, [CURRENT_TASK+ebx+4] |
|
- | 104 | mov [eax+APPOBJ.pid], ebx |
|
- | 105 | mov edx, [.flags] |
|
- | 106 | mov [eax+EVENT.state], edx |
|
- | 107 | ||
- | 108 | mov esi, [.data] |
|
- | 109 | test esi, esi |
|
- | 110 | jz @F |
|
- | 111 | lea edi, [eax+EVENT.code] |
|
- | 112 | mov ecx, 6 |
|
- | 113 | cld |
|
- | 114 | rep movsd |
|
- | 115 | @@: |
|
- | 116 | mov ecx, [CURRENT_TASK] |
|
- | 117 | shl ecx,8 |
|
- | 118 | add ecx, SLOT_BASE+APP_OBJ_OFFSET |
|
- | 119 | ||
- | 120 | pushfd |
|
- | 121 | cli |
|
- | 122 | mov edx, [ecx+APPOBJ.fd] |
|
- | 123 | mov [eax+APPOBJ.fd], edx |
|
- | 124 | mov [eax+APPOBJ.bk], ecx |
|
- | 125 | mov [ecx+APPOBJ.fd], eax |
|
- | 126 | mov [edx+APPOBJ.bk], eax |
|
- | 127 | popfd |
|
- | 128 | mov edx, [eax+EVENT.id] |
|
- | 129 | .fail: |
|
- | 130 | add esp, 8 |
|
- | 131 | ret |
|
- | 132 | ||
- | 133 | restore .flags |
|
- | 134 | restore .data |
|
- | 135 | ||
- | 136 | ; param |
|
- | 137 | ; eax= event |
|
- | 138 | ; ebx= id |
|
- | 139 | ||
- | 140 | destroy_event: |
|
- | 141 | ||
- | 142 | cmp [eax+APPOBJ.magic], 'EVNT' |
|
- | 143 | jne .fail |
|
- | 144 | cmp [eax+EVENT.id], ebx |
|
- | 145 | jne .fail |
|
- | 146 | .internal: |
|
- | 147 | mov ebx, [eax+APPOBJ.fd] |
|
- | 148 | mov ecx, [eax+APPOBJ.bk] |
|
- | 149 | mov [ebx+APPOBJ.bk], ecx |
|
- | 150 | mov [ecx+APPOBJ.fd], ebx |
|
- | 151 | .force: |
|
- | 152 | xor edx, edx ;clear common header |
|
- | 153 | mov [eax], edx |
|
- | 154 | mov [eax+4], edx |
|
- | 155 | mov [eax+8], edx |
|
- | 156 | mov [eax+12], edx |
|
- | 157 | mov [eax+16], edx |
|
- | 158 | ||
- | 159 | call free_event ;release object memory |
|
- | 160 | .fail: |
|
- | 161 | ret |
|
- | 162 | ||
- | 163 | align 4 |
|
- | 164 | proc send_event stdcall pid:dword, event:dword |
|
- | 165 | locals |
|
- | 166 | slot dd ? |
|
- | 167 | endl |
|
- | 168 | ||
- | 169 | mov eax, [pid] |
|
- | 170 | call pid_to_slot |
|
- | 171 | test eax, eax |
|
- | 172 | jz .fail |
|
- | 173 | ||
- | 174 | shl eax, 8 |
|
- | 175 | cmp [SLOT_BASE+eax+APPDATA.ev_count], 32 |
|
- | 176 | ja .fail |
|
- | 177 | ||
- | 178 | mov [slot], eax |
|
- | 179 | ||
- | 180 | call alloc_event |
|
- | 181 | test eax, eax |
|
- | 182 | jz .fail |
|
- | 183 | ||
- | 184 | lea edi, [eax+EVENT.code] |
|
- | 185 | mov ecx, 6 |
|
- | 186 | mov esi, [event] |
|
- | 187 | cld |
|
- | 188 | rep movsd |
|
- | 189 | ||
- | 190 | mov ecx, [slot] |
|
- | 191 | add ecx, SLOT_BASE+APP_EV_OFFSET |
|
- | 192 | ||
- | 193 | mov [eax+APPOBJ.magic], 'EVNT' |
|
- | 194 | mov [eax+APPOBJ.destroy], destroy_event |
|
- | 195 | mov ebx, [pid] |
|
- | 196 | mov [eax+APPOBJ.pid], ebx |
|
- | 197 | mov [eax+EVENT.state], EVENT_SIGNALED |
|
- | 198 | ||
- | 199 | pushfd |
|
- | 200 | cli ;insert event into |
|
- | 201 | mov edx, [ecx+APPOBJ.fd] ;events list |
|
- | 202 | mov [eax+APPOBJ.fd], edx ;and set events flag |
|
- | 203 | mov [eax+APPOBJ.bk], ecx |
|
- | 204 | mov [ecx+APPOBJ.fd], eax |
|
- | 205 | mov [edx+APPOBJ.bk], eax |
|
- | 206 | inc [ecx+APPDATA.ev_count-APP_EV_OFFSET] |
|
- | 207 | or [ecx+APPDATA.event_mask-APP_EV_OFFSET], EVENT_EXTENDED |
|
- | 208 | popfd |
|
- | 209 | .fail: |
|
- | 210 | ret |
|
- | 211 | endp |
|
- | 212 | ||
- | 213 | ; timeout ignored |
|
- | 214 | ||
- | 215 | align 4 |
|
- | 216 | proc get_event_ex stdcall, p_ev:dword, timeout:dword |
|
- | 217 | ||
- | 218 | .wait: |
|
- | 219 | mov edx,[CURRENT_TASK] |
|
- | 220 | shl edx,8 |
|
- | 221 | ; cmp [SLOT_BASE+edx+APPDATA.ev_count], 0 |
|
- | 222 | ; je .switch |
|
- | 223 | ||
- | 224 | add edx, SLOT_BASE+APP_EV_OFFSET |
|
- | 225 | ||
- | 226 | mov eax, [edx+APPOBJ.fd] |
|
- | 227 | cmp eax, edx |
|
- | 228 | je .switch |
|
- | 229 | ||
- | 230 | lea esi, [eax+EVENT.code] |
|
- | 231 | mov edi, [p_ev] ;copy event data |
|
- | 232 | mov ecx, 6 |
|
- | 233 | cld |
|
- | 234 | rep movsd |
|
- | 235 | ||
- | 236 | and dword [edi-24], 0xFF00FFFF ;clear priority field |
|
- | 237 | ; |
|
- | 238 | test [eax+EVENT.state], MANUAL_RESET |
|
- | 239 | jnz .done |
|
- | 240 | ||
- | 241 | pushfd |
|
- | 242 | cli ;remove event from events |
|
- | 243 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
|
- | 244 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
|
- | 245 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
|
- | 246 | mov [ecx+APPOBJ.fd], ebx |
|
- | 247 | ||
- | 248 | and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
- | 249 | ||
- | 250 | dec [edx+APPDATA.ev_count-APP_EV_OFFSET] |
|
- | 251 | jnz @F |
|
- | 252 | and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
|
- | 253 | @@: |
|
- | 254 | popfd |
|
- | 255 | ||
- | 256 | test [eax+EVENT.state], MANUAL_DESTROY |
|
- | 257 | jz .destroy |
|
- | 258 | ||
- | 259 | add edx, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
|
- | 260 | ||
- | 261 | pushfd |
|
- | 262 | cli |
|
- | 263 | mov ebx, [edx+APPOBJ.fd] ;insert event into |
|
- | 264 | mov [eax+APPOBJ.fd], ebx ;objects list |
|
- | 265 | mov [eax+APPOBJ.bk], edx |
|
- | 266 | mov [edx+APPOBJ.fd], eax |
|
- | 267 | mov [ebx+APPOBJ.bk], eax |
|
- | 268 | popfd |
|
- | 269 | .done: |
|
- | 270 | ret |
|
- | 271 | ||
- | 272 | .destroy: |
|
- | 273 | call destroy_event.force |
|
- | 274 | ret |
|
- | 275 | .switch: |
|
- | 276 | mov eax, [TASK_BASE] |
|
- | 277 | mov [eax+TASKDATA.state], byte 5 |
|
- | 278 | call change_task |
|
- | 279 | jmp .wait |
|
- | 280 | endp |
|
- | 281 | ||
- | 282 | ; param |
|
- | 283 | ; eax= event |
|
- | 284 | ; ebx= id |
|
- | 285 | ||
- | 286 | align 4 |
|
- | 287 | wait_event: |
|
- | 288 | .event equ esp |
|
- | 289 | push eax |
|
- | 290 | .wait: |
|
- | 291 | cmp [eax+APPOBJ.magic], 'EVNT' |
|
- | 292 | jne .done |
|
- | 293 | cmp [eax+EVENT.id], ebx |
|
- | 294 | jne .done |
|
- | 295 | ||
- | 296 | test [eax+EVENT.state], EVENT_SIGNALED |
|
- | 297 | jz .switch |
|
- | 298 | ||
- | 299 | test [eax+EVENT.state], MANUAL_RESET |
|
- | 300 | jnz .done |
|
- | 301 | ||
- | 302 | mov edx,[CURRENT_TASK] |
|
- | 303 | shl edx,8 |
|
- | 304 | add edx, SLOT_BASE |
|
- | 305 | ||
- | 306 | pushfd |
|
- | 307 | cli ;remove event from events |
|
- | 308 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
|
- | 309 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
|
- | 310 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
|
- | 311 | mov [ecx+APPOBJ.fd], ebx |
|
- | 312 | dec [edx+APPDATA.ev_count] |
|
- | 313 | jnz @F |
|
- | 314 | and [edx+APPDATA.event_mask], not EVENT_EXTENDED |
|
- | 315 | @@: |
|
- | 316 | and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
- | 317 | popfd |
|
- | 318 | ||
- | 319 | test [eax+EVENT.state], MANUAL_DESTROY |
|
- | 320 | jz .destroy |
|
- | 321 | ||
- | 322 | add edx, APP_OBJ_OFFSET |
|
- | 323 | ||
- | 324 | pushfd |
|
- | 325 | cli |
|
- | 326 | mov ecx, [edx+APPOBJ.fd] ;insert event into |
|
- | 327 | mov [eax+APPOBJ.fd], ecx ;objects list |
|
- | 328 | mov [eax+APPOBJ.bk], edx |
|
- | 329 | mov [edx+APPOBJ.fd], eax |
|
- | 330 | mov [ecx+APPOBJ.bk], eax |
|
- | 331 | popfd |
|
- | 332 | .done: |
|
- | 333 | add esp, 4 |
|
- | 334 | ret |
|
- | 335 | .destroy: |
|
- | 336 | call destroy_event.force |
|
- | 337 | add esp, 4 |
|
- | 338 | ret |
|
- | 339 | .switch: |
|
- | 340 | or [eax+EVENT.state], EVENT_WATCHED |
|
- | 341 | mov eax, [TASK_BASE] |
|
- | 342 | mov [eax+TASKDATA.state], byte 5 |
|
- | 343 | call change_task |
|
- | 344 | mov eax, [.event] |
|
- | 345 | jmp .wait |
|
- | 346 | restore .event |
|
- | 347 | ||
- | 348 | ; param |
|
- | 349 | ; eax= event |
|
- | 350 | ; ebx= id |
|
- | 351 | ; ecx= flags |
|
- | 352 | ; edx= event data |
|
- | 353 | ||
- | 354 | raise_event: |
|
- | 355 | .event equ esp |
|
- | 356 | push eax |
|
- | 357 | ||
- | 358 | cmp [eax+APPOBJ.magic], 'EVNT' |
|
- | 359 | jne .fail |
|
- | 360 | cmp [eax+EVENT.id], ebx |
|
- | 361 | jne .fail |
|
- | 362 | ||
- | 363 | mov eax, [eax+APPOBJ.pid] |
|
- | 364 | call pid_to_slot |
|
- | 365 | test eax, eax |
|
- | 366 | jz .fail |
|
- | 367 | ||
- | 368 | mov esi, edx |
|
- | 369 | test esi, esi |
|
- | 370 | mov edx, [.event] |
|
- | 371 | jz @F |
|
- | 372 | ||
- | 373 | push ecx |
|
- | 374 | lea edi, [edx+EVENT.code] |
|
- | 375 | mov ecx, 6 |
|
- | 376 | cld |
|
- | 377 | rep movsd |
|
- | 378 | pop ecx |
|
- | 379 | @@: |
|
- | 380 | test [edx+EVENT.state], EVENT_SIGNALED |
|
- | 381 | jnz .done |
|
- | 382 | ||
- | 383 | test ecx, EVENT_WATCHED |
|
- | 384 | jz @F |
|
- | 385 | test [edx+EVENT.state], EVENT_WATCHED |
|
- | 386 | jz .done |
|
- | 387 | @@: |
|
- | 388 | shl eax, 8 |
|
- | 389 | add eax, SLOT_BASE+APP_EV_OFFSET |
|
- | 390 | ||
- | 391 | pushfd |
|
- | 392 | cli |
|
- | 393 | mov ebx, [edx+APPOBJ.fd] |
|
- | 394 | mov ecx, [edx+APPOBJ.bk] |
|
- | 395 | mov [ebx+APPOBJ.bk], ecx |
|
- | 396 | mov [ecx+APPOBJ.fd], ebx |
|
- | 397 | ||
- | 398 | mov ecx, [eax+APPOBJ.fd] |
|
- | 399 | mov [edx+APPOBJ.fd], ecx |
|
- | 400 | mov [edx+APPOBJ.bk], eax |
|
- | 401 | mov [eax+APPOBJ.fd], edx |
|
- | 402 | mov [ecx+APPOBJ.bk], edx |
|
- | 403 | or [edx+EVENT.state], EVENT_SIGNALED |
|
- | 404 | ||
- | 405 | inc [eax+APPDATA.ev_count-APP_EV_OFFSET] |
|
- | 406 | or [eax+APPDATA.event_mask-APP_EV_OFFSET], EVENT_EXTENDED |
|
- | 407 | popfd |
|
- | 408 | .fail: |
|
- | 409 | .done: |
|
- | 410 | add esp, 4 |
|
- | 411 | ret |
|
- | 412 | restore .event |
|
- | 413 | ||
- | 414 | ; param |
|
- | 415 | ; eax= event |
|
- | 416 | ; ebx= id |
|
- | 417 | align 4 |
|
- | 418 | clear_event: |
|
- | 419 | .event equ esp |
|
- | 420 | push eax |
|
- | 421 | ||
- | 422 | cmp [eax+APPOBJ.magic], 'EVNT' |
|
- | 423 | jne .fail |
|
- | 424 | cmp [eax+EVENT.id], ebx |
|
- | 425 | jne .fail |
|
- | 426 | ||
- | 427 | mov eax, [eax+APPOBJ.pid] |
|
- | 428 | call pid_to_slot |
|
- | 429 | test eax, eax |
|
- | 430 | jz .fail |
|
- | 431 | ||
- | 432 | shl eax, 8 |
|
- | 433 | add eax, SLOT_BASE+APP_EV_OFFSET |
|
- | 434 | mov edx, [.event] |
|
- | 435 | pushfd |
|
- | 436 | cli ;remove event from events |
|
- | 437 | mov ebx, [edx+APPOBJ.fd] ;list (reset event) |
|
- | 438 | mov ecx, [edx+APPOBJ.bk] ;and clear events flag |
|
- | 439 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
|
- | 440 | mov [ecx+APPOBJ.fd], ebx |
|
- | 441 | ||
- | 442 | and [edx+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
- | 443 | ||
- | 444 | dec [eax+APPDATA.ev_count-APP_EV_OFFSET] |
|
- | 445 | jnz @F |
|
- | 446 | and [eax+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
|
- | 447 | @@: |
|
- | 448 | add eax, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
|
- | 449 | ||
- | 450 | mov ecx, [eax+APPOBJ.fd] ;insert event into |
|
- | 451 | mov [edx+APPOBJ.fd], ecx ;objects list |
|
- | 452 | mov [edx+APPOBJ.bk], eax |
|
- | 453 | mov [eax+APPOBJ.fd], edx |
|
- | 454 | mov [ecx+APPOBJ.bk], edx |
|
- | 455 | popfd |
|
- | 456 | .fail: |
|
- | 457 | .done: |
|
- | 458 | add esp, 4 |
|
- | 459 | ret |
|
- | 460 | restore .event |
|
- | 461 | ||
- | 462 | sys_getevent: |
|
1 | sys_getevent: |
463 | |
Line 2... | Line 464... | ||
2 | 464 | call get_event_for_app |
|
3 | call get_event_for_app |
465 | mov [esp+36],eax |
4 | mov [esp+36],eax |
466 | ret |
Line 5... | Line 467... | ||
5 | ret |
467 | |
6 | - | ||
7 | 468 | ||
Line 8... | Line 469... | ||
8 | align 4 |
469 | align 4 |
9 | 470 | sys_wait_event_timeout: |
|
10 | sys_wait_event_timeout: |
471 | |
Line 34... | Line 495... | ||
34 | call get_event_for_app |
495 | test eax,eax |
35 | test eax,eax |
496 | jne eventoccur |
36 | jne eventoccur |
497 | newwait: |
37 | newwait: |
498 | |
Line 38... | Line 499... | ||
38 | 499 | mov eax, [TASK_BASE] |
|
39 | mov eax, [0x3010] |
500 | mov [eax+TASKDATA.state], byte 5 |
40 | mov [eax+TASKDATA.state], byte 5 |
501 | call change_task |
Line 41... | Line 502... | ||
41 | call change_task |
502 | |
Line 42... | Line 503... | ||
42 | 503 | mov eax, [event_sched] |
|
43 | mov eax, [event_sched] |
504 | |
44 | 505 | eventoccur: |
|
Line 45... | Line -... | ||
45 | eventoccur: |
- | |
46 | mov [esp+36],eax |
506 | mov [esp+36],eax |
Line 47... | Line 507... | ||
47 | ret |
507 | ret |
Line 48... | Line 508... | ||
48 | 508 | ||
49 | 509 | get_event_for_app: |
|
50 | get_event_for_app: |
510 | |
51 | 511 | pushad |
|
52 | pushad |
512 | |
53 | 513 | mov edi,[TASK_BASE] ; WINDOW REDRAW |
|
54 | mov edi,[0x3010] ; WINDOW REDRAW |
514 | test [edi+TASKDATA.event_mask],dword 1 |
55 | test [edi+TASKDATA.event_mask],dword 1 |
515 | jz no_eventoccur1 |
56 | jz no_eventoccur1 |
516 | ;mov edi,[TASK_BASE] |
57 | ;mov edi,[0x3010] |
517 | cmp [edi-twdw+WDATA.fl_redraw],byte 0 |
Line 58... | Line 518... | ||
58 | cmp [edi-twdw+WDATA.fl_redraw],byte 0 |
518 | je no_eventoccur1 |
59 | je no_eventoccur1 |
519 | popad |
60 | popad |
520 | mov eax,1 |
61 | mov eax,1 |
521 | ret |
62 | ret |
522 | no_eventoccur1: |
63 | no_eventoccur1: |
523 | |
64 | 524 | ;mov edi,[TASK_BASE] ; KEY IN BUFFER |
|
65 | ;mov edi,[0x3010] ; KEY IN BUFFER |
525 | test [edi+TASKDATA.event_mask],dword 2 |
66 | test [edi+TASKDATA.event_mask],dword 2 |
526 | jz no_eventoccur2 |
67 | jz no_eventoccur2 |
527 | mov ecx, [CURRENT_TASK] |
68 | mov ecx, [0x3000] |
528 | movzx edx,word [WIN_STACK+ecx*2] |
69 | movzx edx,word [0xC000+ecx*2] |
529 | mov eax, [TASK_COUNT] |
70 | mov eax, [0x3004] |
530 | cmp eax,edx |
71 | cmp eax,edx |
531 | jne no_eventoccur2x |
Line 84... | Line 544... | ||
84 | add eax, 8 |
544 | cmp eax, hotkey_buffer+120*8 |
85 | cmp eax, hotkey_buffer+120*8 |
545 | jb @b |
86 | jb @b |
546 | no_eventoccur2: |
87 | no_eventoccur2: |
547 | |
Line 88... | Line 548... | ||
88 | 548 | ;mov edi,[TASK_BASE] ; BUTTON IN BUFFER |
|
89 | ;mov edi,[0x3010] ; BUTTON IN BUFFER |
549 | test [edi+TASKDATA.event_mask],dword 4 |
90 | test [edi+TASKDATA.event_mask],dword 4 |
550 | jz no_eventoccur3 |
91 | jz no_eventoccur3 |
551 | cmp [BTN_COUNT],byte 0 |
92 | cmp [0xf500],byte 0 |
552 | je no_eventoccur3 |
93 | je no_eventoccur3 |
553 | mov ecx, [CURRENT_TASK] |
94 | mov ecx, [0x3000] |
554 | movzx edx, word [WIN_STACK+ecx*2] |
95 | movzx edx, word [0xC000+ecx*2] |
555 | mov eax, [TASK_COUNT] |
96 | mov eax, [0x3004] |
556 | cmp eax,edx |
97 | cmp eax,edx |
557 | jnz no_eventoccur3 |
98 | jnz no_eventoccur3 |
558 | popad |
99 | popad |
559 | mov eax,[BTN_BUFF] |
100 | mov eax,[0xf501] |
560 | cmp eax,65535 |
101 | cmp eax,65535 |
561 | je no_event_1 |
102 | je no_event_1 |
562 | mov eax,3 |
103 | mov eax,3 |
563 | ret |
Line 104... | Line 564... | ||
104 | ret |
564 | |
105 | 565 | no_event_1: |
|
106 | no_event_1: |
566 | mov [window_minimize],1 |
107 | mov [window_minimize],1 |
567 | mov [BTN_COUNT],byte 0 |
108 | mov [0xf500],byte 0 |
568 | xor eax, eax |
Line 109... | Line 569... | ||
109 | xor eax, eax |
569 | ret |
Line 110... | Line 570... | ||
110 | ret |
570 | |
111 | 571 | no_eventoccur3: |
|
112 | no_eventoccur3: |
572 | |
113 | 573 | ||
114 | 574 | ;mov edi,[TASK_BASE] ; mouse event |
|
115 | ;mov edi,[0x3010] ; mouse event |
575 | test [edi+TASKDATA.event_mask],dword 00100000b |
116 | test [edi+TASKDATA.event_mask],dword 00100000b |
576 | jz no_mouse_event |
117 | jz no_mouse_event |
577 | mov eax,[CURRENT_TASK] |
118 | mov eax,[0x3000] |
578 | shl eax,8 |
119 | shl eax,8 |
579 | test [eax+SLOT_BASE+APPDATA.event_mask],dword 00100000b |
120 | test [eax+0x80000+APPDATA.event_mask],dword 00100000b |
580 | jz no_mouse_event |
121 | jz no_mouse_event |
581 | and [eax+SLOT_BASE+APPDATA.event_mask],dword 0xffffffff-00100000b |
Line 122... | Line 582... | ||
122 | and [eax+0x80000+APPDATA.event_mask],dword 0xffffffff-00100000b |
582 | popad |
123 | popad |
583 | mov eax,6 |
124 | mov eax,6 |
584 | ret |
125 | ret |
585 | no_mouse_event: |
126 | no_mouse_event: |
586 | |
127 | 587 | ||
128 | 588 | ;mov edi,[TASK_BASE] ; DESKTOP BACKGROUND REDRAW |
|
129 | ;mov edi,[0x3010] ; DESKTOP BACKGROUND REDRAW |
589 | test [edi+TASKDATA.event_mask],dword 16 |
130 | test [edi+TASKDATA.event_mask],dword 16 |
590 | jz no_eventoccur5 |
Line 131... | Line 591... | ||
131 | jz no_eventoccur5 |
591 | cmp [REDRAW_BACKGROUND],byte 2 |
132 | cmp [0xfff0],byte 2 |
592 | jnz no_eventoccur5 |
133 | jnz no_eventoccur5 |
593 | popad |
134 | popad |
594 | mov eax,5 |
135 | mov eax,5 |
595 | ret |
136 | ret |
596 | no_eventoccur5: |
137 | no_eventoccur5: |
597 | |
138 | 598 | ;mov edi,[TASK_BASE] ; IPC |
|
139 | ;mov edi,[0x3010] ; IPC |
599 | test [edi+TASKDATA.event_mask],dword 01000000b |
140 | test [edi+TASKDATA.event_mask],dword 01000000b |
600 | jz no_ipc |
141 | jz no_ipc |
601 | mov eax,[CURRENT_TASK] |
142 | mov eax,[0x3000] |
602 | shl eax,8 |
Line 143... | Line 603... | ||
143 | shl eax,8 |
603 | test [eax+SLOT_BASE+APPDATA.event_mask],dword 01000000b |
144 | test [eax+0x80000+APPDATA.event_mask],dword 01000000b |
604 | jz no_ipc |
145 | jz no_ipc |
605 | and [eax+SLOT_BASE+APPDATA.event_mask],dword 0xffffffff-01000000b |
146 | and [eax+0x80000+APPDATA.event_mask],dword 0xffffffff-01000000b |
606 | popad |
147 | popad |
607 | mov eax,7 |
148 | mov eax,7 |
608 | ret |
149 | ret |
609 | no_ipc: |
150 | no_ipc: |
610 | |
151 | 611 | ||
152 | 612 | ;mov edi,[TASK_BASE] ; STACK |
|
153 | ;mov edi,[0x3010] ; STACK |
613 | test [edi+TASKDATA.event_mask],dword 10000000b |
154 | test [edi+TASKDATA.event_mask],dword 10000000b |
614 | jz no_stack_event |
Line 155... | Line 615... | ||
155 | jz no_stack_event |
615 | mov eax,[CURRENT_TASK] |
156 | mov eax,[0x3000] |
616 | shl eax,8 |
157 | shl eax,8 |
617 | test [eax+SLOT_BASE+APPDATA.event_mask],dword 10000000b |
158 | test [eax+0x80000+APPDATA.event_mask],dword 10000000b |
618 | jz no_stack_event |
159 | jz no_stack_event |
619 | and [eax+SLOT_BASE+APPDATA.event_mask],dword 0xffffffff-10000000b |
160 | and [eax+0x80000+APPDATA.event_mask],dword 0xffffffff-10000000b |
620 | popad |
161 | popad |
621 | mov eax,8 |
162 | mov eax,8 |
622 | ret |
163 | ret |
623 | no_stack_event: |
164 | no_stack_event: |
624 | |
165 | - | ||
Line -... | Line 625... | ||
- | 625 | test byte [edi+TASKDATA.event_mask+1], 1 ; DEBUG |
|
- | 626 | jz .test_IRQ |
|
- | 627 | mov eax, [CURRENT_TASK] |
|
- | 628 | shl eax, 8 |
|
- | 629 | test byte [eax+SLOT_BASE+APPDATA.event_mask+1], byte 1 |
|
- | 630 | jz .test_IRQ |
|
- | 631 | and byte [eax+SLOT_BASE+APPDATA.event_mask+1], not 1 |
|
- | 632 | popad |
|
- | 633 | mov eax, 9 |
|
- | 634 | ret |
|
166 | test byte [edi+TASKDATA.event_mask+1], 1 ; DEBUG |
635 | |
167 | jz no_debug_event |
636 | ;.test_ext: |
Line 168... | Line 637... | ||
168 | mov eax, [0x3000] |
637 | ; mov eax, [CURRENT_TASK] |
169 | shl eax, 8 |
638 | ; shl eax, 8 |
170 | test byte [eax+0x80000+APPDATA.event_mask+1], byte 1 |
639 | ; test dword [eax+SLOT_BASE+APPDATA.event_mask], EVENT_EXTENDED |
171 | jz no_debug_event |
640 | ; jz .test_IRQ |
172 | and byte [eax+0x80000+APPDATA.event_mask+1], not 1 |
641 | ; popad |
173 | popad |
642 | ; mov eax, 10 |
174 | mov eax, 9 |
643 | ; ret |
175 | ret |
644 | |
176 | no_debug_event: |
645 | .test_IRQ: |
177 | 646 | cmp dword [edi+TASKDATA.event_mask], 0xFFFF |
|
178 | cmp dword [edi+TASKDATA.event_mask], 0xFFFF |
647 | jbe no_events |
179 | jbe no_events |
648 | |
180 | 649 | mov esi,IRQ_SAVE ; IRQ'S AND DATA |
|
181 | mov esi,0x2e0000 ; IRQ'S AND DATA |
650 | mov ebx,0x00010000 |
182 | mov ebx,0x00010000 |
651 | xor ecx, ecx |
183 | xor ecx, ecx |
652 | irq_event_test: |
184 | irq_event_test: |
653 | mov edi,[TASK_BASE] |
Line 211... | Line 680... | ||
211 | popad |
680 | xor eax, eax |
212 | xor eax, eax |
681 | ret |
213 | ret |
682 | |
Line -... | Line 683... | ||
- | 683 |