Rev 9830 | Rev 9865 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9830 | Rev 9836 | ||
---|---|---|---|
Line 380... | Line 380... | ||
380 | /*============== Function 0 - define and draw the window. ==============*/ |
380 | /*============== Function 0 - define and draw the window. ==============*/ |
Line 381... | Line 381... | ||
381 | 381 | ||
382 | KOSAPI void _ksys_create_window(uint32_t x, uint32_t y, uint32_t w, uint32_t h, const char* name, ksys_color_t workcolor, uint32_t style) |
382 | KOSAPI void _ksys_create_window(uint32_t x, uint32_t y, uint32_t w, uint32_t h, const char* name, ksys_color_t workcolor, uint32_t style) |
383 | { |
383 | { |
384 | asm_inline( |
384 | asm_inline( |
- | 385 | "int $0x40" |
|
- | 386 | : |
|
385 | "int $0x40" ::"a"(0), |
387 | : "a"(0), |
386 | "b"((x << 16) | ((w - 1) & 0xFFFF)), |
388 | "b"((x << 16) | ((w - 1) & 0xFFFF)), |
387 | "c"((y << 16) | ((h - 1) & 0xFFFF)), |
389 | "c"((y << 16) | ((h - 1) & 0xFFFF)), |
388 | "d"((style << 24) | (workcolor & 0xFFFFFF)), |
390 | "d"((style << 24) | (workcolor & 0xFFFFFF)), |
389 | "D"(name), |
391 | "D"(name), |
Line 393... | Line 395... | ||
393 | 395 | ||
Line 394... | Line 396... | ||
394 | /*================ Function 1 - put pixel in the window. ===============*/ |
396 | /*================ Function 1 - put pixel in the window. ===============*/ |
395 | 397 | ||
396 | KOSAPI void _ksys_draw_pixel(uint32_t x, uint32_t y, ksys_color_t color) |
- | |
397 | { |
398 | KOSAPI void _ksys_draw_pixel(uint32_t x, uint32_t y, ksys_color_t color) |
398 | asm_inline( |
399 | { |
Line 399... | Line 400... | ||
399 | "int $0x40" ::"a"(1), "b"(x), "c"(y), "d"(color)); |
400 | asm_inline("int $0x40" ::"a"(1), "b"(x), "c"(y), "d"(color)); |
Line 400... | Line 401... | ||
400 | } |
401 | } |
Line 426... | Line 427... | ||
426 | 427 | ||
427 | /*=================== Function 4 - draw text string. ===================*/ |
428 | /*=================== Function 4 - draw text string. ===================*/ |
428 | KOSAPI void _ksys_draw_text(const char* text, uint32_t x, uint32_t y, uint32_t len, ksys_color_t color) |
429 | KOSAPI void _ksys_draw_text(const char* text, uint32_t x, uint32_t y, uint32_t len, ksys_color_t color) |
429 | { |
430 | { |
- | 431 | asm_inline( |
|
- | 432 | "int $0x40" |
|
430 | asm_inline( |
433 | : |
431 | "int $0x40" ::"a"(4), "d"(text), |
434 | : "a"(4), "d"(text), |
432 | "b"((x << 16) | y), |
435 | "b"((x << 16) | y), |
433 | "S"(len), "c"(color) |
436 | "S"(len), "c"(color) |
434 | : "memory"); |
437 | : "memory"); |
Line 435... | Line 438... | ||
435 | } |
438 | } |
Line 436... | Line 439... | ||
436 | 439 | ||
437 | /*========================= Function 5 - delay. ========================*/ |
440 | /*========================= Function 5 - delay. ========================*/ |
438 | 441 | ||
- | 442 | KOSAPI void _ksys_delay(uint32_t time) |
|
- | 443 | { |
|
439 | KOSAPI void _ksys_delay(uint32_t time) |
444 | asm_inline( |
440 | { |
445 | "int $0x40" |
441 | asm_inline( |
446 | : |
Line 442... | Line 447... | ||
442 | "int $0x40" ::"a"(5), "b"(time) |
447 | : "a"(5), "b"(time) |
Line 443... | Line 448... | ||
443 | : "memory"); |
448 | : "memory"); |
444 | } |
449 | } |
445 | 450 | ||
- | 451 | /*=============== Function 7 - draw image in the window. ===============*/ |
|
- | 452 | ||
446 | /*=============== Function 7 - draw image in the window. ===============*/ |
453 | KOSAPI void _ksys_draw_bitmap(void* bitmap, int x, int y, int w, int h) |
447 | 454 | { |
|
448 | KOSAPI void _ksys_draw_bitmap(void* bitmap, int x, int y, int w, int h) |
455 | asm_inline( |
449 | { |
456 | "int $0x40" |
450 | asm_inline( |
457 | : |
Line 451... | Line 458... | ||
451 | "int $0x40" ::"a"(7), "b"(bitmap), |
458 | : "a"(7), "b"(bitmap), |
Line 452... | Line 459... | ||
452 | "c"((w << 16) | h), |
459 | "c"((w << 16) | h), |
453 | "d"((x << 16) | y) |
460 | "d"((x << 16) | y) |
454 | : "memory"); |
461 | : "memory"); |
455 | } |
462 | } |
- | 463 | ||
- | 464 | /*=============== Function 8 - define/delete the button. ===============*/ |
|
456 | 465 | ||
457 | /*=============== Function 8 - define/delete the button. ===============*/ |
466 | KOSAPI void _ksys_define_button(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t id, ksys_color_t color) |
458 | 467 | { |
|
459 | KOSAPI void _ksys_define_button(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t id, ksys_color_t color) |
468 | asm_inline( |
460 | { |
469 | "int $0x40" |
Line 461... | Line 470... | ||
461 | asm_inline( |
470 | : |
462 | "int $0x40" ::"a"(8), |
471 | : "a"(8), |
463 | "b"((x << 16) + w), |
- | |
464 | "c"((y << 16) + h), |
472 | "b"((x << 16) + w), |
465 | "d"(id), |
473 | "c"((y << 16) + h), |
Line 466... | Line 474... | ||
466 | "S"(color)); |
474 | "d"(id), |
Line 467... | Line 475... | ||
467 | }; |
475 | "S"(color)); |
Line 536... | Line 544... | ||
536 | /*============ Function 13 - draw a rectangle in the window. ===========*/ |
544 | /*============ Function 13 - draw a rectangle in the window. ===========*/ |
Line 537... | Line 545... | ||
537 | 545 | ||
538 | KOSAPI void _ksys_draw_bar(uint32_t x, uint32_t y, uint32_t w, uint32_t h, ksys_color_t color) |
546 | KOSAPI void _ksys_draw_bar(uint32_t x, uint32_t y, uint32_t w, uint32_t h, ksys_color_t color) |
539 | { |
547 | { |
- | 548 | asm_inline( |
|
- | 549 | "int $0x40" |
|
540 | asm_inline( |
550 | : |
541 | "int $0x40" ::"a"(13), "d"(color), |
551 | : "a"(13), "d"(color), |
542 | "b"((x << 16) | w), |
552 | "b"((x << 16) | w), |
543 | "c"((y << 16) | h)); |
553 | "c"((y << 16) | h)); |
Line 544... | Line 554... | ||
544 | } |
554 | } |
Line 557... | Line 567... | ||
557 | 567 | ||
Line 558... | Line 568... | ||
558 | /*== Function 15, subfunction 1 - set a size of the background image. ==*/ |
568 | /*== Function 15, subfunction 1 - set a size of the background image. ==*/ |
559 | 569 | ||
560 | KOSAPI void _ksys_bg_set_size(uint32_t w, uint32_t h) |
- | |
561 | { |
570 | KOSAPI void _ksys_bg_set_size(uint32_t w, uint32_t h) |
562 | asm_inline( |
571 | { |
Line 563... | Line 572... | ||
563 | "int $0x40" ::"a"(15), "b"(1), "c"(w), "d"(h)); |
572 | asm_inline("int $0x40" ::"a"(15), "b"(1), "c"(w), "d"(h)); |
Line 564... | Line 573... | ||
564 | } |
573 | } |
565 | 574 | ||
566 | /*=== Function 15, subfunction 2 - put pixel on the background image. ==*/ |
- | |
567 | 575 | /*=== Function 15, subfunction 2 - put pixel on the background image. ==*/ |
|
568 | KOSAPI void _ksys_bg_put_pixel(uint32_t x, uint32_t y, uint32_t w, ksys_color_t color) |
576 | |
Line 569... | Line 577... | ||
569 | { |
577 | KOSAPI void _ksys_bg_put_pixel(uint32_t x, uint32_t y, uint32_t w, ksys_color_t color) |
Line 570... | Line 578... | ||
570 | asm_inline( |
578 | { |
571 | "int $0x40" ::"a"(15), "b"(2), "c"((x + y * w) * 3), "d"(color)); |
579 | asm_inline("int $0x40" ::"a"(15), "b"(2), "c"((x + y * w) * 3), "d"(color)); |
572 | } |
- | |
573 | 580 | } |
|
574 | /*=========== Function 15, subfunction 3 - redraw background. ==========*/ |
581 | |
Line 575... | Line 582... | ||
575 | 582 | /*=========== Function 15, subfunction 3 - redraw background. ==========*/ |
|
Line 576... | Line 583... | ||
576 | KOSAPI void _ksys_bg_redraw(void) |
583 | |
Line 586... | Line 593... | ||
586 | KSYS_BG_MODE_STRETCH = 2 |
593 | KSYS_BG_MODE_STRETCH = 2 |
587 | }; |
594 | }; |
Line 588... | Line 595... | ||
588 | 595 | ||
589 | KOSAPI void _ksys_bg_set_mode(uint32_t mode) |
596 | KOSAPI void _ksys_bg_set_mode(uint32_t mode) |
590 | { |
- | |
591 | asm_inline( |
597 | { |
592 | "int $0x40" ::"a"(15), "b"(4), "c"(mode)); |
598 | asm_inline("int $0x40" ::"a"(15), "b"(4), "c"(mode)); |
Line 593... | Line 599... | ||
593 | } |
599 | } |
594 | 600 | ||
Line 595... | Line 601... | ||
595 | /*===================== Function 15, subfunction 5 =====================*/ |
601 | /*===================== Function 15, subfunction 5 =====================*/ |
596 | /*============ Put block of pixels on the background image. ============*/ |
602 | /*============ Put block of pixels on the background image. ============*/ |
597 | 603 | ||
- | 604 | KOSAPI void _ksys_bg_put_bitmap(ksys_bitmap_t* bitmap, size_t bitmap_size, uint32_t x, uint32_t y, uint32_t w) |
|
- | 605 | { |
|
598 | KOSAPI void _ksys_bg_put_bitmap(ksys_bitmap_t* bitmap, size_t bitmap_size, uint32_t x, uint32_t y, uint32_t w) |
606 | asm_inline( |
599 | { |
607 | "int $0x40" |
Line 600... | Line 608... | ||
600 | asm_inline( |
608 | : |
601 | "int $0x40" ::"a"(15), "b"(5), "c"(bitmap), "d"((x + y * w) * 3), "S"(bitmap_size)); |
609 | : "a"(15), "b"(5), "c"(bitmap), "d"((x + y * w) * 3), "S"(bitmap_size)); |
Line 630... | Line 638... | ||
630 | /*============= Redraws a rectangular part of the background ===========*/ |
638 | /*============= Redraws a rectangular part of the background ===========*/ |
Line 631... | Line 639... | ||
631 | 639 | ||
632 | KOSAPI void _ksys_bg_redraw_bar(ksys_pos_t angle1, ksys_pos_t angle2) |
640 | KOSAPI void _ksys_bg_redraw_bar(ksys_pos_t angle1, ksys_pos_t angle2) |
633 | { |
641 | { |
- | 642 | asm_inline( |
|
- | 643 | "int $0x40" |
|
634 | asm_inline( |
644 | : |
635 | "int $0x40" ::"a"(15), "b"(9), |
645 | : "a"(15), "b"(9), |
636 | "c"(angle1.x * (1 << 16) + angle2.x), |
646 | "c"(angle1.x * (1 << 16) + angle2.x), |
637 | "d"(angle1.y * (1 << 16) + angle2.y)); |
647 | "d"(angle1.y * (1 << 16) + angle2.y)); |
Line 638... | Line 648... | ||
638 | } |
648 | } |
Line 664... | Line 674... | ||
664 | /*===================== Function 18, subfunction 1 =====================*/ |
674 | /*===================== Function 18, subfunction 1 =====================*/ |
665 | /*============= Make deactive the window of the given thread. ==========*/ |
675 | /*============= Make deactive the window of the given thread. ==========*/ |
Line 666... | Line 676... | ||
666 | 676 | ||
667 | KOSAPI void _ksys_unfocus_window(int slot) |
677 | KOSAPI void _ksys_unfocus_window(int slot) |
668 | { |
- | |
669 | asm_inline( |
678 | { |
670 | "int $0x40" ::"a"(18), "b"(1), "c"(slot)); |
679 | asm_inline("int $0x40" ::"a"(18), "b"(1), "c"(slot)); |
Line 671... | Line 680... | ||
671 | } |
680 | } |
Line 672... | Line 681... | ||
672 | 681 | ||
Line 681... | Line 690... | ||
681 | /*===================== Function 18, subfunction 3 =====================*/ |
690 | /*===================== Function 18, subfunction 3 =====================*/ |
682 | /*============= Make active the window of the given thread. ============*/ |
691 | /*============= Make active the window of the given thread. ============*/ |
Line 683... | Line 692... | ||
683 | 692 | ||
684 | KOSAPI void _ksys_focus_window(int slot) |
693 | KOSAPI void _ksys_focus_window(int slot) |
685 | { |
- | |
686 | asm_inline( |
694 | { |
687 | "int $0x40" ::"a"(18), "b"(3), "c"(slot)); |
695 | asm_inline("int $0x40" ::"a"(18), "b"(3), "c"(slot)); |
Line 688... | Line 696... | ||
688 | } |
696 | } |
689 | 697 | ||
Line 733... | Line 741... | ||
733 | KSYS_SHD_RESTART_KRN = 4 |
741 | KSYS_SHD_RESTART_KRN = 4 |
734 | }; |
742 | }; |
Line 735... | Line 743... | ||
735 | 743 | ||
736 | KOSAPI void _ksys_shutdown(uint32_t shd_param) |
744 | KOSAPI void _ksys_shutdown(uint32_t shd_param) |
737 | { |
- | |
738 | asm_inline( |
745 | { |
739 | "int $0x40" ::"a"(18), "b"(9), "c"(shd_param)); |
746 | asm_inline("int $0x40" ::"a"(18), "b"(9), "c"(shd_param)); |
Line 740... | Line 747... | ||
740 | } |
747 | } |
Line 741... | Line 748... | ||
741 | 748 | ||
Line 850... | Line 857... | ||
850 | /*=================== Function 29 - get system date. ===================*/ |
857 | /*=================== Function 29 - get system date. ===================*/ |
Line 851... | Line 858... | ||
851 | 858 | ||
852 | KOSAPI ksys_date_t _ksys_get_date(void) |
859 | KOSAPI ksys_date_t _ksys_get_date(void) |
853 | { |
860 | { |
- | 861 | ksys_date_t val; |
|
854 | ksys_date_t val; |
862 | asm_inline( |
855 | asm_inline("int $0x40" |
863 | "int $0x40" |
856 | : "=a"(val) |
864 | : "=a"(val) |
857 | : "a"(29)); |
865 | : "a"(29)); |
858 | return val; |
866 | return val; |
Line 859... | Line 867... | ||
859 | } |
867 | } |
860 | 868 | ||
Line 861... | Line 869... | ||
861 | /*===========+ Function 30 - work with the current folder.==============*/ |
869 | /*===========+ Function 30 - work with the current folder.==============*/ |
862 | /*--------- Subfunction 1 - set current folder for the thread. ---------*/ |
870 | /*--------- Subfunction 1 - set current folder for the thread. ---------*/ |
863 | - | ||
864 | KOSAPI void _ksys_setcwd(char* dir) |
871 | |
865 | { |
872 | KOSAPI void _ksys_setcwd(char* dir) |
Line 866... | Line 873... | ||
866 | asm_inline( |
873 | { |
Line 867... | Line 874... | ||
867 | "int $0x40" ::"a"(30), "b"(1), "c"(dir)); |
874 | asm_inline("int $0x40" ::"a"(30), "b"(1), "c"(dir)); |
Line 1015... | Line 1022... | ||
1015 | /*====================== Function 38 - draw line. ======================*/ |
1022 | /*====================== Function 38 - draw line. ======================*/ |
Line 1016... | Line 1023... | ||
1016 | 1023 | ||
1017 | KOSAPI void _ksys_draw_line(int xs, int ys, int xe, int ye, ksys_color_t color) |
1024 | KOSAPI void _ksys_draw_line(int xs, int ys, int xe, int ye, ksys_color_t color) |
1018 | { |
1025 | { |
- | 1026 | asm_inline( |
|
- | 1027 | "int $0x40" |
|
1019 | asm_inline( |
1028 | : |
1020 | "int $0x40" ::"a"(38), "d"(color), |
1029 | : "a"(38), "d"(color), |
1021 | "b"((xs << 16) | xe), |
1030 | "b"((xs << 16) | xe), |
1022 | "c"((ys << 16) | ye)); |
1031 | "c"((ys << 16) | ye)); |
Line 1023... | Line 1032... | ||
1023 | } |
1032 | } |
Line 1027... | Line 1036... | ||
1027 | KOSAPI void _ksys_draw_number(int number, int x, int y, int len, ksys_color_t color) |
1036 | KOSAPI void _ksys_draw_number(int number, int x, int y, int len, ksys_color_t color) |
1028 | { |
1037 | { |
1029 | unsigned fmt; |
1038 | unsigned fmt; |
1030 | fmt = len << 16 | 0x80000000; // no leading zeros + width |
1039 | fmt = len << 16 | 0x80000000; // no leading zeros + width |
1031 | asm_inline( |
1040 | asm_inline( |
- | 1041 | "int $0x40" |
|
- | 1042 | : |
|
1032 | "int $0x40" ::"a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color)); |
1043 | : "a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color)); |
1033 | } |
1044 | } |
Line 1034... | Line 1045... | ||
1034 | 1045 | ||
1035 | KOSAPI void _ksys_draw_number_bg(unsigned number, int x, int y, int len, ksys_color_t color, ksys_color_t bg) |
1046 | KOSAPI void _ksys_draw_number_bg(unsigned number, int x, int y, int len, ksys_color_t color, ksys_color_t bg) |
1036 | { |
1047 | { |
1037 | unsigned fmt; |
1048 | unsigned fmt; |
1038 | fmt = len << 16 | 0x80000000; // no leading zeros + width |
1049 | fmt = len << 16 | 0x80000000; // no leading zeros + width |
- | 1050 | asm_inline( |
|
- | 1051 | "int $0x40" |
|
1039 | asm_inline( |
1052 | : |
1040 | "int $0x40" ::"a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color), "D"(bg)); |
1053 | : "a"(47), "b"(fmt), "c"(number), "d"((x << 16) | y), "S"(color), "D"(bg)); |
Line 1041... | Line 1054... | ||
1041 | } |
1054 | } |
Line 1042... | Line 1055... | ||
1042 | 1055 | ||
1043 | /*====== Function 48, subfunction 3 - get standard window colors. ======*/ |
1056 | /*====== Function 48, subfunction 3 - get standard window colors. ======*/ |
1044 | - | ||
1045 | KOSAPI void _ksys_get_system_colors(ksys_colors_table_t* color_table) |
1057 | |
1046 | { |
1058 | KOSAPI void _ksys_get_system_colors(ksys_colors_table_t* color_table) |
Line 1047... | Line 1059... | ||
1047 | asm_inline( |
1059 | { |
Line 1048... | Line 1060... | ||
1048 | "int $0x40" ::"a"(48), "b"(3), "c"(color_table), "d"(40)); |
1060 | asm_inline("int $0x40" ::"a"(48), "b"(3), "c"(color_table), "d"(40)); |
Line 1165... | Line 1177... | ||
1165 | asm_inline("int $0x40" ::"a"(63), "b"(1), "c"(*(s + i))); |
1177 | asm_inline("int $0x40" ::"a"(63), "b"(1), "c"(*(s + i))); |
1166 | i++; |
1178 | i++; |
1167 | } |
1179 | } |
1168 | } |
1180 | } |
Line -... | Line 1181... | ||
- | 1181 | ||
- | 1182 | /*========= Function 65 - draw image with the palette in window. =============*/ |
|
- | 1183 | ||
- | 1184 | KOSAPI void ksys_draw_bitmap_palette(void* bitmap, int x, int y, int w, int h, int bpp, void* palette, int offset) |
|
- | 1185 | { |
|
- | 1186 | asm_inline( |
|
- | 1187 | "pushl %%ebp,\n\t" // save EBP register |
|
- | 1188 | "movl 0x24(%%ebp), %%ebp\n\t" // 0x24 - "offset" param |
|
- | 1189 | "int $0x40\n\t" |
|
- | 1190 | "popl %%ebp" // restore EBP register |
|
- | 1191 | : |
|
- | 1192 | : "a"(65), |
|
- | 1193 | "b"(bitmap), |
|
- | 1194 | "c"((w << 16) + h), |
|
- | 1195 | "d"((x << 16) + y), |
|
- | 1196 | "S"(bpp), |
|
- | 1197 | "D"(palette)); |
|
- | 1198 | } |
|
1169 | 1199 | ||
Line 1170... | Line 1200... | ||
1170 | /*========= Function 66, subfunction 1 - set keyboard input mode. ==============*/ |
1200 | /*========= Function 66, subfunction 1 - set keyboard input mode. ==============*/ |
1171 | 1201 | ||
1172 | typedef enum KSYS_KEY_INPUT_MODE { |
1202 | typedef enum KSYS_KEY_INPUT_MODE { |
1173 | KSYS_KEY_INPUT_MODE_ASCII = 0, |
1203 | KSYS_KEY_INPUT_MODE_ASCII = 0, |
Line 1174... | Line 1204... | ||
1174 | KSYS_KEY_INPUT_MODE_SCANC = 1, |
1204 | KSYS_KEY_INPUT_MODE_SCANC = 1, |
1175 | } ksys_key_input_mode_t; |
1205 | } ksys_key_input_mode_t; |
1176 | - | ||
1177 | KOSAPI void _ksys_set_key_input_mode(ksys_key_input_mode_t mode) |
1206 | |
1178 | { |
1207 | KOSAPI void _ksys_set_key_input_mode(ksys_key_input_mode_t mode) |
Line 1179... | Line 1208... | ||
1179 | asm_inline( |
1208 | { |
Line 1180... | Line 1209... | ||
1180 | "int $0x40" ::"a"(66), "b"(1), "c"(mode)); |
1209 | asm_inline("int $0x40" ::"a"(66), "b"(1), "c"(mode)); |
Line 1224... | Line 1253... | ||
1224 | KSYS_SYS_HOTKEY_ALT_BOTH = 0x200, |
1253 | KSYS_SYS_HOTKEY_ALT_BOTH = 0x200, |
1225 | KSYS_SYS_HOTKEY_ALT_LEFTONLY = 0x300, |
1254 | KSYS_SYS_HOTKEY_ALT_LEFTONLY = 0x300, |
1226 | KSYS_SYS_HOTKEY_ALT_RIGHTONLY = 0x400, |
1255 | KSYS_SYS_HOTKEY_ALT_RIGHTONLY = 0x400, |
1227 | }; |
1256 | }; |
Line 1228... | Line 1257... | ||
1228 | 1257 | ||
- | 1258 | KOSAPI int _ksys_set_sys_hotkey(uint8_t scancode, uint16_t control_key_states) |
|
1229 | KOSAPI int _ksys_set_sys_hotkey(uint8_t scancode, uint16_t control_key_states) { |
1259 | { |
1230 | int res; |
1260 | int res; |
1231 | asm_inline( |
1261 | asm_inline( |
1232 | "int $0x40" |
1262 | "int $0x40" |
1233 | : "=a"(res) |
1263 | : "=a"(res) |
Line 1236... | Line 1266... | ||
1236 | return res; |
1266 | return res; |
1237 | } |
1267 | } |
Line 1238... | Line 1268... | ||
1238 | 1268 | ||
Line 1239... | Line 1269... | ||
1239 | /*========= Function 66, subfunction 5 - delete installed hotkey. ========*/ |
1269 | /*========= Function 66, subfunction 5 - delete installed hotkey. ========*/ |
- | 1270 | ||
1240 | 1271 | KOSAPI int _ksys_del_sys_hotkey(uint8_t scancode, uint16_t control_key_states) |
|
1241 | KOSAPI int _ksys_del_sys_hotkey(uint8_t scancode, uint16_t control_key_states) { |
1272 | { |
1242 | int res; |
1273 | int res; |
1243 | asm_inline( |
1274 | asm_inline( |
1244 | "int $0x40" |
1275 | "int $0x40" |
Line 1250... | Line 1281... | ||
1250 | 1281 | ||
Line 1251... | Line 1282... | ||
1251 | /*========= Function 67 - change position/sizes of the window. =========*/ |
1282 | /*========= Function 67 - change position/sizes of the window. =========*/ |
1252 | 1283 | ||
1253 | KOSAPI void _ksys_change_window(int new_x, int new_y, int new_w, int new_h) |
- | |
1254 | { |
1284 | KOSAPI void _ksys_change_window(int new_x, int new_y, int new_w, int new_h) |
1255 | asm_inline( |
1285 | { |
Line 1256... | Line 1286... | ||
1256 | "int $0x40" ::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w), "S"(new_h)); |
1286 | asm_inline("int $0x40" ::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w), "S"(new_h)); |
Line 1257... | Line 1287... | ||
1257 | } |
1287 | } |
Line 1289... | Line 1319... | ||
1289 | 1319 | ||
Line 1290... | Line 1320... | ||
1290 | /*====== Function 68, subfunction 14 - Wait signal from other applications/drivers. =====*/ |
1320 | /*====== Function 68, subfunction 14 - Wait signal from other applications/drivers. =====*/ |
1291 | 1321 | ||
- | 1322 | KOSAPI void _ksys_wait_signal(ksys_signal_info_t* signal) |
|
- | 1323 | { |
|
- | 1324 | asm_inline( |
|
1292 | KOSAPI void _ksys_wait_signal(ksys_signal_info_t* signal) |
1325 | "int $0x40" |
- | 1326 | : |
|
1293 | { |
1327 | : "a"(68), "b"(14), "c"(signal) |
Line 1294... | Line 1328... | ||
1294 | asm_inline("int $0x40" :: "a"(68),"b"(14),"c"(signal) : "memory"); |
1328 | : "memory"); |
Line 1295... | Line 1329... | ||
1295 | } |
1329 | } |
Line 1570... | Line 1604... | ||
1570 | 1604 | ||
Line 1571... | Line 1605... | ||
1571 | /*============= Function 71, subfunction 1 - set window title =============*/ |
1605 | /*============= Function 71, subfunction 1 - set window title =============*/ |
1572 | 1606 | ||
- | 1607 | KOSAPI void _ksys_set_window_title(const char* title) |
|
- | 1608 | { |
|
- | 1609 | asm_inline( |
|
1573 | KOSAPI void _ksys_set_window_title(const char* title) |
1610 | "int $0x40" |
1574 | { |
1611 | : |
1575 | asm_inline("int $0x40" ::"a"(71), "b"(1), "c"(title) |
1612 | : "a"(71), "b"(1), "c"(title) |
Line 1576... | Line 1613... | ||
1576 | : "memory"); |
1613 | : "memory"); |
Line 1577... | Line 1614... | ||
1577 | } |
1614 | } |
Line 1578... | Line 1615... | ||
1578 | 1615 | ||
- | 1616 | #define _ksys_clear_window_title() _ksys_set_window_title(NULL) |
|
1579 | #define _ksys_clear_window_title() _ksys_set_window_title(NULL) |
1617 | |
1580 | 1618 | /*============= Function 77, subfunction 0 - create futex object =============*/ |
|
1581 | /*============= Function 77, subfunction 0 - create futex object =============*/ |
1619 | |
1582 | 1620 | KOSAPI void* _ksys_futex_create(void* futex_control_addr) |
|
1583 | KOSAPI void* _ksys_futex_create(void* futex_control_addr) { |
1621 | { |
Line 1590... | Line 1628... | ||
1590 | return futex_desc; |
1628 | return futex_desc; |
1591 | } |
1629 | } |
Line 1592... | Line 1630... | ||
1592 | 1630 | ||
Line 1593... | Line 1631... | ||
1593 | /*============= Function 77, subfunction 1 - destroy futex object =============*/ |
1631 | /*============= Function 77, subfunction 1 - destroy futex object =============*/ |
- | 1632 | ||
1594 | 1633 | KOSAPI int _ksys_futex_destroy(void* futex_desc) |
|
1595 | KOSAPI int _ksys_futex_destroy(void* futex_desc) { |
1634 | { |
1596 | int res; |
1635 | int res; |
1597 | asm_inline( |
1636 | asm_inline( |
1598 | "int $0x40" |
1637 | "int $0x40" |
Line 1602... | Line 1641... | ||
1602 | return res; |
1641 | return res; |
1603 | } |
1642 | } |
Line 1604... | Line 1643... | ||
1604 | 1643 | ||
Line 1605... | Line 1644... | ||
1605 | /*============= Function 77, subfunction 2 - futex wait =============*/ |
1644 | /*============= Function 77, subfunction 2 - futex wait =============*/ |
- | 1645 | ||
1606 | 1646 | KOSAPI int _ksys_futex_wait(void* futex_desc, int control_val, int timeout) |
|
1607 | KOSAPI int _ksys_futex_wait(void* futex_desc, int control_val, int timeout) { |
1647 | { |
1608 | int res; |
1648 | int res; |
1609 | asm_inline( |
1649 | asm_inline( |
1610 | "int $0x40" |
1650 | "int $0x40" |
Line 1614... | Line 1654... | ||
1614 | return res; |
1654 | return res; |
1615 | } |
1655 | } |
Line 1616... | Line 1656... | ||
1616 | 1656 | ||
Line 1617... | Line 1657... | ||
1617 | /*============= Function 77, subfunction 3 - futex wake =============*/ |
1657 | /*============= Function 77, subfunction 3 - futex wake =============*/ |
- | 1658 | ||
1618 | 1659 | KOSAPI int _ksys_futex_wake(void* futex_desc, int max_wake_count) |
|
1619 | KOSAPI int _ksys_futex_wake(void* futex_desc, int max_wake_count) { |
1660 | { |
1620 | int count; |
1661 | int count; |
1621 | asm_inline( |
1662 | asm_inline( |
1622 | "int $0x40" |
1663 | "int $0x40" |