diff --git a/programs/develop/ktcc/trunk/libc.obj/include/sys/ksys.h b/programs/develop/ktcc/trunk/libc.obj/include/sys/ksys.h index ee2489eee7..c6e3c32aa4 100644 --- a/programs/develop/ktcc/trunk/libc.obj/include/sys/ksys.h +++ b/programs/develop/ktcc/trunk/libc.obj/include/sys/ksys.h @@ -314,6 +314,20 @@ void _ksys_delay(uint32_t time){ ); } +/*=============== Function 7 - draw image in the window. ===============*/ + +static inline +void _ksys_draw_bitmap(void *bitmap, int x, int y, int w, int h) +{ + asm_inline( + "int $0x40" + ::"a"(7), "b"(bitmap), + "c"((w << 16) | h), + "d"((x << 16) | y) + :"memory" + ); +} + /*=============== Function 8 - define/delete the button. ===============*/ static inline @@ -1404,8 +1418,6 @@ int _ksys_file_rename(const char *name, const char *new_name) /* ######### Old names of functions and structures. Do not use again! ##########*/ -#define ksys_coff_etable_t ksys_dll_t -#define ksys_proc_table_t ksys_thread_t #define _ksys_get_event _ksys_wait_event #endif // _KSYS_H_ diff --git a/programs/develop/ktcc/trunk/libc.obj/linuxtools/src/ExportGen.c b/programs/develop/ktcc/trunk/libc.obj/linuxtools/src/ExportGen.c index 97078eb9a1..182aaee750 100755 --- a/programs/develop/ktcc/trunk/libc.obj/linuxtools/src/ExportGen.c +++ b/programs/develop/ktcc/trunk/libc.obj/linuxtools/src/ExportGen.c @@ -26,7 +26,7 @@ int main(int argc, char** argv) { "#include \n\n" \ "#include \n\n" \ "#include \n\n" \ - "ksys_coff_etable_t EXPORTS[] = {\n"); + "ksys_dll_t EXPORTS[] = {\n"); // Generate char symbol[256]; diff --git a/programs/develop/ktcc/trunk/libc.obj/samples/basic_gui.c b/programs/develop/ktcc/trunk/libc.obj/samples/basic_gui.c index f6abe472db..f4d930f67a 100644 --- a/programs/develop/ktcc/trunk/libc.obj/samples/basic_gui.c +++ b/programs/develop/ktcc/trunk/libc.obj/samples/basic_gui.c @@ -7,7 +7,7 @@ ksys_colors_table_t sys_color_table; char statusbar[255]; -ksys_proc_table_t proc_info; +ksys_thread_t proc_info; char text_line[255]; enum BUTTONS @@ -29,7 +29,7 @@ void draw_window() _ksys_start_draw(); // define&draw window _ksys_create_window(10, 40, 600, 400, "My window", sys_color_table.work_area, 0x13); - _ksys_process_info(&proc_info, -1); + _ksys_thread_info(&proc_info, -1); win_width = proc_info.winx_size; win_hight = proc_info.winy_size; diff --git a/programs/develop/ktcc/trunk/libc.obj/samples/tmpdisk_work.c b/programs/develop/ktcc/trunk/libc.obj/samples/tmpdisk_work.c index df3b378cb1..f57fa909de 100644 --- a/programs/develop/ktcc/trunk/libc.obj/samples/tmpdisk_work.c +++ b/programs/develop/ktcc/trunk/libc.obj/samples/tmpdisk_work.c @@ -46,7 +46,7 @@ int main(){ ioctl.out_data_size = 0; printf("Create '/tmp%u/' disk a %u Mb size...\n", tmpdisk_add.disk_id, TMPDISK_SIZE); - unsigned status =_ksys_work_driver(&ioctl); + unsigned status =_ksys_driver_control(&ioctl); if(status<7){ puts(tmpdisk_res_text[status]); }else{ diff --git a/programs/develop/ktcc/trunk/libc.obj/source/stdio/conio.c b/programs/develop/ktcc/trunk/libc.obj/source/stdio/conio.c index 8d1aafb377..c99924ecaa 100644 --- a/programs/develop/ktcc/trunk/libc.obj/source/stdio/conio.c +++ b/programs/develop/ktcc/trunk/libc.obj/source/stdio/conio.c @@ -27,40 +27,40 @@ void stdcall (*con_cls)(); void stdcall (*con_get_cursor_pos)(int* px, int* py); void stdcall (*con_set_cursor_pos)(int x, int y); -static void __con_panic(char* func_name) +/*static void __con_panic(char* func_name) { debug_printf("In console.obj %s=NULL!\n", func_name); _ksys_exit(); -} +}*/ -static void __con_lib_link(ksys_coff_etable_t *exp) +static void __con_lib_link(ksys_dll_t *exp) { - __con_init_hidden = _ksys_get_coff_func(exp, "con_init", __con_panic); - con_exit = _ksys_get_coff_func(exp, "con_exit", __con_panic); - con_set_title = _ksys_get_coff_func(exp, "con_set_title", __con_panic); - con_write_asciiz = _ksys_get_coff_func(exp, "con_write_asciiz", __con_panic); - con_write_string = _ksys_get_coff_func(exp, "con_write_string", __con_panic); - con_printf = _ksys_get_coff_func(exp, "con_printf", __con_panic); - con_get_flags = _ksys_get_coff_func(exp, "con_get_flags", __con_panic); - con_set_flags = _ksys_get_coff_func(exp, "con_set_flags", __con_panic); - con_get_font_height = _ksys_get_coff_func(exp, "con_get_font_height", __con_panic); - con_get_cursor_height = _ksys_get_coff_func(exp, "con_get_cursor_height", __con_panic); - con_set_cursor_height = _ksys_get_coff_func(exp, "con_set_cursor_height", __con_panic); - con_getch = _ksys_get_coff_func(exp, "con_getch", __con_panic); - con_getch2 = _ksys_get_coff_func(exp, "con_getch2", __con_panic); - con_kbhit = _ksys_get_coff_func(exp, "con_kbhit", __con_panic); - con_gets = _ksys_get_coff_func(exp, "con_gets", __con_panic); - con_gets2 = _ksys_get_coff_func(exp, "con_gets2", __con_panic); - con_cls = _ksys_get_coff_func(exp, "con_cls", __con_panic); - con_get_cursor_pos = _ksys_get_coff_func(exp, "con_get_cursor_pos", __con_panic); - con_set_cursor_pos = _ksys_get_coff_func(exp, "con_set_cursor_pos", __con_panic); + __con_init_hidden = _ksys_dlsym(exp, "con_init"); + con_exit = _ksys_dlsym(exp, "con_exit"); + con_set_title = _ksys_dlsym(exp, "con_set_title"); + con_write_asciiz = _ksys_dlsym(exp, "con_write_asciiz"); + con_write_string = _ksys_dlsym(exp, "con_write_string"); + con_printf = _ksys_dlsym(exp, "con_printf"); + con_get_flags = _ksys_dlsym(exp, "con_get_flags"); + con_set_flags = _ksys_dlsym(exp, "con_set_flags"); + con_get_font_height = _ksys_dlsym(exp, "con_get_font_height"); + con_get_cursor_height = _ksys_dlsym(exp, "con_get_cursor_height"); + con_set_cursor_height = _ksys_dlsym(exp, "con_set_cursor_height"); + con_getch = _ksys_dlsym(exp, "con_getch"); + con_getch2 = _ksys_dlsym(exp, "con_getch2"); + con_kbhit = _ksys_dlsym(exp, "con_kbhit"); + con_gets = _ksys_dlsym(exp, "con_gets"); + con_gets2 = _ksys_dlsym(exp, "con_gets2"); + con_cls = _ksys_dlsym(exp, "con_cls"); + con_get_cursor_pos = _ksys_dlsym(exp, "con_get_cursor_pos"); + con_set_cursor_pos = _ksys_dlsym(exp, "con_set_cursor_pos"); } int con_init_opt(dword wnd_width, dword wnd_height, dword scr_width, dword scr_height, const char* title) { if(!__con_is_load){ - ksys_coff_etable_t *__con_lib; - __con_lib = _ksys_load_coff(__con_dllname); + ksys_dll_t *__con_lib; + __con_lib = _ksys_dlopen(__con_dllname); if(__con_lib==NULL){ _ksys_debug_puts("Error! Can't load console.obj lib\n"); return 1; diff --git a/programs/develop/ktcc/trunk/libc.obj/source/stdio/tmpnam.c b/programs/develop/ktcc/trunk/libc.obj/source/stdio/tmpnam.c index ff13759c4d..40375ccdac 100644 --- a/programs/develop/ktcc/trunk/libc.obj/source/stdio/tmpnam.c +++ b/programs/develop/ktcc/trunk/libc.obj/source/stdio/tmpnam.c @@ -6,11 +6,11 @@ static char buf[FILENAME_MAX + 1]; static int static_index = 0; char *tmpnam(char *name) { - ksys_proc_table_t table; - _ksys_process_info(&table, -1); + ksys_thread_t table; + _ksys_thread_info(&table, -1); char *out = name ? name : buf; // PID is also unique for each thread sprintf(out, "/tmp0/1/%x_%x.tmp", table.pid, static_index++); return out; -} \ No newline at end of file +} diff --git a/programs/develop/ktcc/trunk/libc.obj/source/time/time.c b/programs/develop/ktcc/trunk/libc.obj/source/time/time.c index 61f0af450e..1e772dfd1f 100644 --- a/programs/develop/ktcc/trunk/libc.obj/source/time/time.c +++ b/programs/develop/ktcc/trunk/libc.obj/source/time/time.c @@ -6,7 +6,7 @@ static struct tm __buffertime; time_t time(time_t *timer){ int kos_date, kos_time; kos_date = _ksys_get_date().val; - kos_time = _ksys_get_clock(); + kos_time = _ksys_get_time().val; int bcd_day = (kos_date >> 16); int bcd_mon = ((kos_date & 0xFF00) >> 8);