home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / animutil / pvquan / vga / vga_pal.c < prev    next >
C/C++ Source or Header  |  1992-11-30  |  2KB  |  40 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  *                  Copyright (c) 1991, Frank van der Hulst             *
  4.  *                          All Rights Reserved                         *
  5.  *                                                                      *
  6.  * Authors:                                                             *
  7.  *          FvdH - Frank van der Hulst (Wellington, NZ)                     *
  8.  *                                                                      *
  9.  * Versions:                                                            *
  10.  *    V1.1 910626 FvdH - QUANT released for DBW_RENDER                    *
  11.  *    V1.2 911021 FvdH - QUANT released for PoV Ray                      *
  12.  *    V1.3 911030 FvdH - Added 320x200x256x4 pages support                    *
  13.  *                                                                      *
  14.  ************************************************************************/
  15. /*
  16.  
  17. VGA 256 colour palette setting module.
  18.  
  19. */
  20.  
  21. #include <dos.h>
  22.  
  23. #include "vga.h"
  24.  
  25. /* Setvgapalette sets the given number of VGA colours */
  26. /* palette contains RGB values for 'colours' colours  */
  27. /* R,G,B values range from 0 to 63                      */
  28.  
  29. void setvgapalette(PALETTE *palette, int colours)
  30. {
  31.   struct REGPACK reg;
  32.  
  33.   reg.r_ax = 0x1012;
  34.   reg.r_bx = 0;
  35.   reg.r_cx = colours;
  36.   reg.r_es = FP_SEG(palette);
  37.   reg.r_dx = FP_OFF(palette);
  38.   intr(0x10, ®);
  39. }
  40.