2021-06-11 00:27:24 +02:00
|
|
|
// demonstration conio use, color text
|
|
|
|
// more info in conio.h
|
|
|
|
|
|
|
|
#include <conio.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2022-04-15 11:11:49 +02:00
|
|
|
if (con_init())
|
|
|
|
return 1; // init fail
|
2022-05-10 20:58:40 +02:00
|
|
|
(*con_set_title)("Console colors");
|
2021-06-11 00:27:24 +02:00
|
|
|
|
2022-04-15 11:11:49 +02:00
|
|
|
// con_write_asciiz("\033[0;31;42m test \n"); // red on green bk
|
2021-06-11 00:27:24 +02:00
|
|
|
|
2022-04-15 11:11:49 +02:00
|
|
|
for (int i = 30; i < 48; i++) {
|
|
|
|
(*con_printf)("\033[%dmColor 0x%02X: ", i, i);
|
2021-06-11 00:27:24 +02:00
|
|
|
(*con_write_asciiz)("Text sample.");
|
|
|
|
(*con_printf)(" printf %s test %d\n", "small", i);
|
|
|
|
}
|
|
|
|
|
|
|
|
(*con_exit)(0);
|
|
|
|
}
|