Category : Miscellaneous Language Source Code
Archive   : SVGABG31.ZIP
Filename : VGAPALET.C

 
Output of file : VGAPALET.C contained in archive : SVGABG31.ZIP
/************************************************/
/* */
/* SuperVGA BGI driver defines */
/* Copyright (c) 1991 */
/* Jordan Hargraphix Software */
/* */
/************************************************/

#include
#include "svga16.h"
#include "svga256.h"
#include "twk16.h"
#include "twk256.h"
#include "svga32k.h"

/* Getvgapalette16 gets the entire 16 color palette */
/* PalBuf contains RGB values for all 16 colors */
/* R,G,B values range from 0 to 63 */
/* Usage: */
/* DacPalette16 dac16; */
/* */
/* getvgapalette(&dac16); */
void getvgapalette16(DacPalette16 *PalBuf)
{
struct REGPACK reg;

reg.r_ax = 0x1017;
reg.r_bx = 0;
reg.r_cx = 16;
reg.r_es = FP_SEG(PalBuf);
reg.r_dx = FP_OFF(PalBuf);
intr(0x10,®);
}

/* Getvgapalette256 gets the entire 256 color palette */
/* PalBuf contains RGB values for all 256 colors */
/* R,G,B values range from 0 to 63 */
/* Usage: */
/* DacPalette256 dac256; */
/* */
/* getvgapalette256(&dac256); */
void getvgapalette256(DacPalette256 *PalBuf)
{
struct REGPACK reg;

reg.r_ax = 0x1017;
reg.r_bx = 0;
reg.r_cx = 256;
reg.r_es = FP_SEG(PalBuf);
reg.r_dx = FP_OFF(PalBuf);
intr(0x10,®);
}

/* Setvgapalette16 sets the entire 16 color palette */
/* PalBuf contains RGB values for all 16 colors */
/* R,G,B values range from 0 to 63 */
/* Usage: */
/* DacPalette16 dac16; */
/* */
/* setvgapalette(&dac16); */
void setvgapalette16(DacPalette16 *PalBuf)
{
struct REGPACK reg;

reg.r_ax = 0x1012;
reg.r_bx = 0;
reg.r_cx = 16;
reg.r_es = FP_SEG(PalBuf);
reg.r_dx = FP_OFF(PalBuf);
intr(0x10,®);
}

/* Setvgapalette256 sets the entire 256 color palette */
/* PalBuf contains RGB values for all 256 colors */
/* R,G,B values range from 0 to 63 */
/* Usage: */
/* DacPalette256 dac256; */
/* */
/* setvgapalette256(&dac256); */
void setvgapalette256(DacPalette256 *PalBuf)
{
struct REGPACK reg;

reg.r_ax = 0x1012;
reg.r_bx = 0;
reg.r_cx = 256;
reg.r_es = FP_SEG(PalBuf);
reg.r_dx = FP_OFF(PalBuf);
intr(0x10,®);
}


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : SVGABG31.ZIP
Filename : VGAPALET.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/