Updated cancerous stuff...

This commit is contained in:
Ognjen Milan Robovic 2023-09-20 06:27:59 -04:00
parent 75e4a68b95
commit 1d9f128c1d
2 changed files with 13 additions and 12 deletions

View File

@ -656,27 +656,27 @@ void memory_copy (void * memory, void * source, int length) {
} }
void terminal_clear (void) { 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"; char format [8] = "\033[ ;3 m";
if ((effect == -1) || (colour == -1)) {
out ("\033[0m", 4);
} else {
format [2] = (char) (effect % EFFECT_COUNT) + '0'; format [2] = (char) (effect % EFFECT_COUNT) + '0';
format [5] = (char) (colour % COLOUR_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) { void terminal_show_cursor (int show) {
if (show != 0) { if (show != 0) {
out ("\033[?25h", 6); echo ("\033[?25h");
} else { } else {
out ("\033[?25l", 6); echo ("\033[?25l");
} }
} }

View File

@ -140,7 +140,8 @@ extern int memory_compare (void *, void *, int);
extern void memory_copy (void *, void *, int); extern void memory_copy (void *, void *, int);
extern void terminal_clear (void); 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 void terminal_show_cursor (int);
extern int encode_byte (char *); extern int encode_byte (char *);