#include <dos.h>

#ifdef WATCOM

#include <graph.h>
#include "vogle.h"

#else

union REGS inregs, outregs;
static	unsigned  pal[17] = {0, 4, 2, 14, 1, 5, 3, 7,
	      		     12, 10, 6, 9, 11, 13, 14, 15, 0};
#endif

extern	unsigned	int	_cur_color;

void  vega_color(i)
int	i;
{
  _cur_color = (unsigned)i;
}

void vega_setpal()
{
  unsigned	i;
  
#ifdef WATCOM
  _remappalette( (short) BLACK,_BLACK);
  _remappalette( (short) RED,_RED);
  _remappalette( (short) GREEN,_GREEN);
  _remappalette( (short) YELLOW,_YELLOW);
  _remappalette( (short) BLUE,_BLUE);
  _remappalette( (short) MAGENTA,_MAGENTA);
  _remappalette( (short) CYAN,_CYAN);
  _remappalette( (short) WHITE,_WHITE);
#else
  for (i = 0; i < 16; i++) {
    inregs.h.ah = 0x10;
    inregs.h.al = 0;
    inregs.h.bl = i;
    inregs.h.bh = pal[i];
    int86(0x10, &inregs, &outregs);
  }
#endif
}
