Rev 2655 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2655 | Rev 2829 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | 8 | ||
Line 9... | Line 9... | ||
9 | 9 | ||
10 | void kol_exit() |
10 | void kol_exit() |
11 | { |
11 | { |
12 | asm ("int $0x40"::"a"(-1)); |
12 | asm volatile ("int $0x40"::"a"(-1)); |
Line 13... | Line 13... | ||
13 | } |
13 | } |
14 | 14 | ||
15 | 15 | ||
16 | void kol_sleep(unsigned d) |
16 | void kol_sleep(unsigned d) |
Line -... | Line 17... | ||
- | 17 | { |
|
- | 18 | asm volatile ("int $0x40"::"a"(5), "b"(d)); |
|
17 | { |
19 | } |
18 | asm ("int $0x40"::"a"(5), "b"(d)); |
20 | |
19 | } |
21 | |
20 | - | ||
21 | 22 | // define a window |
|
Line 22... | Line 23... | ||
22 | void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
23 | // x, y - position; w, h - size; cs - color and style; c - caption; b - boder |
23 | { |
24 | void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned cs, unsigned b, char *t) |
24 | asm ("nop"::"a"(0), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
25 | { |
25 | asm ("movl $0xffffff, %esi \n int $0x40"); |
- | |
26 | } |
26 | asm volatile ("int $0x40"::"a"(0), "b"(x*65536+w), "c"(y*65536+h), "d"(cs), "D"(t), "S"(b) ); |
Line 27... | Line 27... | ||
27 | 27 | } |
|
28 | 28 | ||
29 | void kol_wnd_move(unsigned x, unsigned y) |
29 | |
30 | { |
30 | void kol_wnd_move(unsigned x, unsigned y) |
Line 31... | Line 31... | ||
31 | asm ("nop"::"a"(67), "b"(x), "c"(y)); |
31 | { |
32 | asm ("movl $-1, %edx \n movl $-1, %esi \n int $0x40"); |
32 | asm volatile ("int $0x40"::"a"(67), "b"(x), "c"(y), "d"(-1), "S"(-1)); |
33 | } |
33 | } |
34 | 34 | ||
Line 35... | Line 35... | ||
35 | 35 | ||
36 | void kol_event_mask(unsigned e) |
36 | void kol_event_mask(unsigned e) |
37 | { |
37 | { |
38 | asm ("int $0x40"::"a"(40), "b"(e)); |
38 | asm volatile ("int $0x40"::"a"(40), "b"(e)); |
Line 39... | Line 39... | ||
39 | } |
39 | } |
40 | 40 | ||
41 | 41 | ||
42 | unsigned kol_event_wait() |
42 | unsigned kol_event_wait() |
Line 43... | Line 43... | ||
43 | { |
43 | { |
44 | asm ("int $0x40"::"a"(10)); |
44 | asm volatile ("int $0x40"::"a"(10)); |
45 | } |
45 | } |
46 | 46 | ||
Line 47... | Line 47... | ||
47 | 47 | ||
48 | unsigned kol_event_wait_time(unsigned time) |
48 | unsigned kol_event_wait_time(unsigned time) |
49 | { |
49 | { |
50 | asm ("int $0x40"::"a"(23), "b"(time)); |
50 | asm volatile ("int $0x40"::"a"(23), "b"(time)); |
Line 51... | Line 51... | ||
51 | } |
51 | } |
52 | 52 | ||
53 | 53 | ||
54 | unsigned kol_event_check() |
54 | unsigned kol_event_check() |
Line 55... | Line 55... | ||
55 | { |
55 | { |
56 | asm ("int $0x40"::"a"(11)); |
56 | asm volatile ("int $0x40"::"a"(11)); |
57 | } |
57 | } |
58 | 58 | ||
Line 59... | Line 59... | ||
59 | 59 | ||
60 | void kol_paint_start() |
60 | void __attribute__((__always_inline__)) kol_paint_start() |
61 | { |
61 | { |
62 | asm ("int $0x40"::"a"(12), "b"(1)); |
62 | asm volatile ("int $0x40"::"a"(12), "b"(1)); |
Line 63... | Line 63... | ||
63 | } |
63 | } |
64 | 64 | ||
65 | 65 | ||
66 | void kol_paint_end() |
66 | void __attribute__((__always_inline__)) kol_paint_end() |
Line 67... | Line 67... | ||
67 | { |
67 | { |
68 | asm ("int $0x40"::"a"(12), "b"(2)); |
68 | asm volatile ("int $0x40"::"a"(12), "b"(2)); |
69 | } |
69 | } |
70 | 70 | ||
Line 71... | Line 71... | ||
71 | 71 | ||
72 | void kol_paint_pixel(unsigned x, unsigned y, unsigned c) |
72 | void kol_paint_pixel(unsigned x, unsigned y, unsigned c) |
73 | { |
73 | { |
74 | asm ("int $0x40"::"a"(1), "b"(x), "c"(y), "d"(c)); |
- | |
75 | } |
- | |
76 | - | ||
77 | - | ||
78 | void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
- | |
79 | { |
- | |
80 | asm ("int $0x40"::"a"(13), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
- | |
81 | } |
74 | asm volatile ("int $0x40"::"a"(1), "b"(x), "c"(y), "d"(c)); |
Line 82... | Line 75... | ||
82 | 75 | } |
|
83 | 76 | ||
84 | void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c) |
77 | |
85 | { |
78 | void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) |
Line 86... | Line 79... | ||
86 | asm ("int $0x40"::"a"(38), "b"(x1*65536+x2), "c"(y1*65536+y2), "d"(c)); |
79 | { |
87 | } |
80 | asm volatile ("int $0x40"::"a"(13), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); |
88 | 81 | } |
|
89 | 82 | ||
Line 90... | Line 83... | ||
90 | void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c) |
83 | |
91 | { |
84 | void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c) |
92 | asm ("int $0x40"::"a"(4), "b"(x*65536+y), "c"(c), "d"(s)); |
85 | { |
93 | } |
86 | asm volatile ("int $0x40"::"a"(38), "b"(x1*65536+x2), "c"(y1*65536+y2), "d"(c)); |
Line 94... | Line 87... | ||
94 | 87 | } |
|
95 | 88 | ||
96 | void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d) |
89 | |
97 | { |
90 | void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c) |
Line 98... | Line 91... | ||
98 | asm ("int $0x40"::"a"(7), "c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
91 | { |
99 | } |
92 | asm volatile ("int $0x40"::"a"(4), "b"(x*65536+y), "c"(c), "d"(s)); |
100 | 93 | } |
|
101 | 94 | ||
Line 102... | Line 95... | ||
102 | void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette) |
95 | |
103 | { |
96 | void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d) |
104 | asm ("nop"::"c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
97 | { |
105 | asm ("nop"::"a"(palette)); |
98 | asm volatile ("int $0x40"::"a"(7), "c"(w*65536+h), "d"(x*65536+y), "b"(d)); |
Line 106... | Line 99... | ||
106 | asm ("movl %eax, %edi"); |
99 | } |
107 | asm ("xor %eax, %eax"); |
100 | |
108 | asm ("movl %eax, %ebp"); |
101 | |
109 | asm ("pushl $8"); |
102 | void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette) |
Line 110... | Line 103... | ||
110 | asm ("popl %esi"); |
103 | { |
111 | asm ("int $0x40"::"a"(65)); |
104 | asm volatile ("int $0x40"::"a"(65), "b"(d), "c"(w*65536+h), "d"(x*65536+y), "D"(palette), "S"(8)); |
112 | } |
105 | } |
113 | - | ||
114 | - | ||
115 | unsigned kol_key_get() |
- | |
116 | { |
106 | |
Line 117... | Line 107... | ||
117 | asm ("int $0x40"::"a"(2)); |
107 | |
118 | } |
108 | unsigned kol_key_get() |
119 | 109 | { |
|
120 | 110 | asm volatile ("int $0x40"::"a"(2)); |
|
Line 121... | Line 111... | ||
121 | unsigned kol_key_control() |
111 | } |
122 | { |
112 | |
123 | asm ("int $0x40"::"a"(66), "b"(3)); |
113 | |
124 | } |
114 | unsigned kol_key_control() |
Line 125... | Line 115... | ||
125 | 115 | { |
|
126 | 116 | asm volatile ("int $0x40"::"a"(66), "b"(3)); |
|
127 | void kol_key_lang_set(unsigned lang) |
117 | } |
128 | { |
118 | |
Line 129... | Line 119... | ||
129 | asm ("int $0x40"::"a"(21), "b"(2), "c"(9), "d"(lang)); |
119 | |
130 | } |
120 | void kol_key_lang_set(unsigned lang) |
131 | 121 | { |
|
132 | 122 | asm volatile ("int $0x40"::"a"(21), "b"(2), "c"(9), "d"(lang)); |
|
Line 133... | Line 123... | ||
133 | unsigned kol_key_lang_get() |
123 | } |
134 | { |
124 | |
135 | asm ("int $0x40"::"a"(26), "b"(2), "c"(9)); |
125 | |
136 | } |
126 | unsigned kol_key_lang_get() |
Line 137... | Line 127... | ||
137 | 127 | { |
|
138 | 128 | asm volatile ("int $0x40"::"a"(26), "b"(2), "c"(9)); |
|
139 | void kol_key_mode_set(unsigned mode) |
129 | } |
140 | { |
130 | |
Line 141... | Line 131... | ||
141 | asm ("int $0x40"::"a"(66), "b"(1), "c"(mode)); |
131 | |
142 | } |
132 | void kol_key_mode_set(unsigned mode) |
143 | 133 | { |
|
144 | 134 | asm volatile ("int $0x40"::"a"(66), "b"(1), "c"(mode)); |
|
145 | unsigned kol_key_mode_get() |
135 | } |
146 | { |
136 | |
147 | asm ("int $0x40"::"a"(66), "b"(2)); |
137 | |
148 | } |
138 | unsigned kol_key_mode_get() |
149 | 139 | { |
|
150 | 140 | asm volatile ("int $0x40"::"a"(66), "b"(2)); |
|
Line 218... | Line 208... | ||
218 | if ( n > 1 ) |
208 | if ( n > 1 ) |
219 | kol_board_puti(n / 10); |
209 | kol_board_puti(n / 10); |
Line 220... | Line 210... | ||
220 | 210 | ||
221 | c = n % 10 + '0'; |
211 | c = n % 10 + '0'; |
Line 222... | Line 212... | ||
222 | asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
212 | asm volatile ("int $0x40"::"a"(63), "b"(1), "c"(c)); |
Line 223... | Line 213... | ||
223 | 213 | ||
224 | } |
214 | } |
225 | 215 | ||
226 | 216 | ||
Line 227... | Line 217... | ||
227 | int kol_file_70(kol_struct70 *k) |
217 | int kol_file_70(kol_struct70 *k) |
228 | { |
218 | { |
229 | asm ("int $0x40"::"a"(70), "b"(k)); |
219 | asm volatile ("int $0x40"::"a"(70), "b"(k)); |
230 | } |
220 | } |
Line 231... | Line 221... | ||
231 | 221 | ||
232 | 222 | ||
Line 282... | Line 272... | ||
282 | 272 | ||
Line 283... | Line 273... | ||
283 | 273 | ||
284 | unsigned kol_system_cpufreq() |
274 | unsigned kol_system_cpufreq() |
285 | { |
275 | { |
286 | asm ("int $0x40"::"a"(18), "b"(5)); |
276 | asm volatile ("int $0x40"::"a"(18), "b"(5)); |
Line 287... | Line 277... | ||
287 | } |
277 | } |
288 | 278 | ||
289 | 279 | ||
290 | unsigned kol_system_mem() |
280 | unsigned kol_system_mem() |
Line 291... | Line 281... | ||
291 | { |
281 | { |
292 | asm ("int $0x40"::"a"(18), "b"(17)); |
282 | asm volatile ("int $0x40"::"a"(18), "b"(17)); |
293 | } |
283 | } |
294 | 284 | ||
Line 295... | Line 285... | ||
295 | 285 | ||
296 | unsigned kol_system_memfree() |
286 | unsigned kol_system_memfree() |
297 | { |
287 | { |
298 | asm ("int $0x40"::"a"(18), "b"(16)); |
288 | asm volatile ("int $0x40"::"a"(18), "b"(16)); |
Line 299... | Line 289... | ||
299 | } |
289 | } |
300 | 290 | ||
301 | 291 | ||
302 | unsigned kol_system_time_get() |
292 | unsigned kol_system_time_get() |
Line 303... | Line 293... | ||
303 | { |
293 | { |
304 | asm ("int $0x40"::"a"(3)); |
294 | asm volatile ("int $0x40"::"a"(3)); |
305 | } |
295 | } |
306 | 296 | ||
Line 307... | Line 297... | ||
307 | 297 | ||
308 | unsigned kol_system_date_get() |
298 | unsigned kol_system_date_get() |
Line 355... | Line 345... | ||
355 | } |
345 | } |
Line 356... | Line 346... | ||
356 | 346 | ||
357 | 347 | ||
358 | 348 | ||
359 | void kol_screen_wait_rr() |
349 | void __attribute__((__always_inline__)) kol_screen_wait_rr() |
Line 360... | Line 350... | ||
360 | { |
350 | { |
361 | asm ("int $0x40"::"a"(18), "b"(14)); |
351 | asm volatile ("int $0x40"::"a"(18), "b"(14)); |
362 | } |
352 | } |
363 | 353 | ||
364 | 354 | ||
365 | 355 | ||
366 | void kol_screen_get_size(unsigned *w, unsigned *h) |
356 | void kol_screen_get_size(unsigned *w, unsigned *h) |
Line 367... | Line 357... | ||
367 | { |
357 | { |
368 | unsigned size; |
358 | unsigned size; |
369 | asm ("int $0x40":"=a"(size):"a"(14)); |
359 | asm volatile ("int $0x40":"=a"(size):"a"(14)); |
370 | *w = size / 65536; |
360 | *w = size / 65536; |
Line 371... | Line 361... | ||
371 | *h = size % 65536; |
361 | *h = size % 65536; |
372 | } |
362 | } |
373 | 363 | ||
374 | 364 | ||
Line 375... | Line 365... | ||
375 | 365 | ||
376 | unsigned kol_skin_height() |
366 | unsigned kol_skin_height() |
377 | { |
367 | { |
378 | asm ("int $0x40"::"a"(48), "b"(4)); |
368 | asm volatile ("int $0x40"::"a"(48), "b"(4)); |
Line 379... | Line 369... | ||
379 | } |
369 | } |
380 | 370 | ||
381 | 371 | ||
382 | unsigned kol_thread_start(unsigned start, unsigned stack) |
372 | unsigned kol_thread_start(unsigned start, unsigned stack) |
383 | { |
373 | { |
Line 384... | Line 374... | ||
384 | asm ("int $0x40"::"a"(51), "b"(1), "c"(start), "d"(stack)); |
374 | asm volatile ("int $0x40"::"a"(51), "b"(1), "c"(start), "d"(stack)); |
385 | } |
375 | } |
386 | 376 | ||
387 | 377 | ||
Line 388... | Line 378... | ||
388 | unsigned kol_time_tick() |
378 | unsigned kol_time_tick() |
389 | { |
379 | { |
390 | asm ("int $0x40"::"a"(26), "b"(9)); |
380 | asm volatile ("int $0x40"::"a"(26), "b"(9)); |
391 | } |
381 | } |
Line 392... | Line 382... | ||
392 | 382 | ||
393 | 383 | ||
394 | unsigned kol_sound_speaker(char data[]) |
384 | unsigned kol_sound_speaker(char data[]) |
395 | { |
385 | { |
Line 396... | Line 386... | ||
396 | asm ("movl %0, %%esi"::"a"(data)); |
386 | asm volatile ("movl %0, %%esi"::"a"(data)); |
397 | asm ("int $0x40"::"a"(55), "b"(55)); |
387 | asm volatile ("int $0x40"::"a"(55), "b"(55)); |
398 | } |
388 | } |
399 | 389 | ||
Line 400... | Line 390... | ||
400 | 390 | ||
401 | unsigned kol_process_info(unsigned slot, char buf1k[]) |
391 | unsigned kol_process_info(unsigned slot, char buf1k[]) |
402 | { |
392 | { |
403 | asm ("int $0x40"::"a"(9), "b"(buf1k), "c"(slot)); |
- | |
404 | } |
393 | asm volatile ("int $0x40"::"a"(9), "b"(buf1k), "c"(slot)); |
405 | 394 | } |
|
406 | 395 | ||
Line 407... | Line 396... | ||
407 | int kol_process_kill_pid(unsigned process) |
396 | |
408 | { |
397 | int kol_process_kill_pid(unsigned process) |
409 | asm ("int $0x40"::"a"(18), "b"(18), "c"(process)); |
398 | { |
410 | } |
399 | asm volatile ("int $0x40"::"a"(18), "b"(18), "c"(process)); |