X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=inline;f=second%2Fgui%2Fpcx.c;fp=second%2Fgui%2Fpcx.c;h=0509777d96e5f7dbdc59933c0795108c9310e85c;hb=f4ebbd9f7ea23e3f0fcbe098754580c220894628;hp=0000000000000000000000000000000000000000;hpb=f42aaadb5c8c5f7f15e5159cbc251e64e1a4ac8f;p=yaboot.git diff --git a/second/gui/pcx.c b/second/gui/pcx.c new file mode 100644 index 0000000..0509777 --- /dev/null +++ b/second/gui/pcx.c @@ -0,0 +1,31 @@ +/* Crude PCX file loading and display for 640x480 image at boot */ + +unsigned char *pcxColormap(unsigned char *gfx_file, int gfx_len) +{ + return(gfx_file + gfx_len - 768); +} + +extern void scrPutPixel( int x, int y, unsigned char c ); + +static void inline do_putpixel(int offset, unsigned char c) +{ + scrPutPixel(offset % 640, offset / 640, c); +} + +void pcxDisplay(unsigned char *gfx_file, unsigned gfx_len) +{ + int offset, file_offset, i, c, f; + + for(offset = 0, file_offset = 128; offset < 640 * 480 && file_offset < gfx_len - 769; file_offset++) + { + if(((c = gfx_file[file_offset]) & 0xc0) == 0xc0) + { + f = gfx_file[++file_offset]; + c &= 0x3f; + for(i = 0; i < c; ++i) + do_putpixel(offset++, f); + } + else + do_putpixel(offset++, c); + } +}