Rev 8196 | Rev 8283 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8140 | IgorA | 1 | ;const int |
2 | KOLIBRI_BORDER_SIZE = 4; |
||
3 | ;const int |
||
4 | KOLIBRI_HEADER_SIZE = 20; |
||
5 | |||
6 | ;const int |
||
7 | KOLIBRI_THREAD_DATA_USER = 0; // Thread data begin from the user dword |
||
8 | ;const int |
||
9 | KOLIBRI_THREAD_DATA_ST_BEGIN = 1; // Stack beginning follows after the user dword |
||
10 | ;const int |
||
11 | KOLIBRI_THREAD_DATA_NEXT = 2; |
||
12 | ;const int |
||
13 | KOLIBRI_THREAD_DATA_PID = 3; |
||
14 | ;const int |
||
15 | KOLIBRI_THREAD_DATA_FLAG = 4; |
||
16 | ;const int |
||
17 | KOLIBRI_THREAD_DATA_X = 5; |
||
18 | ;const int |
||
19 | KOLIBRI_THREAD_DATA_Y = 6; |
||
20 | ;const int |
||
21 | KOLIBRI_THREAD_DATA_C_WINDOW = 7; |
||
22 | ;const int |
||
23 | KOLIBRI_THREAD_DATA_C_HEADER = 8; |
||
24 | ;const int |
||
25 | KOLIBRI_THREAD_DATA_C_BORDER = 9; |
||
26 | ;const int |
||
27 | KOLIBRI_THREAD_DATA_C_TITLE = 10; |
||
28 | ;const int |
||
29 | KOLIBRI_THREAD_DATA_TITLE = 11; |
||
30 | ;const int |
||
31 | KOLIBRI_THREAD_DATA_PICTURE = 12; |
||
32 | ;const int |
||
33 | KOLIBRI_THREAD_DATA_SZ_PICT = 13; |
||
34 | ;const int |
||
35 | KOLIBRI_THREAD_DATA_LAST_SX = 14; |
||
36 | ;const int |
||
37 | KOLIBRI_THREAD_DATA_LAST_SY = 15; |
||
38 | ;const int |
||
39 | KOLIBRI_THREAD_DATA_LEN = 16; |
||
40 | |||
41 | ;const int |
||
42 | KOLIBRI_MUTEX_MAX_TIME_WAIT = 20; |
||
43 | |||
44 | ;/*** |
||
45 | |||
46 | macro segment name |
||
47 | { |
||
48 | segment name |
||
49 | if name eq _init_ | name eq _INIT_ |
||
50 | Kolibri_SegmentInit: |
||
51 | else if name eq _exit_ | name eq _EXIT_ |
||
52 | Kolibri_SegmentExit: |
||
53 | end if |
||
54 | } |
||
55 | |||
56 | macro endseg name |
||
57 | { |
||
58 | if name eq _init_ | name eq _INIT_ |
||
59 | Kolibri_SegmentInitEnd: |
||
60 | else if name eq _exit_ | name eq _EXIT_ |
||
61 | Kolibri_SegmentExitEnd: |
||
62 | end if |
||
63 | endseg name |
||
64 | } |
||
65 | |||
66 | macro Kolibri_Put_MovEaxVal_Ret address,val |
||
67 | { |
||
68 | mov byte [address],0xB8 |
||
69 | mov dword [address+4],0xC089C300 |
||
70 | mov dword [address+1],val |
||
71 | } |
||
72 | |||
73 | proc @Kolibri@Main$qv |
||
74 | and esp,not 3 |
||
75 | sub esp,1024 |
||
8165 | IgorA | 76 | mov eax,SF_THREAD_INFO |
8140 | IgorA | 77 | mov ebx,esp |
78 | mov ecx,-1 |
||
79 | int 0x40 |
||
8236 | IgorA | 80 | mov ebx,[esp+process_information.used_memory] |
81 | mov edx,[esp+process_information.PID] |
||
8140 | IgorA | 82 | lea eax,[ebx-0x20] |
83 | add esp,1024 |
||
84 | cmp esp,eax |
||
85 | cmova esp,eax |
||
86 | and esp,not 3 |
||
87 | xor eax,eax |
||
88 | cld |
||
89 | mov edi,@Kolibri@_ThreadTable |
||
90 | mov ecx,256 |
||
8165 | IgorA | 91 | rep stosd |
8140 | IgorA | 92 | mov esi,@Kolibri@GetPid$qv |
93 | mov edi,@Kolibri@_ThreadSavedBegProc |
||
8165 | IgorA | 94 | movsd |
95 | movsd |
||
8140 | IgorA | 96 | mov esi,@Kolibri@GetThreadData$qv |
8165 | IgorA | 97 | movsd |
98 | movsd |
||
8140 | IgorA | 99 | Kolibri_Put_MovEaxVal_Ret @Kolibri@GetPid$qv,edx |
100 | if defined KolibriHeapInit |
||
8196 | IgorA | 101 | call KolibriHeapInit ; Initialize a dynamic heap |
102 | end if |
||
8140 | IgorA | 103 | xor eax,eax |
104 | push eax |
||
105 | push eax |
||
106 | call @Kolibri@ThreadMain$qpvt1 |
||
107 | .ThreadFinish: |
||
108 | add esp,8 |
||
109 | if defined KolibriHeapFreeAndThreadFinish |
||
110 | test eax,eax |
||
111 | jz .ThreadFinish_end |
||
112 | push dword @Kolibri@_ExitProcessNow |
||
113 | push eax |
||
114 | call KolibriHeapFreeAndThreadFinish ; Free the given memory and finish the thread, |
||
115 | end if ; should exit process if second argument points to not zero. |
||
116 | .ThreadFinish_end: |
||
117 | or eax,-1 |
||
118 | int 0x40 |
||
119 | endp |
||
120 | |||
121 | proc @Kolibri@ThreadMain$qpvt1 |
||
122 | xchg ebx,[esp+4] |
||
123 | xchg ebp,[esp+8] |
||
124 | push esi edi |
||
125 | sub esp,KOLIBRI_THREAD_DATA_LEN*4 |
||
126 | mov [esp],ebx |
||
127 | mov [esp+4],ebp |
||
8165 | IgorA | 128 | mov eax,SF_SET_EVENTS_MASK |
8140 | IgorA | 129 | mov ebx,0x27 |
130 | int 0x40 |
||
131 | mov ebx,esp |
||
132 | cmp byte [@Kolibri@_ThreadSavedBegProc],0x90 |
||
133 | jz .main_else_first_check |
||
134 | Kolibri_Put_MovEaxVal_Ret @Kolibri@GetThreadData$qv,esp |
||
135 | if defined Kolibri_SegmentInit & defined Kolibri_SegmentInitEnd |
||
136 | push Kolibri_SegmentInitEnd |
||
137 | push Kolibri_SegmentInit |
||
138 | jmp .main_after_first_check |
||
139 | end if |
||
140 | .main_else_first_check: |
||
141 | xor eax,eax |
||
142 | push eax eax |
||
143 | .main_after_first_check: |
||
144 | push ebx |
||
145 | call @@Kolibri@_CallStart$qppvpvt2 |
||
146 | add esp,12 |
||
147 | test al,al |
||
148 | jnz .main_test_close_first |
||
149 | jmp .main_end |
||
150 | .main_close_first: |
||
151 | btr dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],31 |
||
8165 | IgorA | 152 | if defined @@KolibriOnClose$qppv |
8140 | IgorA | 153 | push esp |
154 | call @@KolibriOnClose$qppv |
||
155 | pop ecx |
||
156 | test al,al |
||
157 | jnz .main_end |
||
8165 | IgorA | 158 | end if |
8140 | IgorA | 159 | .main_test_close_first: |
160 | cmp dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],0 |
||
161 | jl .main_close_first |
||
162 | ; push esp |
||
163 | ; push dword 1 |
||
164 | ; call @Kolibri@Redraw$qippv |
||
165 | ; add esp,8 |
||
166 | .main_paint_msg: |
||
167 | or dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],3 |
||
168 | sub esp,1024 |
||
8165 | IgorA | 169 | mov eax,SF_THREAD_INFO |
8140 | IgorA | 170 | mov ebx,esp |
171 | mov ecx,-1 |
||
172 | int 0x40 |
||
8236 | IgorA | 173 | mov eax,[esp+process_information.box.left] |
174 | mov ebx,[esp+process_information.box.top] |
||
175 | mov ecx,[esp+process_information.box.width] |
||
176 | mov edx,[esp+process_information.box.height] |
||
8140 | IgorA | 177 | add esp,1024 |
178 | cmp ecx,[esp+KOLIBRI_THREAD_DATA_LAST_SX*4] |
||
179 | jnz .main_size |
||
180 | cmp edx,[esp+KOLIBRI_THREAD_DATA_LAST_SY*4] |
||
181 | jz .main_paint |
||
182 | .main_size: |
||
183 | mov [esp+KOLIBRI_THREAD_DATA_LAST_SX*4],ecx |
||
184 | mov [esp+KOLIBRI_THREAD_DATA_LAST_SY*4],edx |
||
8165 | IgorA | 185 | if defined @@KolibriOnSize$qpippv |
8140 | IgorA | 186 | push edx |
187 | push ecx |
||
188 | push ebx |
||
189 | push eax |
||
190 | lea ecx,[esp+16] |
||
191 | mov edx,esp |
||
192 | push ecx |
||
193 | push edx |
||
194 | call @@KolibriOnSize$qpippv |
||
195 | add esp,24 |
||
8165 | IgorA | 196 | end if |
8140 | IgorA | 197 | test dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],3 |
198 | jz .main_cycle |
||
199 | .main_paint: |
||
200 | cmp dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],0 |
||
201 | jl .main_close |
||
202 | push esp |
||
203 | push dword 0 |
||
204 | call @Kolibri@Redraw$qippv |
||
205 | add esp,8 |
||
206 | .main_cycle: |
||
8165 | IgorA | 207 | mov eax,SF_CHECK_EVENT |
8140 | IgorA | 208 | .main_message: |
209 | cmp dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],0 |
||
210 | jl .main_close |
||
211 | int 0x40 |
||
212 | test eax,eax |
||
213 | jnz .main_on_message |
||
214 | cmp dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],0 |
||
215 | jne .main_paint |
||
8165 | IgorA | 216 | if defined @@KolibriOnIdle$qppv |
8140 | IgorA | 217 | push esp |
218 | call @@KolibriOnIdle$qppv |
||
219 | pop ecx |
||
8165 | IgorA | 220 | else |
221 | or eax,-1 |
||
222 | end if |
||
8140 | IgorA | 223 | test eax,eax |
224 | jz .main_cycle |
||
225 | jl .main_wait_message |
||
226 | mov ebx,eax |
||
8165 | IgorA | 227 | mov eax,SF_WAIT_EVENT_TIMEOUT |
8140 | IgorA | 228 | jmp .main_message |
229 | .main_wait_message: |
||
8165 | IgorA | 230 | mov eax,SF_WAIT_EVENT |
8140 | IgorA | 231 | jmp .main_message |
8165 | IgorA | 232 | if defined @@KolibriOnKeyPress$qppv |
8140 | IgorA | 233 | .main_key_press: |
234 | push esp |
||
235 | call @@KolibriOnKeyPress$qppv |
||
236 | pop ecx |
||
237 | jmp .main_cycle |
||
8165 | IgorA | 238 | end if |
239 | if defined @@KolibriOnMouse$qppv |
||
8140 | IgorA | 240 | .main_mouse: |
241 | push esp |
||
242 | call @@KolibriOnMouse$qppv |
||
243 | pop ecx |
||
244 | jmp .main_cycle |
||
8165 | IgorA | 245 | end if |
246 | |||
247 | align 4 |
||
8140 | IgorA | 248 | .main_on_message: |
249 | dec eax |
||
250 | jz .main_paint_msg |
||
251 | dec eax |
||
8165 | IgorA | 252 | if defined @@KolibriOnKeyPress$qppv |
8140 | IgorA | 253 | jz .main_key_press |
8165 | IgorA | 254 | else |
255 | jz .main_cycle |
||
256 | end if |
||
8140 | IgorA | 257 | cmp eax,4 |
8165 | IgorA | 258 | if defined @@KolibriOnMouse$qppv |
8140 | IgorA | 259 | jz .main_mouse |
8165 | IgorA | 260 | else |
261 | jz .main_cycle |
||
262 | end if |
||
8140 | IgorA | 263 | dec eax |
264 | jnz .main_cycle |
||
8165 | IgorA | 265 | |
266 | align 4 |
||
8140 | IgorA | 267 | .main_button: |
8165 | IgorA | 268 | mov eax,SF_GET_BUTTON |
8140 | IgorA | 269 | int 0x40 |
8165 | IgorA | 270 | shr eax,8 |
271 | cmp eax,1 |
||
272 | je .main_close |
||
273 | if defined @@KolibriOnButton$qlppv |
||
274 | push esp |
||
275 | push eax |
||
276 | call @@KolibriOnButton$qlppv |
||
277 | add esp,8 |
||
278 | end if |
||
279 | jmp .main_cycle |
||
8140 | IgorA | 280 | .main_close: |
281 | btr dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],31 |
||
8165 | IgorA | 282 | if defined @@KolibriOnClose$qppv |
8140 | IgorA | 283 | push esp |
284 | call @@KolibriOnClose$qppv |
||
285 | pop ecx |
||
286 | test al,al |
||
287 | jz .main_button |
||
8165 | IgorA | 288 | end if |
8140 | IgorA | 289 | .main_end: |
290 | mov ebx,esp |
||
291 | lock dec dword [@Kolibri@_ThreadNumber] |
||
292 | if defined Kolibri_SegmentExit & defined Kolibri_SegmentExitEnd |
||
293 | jnz .main_else_last_check |
||
294 | push Kolibri_SegmentExitEnd |
||
295 | push Kolibri_SegmentExit |
||
296 | jmp .main_after_last_check |
||
297 | end if |
||
298 | .main_else_last_check: |
||
299 | xor eax,eax |
||
300 | push eax |
||
301 | push eax |
||
302 | .main_after_last_check: |
||
303 | push ebx |
||
304 | call @@Kolibri@_RemoveThreadData$qppvpvt2 |
||
305 | add esp,12 |
||
306 | lock inc dword [@Kolibri@_ThreadScanCount+4] |
||
307 | mov ebx,1 |
||
308 | jmp .main_end_wait |
||
309 | .main_end_wait_loop: |
||
8165 | IgorA | 310 | mov eax,SF_SLEEP |
8140 | IgorA | 311 | int 0x40 |
312 | shl ebx,1 |
||
313 | cmp ebx,KOLIBRI_MUTEX_MAX_TIME_WAIT |
||
314 | jna .main_end_wait |
||
315 | mov ebx,KOLIBRI_MUTEX_MAX_TIME_WAIT |
||
316 | .main_end_wait: |
||
317 | cmp dword [@Kolibri@_ExitProcessNow],0 |
||
318 | jnz @Kolibri@ExitProcess$qv |
||
319 | cmp dword [@Kolibri@_ThreadScanCount],0 |
||
320 | jnz .main_end_wait_loop |
||
321 | lock dec dword [@Kolibri@_ThreadScanCount+4] |
||
322 | mov ebp,[esp+4] |
||
323 | mov ebx,[esp] |
||
324 | add esp,KOLIBRI_THREAD_DATA_LEN*4 |
||
325 | mov eax,ebp |
||
326 | pop edi esi |
||
327 | xchg ebp,[esp+8] |
||
328 | xchg ebx,[esp+4] |
||
329 | ret |
||
330 | endp |
||
331 | |||
332 | proc @Kolibri@Redraw$qippv |
||
333 | push ebp |
||
334 | mov ebp,[esp+12] |
||
335 | mov edx,[ebp+KOLIBRI_THREAD_DATA_FLAG*4] |
||
336 | cmp dword [esp+8],0 |
||
337 | jl .redraw_only_inv |
||
338 | jz .redraw_no_frame |
||
339 | or dl,2 |
||
340 | .redraw_no_frame: |
||
341 | bt edx,30 |
||
342 | jnc .redraw_begin |
||
343 | or dl,1 |
||
344 | mov [ebp+KOLIBRI_THREAD_DATA_FLAG*4],edx |
||
345 | jmp .redraw_end |
||
346 | .redraw_only_inv: |
||
347 | test dl,3 |
||
348 | jnz .redraw_no_frame |
||
349 | .redraw_end: |
||
350 | pop ebp |
||
351 | ret |
||
352 | .redraw_begin: |
||
353 | push ebx esi edi |
||
354 | and dword [ebp+KOLIBRI_THREAD_DATA_FLAG*4],0xFFFFFFFC |
||
8165 | IgorA | 355 | mov eax,SF_REDRAW |
356 | mov ebx,SSF_BEGIN_DRAW |
||
8140 | IgorA | 357 | int 0x40 |
358 | test dl,2 |
||
359 | jz .redraw_picture |
||
8165 | IgorA | 360 | mov eax,SF_STYLE_SETTINGS |
361 | mov ebx,SSF_GET_SKIN_HEIGHT |
||
8140 | IgorA | 362 | int 0x40 |
363 | mov ebx,[ebp+KOLIBRI_THREAD_DATA_X*4] |
||
364 | add ebx,2*5-1 |
||
365 | mov ecx,[ebp+KOLIBRI_THREAD_DATA_Y*4] |
||
366 | add cx,ax |
||
367 | add ecx,5-1 |
||
368 | mov edx,[ebp+KOLIBRI_THREAD_DATA_C_WINDOW*4] |
||
369 | mov edi,[ebp+KOLIBRI_THREAD_DATA_TITLE*4] |
||
8236 | IgorA | 370 | xor eax,eax ;SF_CREATE_WINDOW |
8140 | IgorA | 371 | int 0x40 |
372 | .redraw_picture: |
||
373 | call @@KolibriOnPaint$qv |
||
374 | .redraw_end_draw: |
||
8165 | IgorA | 375 | mov eax,SF_REDRAW |
376 | mov ebx,SSF_END_DRAW |
||
8140 | IgorA | 377 | int 0x40 |
378 | pop edi esi ebx ebp |
||
379 | ret |
||
380 | endp |
||
381 | |||
382 | proc @Kolibri@MoveWindow$qxpxi uses ebx esi |
||
383 | mov eax,[esp+12] |
||
384 | mov ebx,[eax] |
||
385 | mov ecx,[eax+4] |
||
386 | mov edx,[eax+8] |
||
387 | mov esi,[eax+12] |
||
8165 | IgorA | 388 | mov eax,SF_CHANGE_WINDOW |
8140 | IgorA | 389 | int 0x40 |
390 | ret |
||
391 | endp |
||
392 | |||
8165 | IgorA | 393 | proc @Kolibri@ExitDebug$qv |
394 | push dword [@Kolibri@DebugPrefix] |
||
395 | call @Kolibri@DebugPutString$qpxc |
||
396 | mov dword [esp],Kolibri_debug_string |
||
397 | call @Kolibri@DebugPutString$qpxc |
||
398 | pop ecx |
||
399 | jmp @Kolibri@ExitProcess$qv |
||
400 | endp |
||
401 | |||
8140 | IgorA | 402 | proc @Kolibri@ExitProcess$qv |
403 | lock bts dword [@Kolibri@_ExitProcessNow],0 |
||
404 | jc .exit_process_wait |
||
405 | sub esp,1024 |
||
8165 | IgorA | 406 | mov eax,SF_THREAD_INFO |
8140 | IgorA | 407 | mov ebx,esp |
408 | mov ecx,-1 |
||
409 | int 0x40 |
||
410 | mov esi,eax |
||
8236 | IgorA | 411 | mov edi,[esp+process_information.PID] |
8140 | IgorA | 412 | .exit_process_loop: |
8165 | IgorA | 413 | mov eax,SF_THREAD_INFO |
8140 | IgorA | 414 | mov ebx,esp |
415 | mov ecx,esi |
||
416 | int 0x40 |
||
8236 | IgorA | 417 | mov eax,[esp+process_information.PID] |
8140 | IgorA | 418 | cmp eax,edi |
419 | jz .exit_process_continue |
||
420 | mov ebx,eax |
||
421 | or bl,15 |
||
422 | inc ebx |
||
423 | jz .exit_process_continue |
||
424 | mov ebx,eax |
||
425 | call Kolibri_HashInt |
||
426 | movzx eax,al |
||
427 | mov eax,dword [@Kolibri@_ThreadTable+eax*4] |
||
428 | jmp .exit_process_test |
||
429 | .exit_process_next: |
||
430 | mov eax,dword [eax+KOLIBRI_THREAD_DATA_NEXT*4] |
||
431 | .exit_process_test: |
||
432 | test eax,eax |
||
433 | jz .exit_process_continue |
||
434 | cmp ebx,[eax+KOLIBRI_THREAD_DATA_PID*4] |
||
435 | jnz .exit_process_next |
||
8165 | IgorA | 436 | mov eax,SF_SYSTEM |
437 | mov ebx,SSF_TERMINATE_THREAD |
||
8140 | IgorA | 438 | mov ecx,esi |
439 | int 0x40 |
||
440 | .exit_process_continue: |
||
441 | dec esi |
||
442 | jnl .exit_process_loop |
||
443 | add esp,1024 |
||
444 | mov dword [@Kolibri@_ExitProcessNow],-1 |
||
445 | if defined EMULATOR |
||
446 | int3 |
||
447 | call 0x76543210 |
||
448 | end if |
||
449 | .exit_process_end: |
||
450 | mov dword [@Kolibri@_ThreadMutex],0 |
||
451 | or eax,-1 |
||
452 | int 0x40 |
||
453 | .exit_process_wait: |
||
8165 | IgorA | 454 | mov eax,SF_SLEEP |
8140 | IgorA | 455 | mov ebx,1 |
456 | .exit_process_wait_loop: |
||
457 | cmp dword [@Kolibri@_ExitProcessNow],0 |
||
458 | jl .exit_process_end |
||
459 | int 0x40 |
||
460 | shl ebx,1 |
||
461 | cmp ebx,KOLIBRI_MUTEX_MAX_TIME_WAIT |
||
462 | jna .exit_process_wait_loop |
||
463 | mov ebx,KOLIBRI_MUTEX_MAX_TIME_WAIT |
||
464 | jmp .exit_process_wait_loop |
||
465 | endp |
||
466 | |||
8236 | IgorA | 467 | proc @Kolibri@ExitThread$qppv |
8140 | IgorA | 468 | mov esp,[esp+4] |
8236 | IgorA | 469 | jmp @Kolibri@ThreadMain$qpvt1.main_end |
8140 | IgorA | 470 | endp |
471 | |||
8236 | IgorA | 472 | proc @Kolibri@ReturnMessageLoop$qppv |
8140 | IgorA | 473 | mov esp,[esp+4] |
474 | bt dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],30 |
||
8236 | IgorA | 475 | jc @Kolibri@ThreadMain$qpvt1.main_end |
476 | jmp @Kolibri@ThreadMain$qpvt1.main_cycle |
||
8140 | IgorA | 477 | endp |
478 | |||
479 | proc @Kolibri@Delay$qui uses ebx |
||
8165 | IgorA | 480 | mov eax,SF_SLEEP |
8140 | IgorA | 481 | mov ebx,[esp+8] |
482 | int 0x40 |
||
483 | ret |
||
484 | endp |
||
485 | |||
486 | proc @Kolibri@Clock$qv uses ebx |
||
8165 | IgorA | 487 | mov eax,SF_SYSTEM_GET |
488 | mov ebx,SSF_TIME_COUNT |
||
8140 | IgorA | 489 | int 0x40 |
490 | ret |
||
491 | endp |
||
492 | |||
8153 | maxcodehac | 493 | proc @Kolibri@DrawButton$qllllll uses ebx esi |
8165 | IgorA | 494 | mov eax,SF_DEFINE_BUTTON |
495 | mov ebx,[esp+12-2+8] |
||
8153 | maxcodehac | 496 | mov bx,[esp+20+8] |
8165 | IgorA | 497 | mov ecx,[esp+16-2+8] |
8153 | maxcodehac | 498 | mov cx,[esp+24+8] |
499 | mov edx,[esp+4+8] |
||
500 | mov esi,[esp+8+8] |
||
501 | int 0x40 |
||
502 | ret |
||
503 | endp |
||
504 | |||
8165 | IgorA | 505 | proc @Kolibri@GetPackedTime$qv |
506 | mov eax,SF_GET_SYS_TIME |
||
507 | int 0x40 |
||
508 | ret |
||
509 | endp |
||
510 | |||
8140 | IgorA | 511 | proc @Kolibri@GetTime$qpi |
8165 | IgorA | 512 | mov eax,SF_GET_SYS_TIME |
8140 | IgorA | 513 | int 0x40 |
514 | mov edx,[esp+4] |
||
515 | movzx ecx,al |
||
516 | shr ecx,4 |
||
517 | and al,0x0F |
||
518 | imul ecx,10 |
||
519 | add cl,al |
||
520 | mov dword [edx+8],ecx |
||
521 | mov cl,ah |
||
522 | shr ecx,4 |
||
523 | and ah,0x0F |
||
524 | imul ecx,10 |
||
525 | add cl,ah |
||
526 | mov dword [edx+4],ecx |
||
527 | bswap eax |
||
528 | mov cl,ah |
||
529 | shr ecx,4 |
||
530 | and ah,0x0F |
||
531 | imul ecx,10 |
||
532 | add cl,ah |
||
533 | mov dword [edx],ecx |
||
534 | ret |
||
535 | endp |
||
536 | |||
537 | proc @Kolibri@GetPackedDate$qv |
||
8165 | IgorA | 538 | mov eax,SF_GET_SYS_DATE |
8140 | IgorA | 539 | int 0x40 |
540 | ret |
||
541 | endp |
||
542 | |||
543 | proc @Kolibri@GetDate$qpi |
||
8165 | IgorA | 544 | mov eax,SF_GET_SYS_DATE |
8140 | IgorA | 545 | int 0x40 |
546 | mov edx,[esp+4] |
||
547 | movzx ecx,al |
||
548 | shr ecx,4 |
||
549 | and al,0x0F |
||
550 | imul ecx,10 |
||
551 | add cl,al |
||
552 | mov dword [edx+4],ecx |
||
553 | mov cl,ah |
||
554 | shr ecx,4 |
||
555 | and ah,0x0F |
||
556 | imul ecx,10 |
||
557 | add cl,ah |
||
558 | mov dword [edx],ecx |
||
559 | bswap eax |
||
560 | mov cl,ah |
||
561 | shr ecx,4 |
||
562 | and ah,0x0F |
||
563 | imul ecx,10 |
||
564 | add cl,ah |
||
565 | mov dword [edx+8],ecx |
||
566 | ret |
||
567 | endp |
||
568 | |||
569 | proc @Kolibri@ReadCommonColors$qpui uses ebx |
||
8165 | IgorA | 570 | mov eax,SF_STYLE_SETTINGS |
571 | mov ebx,SSF_GET_COLORS |
||
8140 | IgorA | 572 | mov ecx,[esp+8] |
573 | mov edx,40 |
||
574 | int 0x40 |
||
575 | ret |
||
576 | endp |
||
577 | |||
578 | proc @Kolibri@DrawText$qssipxc uses ebx |
||
8165 | IgorA | 579 | mov eax,SF_DRAW_TEXT |
8140 | IgorA | 580 | mov ebx,[esp+8-2] |
581 | mov bx,[esp+12] |
||
582 | mov ecx,[esp+16] |
||
583 | or ecx,0x80000000 |
||
584 | mov edx,[esp+20] |
||
585 | int 0x40 |
||
586 | ret |
||
587 | endp |
||
588 | |||
8236 | IgorA | 589 | proc @Kolibri@PutImage$qpucllll uses ebx |
590 | mov eax,SF_PUT_IMAGE |
||
591 | mov ebx,[esp+8] |
||
592 | mov ecx,[esp+20-2] |
||
593 | mov cx,[esp+24] |
||
594 | mov edx,[esp+12-2] |
||
595 | mov dx,[esp+16] |
||
596 | int 0x40 |
||
597 | ret |
||
598 | endp |
||
599 | |||
8165 | IgorA | 600 | proc @Kolibri@SetWindowCaption$qpxc uses ebx |
601 | mov eax,SF_SET_CAPTION |
||
602 | mov ebx,2 |
||
603 | mov ecx,[esp+8] |
||
604 | int 0x40 |
||
605 | ret |
||
606 | endp |
||
607 | |||
8140 | IgorA | 608 | proc @Kolibri@GetProcessInfo$qpuipct1t1piui uses ebx esi edi |
609 | sub esp,1024 |
||
8165 | IgorA | 610 | mov eax,SF_THREAD_INFO |
8140 | IgorA | 611 | mov ebx,esp |
612 | mov ecx,[1024+12+24+esp] |
||
613 | int 0x40 |
||
614 | xor edi,edi |
||
615 | or edi,[1024+12+4+esp] |
||
616 | jz .get_proc_info_no_usecpu |
||
617 | mov ecx,[esp] |
||
618 | mov [edi],ecx |
||
619 | xor edi,edi |
||
620 | .get_proc_info_no_usecpu: |
||
621 | or edi,[1024+12+8+esp] |
||
622 | jz .get_proc_info_no_name |
||
8236 | IgorA | 623 | lea esi,[esp+process_information.process_name] |
8140 | IgorA | 624 | cld |
8165 | IgorA | 625 | movsd |
626 | movsd |
||
627 | movsd |
||
8140 | IgorA | 628 | mov byte [edi],0 |
629 | xor edi,edi |
||
630 | .get_proc_info_no_name: |
||
631 | or edi,[1024+12+12+esp] |
||
632 | jz .get_proc_info_no_mem |
||
8236 | IgorA | 633 | mov ecx,[esp+process_information.used_memory] |
8140 | IgorA | 634 | mov [edi],ecx |
635 | xor edi,edi |
||
636 | .get_proc_info_no_mem: |
||
637 | or edi,[1024+12+16+esp] |
||
638 | jz .get_proc_info_no_pid |
||
8236 | IgorA | 639 | mov ecx,[esp+process_information.PID] |
8140 | IgorA | 640 | mov [edi],ecx |
641 | xor edi,edi |
||
642 | .get_proc_info_no_pid: |
||
643 | or edi,[1024+12+20+esp] |
||
644 | jz .get_proc_info_no_rect |
||
8236 | IgorA | 645 | lea esi,[esp+process_information.box] |
8140 | IgorA | 646 | cld |
8165 | IgorA | 647 | movsd |
648 | movsd |
||
649 | movsd |
||
650 | movsd |
||
8140 | IgorA | 651 | xor edi,edi |
652 | .get_proc_info_no_rect: |
||
653 | add esp,1024 |
||
654 | ret |
||
655 | endp |
||
656 | |||
657 | proc @Kolibri@GetPid$qv uses ebx |
||
658 | sub esp,1024 |
||
8165 | IgorA | 659 | mov eax,SF_THREAD_INFO |
8140 | IgorA | 660 | mov ebx,esp |
661 | mov ecx,-1 |
||
662 | int 0x40 |
||
663 | mov eax,[esp+30] |
||
664 | add esp,1024 |
||
665 | ret |
||
666 | endp |
||
667 | |||
668 | proc @Kolibri@GetPid$qppv |
||
669 | mov ecx,[esp+4] |
||
670 | mov eax,[ecx+KOLIBRI_THREAD_DATA_PID*4] |
||
671 | ret |
||
672 | endp |
||
673 | |||
674 | proc @Kolibri@_HashByte$qui |
||
675 | @Kolibri@_HashWord$qui: |
||
676 | @Kolibri@_HashDword$qui: |
||
677 | mov eax,[esp+4] |
||
678 | Kolibri_HashInt: |
||
679 | mul dword [Kolibri_hash_int_val0] |
||
680 | xor eax,edx |
||
681 | bswap eax |
||
682 | mul dword [Kolibri_hash_int_val1] |
||
683 | shrd eax,edx,14 |
||
684 | bswap eax |
||
685 | lea eax,[eax+4*eax] |
||
686 | ror eax,9 |
||
687 | ret |
||
688 | endp |
||
689 | |||
8165 | IgorA | 690 | if defined @Kolibri@_HashByte$qui | defined @Kolibri@_HashWord$qui | defined @Kolibri@_HashDword$qui |
8140 | IgorA | 691 | Kolibri_hash_int_val0: |
692 | dd 0xA82F94C5 |
||
693 | Kolibri_hash_int_val1: |
||
694 | dd 0x9193780B |
||
8165 | IgorA | 695 | end if |
8140 | IgorA | 696 | |
697 | proc @Kolibri@GetThreadData$qv |
||
698 | call @Kolibri@GetPid$qv |
||
699 | push eax |
||
700 | call @Kolibri@GetThreadData$qui |
||
701 | pop ecx |
||
702 | ret |
||
703 | endp |
||
704 | |||
705 | proc @Kolibri@GetThreadData$qui |
||
706 | mov eax,[esp+4] |
||
707 | call Kolibri_HashInt |
||
708 | movzx eax,al |
||
709 | cmp dword [@Kolibri@_ThreadScanCount+4],0 |
||
710 | jnz .get_thread_data_wait |
||
711 | .get_thread_data_nowait: |
||
712 | lock inc dword [@Kolibri@_ThreadScanCount] |
||
713 | mov eax,dword [@Kolibri@_ThreadTable+eax*4] |
||
714 | mov ecx,[esp+4] |
||
715 | jmp .get_thread_data_test |
||
716 | .get_thread_data_loop: |
||
717 | mov eax,dword [eax+KOLIBRI_THREAD_DATA_NEXT*4] |
||
718 | .get_thread_data_test: |
||
719 | test eax,eax |
||
720 | jz .get_thread_data_end |
||
721 | cmp ecx,[eax+KOLIBRI_THREAD_DATA_PID*4] |
||
722 | jnz .get_thread_data_loop |
||
723 | .get_thread_data_end: |
||
724 | lock dec dword [@Kolibri@_ThreadScanCount] |
||
725 | ret |
||
726 | .get_thread_data_wait: |
||
727 | push eax ebx |
||
8165 | IgorA | 728 | mov eax,SF_SLEEP |
8140 | IgorA | 729 | mov ebx,1 |
730 | .get_thread_data_wait_loop: |
||
731 | int 0x40 |
||
732 | cmp dword [@Kolibri@_ThreadScanCount+4],0 |
||
733 | jz .get_thread_data_wait_end |
||
734 | shl ebx,1 |
||
735 | cmp ebx,KOLIBRI_MUTEX_MAX_TIME_WAIT |
||
736 | jna .get_thread_data_wait_loop |
||
737 | mov ebx,KOLIBRI_MUTEX_MAX_TIME_WAIT |
||
738 | jmp .get_thread_data_wait_loop |
||
739 | .get_thread_data_wait_end: |
||
740 | pop ebx eax |
||
741 | jmp .get_thread_data_nowait |
||
742 | endp |
||
743 | |||
744 | proc @Kolibri@_GetSkinHeader$qv uses ebx |
||
8165 | IgorA | 745 | mov eax,SF_STYLE_SETTINGS |
746 | mov ebx,SSF_GET_SKIN_HEIGHT |
||
8140 | IgorA | 747 | int 0x40 |
748 | ret |
||
749 | endp |
||
750 | |||
751 | proc @Kolibri@GetScreenSize$qrust1 |
||
8165 | IgorA | 752 | mov eax,SF_GET_SCREEN_SIZE |
8140 | IgorA | 753 | int 0x40 |
754 | mov ecx,[esp+8] |
||
755 | mov word [ecx],ax |
||
756 | mov ecx,[esp+4] |
||
757 | shr eax,16 |
||
758 | mov word [ecx],ax |
||
759 | ret |
||
760 | endp |
||
761 | |||
762 | proc Kolibri_MutexLockNoWait |
||
763 | pop eax |
||
764 | xor al,al |
||
765 | ret |
||
766 | endp |
||
767 | |||
768 | proc Kolibri_MutexLockWait uses ebx |
||
8165 | IgorA | 769 | mov eax,SF_SLEEP |
8140 | IgorA | 770 | xor ebx,ebx |
771 | .lock_wait_cycle: |
||
772 | int 0x40 |
||
773 | shl byte [ecx],1 |
||
774 | jz .lock_wait_cycle |
||
775 | mov al,1 |
||
776 | ret |
||
777 | endp |
||
778 | |||
779 | proc Kolibri_MutexLockWaitTime |
||
780 | cmp dword [esp+12],0 |
||
781 | jng .MutexLockWait |
||
782 | push ebx edx |
||
783 | mov edx,[esp+20] |
||
8165 | IgorA | 784 | mov eax,SF_SYSTEM_GET |
785 | mov ebx,SSF_TIME_COUNT |
||
8140 | IgorA | 786 | int 0x40 |
787 | add edx,eax |
||
788 | .lock_wait_time_cycle: |
||
8165 | IgorA | 789 | mov eax,SF_SLEEP |
8140 | IgorA | 790 | xor ebx,ebx |
791 | int 0x40 |
||
792 | shl byte [ecx],1 |
||
793 | jnz .lock_wait_time_ret_true |
||
8165 | IgorA | 794 | mov eax,SF_SYSTEM_GET |
795 | mov ebx,SSF_TIME_COUNT |
||
8140 | IgorA | 796 | int 0x40 |
797 | cmp eax,edx |
||
798 | js .lock_wait_time_cycle |
||
799 | pop edx ebx eax |
||
800 | xor al,al |
||
801 | ret |
||
802 | .lock_wait_time_ret_true: |
||
803 | pop edx ebx |
||
804 | mov al,1 |
||
805 | ret |
||
806 | endp |
||
807 | |||
808 | proc Kolibri_MutexLock |
||
809 | shl byte [ecx],1 |
||
810 | jnz .lock_first |
||
811 | call eax |
||
812 | .lock_first: |
||
813 | mov al,1 |
||
814 | ret |
||
815 | endp |
||
816 | |||
817 | proc @Kolibri@TryLock$qp14Kolibri@TMutex |
||
818 | mov eax,Kolibri_MutexLockNoWait |
||
819 | mov ecx,[esp+4] |
||
820 | jmp Kolibri_MutexLock |
||
821 | endp |
||
822 | |||
823 | proc @Kolibri@Lock$qp14Kolibri@TMutex |
||
824 | mov eax,Kolibri_MutexLockWait |
||
825 | mov ecx,[esp+4] |
||
826 | jmp Kolibri_MutexLock |
||
827 | endp |
||
828 | |||
829 | proc @Kolibri@LockTime$qp14Kolibri@TMutexi |
||
830 | mov eax,Kolibri_MutexLockWaitTime |
||
831 | mov ecx,[esp+4] |
||
832 | jmp Kolibri_MutexLock |
||
833 | endp |
||
834 | |||
835 | proc @Kolibri@UnLock$qp14Kolibri@TMutex |
||
836 | mov ecx,[esp+4] |
||
837 | shr byte [ecx],1 |
||
838 | jz .unlock_pause |
||
839 | ret |
||
840 | .unlock_pause: |
||
841 | mov byte [ecx],0x40 |
||
842 | push ebx |
||
8165 | IgorA | 843 | mov eax,SF_SLEEP |
8140 | IgorA | 844 | xor ebx,ebx |
845 | int 0x40 |
||
846 | pop ebx |
||
847 | ret |
||
848 | endp |
||
849 | |||
850 | proc Kolibri_MutexLockRec |
||
851 | shl byte [ecx],1 |
||
852 | jng .lock_first |
||
853 | cmp dword [ecx+4],edx |
||
854 | jz .lock_rec_self |
||
855 | call eax |
||
856 | .lock_rec_first: |
||
857 | mov al,1 |
||
858 | mov dword [ecx+4],edx |
||
859 | ret |
||
860 | .lock_rec_self: |
||
861 | mov al,1 |
||
862 | add dword [ecx],0x100 |
||
863 | jc .lock_rec_overflow |
||
864 | ret |
||
865 | .lock_rec_overflow: |
||
866 | push dword [@Kolibri@DebugPrefix] |
||
867 | call @Kolibri@DebugPutString$qpxc |
||
868 | mov dword [esp],Kolibri_try_lock_rec_overflow_string |
||
869 | call @Kolibri@DebugPutString$qpxc |
||
870 | pop ecx |
||
8165 | IgorA | 871 | jmp @Kolibri@ExitDebug$qv |
8140 | IgorA | 872 | endp |
873 | |||
874 | proc @Kolibri@TryLock$qp16Kolibri@TRecMutexui |
||
875 | mov eax,Kolibri_MutexLockNoWait |
||
876 | mov ecx,[esp+4] |
||
877 | mov edx,[esp+8] |
||
878 | jmp Kolibri_MutexLockRec |
||
879 | endp |
||
880 | |||
881 | proc @Kolibri@Lock$qp16Kolibri@TRecMutexui |
||
882 | mov eax,Kolibri_MutexLockWait |
||
883 | mov ecx,[esp+4] |
||
884 | mov edx,[esp+8] |
||
885 | jmp Kolibri_MutexLockRec |
||
886 | endp |
||
887 | |||
888 | proc @Kolibri@LockTime$qp16Kolibri@TRecMutexiui |
||
889 | mov eax,Kolibri_MutexLockWaitTime |
||
890 | mov ecx,[esp+4] |
||
891 | mov edx,[esp+12] |
||
892 | jmp Kolibri_MutexLockRec |
||
893 | endp |
||
894 | |||
895 | proc @Kolibri@UnLock$qp16Kolibri@TRecMutexui |
||
896 | mov ecx,[esp+4] |
||
897 | mov edx,[esp+8] |
||
898 | cmp dword [ecx+4],edx |
||
899 | jnz .unlock_rec_notlocked |
||
900 | sub dword [ecx],0x100 |
||
901 | jnc .unlock_rec_end |
||
902 | add dword [ecx],0x100 |
||
903 | shl byte [ecx],1 |
||
904 | shr byte [ecx],2 |
||
905 | jng .unlock_rec_pause |
||
906 | .unlock_rec_end: |
||
907 | ret |
||
908 | .unlock_rec_pause: |
||
909 | mov byte [ecx],0x20 |
||
910 | push ebx |
||
8165 | IgorA | 911 | mov eax,SF_SLEEP |
8140 | IgorA | 912 | xor ebx,ebx |
913 | int 0x40 |
||
914 | pop ebx |
||
915 | ret |
||
916 | .unlock_rec_notlocked: |
||
917 | push dword [@Kolibri@DebugPrefix] |
||
918 | call @Kolibri@DebugPutString$qpxc |
||
919 | mov dword [esp],Kolibri_unlock_rec_notlocked_string |
||
920 | call @Kolibri@DebugPutString$qpxc |
||
921 | pop ecx |
||
8165 | IgorA | 922 | jmp @Kolibri@ExitDebug$qv |
8140 | IgorA | 923 | endp |
924 | |||
925 | proc @Kolibri@DebugPutChar$qc |
||
926 | mov cl,byte [esp+4] |
||
927 | cmp cl,13 |
||
928 | jz .debug_put_char_ret |
||
929 | push ebx |
||
930 | cmp cl,10 |
||
931 | jz .debug_put_char_enter |
||
932 | .debug_put_char_after_cmp: |
||
8165 | IgorA | 933 | mov eax,SF_BOARD |
934 | mov ebx,SSF_DEBUG_WRITE |
||
8140 | IgorA | 935 | int 0x40 |
936 | pop ebx |
||
937 | .debug_put_char_ret: |
||
938 | ret |
||
939 | .debug_put_char_enter: |
||
940 | mov cl,13 |
||
8165 | IgorA | 941 | mov eax,SF_BOARD |
942 | mov ebx,SSF_DEBUG_WRITE |
||
8140 | IgorA | 943 | int 0x40 |
944 | mov cl,10 |
||
945 | jmp .debug_put_char_after_cmp |
||
946 | endp |
||
947 | |||
8165 | IgorA | 948 | proc @Kolibri@DebugPutString$qpxc uses esi |
8140 | IgorA | 949 | push dword 0 |
950 | mov esi,dword [esp+12] |
||
951 | jmp .debug_put_string_test |
||
952 | .debug_put_string_loop: |
||
953 | mov dword [esp],eax |
||
954 | call @Kolibri@DebugPutChar$qc |
||
955 | inc esi |
||
956 | .debug_put_string_test: |
||
957 | xor eax,eax |
||
958 | or al,[esi] |
||
959 | test al,al |
||
960 | jnz .debug_put_string_loop |
||
8165 | IgorA | 961 | pop ecx |
8140 | IgorA | 962 | ret |
963 | endp |
||
964 | |||
965 | proc @Kolibri@GetKey$qv |
||
8165 | IgorA | 966 | mov eax,SF_GET_KEY |
8140 | IgorA | 967 | int 0x40 |
968 | test al,al |
||
969 | jnz .get_key_eof |
||
970 | movzx eax,ah |
||
971 | ret |
||
972 | .get_key_eof: |
||
8165 | IgorA | 973 | mov eax,SF_TERMINATE_PROCESS |
8140 | IgorA | 974 | ret |
975 | endp |
||
976 | |||
977 | proc @Kolibri@GetMouseButton$qv uses ebx |
||
8165 | IgorA | 978 | mov eax,SF_MOUSE_GET |
979 | mov ebx,SSF_BUTTON |
||
8140 | IgorA | 980 | int 0x40 |
981 | ret |
||
982 | endp |
||
983 | |||
984 | proc @Kolibri@GetMousePosition$qrst1o uses ebx |
||
8165 | IgorA | 985 | mov eax,SF_MOUSE_GET |
986 | xor ebx,ebx ;SSF_SCREEN_POSITION |
||
8140 | IgorA | 987 | cmp byte [esp+16],0 |
988 | jnz .get_mouse_pos_absolute |
||
989 | inc ebx |
||
990 | .get_mouse_pos_absolute: |
||
991 | int 0x40 |
||
992 | mov ecx,[esp+12] |
||
993 | mov word [ecx],ax |
||
994 | mov ecx,[esp+8] |
||
995 | shr eax,16 |
||
996 | mov word [ecx],ax |
||
997 | ret |
||
998 | endp |
||
999 | |||
1000 | proc @Kolibri@WasThreadCreated$qv |
||
1001 | cmp byte [@Kolibri@_ThreadSavedBegProc],0x90 |
||
1002 | setz al |
||
1003 | ret |
||
1004 | endp |
||
1005 | |||
1006 | proc @Kolibri@CreateThread$qpvuit1 |
||
1007 | push ebx |
||
1008 | mov edx,[esp+16] |
||
1009 | mov ebx,[esp+12] |
||
1010 | test edx,edx |
||
1011 | jnz .create_thread_after_new |
||
1012 | if defined KolibriHeapAlloc |
||
1013 | cmp ebx,4096 |
||
1014 | jnb .create_thread_alloc |
||
1015 | mov ebx,STACKSIZE |
||
1016 | .create_thread_alloc: |
||
1017 | push ebx |
||
1018 | call KolibriHeapAlloc ; Create new dynamic memory of the given size |
||
1019 | pop ecx |
||
1020 | test eax,eax |
||
1021 | jnz .create_thread_mem_created |
||
1022 | end if |
||
1023 | or eax,-1 |
||
1024 | jmp .create_thread_end |
||
1025 | .create_thread_mem_created: |
||
1026 | lea edx,[eax+ebx] |
||
1027 | .create_thread_after_new: |
||
1028 | neg ebx |
||
1029 | jz .create_thread_test_first |
||
1030 | add ebx,edx |
||
1031 | .create_thread_test_first: |
||
1032 | cmp byte [@Kolibri@_ThreadSavedBegProc],0x90 |
||
1033 | jnz .create_thread_init |
||
1034 | .create_thread_fill_stack: |
||
1035 | lock inc dword [@Kolibri@_ThreadNumber] |
||
1036 | and edx,not 3 |
||
1037 | sub edx,12 |
||
1038 | mov ecx,[esp+8] |
||
1039 | mov dword [edx+8],ebx |
||
1040 | mov dword [edx+4],ecx |
||
1041 | mov dword [edx],Kolibri_ThreadFinish |
||
8165 | IgorA | 1042 | mov eax,SF_CREATE_THREAD |
8140 | IgorA | 1043 | mov ebx,1 |
1044 | mov ecx,@Kolibri@ThreadMain$qpvt1 |
||
1045 | int 0x40 |
||
1046 | mov ebx,eax |
||
1047 | or bl,15 |
||
1048 | inc ebx |
||
1049 | jnz .create_thread_end |
||
1050 | lock dec dword [@Kolibri@_ThreadNumber] |
||
1051 | if defined KolibriHeapFree |
||
1052 | or ebx,[edx+8] |
||
1053 | jz .create_thread_end |
||
1054 | push ebx |
||
1055 | call KolibriHeapFree ; Delete the given dynamic memory |
||
1056 | pop ecx |
||
1057 | end if |
||
1058 | .create_thread_end: |
||
1059 | pop ebx |
||
1060 | ret |
||
1061 | .create_thread_init: |
||
1062 | push esi edi |
||
1063 | cld |
||
1064 | mov esi,@Kolibri@_ThreadSavedBegProc |
||
1065 | mov edi,@Kolibri@GetPid$qv |
||
8165 | IgorA | 1066 | movsd |
1067 | movsd |
||
8140 | IgorA | 1068 | mov edi,@Kolibri@GetThreadData$qv |
8165 | IgorA | 1069 | movsd |
1070 | movsd |
||
8140 | IgorA | 1071 | mov eax,0x90909090 |
1072 | mov edi,@Kolibri@_ThreadSavedBegProc |
||
8165 | IgorA | 1073 | stosd |
1074 | stosd |
||
1075 | stosd |
||
1076 | stosd |
||
8140 | IgorA | 1077 | pop edi esi |
1078 | jmp .create_thread_fill_stack |
||
1079 | endp |
||
1080 | |||
8179 | IgorA | 1081 | proc @Kolibri@_FileAccess$qp21Kolibri@FileInfoBlock uses ebx |
8165 | IgorA | 1082 | mov eax,SF_FILE |
8140 | IgorA | 1083 | mov ebx,[esp+8] |
1084 | int 0x40 |
||
1085 | mov ecx,[esp+8] |
||
1086 | mov [ecx],ebx |
||
1087 | ret |
||
1088 | endp |
||
1089 | |||
8165 | IgorA | 1090 | if defined Kolibri_debug_string |
1091 | Kolibri_debug_string: |
||
8140 | IgorA | 1092 | db 'Abnormal program termination.',10,0 |
8165 | IgorA | 1093 | end if |
1094 | |||
1095 | if defined Kolibri_MutexLockRec |
||
8140 | IgorA | 1096 | Kolibri_try_lock_rec_overflow_string: |
1097 | db 'Recursive mutex lock count overflow.',10,0 |
||
8165 | IgorA | 1098 | end if |
1099 | |||
1100 | if defined @Kolibri@UnLock$qp16Kolibri@TRecMutexui |
||
8140 | IgorA | 1101 | Kolibri_unlock_rec_notlocked_string: |
1102 | db 'Recursive mutex unlock error.',10,0 |
||
8165 | IgorA | 1103 | end if |
8140 | IgorA | 1104 | |
1105 | include "kos_lib.inc" |
||
1106 | |||
1107 | ;/**/ |
||
1108 |