All current x86 BIOS's use textmode (if any of you find any exceptions,
please tell me). Even the Energy Star logo (or the Packard Bell logo,
or the Compaq logo, etc) is *text* (8x14 pixel chars) and is done by
remapping the character set to look like graphics. They even did the
fading bit in textmode. Even AMI's WinBIOS is done the same way, and
boy does that wiggling mouse cursor look stupid :) (for those with older
winbios's, they recently made the stem of the arrow wiggle back and forth)
Proof:
http://www.kaotica.com/asus/
And a quickie Linux viewer made by a friend (roler@primenet.com) a while
back (needs console, will remap your console font, should clean up after
itself, but be prepared :)
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/kd.h>
#include <sys/stat.h>
#include <unistd.h>
#include "fcntl.h"
unsigned char bow[8192], buf[8192], cols[155];
main(int argc, char **argv)
{
FILE *fh;
int d = 33, x, y, i, fd, o = 1;
struct stat fstatus;
if (argc != 2) {
printf("Syntax: %s filename.epa!\n", argv[0]);
exit(1);
}
fd = open("/dev/tty", O_RDWR);
memset(buf, 0, sizeof(buf));
// Next 2 lines are for reading the font
ioctl(fd, GIO_FONT, buf);
memcpy(&bow, &buf, 8192); // Save original font
fh = fopen(argv[1], "r");
fstat(fileno(fh), &fstatus);
if (fstatus.st_size != 2367) {
printf("This does not look like a .epa file!\n");
exit(1);
}
fread(&cols, 1, 155, fh);
printf("\e[2J\e[H");
for (y = 1; y <= 9; y++)
for (x = 1; x <= 17; x++) {
for (i = 0; i < 14; i++)
buf[(d * 32) + i] = fgetc(fh);
buf[(d * 32) + 14] = 0;
buf[(d * 32) + 15] = 0;
color(cols[++o]);
/* first char in this printf is an escape,
if mail eats it, recreate it */
printf("[%d;%dH%c", y, x, d);
// Skip undisplayable chars
if (d++ == 154 || d == 127)
d++;
}
fclose(fh);
ioctl(fd, PIO_FONT, buf); // This line sets the font
getchar();
memcpy(&buf, &bow, 8192); // Restore original font
ioctl(fd, PIO_FONT, buf);
printf("\e[2J\e[H\e[0;37mThanks for using .epa view...\n");
}
color(int a) // Changes colors
{
switch (a) {
case 0:
printf("\e[0;30m");
break;
case 1:
printf("\e[0;34m");
break;
case 2:
printf("\e[0;32m");
break;
case 3:
printf("\e[0;36m");
break;
case 4:
printf("\e[0;31m");
break;
case 5:
printf("\e[0;35m");
break;
case 6:
printf("\e[0;33m");
break;
case 7:
printf("\e[0;37m");
break;
case 8:
printf("\e[1;30m");
break;
case 9:
printf("\e[1;34m");
break;
case 10:
printf("\e[1;32m");
break;
case 11:
printf("\e[1;36m");
break;
case 12:
printf("\e[1;31m");
break;
case 13:
printf("\e[1;35m");
break;
case 14:
printf("\e[1;33m");
break;
case 15:
printf("\e[1;37m");
break;
}
}
-- Robert Woodcock - rcw@oz.net All I want is a warm bed and a kind word and unlimited power. -- Ashleigh Brilliant- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu