From 5674a7aa14a7e7c24e18c3801bcc618d21a10d8c Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 7 Nov 2016 17:49:22 +0000 Subject: [PATCH] fix console.h, add console example git-svn-id: svn://kolibrios.org@6685 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/examples/Tupfile.lua | 1 + programs/cmm/examples/compile_en.bat | 3 ++- programs/cmm/examples/console.c | 18 ++++++++++++++++++ programs/cmm/lib/obj/console.h | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 programs/cmm/examples/console.c diff --git a/programs/cmm/examples/Tupfile.lua b/programs/cmm/examples/Tupfile.lua index dd9ff3d2d1..65b13ccf1c 100644 --- a/programs/cmm/examples/Tupfile.lua +++ b/programs/cmm/examples/Tupfile.lua @@ -7,3 +7,4 @@ tup.rule("window.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_ tup.rule("collections.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "collections.com") tup.rule("menu.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "menu.com") tup.rule("rgb.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "rgb.com") +tup.rule("console.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "console.com") diff --git a/programs/cmm/examples/compile_en.bat b/programs/cmm/examples/compile_en.bat index cba7f6bc96..3c16a59b9d 100644 --- a/programs/cmm/examples/compile_en.bat +++ b/programs/cmm/examples/compile_en.bat @@ -1,9 +1,10 @@ @del *.kex -@c-- window.c @c-- collections.c +@c-- console.c @c-- menu.c @c-- rgb.c +@c-- window.c @rename *.com *.kex @mkdir bin diff --git a/programs/cmm/examples/console.c b/programs/cmm/examples/console.c new file mode 100644 index 0000000000..17aed7a25f --- /dev/null +++ b/programs/cmm/examples/console.c @@ -0,0 +1,18 @@ +/* + * Console example in C-- +*/ + +#define MEMSIZE 4096*10 + +#include "../lib/obj/console.h" + +void main() +{ + load_dll(libConsole, #con_init, 0); + con_init stdcall (-1, -1, -1, -1, "Hello"); + con_set_flags stdcall (0x1F); + con_write_string stdcall ("Console test", 12); + con_exit stdcall (0); + ExitProcess(); +} + diff --git a/programs/cmm/lib/obj/console.h b/programs/cmm/lib/obj/console.h index 51e8f64d5e..12c768537c 100644 --- a/programs/cmm/lib/obj/console.h +++ b/programs/cmm/lib/obj/console.h @@ -50,7 +50,7 @@ char a_con_gets[] = "con_gets"; char a_con_gets2[] = "con_gets2"; char a_con_get_font_height[] = "con_get_font_height"; char a_con_get_cursor_height[] = "con_get_cursor_height"; -char a_con_set_cursor_height[] = "con_ges_focursoreight"; +char a_con_set_cursor_height[] = "con_set_cursor_height"; char a_con_cls[] = "con_cls"; char a_con_get_cursor_pos[] = "con_get_cursor_pos"; char a_con_set_cursor_pos[] = "con_set_cursor_pos";