aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu/libmenu/com32io.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/cmenu/libmenu/com32io.c')
-rw-r--r--com32/cmenu/libmenu/com32io.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/com32/cmenu/libmenu/com32io.c b/com32/cmenu/libmenu/com32io.c
index 3c4f9219..b910959f 100644
--- a/com32/cmenu/libmenu/com32io.c
+++ b/com32/cmenu/libmenu/com32io.c
@@ -18,104 +18,6 @@
com32sys_t inreg, outreg; // Global register sets for use
-/**
- * cprint_vga2ansi - given a VGA attribute, print a character
- * @chr: character to print
- * @attr: vga attribute
- *
- * Convert the VGA attribute @attr to an ANSI escape sequence and
- * print it.
- **/
-static void cprint_vga2ansi(const char chr, const char attr)
-{
- static const char ansi_char[8] = "04261537";
- static uint8_t last_attr = 0x300;
- char buf[16], *p;
-
- if (attr != last_attr) {
- p = buf;
- *p++ = '\033';
- *p++ = '[';
-
- if (last_attr & ~attr & 0x88) {
- *p++ = '0';
- *p++ = ';';
- /* Reset last_attr to unknown to handle
- * background/foreground attributes correctly */
- last_attr = 0x300;
- }
- if (attr & 0x08) {
- *p++ = '1';
- *p++ = ';';
- }
- if (attr & 0x80) {
- *p++ = '4';
- *p++ = ';';
- }
- if ((attr ^ last_attr) & 0x07) {
- *p++ = '3';
- *p++ = ansi_char[attr & 7];
- *p++ = ';';
- }
- if ((attr ^ last_attr) & 0x70) {
- *p++ = '4';
- *p++ = ansi_char[(attr >> 4) & 7];
- *p++ = ';';
- }
- p[-1] = 'm'; /* We'll have generated at least one semicolon */
- p[0] = '\0';
-
- last_attr = attr;
-
- fputs(buf, stdout);
- }
-
- putchar(chr);
-}
-
-/**
- * cprint - given a VGA attribute, print a single character at cursor
- * @chr: character to print
- * @attr: VGA attribute
- * @times: number of times to print @chr
- *
- * Note: @attr is a VGA attribute.
- **/
-void cprint(const char chr, const char attr, unsigned int times)
-{
- while (times--)
- cprint_vga2ansi(chr, attr);
-}
-
-/**
- * csprint - given a VGA attribute, print a NULL-terminated string
- * @str: string to print
- * @attr: VGA attribute
- **/
-void csprint(const char *str, const char attr)
-{
- while (*str) {
- cprint(*str, attr, 1);
- str++;
- }
-}
-
-/**
- * clearwindow - fill a given a region on the screen
- * @top, @left, @bot, @right: coordinates to fill
- * @fillchar: character to use to fill the region
- * @fillattr: character attribute (VGA)
- **/
-void clearwindow(const char top, const char left, const char bot,
- const char right, const char fillchar, const char fillattr)
-{
- char x;
- for (x = top; x < bot + 1; x++) {
- gotoxy(x, left);
- cprint(fillchar, fillattr, right - left + 1);
- }
-}
-
void getpos(char *row, char *col, char page)
{
REG_AH(inreg) = 0x03;