diff --git a/xtandard.c b/xtandard.c index d643f8a..35097be 100644 --- a/xtandard.c +++ b/xtandard.c @@ -656,27 +656,27 @@ void memory_copy (void * memory, void * source, int length) { } void terminal_clear (void) { - out ("\033[2J\033[H", 7); + echo ("\033[2J\033[H"); } -void terminal_style (int effect, int colour) { +void terminal_colour (int colour, int effect) { char format [8] = "\033[ ;3 m"; - if ((effect == -1) || (colour == -1)) { - out ("\033[0m", 4); - } else { - format [2] = (char) (effect % EFFECT_COUNT) + '0'; - format [5] = (char) (colour % COLOUR_COUNT) + '0'; + format [2] = (char) (effect % EFFECT_COUNT) + '0'; + format [5] = (char) (colour % COLOUR_COUNT) + '0'; - out (format, 7); - } + echo (format); +} + +void terminal_cancel (void) { + echo ("\033[0m"); } void terminal_show_cursor (int show) { if (show != 0) { - out ("\033[?25h", 6); + echo ("\033[?25h"); } else { - out ("\033[?25l", 6); + echo ("\033[?25l"); } } diff --git a/xtandard.h b/xtandard.h index a1d4c0a..4eed4d0 100644 --- a/xtandard.h +++ b/xtandard.h @@ -140,7 +140,8 @@ extern int memory_compare (void *, void *, int); extern void memory_copy (void *, void *, int); extern void terminal_clear (void); -extern void terminal_style (int, int); +extern void terminal_colour (int, int); +extern void terminal_cancel (void); extern void terminal_show_cursor (int); extern int encode_byte (char *);