Rev 2 | Rev 40 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 21 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | align 4 |
8 | align 4 |
Line 9... | Line 9... | ||
9 | 9 | ||
10 | sys_wait_event_timeout: |
10 | sys_wait_event_timeout: |
11 | 11 | ||
12 | mov ebx,[timer_ticks];[0xfdf0] |
12 | mov ebx,[timer_ticks] |
13 | add ebx,eax |
13 | add ebx,eax |
14 | cmp ebx,[timer_ticks];[0xfdf0] |
14 | cmp ebx,[timer_ticks] |
15 | jna .swfet2 |
15 | jna .swfet2 |
16 | .swfet1: |
16 | .swfet1: |
17 | call get_event_for_app |
17 | call get_event_for_app |
18 | test eax,eax |
18 | test eax,eax |
19 | jne .eventoccur_time |
19 | jne .eventoccur_time |
20 | call change_task |
20 | call change_task |
21 | cmp ebx,[timer_ticks];[0xfdf0] |
21 | cmp ebx,[timer_ticks] |
22 | jg .swfet1 |
22 | jg .swfet1 |
23 | .swfet2: |
23 | .swfet2: |
Line 34... | Line 34... | ||
34 | call get_event_for_app |
34 | call get_event_for_app |
35 | test eax,eax |
35 | test eax,eax |
36 | jne eventoccur |
36 | jne eventoccur |
37 | newwait: |
37 | newwait: |
Line -... | Line 38... | ||
- | 38 | ||
- | 39 | mov eax, [0x3010] |
|
38 | 40 | mov [eax+0xA], byte 5 |
|
- | 41 | call change_task |
|
39 | call change_task |
42 | |
40 | call get_event_for_app |
- | |
41 | test eax,eax |
- | |
Line 42... | Line 43... | ||
42 | je newwait |
43 | mov eax, [event_sched] |
43 | 44 | ||
44 | eventoccur: |
45 | eventoccur: |
Line 51... | Line 52... | ||
51 | pushad |
52 | pushad |
Line 52... | Line 53... | ||
52 | 53 | ||
53 | mov edi,[0x3010] ; WINDOW REDRAW |
54 | mov edi,[0x3010] ; WINDOW REDRAW |
54 | test [edi],dword 1 |
55 | test [edi],dword 1 |
55 | jz no_eventoccur1 |
56 | jz no_eventoccur1 |
56 | mov edi,[0x3010] |
57 | ;mov edi,[0x3010] |
57 | cmp [edi-twdw+31],byte 0 |
58 | cmp [edi-twdw+31],byte 0 |
58 | je no_eventoccur1 |
59 | je no_eventoccur1 |
59 | popad |
60 | popad |
60 | mov eax,1 |
61 | mov eax,1 |
61 | ret |
62 | ret |
Line 62... | Line 63... | ||
62 | no_eventoccur1: |
63 | no_eventoccur1: |
63 | 64 | ||
64 | mov edi,[0x3010] ; KEY IN BUFFER |
65 | ;mov edi,[0x3010] ; KEY IN BUFFER |
65 | test [edi],dword 2 |
66 | test [edi],dword 2 |
66 | jz no_eventoccur2 |
67 | jz no_eventoccur2 |
67 | mov ecx, [0x3000] |
68 | mov ecx, [0x3000] |
Line 74... | Line 75... | ||
74 | popad |
75 | popad |
75 | mov eax,2 |
76 | mov eax,2 |
76 | ret |
77 | ret |
77 | no_eventoccur2: |
78 | no_eventoccur2: |
Line 78... | Line 79... | ||
78 | 79 | ||
79 | mov edi,[0x3010] ; BUTTON IN BUFFER |
80 | ;mov edi,[0x3010] ; BUTTON IN BUFFER |
80 | test [edi],dword 4 |
81 | test [edi],dword 4 |
- | 82 | jz no_eventoccur3 |
|
- | 83 | cmp [0xf500],byte 0 |
|
81 | jz no_eventoccur3 |
84 | je no_eventoccur3 |
82 | mov ecx, [0x3000] |
85 | mov ecx, [0x3000] |
83 | movzx edx, word [0xC000+ecx*2] |
86 | movzx edx, word [0xC000+ecx*2] |
84 | mov eax, [0x3004] |
87 | mov eax, [0x3004] |
85 | cmp eax,edx |
88 | cmp eax,edx |
86 | jnz no_eventoccur3 |
- | |
87 | cmp [0xf500],byte 0 |
- | |
88 | je no_eventoccur3 |
89 | jnz no_eventoccur3 |
89 | popad |
90 | popad |
90 | mov eax,[0xf501] |
91 | mov eax,[0xf501] |
91 | cmp eax,65535 |
92 | cmp eax,65535 |
92 | je no_event_1 |
93 | je no_event_1 |
Line 99... | Line 100... | ||
99 | xor eax, eax |
100 | xor eax, eax |
100 | ret |
101 | ret |
Line 101... | Line 102... | ||
101 | 102 | ||
Line 102... | Line -... | ||
102 | no_eventoccur3: |
- | |
103 | - | ||
104 | mov edi,[0x3010] ; DESKTOP BACKGROUND REDRAW |
- | |
105 | test [edi],dword 16 |
- | |
106 | jz no_eventoccur5 |
- | |
107 | cmp [0xfff0],byte 2 |
- | |
108 | jnz no_eventoccur5 |
- | |
109 | popad |
- | |
110 | mov eax,5 |
- | |
Line 111... | Line 103... | ||
111 | ret |
103 | no_eventoccur3: |
112 | no_eventoccur5: |
104 | |
113 | 105 | ||
114 | mov edi,[0x3010] ; mouse event |
106 | ;mov edi,[0x3010] ; mouse event |
115 | test [edi],dword 00100000b |
107 | test [edi],dword 00100000b |
116 | jz no_mouse_event |
108 | jz no_mouse_event |
117 | mov edi,[0x3000] |
109 | mov eax,[0x3000] |
118 | shl edi,8 |
110 | shl eax,8 |
119 | test [edi+0x80000+0xA8],dword 00100000b |
111 | test [eax+0x80000+0xA8],dword 00100000b |
120 | jz no_mouse_event |
112 | jz no_mouse_event |
121 | and [edi+0x80000+0xA8],dword 0xffffffff-00100000b |
113 | and [eax+0x80000+0xA8],dword 0xffffffff-00100000b |
122 | popad |
114 | popad |
Line -... | Line 115... | ||
- | 115 | mov eax,6 |
|
- | 116 | ret |
|
- | 117 | no_mouse_event: |
|
- | 118 | ||
- | 119 | ||
- | 120 | ;mov edi,[0x3010] ; DESKTOP BACKGROUND REDRAW |
|
- | 121 | test [edi],dword 16 |
|
- | 122 | jz no_eventoccur5 |
|
- | 123 | cmp [0xfff0],byte 2 |
|
- | 124 | jnz no_eventoccur5 |
|
- | 125 | popad |
|
123 | mov eax,6 |
126 | mov eax,5 |
124 | ret |
127 | ret |
125 | no_mouse_event: |
128 | no_eventoccur5: |
126 | 129 | ||
127 | mov edi,[0x3010] ; IPC |
130 | ;mov edi,[0x3010] ; IPC |
128 | test [edi],dword 01000000b |
131 | test [edi],dword 01000000b |
129 | jz no_ipc |
132 | jz no_ipc |
130 | mov edi,[0x3000] |
133 | mov eax,[0x3000] |
131 | shl edi,8 |
134 | shl eax,8 |
132 | test [edi+0x80000+0xA8],dword 01000000b |
135 | test [eax+0x80000+0xA8],dword 01000000b |
133 | jz no_ipc |
136 | jz no_ipc |
134 | and [edi+0x80000+0xA8],dword 0xffffffff-01000000b |
137 | and [eax+0x80000+0xA8],dword 0xffffffff-01000000b |
Line 135... | Line 138... | ||
135 | popad |
138 | popad |
136 | mov eax,7 |
139 | mov eax,7 |
137 | ret |
140 | ret |
138 | no_ipc: |
141 | no_ipc: |
139 | 142 | ||
140 | 143 | ||
141 | mov edi,[0x3010] ; STACK |
144 | ;mov edi,[0x3010] ; STACK |
142 | test [edi],dword 10000000b |
145 | test [edi],dword 10000000b |
143 | jz no_stack_event |
146 | jz no_stack_event |
144 | mov edi,[0x3000] |
147 | mov eax,[0x3000] |
145 | shl edi,8 |
148 | shl eax,8 |
146 | test [edi+0x80000+0xA8],dword 10000000b |
149 | test [eax+0x80000+0xA8],dword 10000000b |
Line -... | Line 150... | ||
- | 150 | jz no_stack_event |
|
- | 151 | and [eax+0x80000+0xA8],dword 0xffffffff-10000000b |
|
Line 147... | Line 152... | ||
147 | jz no_stack_event |
152 | popad |
148 | and [edi+0x80000+0xA8],dword 0xffffffff-10000000b |
153 | mov eax,8 |
149 | popad |
154 | ret |
150 | mov eax,7 |
155 | no_stack_event: |
Line 179... | Line 184... | ||
179 | shl ebx,1 |
184 | shl ebx,1 |
180 | inc ecx |
185 | inc ecx |
181 | cmp ecx,16 |
186 | cmp ecx,16 |
182 | jb irq_event_test |
187 | jb irq_event_test |
Line -... | Line 188... | ||
- | 188 | ||
183 | 189 | no_events: |
|
184 | popad |
190 | popad |
185 | xor eax, eax |
191 | xor eax, eax |