/*     paload
*
*  Program to load binary file into Sun's hardware lookup table.
*  Includes all 256 entries, including 0 and 1, the console colors.
*
*   Tim Krauskopf    August, 1987
*   National Center for Supercomputing Applications
*   University of Illinois
*   This program is in the public domain
*
*/
#include "pixrect/pixrect_hs.h"
#include "stdio.h"

char rmap[256],bmap[256],gmap[256];

struct pixrect *screen;

FILE *fp;

main(argc,argv)
	int argc;
	char *argv[];
	{
	register i;

	if (argc < 2) {
		printf("\n Usage: %s file \n",argv[0]);
		exit(1);
	}

	screen = pr_open("/dev/fb");

    if (NULL == (fp = fopen(argv[1],"r"))) {
        puts("Error on palette file open ");
        exit(2);
    }
        fread(rmap,1,256,fp);
        fread(gmap,1,256,fp);
        fread(bmap,1,256,fp);

	
   fclose(fp);

	pr_putcolormap(screen,0,256,rmap,gmap,bmap);


	pr_close(screen);

}

