First commit 16/09/1994
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								BGI/DEMO.EXE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								BGI/DEMO.EXE
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										108
									
								
								BGI/INITSVGA.C
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								BGI/INITSVGA.C
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,108 @@
 | 
			
		||||
/* Sample program that initializes the SuperVGA driver */
 | 
			
		||||
 | 
			
		||||
#include <graphics.h>
 | 
			
		||||
 | 
			
		||||
extern int far Svga16_fdriver[];
 | 
			
		||||
extern int far Svga256_fdriver[];
 | 
			
		||||
extern int far Twk16_fdriver[];
 | 
			
		||||
extern int far Twk256_fdriver[];
 | 
			
		||||
 | 
			
		||||
int huge DetectVGA256()
 | 
			
		||||
{
 | 
			
		||||
  int Vid;
 | 
			
		||||
 | 
			
		||||
  printf("Which video mode would you like to use? \n");
 | 
			
		||||
  printf("  0) 320x200x256\n");
 | 
			
		||||
  printf("  1) 640x400x256\n");
 | 
			
		||||
  printf("  2) 640x480x256\n");
 | 
			
		||||
  printf("  3) 800x600x256\n");
 | 
			
		||||
  printf("  4) 1024x768x256\n\n>");
 | 
			
		||||
  scanf("%d",&Vid);
 | 
			
		||||
  return Vid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int huge DetectVGA16()
 | 
			
		||||
{
 | 
			
		||||
  int Vid;
 | 
			
		||||
 | 
			
		||||
  printf("Which video mode would you like to use? \n");
 | 
			
		||||
  printf("  0) 320x200x16\n");
 | 
			
		||||
  printf("  1) 640x200x16\n");
 | 
			
		||||
  printf("  2) 640x350x16\n");
 | 
			
		||||
  printf("  3) 640x480x256\n");
 | 
			
		||||
  printf("  4) 800x600x16\n");
 | 
			
		||||
  printf("  5) 1024x768x16\n\n>");
 | 
			
		||||
  scanf("%d",&Vid);
 | 
			
		||||
  return Vid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int huge DetectTwk16()
 | 
			
		||||
{
 | 
			
		||||
  int Vid;
 | 
			
		||||
 | 
			
		||||
  printf("Which video mode would you like to use? \n");
 | 
			
		||||
  printf("  0) 704x528x16\n");
 | 
			
		||||
  printf("  1) 720x540x16\n");
 | 
			
		||||
  printf("  2) 736x552x16\n");
 | 
			
		||||
  printf("  3) 752x564x16\n");
 | 
			
		||||
  printf("  4) 768x576x16\n");
 | 
			
		||||
  printf("  5) 784x588x16\n");
 | 
			
		||||
  printf("  6) 800x600x16\n\n>");
 | 
			
		||||
  scanf("%d",&Vid);
 | 
			
		||||
  return Vid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
int huge DetectTwk256()
 | 
			
		||||
{
 | 
			
		||||
  int Vid;
 | 
			
		||||
 | 
			
		||||
  printf("Which video mode would you like to use? \n");
 | 
			
		||||
  printf("  0) 320x400x256\n");
 | 
			
		||||
  printf("  1) 320x480x256\n");
 | 
			
		||||
  printf("  2) 360x480x256\n");
 | 
			
		||||
  printf("  3) 376x564x256\n");
 | 
			
		||||
  printf("  4) 400x564x256\n");
 | 
			
		||||
  printf("  5) 400x600x256\n");
 | 
			
		||||
  scanf("%d",&Vid);
 | 
			
		||||
  return Vid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
main()
 | 
			
		||||
{
 | 
			
		||||
  int Gd = DETECT, Gm;
 | 
			
		||||
  int Drv;
 | 
			
		||||
 | 
			
		||||
  printf("Which driver would you like to use?\n");
 | 
			
		||||
  printf("  0) Svga256\n");
 | 
			
		||||
  printf("  1) Svga16\n");
 | 
			
		||||
  printf("  2) Tweak256\n");
 | 
			
		||||
  printf("  3) Tweak16\n");
 | 
			
		||||
  printf(">");
 | 
			
		||||
  scanf("%d",&Drv);
 | 
			
		||||
  switch(Drv)
 | 
			
		||||
  {
 | 
			
		||||
    case 0: installuserdriver("Svga256",DetectVGA256);
 | 
			
		||||
/*  If driver is linked with file, remove comments */
 | 
			
		||||
/*          registerfarbgidriver(Svga256_fdriver); */
 | 
			
		||||
	    break;
 | 
			
		||||
    case 1: installuserdriver("Svga16",DetectVGA16);
 | 
			
		||||
/*  If driver is linked with file, remove comments */
 | 
			
		||||
/*          registerfarbgidriver(Svga16_fdriver);  */
 | 
			
		||||
	    break;
 | 
			
		||||
    case 2: installuserdriver("Twk16",DetectTwk16);
 | 
			
		||||
/*  If driver is linked with file, remove comments */
 | 
			
		||||
/*          registerfarbgidriver(Twk16_fdriver);  */
 | 
			
		||||
	    break;
 | 
			
		||||
    case 3: installuserdriver("Twk256",DetectTwk256);
 | 
			
		||||
/*  If driver is linked with file, remove comments */
 | 
			
		||||
/*          registerfarbgidriver(Twk256_fdriver);  */
 | 
			
		||||
  }
 | 
			
		||||
  initgraph(&Gd,&Gm,"");
 | 
			
		||||
  setcolor(15);
 | 
			
		||||
  line(0,0,getmaxx(),getmaxy());
 | 
			
		||||
  line(0,getmaxy(),getmaxx(),0);
 | 
			
		||||
  getch();
 | 
			
		||||
  closegraph();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										103
									
								
								BGI/INITSVGA.PAS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								BGI/INITSVGA.PAS
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,103 @@
 | 
			
		||||
{ Sample program that initializes the SuperVGA driver}
 | 
			
		||||
Program Test256;
 | 
			
		||||
 | 
			
		||||
Uses Graph,Crt,Dos;
 | 
			
		||||
 | 
			
		||||
{$i svga16.inc}
 | 
			
		||||
{$i svga256.inc}
 | 
			
		||||
 | 
			
		||||
var
 | 
			
		||||
  GraphMode, GraphDriver : integer;
 | 
			
		||||
  Ky : Char;
 | 
			
		||||
  Drv : Integer;
 | 
			
		||||
 | 
			
		||||
{$F+}
 | 
			
		||||
function DetectVGA256 : Integer;
 | 
			
		||||
var Vid : Integer;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  Writeln('Which video mode would you like to use?');
 | 
			
		||||
  Writeln('  0) 320x200x256');
 | 
			
		||||
  Writeln('  1) 640x400x256');
 | 
			
		||||
  Writeln('  2) 640x480x256');
 | 
			
		||||
  Writeln('  3) 800x600x256');
 | 
			
		||||
  Writeln('  4) 1024x768x256');
 | 
			
		||||
  Write('> ');
 | 
			
		||||
  Readln(Vid);
 | 
			
		||||
  DetectVGA256 := Vid;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function DetectVGA16 : Integer;
 | 
			
		||||
var Vid : Integer;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  Writeln('Which video mode would you like to use? ');
 | 
			
		||||
  Writeln('  0) 320x200x16');
 | 
			
		||||
  Writeln('  1) 640x200x16');
 | 
			
		||||
  Writeln('  2) 640x350x16');
 | 
			
		||||
  Writeln('  3) 640x480x256');
 | 
			
		||||
  Writeln('  4) 800x600x16');
 | 
			
		||||
  Writeln('  5) 1024x768x16');
 | 
			
		||||
  Writeln('>');
 | 
			
		||||
  Readln(Vid);
 | 
			
		||||
  DetectVGA16 := Vid;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function DetectTwk256 : Integer;
 | 
			
		||||
var Vid : Integer;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  Writeln('Which video mode would you like to use?');
 | 
			
		||||
  Writeln('  0) 320x400x256');
 | 
			
		||||
  Writeln('  1) 320x480x256');
 | 
			
		||||
  Writeln('  2) 360x480x256');
 | 
			
		||||
  Writeln('  3) 376x564x256');
 | 
			
		||||
  Writeln('  4) 400x564x256');
 | 
			
		||||
  Writeln('  5) 400x600x256');
 | 
			
		||||
  Write('> ');
 | 
			
		||||
  Readln(Vid);
 | 
			
		||||
  DetectTwk256 := Vid;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function DetectTwk16 : Integer;
 | 
			
		||||
var Vid : Integer;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  Writeln('Which video mode would you like to use? ');
 | 
			
		||||
  Writeln('  0) 704x528x16');
 | 
			
		||||
  Writeln('  1) 720x540x16');
 | 
			
		||||
  Writeln('  2) 736x552x16');
 | 
			
		||||
  Writeln('  3) 752x564x256');
 | 
			
		||||
  Writeln('  4) 768x576x16');
 | 
			
		||||
  Writeln('  5) 784x588x16');
 | 
			
		||||
  Writeln('  6) 800x600x16');
 | 
			
		||||
  Writeln('>');
 | 
			
		||||
  Readln(Vid);
 | 
			
		||||
  DetectTwk16 := Vid;
 | 
			
		||||
end;
 | 
			
		||||
{$F-}
 | 
			
		||||
 
 | 
			
		||||
begin
 | 
			
		||||
  Writeln('Which driver would you like to use?');
 | 
			
		||||
  Writeln('  0) Svga256');
 | 
			
		||||
  Writeln('  1) Svga16');
 | 
			
		||||
  Writeln('  2) Tweak256');
 | 
			
		||||
  Writeln('  3) Tweak16');
 | 
			
		||||
  Write('>');
 | 
			
		||||
  Readln(Drv);
 | 
			
		||||
  if (Drv = 0) then
 | 
			
		||||
    GraphDriver := InstallUserDriver('SVGA256',@DetectVGA256)
 | 
			
		||||
  else if (Drv = 1)
 | 
			
		||||
    GraphDriver := InstallUserDriver('SVGA16',@DetectVGA16)
 | 
			
		||||
  else if (Drv = 2)
 | 
			
		||||
    GraphDriver := InstallUserDriver('Twk256',@DetectTwk256)
 | 
			
		||||
  else if (Drv = 3)
 | 
			
		||||
    GraphDriver := InstallUserDriver('Twk16',@DetectTwk16);
 | 
			
		||||
  GraphDriver := Detect;
 | 
			
		||||
  InitGraph(GraphDriver,GraphMode,'');
 | 
			
		||||
  setcolor(15);
 | 
			
		||||
  line(0,0,GetMaxX,GetMaxY);
 | 
			
		||||
  line(0,GetMaxY,GetMaxX,0);
 | 
			
		||||
  Ky := ReadKey;
 | 
			
		||||
  CloseGraph;
 | 
			
		||||
end.
 | 
			
		||||
							
								
								
									
										19
									
								
								BGI/MAKEFILE.SVG
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								BGI/MAKEFILE.SVG
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
## Makefile for initsvga.c (SuperVGA drivers)
 | 
			
		||||
## Demonstrates use of registerfarbgidriver
 | 
			
		||||
PROG 	= initsvga			# Program name to compile
 | 
			
		||||
CC 	= tcc				# Command-line compiler (tcc/bcc)
 | 
			
		||||
LIB 	= e:\lang\lib			# Library directory
 | 
			
		||||
INCLUDE = e:\lang\include		# Include directory
 | 
			
		||||
MODEL	= s				# Memory Model
 | 
			
		||||
 | 
			
		||||
$(PROG).exe: $(PROG).c svga256f.obj svga16f.obj
 | 
			
		||||
	$(CC) -L$(LIB) -I$(INCLUDE) -m$(MODEL) $(PROG).c \
 | 
			
		||||
	svga256f.obj svga16f.obj graphics.lib
 | 
			
		||||
 | 
			
		||||
svga256f.obj : svga256.bgi
 | 
			
		||||
	bgiobj /F svga256.bgi svga256f.obj _Svga256_fdriver SVGA256_TEXT
 | 
			
		||||
 | 
			
		||||
svga16f.obj : svga16.bgi
 | 
			
		||||
	bgiobj /F svga16.bgi svga16f.obj _Svga16_fdriver SVGA16_TEXT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19
									
								
								BGI/MAKEFILE.TWK
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								BGI/MAKEFILE.TWK
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
## Makefile for initsvga.c (Tweaked drivers)
 | 
			
		||||
## Demonstrates use of registerfarbgidriver
 | 
			
		||||
PROG 	= initsvga			# Program name to compile
 | 
			
		||||
CC 	= tcc				# Command-line compiler (tcc/bcc)
 | 
			
		||||
LIB 	= e:\lang\lib			# Library directory
 | 
			
		||||
INCLUDE = e:\lang\include		# Include directory
 | 
			
		||||
MODEL	= s				# Memory Model
 | 
			
		||||
 | 
			
		||||
$(PROG).exe: $(PROG).c twk256f.obj twk16f.obj
 | 
			
		||||
	$(CC) -L$(LIB) -I$(INCLUDE) -m$(MODEL) $(PROG).c \
 | 
			
		||||
	twk256f.obj twk16f.obj graphics.lib
 | 
			
		||||
 | 
			
		||||
twk256f.obj : twk256.bgi
 | 
			
		||||
	bgiobj /F twk256.bgi twk256f.obj _twk256_fdriver TWK256_TEXT
 | 
			
		||||
 | 
			
		||||
twk16f.obj : twk16.bgi
 | 
			
		||||
	bgiobj /F twk16.bgi twk16f.obj _twk16_fdriver TWK16_TEXT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								BGI/NOTES16.SVG
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								BGI/NOTES16.SVG
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
SuperVGA 16 BGI driver
 | 
			
		||||
Version 1.11
 | 
			
		||||
August 20, 1991
 | 
			
		||||
 | 
			
		||||
This is the latest version of my 16 color BGI driver.  All functions have
 | 
			
		||||
been implemented (including paging and floodfill), and should work like
 | 
			
		||||
the EGAVGA driver.
 | 
			
		||||
 | 
			
		||||
	o Fixed getimage bug
 | 
			
		||||
 | 
			
		||||
	o Added new logical operations to putimage:
 | 
			
		||||
	  XNOR_PUT
 | 
			
		||||
	  NAND_PUT
 | 
			
		||||
	  NOR_PUT
 | 
			
		||||
							
								
								
									
										12
									
								
								BGI/NOTES16.TWK
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								BGI/NOTES16.TWK
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
TweakVGA 16 BGI driver
 | 
			
		||||
Version 1.0
 | 
			
		||||
August 20, 1991
 | 
			
		||||
 | 
			
		||||
This is the first version of my 16 color tweaked BGI driver.  All functions 
 | 
			
		||||
have been implemented (including floodfill), and should work like
 | 
			
		||||
the EGAVGA driver.
 | 
			
		||||
 | 
			
		||||
NOTES:
 | 
			
		||||
 Paging and mouse cursor will not work
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										25
									
								
								BGI/NOTES256.SVG
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								BGI/NOTES256.SVG
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
			
		||||
SuperVGA 256 BGI driver 
 | 
			
		||||
Version 2.21
 | 
			
		||||
August 20, 1991
 | 
			
		||||
 | 
			
		||||
This is the newest version of my SuperVGA 256 BGI driver.  I have fixed 
 | 
			
		||||
several bugs in the previous releases, as well as added several improvements.
 | 
			
		||||
 | 
			
		||||
	o 1024x768x256 color mode is now supported on Tseng 4000,
 | 
			
		||||
	  Chips&Tech, Trident 8900 and Ahead video cards.
 | 
			
		||||
 | 
			
		||||
	o Getimage and putimage will work with bitmaps up to the 
 | 
			
		||||
	 size of available memory. (> 64k)
 | 
			
		||||
 | 
			
		||||
	o VESA support has been added.
 | 
			
		||||
 | 
			
		||||
	o Added setvgapalette256 function.
 | 
			
		||||
 | 
			
		||||
	o Floodfill is implemented.
 | 
			
		||||
 | 
			
		||||
	o Added new logical operations to putimage
 | 
			
		||||
	  XNOR_PUT
 | 
			
		||||
	  NAND_PUT
 | 
			
		||||
	  NOR_PUT
 | 
			
		||||
	  TRANS_COPY_PUT - Treats 0 as transparent
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								BGI/NOTES256.TWK
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								BGI/NOTES256.TWK
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
TweakVGA 256 BGI driver
 | 
			
		||||
Version 0.5
 | 
			
		||||
August 20, 1991
 | 
			
		||||
 | 
			
		||||
This is the first version of my 256 color tweaked BGI driver.  All functions 
 | 
			
		||||
have been implemented (except getimage/putimage, but these will be added soon).
 | 
			
		||||
 | 
			
		||||
NOTES:
 | 
			
		||||
 Paging and mouse cursor will not work
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										181
									
								
								BGI/OCTREE.C
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										181
									
								
								BGI/OCTREE.C
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,181 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include "alloc.h"
 | 
			
		||||
#include "dos.h"
 | 
			
		||||
#include "quant.h"
 | 
			
		||||
#include "octree.h"
 | 
			
		||||
 | 
			
		||||
#define TESTBIT(a,i) ( ((a) >> (i)) & 1)
 | 
			
		||||
#define MAXDEPTH 8
 | 
			
		||||
#define BYTE    unsigned char
 | 
			
		||||
 | 
			
		||||
UCHAR palette [MAXCOLORS][3];
 | 
			
		||||
 | 
			
		||||
static UINT size;
 | 
			
		||||
static UINT reducelevel;
 | 
			
		||||
static UINT leaflevel;
 | 
			
		||||
static OCTREE tree;
 | 
			
		||||
static BYTE rgb_mio[3];
 | 
			
		||||
static OCTREE reducelist[MAXDEPTH + 1];
 | 
			
		||||
 | 
			
		||||
static unsigned char quant_r,
 | 
			
		||||
                     quant_g,
 | 
			
		||||
                     quant_b;
 | 
			
		||||
 | 
			
		||||
    /* Quantiza seg<65>n TESTBIT, pero solamente de retorno */
 | 
			
		||||
 | 
			
		||||
static char quant2(OCTREE tree)
 | 
			
		||||
{
 | 
			
		||||
	if (tree->leaf)   return(tree->colorindex);
 | 
			
		||||
	else					return(quant2(tree->next[
 | 
			
		||||
								TESTBIT(quant_r, MAXDEPTH - tree->level) * 4 +
 | 
			
		||||
								TESTBIT(quant_g, MAXDEPTH - tree->level) * 2 +
 | 
			
		||||
								TESTBIT(quant_b, MAXDEPTH - tree->level)]));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    /* devuelve el indice a la paleta quantizada de acuerdo con RGB apuntado */
 | 
			
		||||
 | 
			
		||||
int pal_index(UCHAR *p)
 | 
			
		||||
{
 | 
			
		||||
	quant_r = p[RED];
 | 
			
		||||
	quant_g = p[GREEN];
 | 
			
		||||
	quant_b = p[BLUE];
 | 
			
		||||
	return quant2(tree);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static double init_Cfactor;
 | 
			
		||||
static UINT init_col_num;
 | 
			
		||||
 | 
			
		||||
static void initpalette(OCTREE tree)
 | 
			
		||||
{
 | 
			
		||||
	UINT j;
 | 
			
		||||
 | 
			
		||||
	if (tree == NULL) return;
 | 
			
		||||
	if (tree->leaf || tree->level == leaflevel) {
 | 
			
		||||
        palette[init_col_num][RED]   = (char) ((init_Cfactor * tree->rgbsum.r) / tree->colorcount + .5);
 | 
			
		||||
        palette[init_col_num][GREEN] = (char) ((init_Cfactor * tree->rgbsum.g) / tree->colorcount + .5);
 | 
			
		||||
        palette[init_col_num][BLUE]  = (char) ((init_Cfactor * tree->rgbsum.b) / tree->colorcount + .5);
 | 
			
		||||
		tree->colorindex = init_col_num;
 | 
			
		||||
		tree->leaf = TRUE;
 | 
			
		||||
		init_col_num++;
 | 
			
		||||
	} else {
 | 
			
		||||
		for (j = 0; j < 8; j++)
 | 
			
		||||
			initpalette(tree->next[j]);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    /* calcula la paleta de acuerdo con un factor introducido */
 | 
			
		||||
 | 
			
		||||
UINT calc_palette(UINT i, double Cfactor)
 | 
			
		||||
{
 | 
			
		||||
	init_Cfactor = Cfactor;
 | 
			
		||||
	init_col_num = i;
 | 
			
		||||
	initpalette(tree);
 | 
			
		||||
	return init_col_num;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void newandinit(OCTREE *tree, UINT depth)
 | 
			
		||||
    {
 | 
			
		||||
    unsigned long rest;
 | 
			
		||||
	*tree = (OCTREE)calloc(1,sizeof(struct node));
 | 
			
		||||
	if (*tree == NULL) {
 | 
			
		||||
	rest=coreleft();
 | 
			
		||||
	printf("No hay bastante Memoria");
 | 
			
		||||
        exit(1);
 | 
			
		||||
        }
 | 
			
		||||
    (*tree)->level = depth;
 | 
			
		||||
    (*tree)->leaf = (depth >= leaflevel);
 | 
			
		||||
    if ((*tree)->leaf)
 | 
			
		||||
        size++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
static void getreduceable(OCTREE *node)
 | 
			
		||||
    {
 | 
			
		||||
    UINT newreducelevel;
 | 
			
		||||
 | 
			
		||||
    newreducelevel = reducelevel;
 | 
			
		||||
    while (reducelist[newreducelevel] == NULL)
 | 
			
		||||
        newreducelevel--;
 | 
			
		||||
    *node = reducelist[newreducelevel];
 | 
			
		||||
    reducelist[newreducelevel] =
 | 
			
		||||
                reducelist[newreducelevel]->nextreduceable;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
static void makereduceable(UINT level,OCTREE node)
 | 
			
		||||
{
 | 
			
		||||
	node->nextreduceable = reducelist[level];
 | 
			
		||||
	reducelist[level] = node;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    /* reduzcamos el arbol, pues K+1>size */
 | 
			
		||||
 | 
			
		||||
static void reducetree(void)
 | 
			
		||||
{
 | 
			
		||||
	OCTREE node;
 | 
			
		||||
	UINT depth;
 | 
			
		||||
 | 
			
		||||
	getreduceable(&node);
 | 
			
		||||
	node->leaf = 1;
 | 
			
		||||
	size = size - node->children + 1;
 | 
			
		||||
	depth = node->level;
 | 
			
		||||
	if (depth < reducelevel) {
 | 
			
		||||
		reducelevel = depth;
 | 
			
		||||
		leaflevel = reducelevel + 1;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static UCHAR insert_rgb[3];
 | 
			
		||||
 | 
			
		||||
    /* para insertar cada color dentro del arbol */
 | 
			
		||||
 | 
			
		||||
static void inserttree(OCTREE *tree, UINT depth)
 | 
			
		||||
{
 | 
			
		||||
	UINT branch;
 | 
			
		||||
 | 
			
		||||
	if (*tree == NULL)
 | 
			
		||||
		newandinit(tree,depth);
 | 
			
		||||
	(*tree)->colorcount++;
 | 
			
		||||
	(*tree)->rgbsum.r += insert_rgb[RED];
 | 
			
		||||
	(*tree)->rgbsum.g += insert_rgb[GREEN];
 | 
			
		||||
	(*tree)->rgbsum.b += insert_rgb[BLUE];
 | 
			
		||||
	if ((*tree)->leaf == FALSE && depth < leaflevel) {
 | 
			
		||||
		branch = TESTBIT(insert_rgb[RED],MAXDEPTH - depth) * 4 +
 | 
			
		||||
					TESTBIT(insert_rgb[GREEN],MAXDEPTH - depth) * 2 +
 | 
			
		||||
					TESTBIT(insert_rgb[BLUE],MAXDEPTH - depth);
 | 
			
		||||
		if ((*tree)->next[branch] == NULL) {
 | 
			
		||||
			(*tree)->children++;
 | 
			
		||||
			if ((*tree)->children == 2)
 | 
			
		||||
				makereduceable(depth,*tree);
 | 
			
		||||
		}
 | 
			
		||||
		inserttree(&((*tree)->next[branch]), depth + 1);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void lee(FILE *uno,double gamm)     /* funci<63>n que leer<65> la 1<> vez el TGA */
 | 
			
		||||
{
 | 
			
		||||
	union REGS regset;
 | 
			
		||||
	struct SREGS sregset;
 | 
			
		||||
 | 
			
		||||
	reducelevel = MAXDEPTH;
 | 
			
		||||
	leaflevel = reducelevel + 1;
 | 
			
		||||
 | 
			
		||||
	while (!feof(uno)) {
 | 
			
		||||
	fread(&rgb_mio,3,1,uno);
 | 
			
		||||
	insert_rgb[0]=rgb_mio[2];	// CUIDADO, valores de TGA tipo 2
 | 
			
		||||
	insert_rgb[1]=rgb_mio[1];	// Estan BGR no RGB
 | 
			
		||||
	insert_rgb[2]=rgb_mio[0];
 | 
			
		||||
		inserttree(&tree, 0);
 | 
			
		||||
	if (size > MAXCOLORS - 1)       /* > K+1? (colores) */
 | 
			
		||||
			reducetree();
 | 
			
		||||
	}
 | 
			
		||||
	calc_palette((unsigned int)0,gamm);
 | 
			
		||||
	regset.x.ax=0x1012;
 | 
			
		||||
	regset.x.bx=0;
 | 
			
		||||
	regset.x.cx=256;
 | 
			
		||||
	regset.x.dx=FP_OFF(palette);
 | 
			
		||||
	sregset.es=FP_SEG(palette);
 | 
			
		||||
    int86x(0x10,®set,®set,&sregset);  /* interrupci<63>n que carga y */
 | 
			
		||||
			/* activa la paleta nueva */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19
									
								
								BGI/OCTREE.H
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								BGI/OCTREE.H
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
struct colorsum {
 | 
			
		||||
	unsigned long r, g, b;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct node * OCTREE;
 | 
			
		||||
struct node {
 | 
			
		||||
	unsigned char leaf;
 | 
			
		||||
	unsigned char level;
 | 
			
		||||
	unsigned char colorindex;
 | 
			
		||||
	unsigned char children;
 | 
			
		||||
	unsigned long colorcount;
 | 
			
		||||
	struct colorsum rgbsum;
 | 
			
		||||
	OCTREE nextreduceable;
 | 
			
		||||
	OCTREE next[8];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern OCTREE	tree;
 | 
			
		||||
 | 
			
		||||
UINT calc_palette(UINT i, double Cfactor);
 | 
			
		||||
							
								
								
									
										146
									
								
								BGI/QUA.C
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								BGI/QUA.C
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,146 @@
 | 
			
		||||
/*  Ejemplo de displayado de TGA tipo 2 en SVGA 640*480*256
 | 
			
		||||
    Autor:  Juan Ramon Lehmann
 | 
			
		||||
            14-09-1994 (c)
 | 
			
		||||
    No olvidar compilar en modo large
 | 
			
		||||
     y a<>adir libreria de graficos */
 | 
			
		||||
 | 
			
		||||
#include "graphics.h"
 | 
			
		||||
#include "stdlib.h"
 | 
			
		||||
#include "alloc.h"
 | 
			
		||||
#include "math.h"
 | 
			
		||||
#include "dos.h"
 | 
			
		||||
#include "conio.h"
 | 
			
		||||
#include "stdio.h"
 | 
			
		||||
#include "string.h"
 | 
			
		||||
#include "search.h"
 | 
			
		||||
#include "math.h"
 | 
			
		||||
 | 
			
		||||
typedef unsigned char	BYTE;
 | 
			
		||||
typedef unsigned int	WORD;
 | 
			
		||||
 | 
			
		||||
void InitGrafico(void);
 | 
			
		||||
int huge DetectSVGA(void);
 | 
			
		||||
 | 
			
		||||
struct Triplete {
 | 
			
		||||
	BYTE Red;
 | 
			
		||||
	BYTE Green;
 | 
			
		||||
	BYTE Blue;
 | 
			
		||||
	} *MiTriplete;
 | 
			
		||||
 | 
			
		||||
struct {
 | 
			
		||||
	  BYTE bIDFieldSize;
 | 
			
		||||
	  BYTE bColorMapType;
 | 
			
		||||
	  BYTE bImageType;
 | 
			
		||||
	  BYTE ClrMapSpec[5];
 | 
			
		||||
	  WORD wXOrigin;
 | 
			
		||||
	  WORD wYOrigin;
 | 
			
		||||
	  WORD wWidth;
 | 
			
		||||
	  WORD wHeight;
 | 
			
		||||
	  BYTE bBitsPerPixel;
 | 
			
		||||
	  BYTE bImageDesc;
 | 
			
		||||
				 } stTarga24Header = {
 | 
			
		||||
				  0,0,2,
 | 
			
		||||
				  0,0,0,0,0,
 | 
			
		||||
				  0,0,0,0,
 | 
			
		||||
				  24,
 | 
			
		||||
				  0
 | 
			
		||||
			   };
 | 
			
		||||
 | 
			
		||||
int pal_index(unsigned char *p);
 | 
			
		||||
void lee(FILE *uno,double gam);     /* funci<63>n que leer<65> la 1<> vez el TGA */
 | 
			
		||||
 | 
			
		||||
	// Para las llamadas a las interrupciones
 | 
			
		||||
	union REGS regset;
 | 
			
		||||
	struct SREGS sregset;
 | 
			
		||||
	FILE *in;
 | 
			
		||||
 | 
			
		||||
int main(int argv,char *argc[])
 | 
			
		||||
{
 | 
			
		||||
	register n;
 | 
			
		||||
	static BYTE RGBLineBuffer[1024*3];
 | 
			
		||||
	int wLineCount,i,x,y;
 | 
			
		||||
	static double gamma;
 | 
			
		||||
	static BYTE pixel;
 | 
			
		||||
	char *name,*endptr;
 | 
			
		||||
	WORD wHeight,wWidth;
 | 
			
		||||
 | 
			
		||||
	if (argv<2)
 | 
			
		||||
		{
 | 
			
		||||
	printf("Error, la sintaxis es demo.exe <filename> <gamma factor>\n");
 | 
			
		||||
	printf("filename= TGA tipo 2\n");
 | 
			
		||||
        printf("gamma factor= Factor de correcci<63>n, se aconseja 0.2\n\n\n");
 | 
			
		||||
		exit(0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	name=argc[1];	// nombre del fichero
 | 
			
		||||
	gamma=strtod(argc[2],&endptr);
 | 
			
		||||
 | 
			
		||||
	InitGrafico();
 | 
			
		||||
 | 
			
		||||
	if ((in=fopen(name,"rb"))==NULL)
 | 
			
		||||
	  {
 | 
			
		||||
	  perror("Error al abrir el fichero TGA");
 | 
			
		||||
	  exit(0);
 | 
			
		||||
	  }
 | 
			
		||||
 | 
			
		||||
	fread(&stTarga24Header, sizeof(stTarga24Header),1, in); // leo cabecera
 | 
			
		||||
	lee(in,gamma);	/* Lee TGA la primera vez */
 | 
			
		||||
 | 
			
		||||
		// aqui ya est<73> la quantizaci<63>n
 | 
			
		||||
 | 
			
		||||
	fseek(in, 0L, SEEK_SET);	// dejo el fichero al principio
 | 
			
		||||
	fread(&stTarga24Header, sizeof(stTarga24Header),1, in); // leo cabecera
 | 
			
		||||
 | 
			
		||||
		wHeight=stTarga24Header.wHeight;
 | 
			
		||||
		wWidth=stTarga24Header.wWidth;	// longitud grafico
 | 
			
		||||
 | 
			
		||||
		y=320;
 | 
			
		||||
		x=0;
 | 
			
		||||
 | 
			
		||||
	   for(wLineCount=0;wLineCount<=wHeight-1;wLineCount++)
 | 
			
		||||
	  {
 | 
			
		||||
		 fread(&RGBLineBuffer,wWidth*3,1,in);	//wWidth*3 ---> 320
 | 
			
		||||
 | 
			
		||||
		  i=0;
 | 
			
		||||
		 while (i<=wWidth*3)
 | 
			
		||||
		 {
 | 
			
		||||
			/* como los valores est<73>n a la inversa....:-) */
 | 
			
		||||
 | 
			
		||||
		 MiTriplete->Blue=RGBLineBuffer[i++];
 | 
			
		||||
		 MiTriplete->Green=RGBLineBuffer[i++];
 | 
			
		||||
		 MiTriplete->Red=RGBLineBuffer[i++];
 | 
			
		||||
 | 
			
		||||
		  pixel=pal_index(MiTriplete);
 | 
			
		||||
		  putpixel(x++,y,pixel);
 | 
			
		||||
		  }
 | 
			
		||||
		  x=0;
 | 
			
		||||
		  y--;
 | 
			
		||||
	  }
 | 
			
		||||
	getch();
 | 
			
		||||
	closegraph();	/* desactiva modo grafico */
 | 
			
		||||
	fclose(in);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void InitGrafico(void)
 | 
			
		||||
	{
 | 
			
		||||
	int gdriver = DETECT, gmode=0, errorcode;
 | 
			
		||||
	installuserdriver("Svga256",DetectSVGA);
 | 
			
		||||
	initgraph(&gdriver,&gmode, "");
 | 
			
		||||
	errorcode = graphresult();
 | 
			
		||||
	if (errorcode != grOk)
 | 
			
		||||
	{
 | 
			
		||||
       printf("Error de gr<67>ficos: %s\n", grapherrormsg(errorcode));
 | 
			
		||||
       printf("Pulse una tecla para salir:");
 | 
			
		||||
	   getch();
 | 
			
		||||
	   exit(1);
 | 
			
		||||
	}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
int huge DetectSVGA(void)
 | 
			
		||||
	{
 | 
			
		||||
		return(2);	 /* 2=SVGA 640*480*256 0=320*200*256*/
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								BGI/QUANT.H
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								BGI/QUANT.H
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <alloc.h>
 | 
			
		||||
 | 
			
		||||
#define TRUE		1
 | 
			
		||||
#define FALSE		0
 | 
			
		||||
 | 
			
		||||
#define RED             0
 | 
			
		||||
#define GREEN		1
 | 
			
		||||
#define BLUE            2
 | 
			
		||||
 | 
			
		||||
#define MAXCOLORS               255
 | 
			
		||||
 | 
			
		||||
typedef unsigned char UCHAR;                    /* 8 bits */
 | 
			
		||||
typedef unsigned short int UINT;                /* 16 bits */
 | 
			
		||||
typedef unsigned long int ULONG;                /* 32 bits */
 | 
			
		||||
 | 
			
		||||
extern UCHAR palette[MAXCOLORS][3];
 | 
			
		||||
int pal_index(UCHAR *pixel);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										135
									
								
								BGI/README
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										135
									
								
								BGI/README
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,135 @@
 | 
			
		||||
**************************************************************
 | 
			
		||||
COPYRIGHT 1991, JORDAN HARGRAPHIX SOFTWARE
 | 
			
		||||
PORTIONS COPYRIGHT JOHN BRIDGES, 1990
 | 
			
		||||
		   CHRISTOPHER MORGAN, 1984
 | 
			
		||||
**************************************************************
 | 
			
		||||
 | 
			
		||||
Here it is! The SuperVGA/Tweak BGI drivers you have all been waiting for! ;->
 | 
			
		||||
 | 
			
		||||
  These drivers support a wide range of VGA cards, and should work on
 | 
			
		||||
all major brands.
 | 
			
		||||
 | 
			
		||||
Card types supported: (SuperVGA drivers)
 | 
			
		||||
  Ahead, ATI, Chips & Tech, Everex, Genoa, Paradise, Trident (both 8800 
 | 
			
		||||
and 8900), Tseng (both 3000 and 4000 chipsets) and Video7.
 | 
			
		||||
  These drivers will also work on video cards with VESA capability.
 | 
			
		||||
  The tweaked drivers will work on any register-compatible VGA card.
 | 
			
		||||
 | 
			
		||||
I have not tested these drivers on all these card types, so I can not guarantee
 | 
			
		||||
perfect operation with your card.  I have tested them extensively
 | 
			
		||||
on Trident, Tseng and ATI cards, and have had no problems. (Trident 8800
 | 
			
		||||
cards occasionally have problems, especially older models)
 | 
			
		||||
 | 
			
		||||
Modes currently supported:
 | 
			
		||||
  SuperVGA 16-color
 | 
			
		||||
   0) Standard EGA/VGA 320x200x16
 | 
			
		||||
   1) Standard EGA/VGA 640x200x16
 | 
			
		||||
   2) Standard EGA/VGA 640x350x16
 | 
			
		||||
   3) Standard VGA 640x480x16
 | 
			
		||||
   4) SuperVGA/VESA 800x600x16
 | 
			
		||||
   5) SuperVGA/VESA 1024x768x16
 | 
			
		||||
 | 
			
		||||
  SuperVGA 256-color
 | 
			
		||||
   0) Standard VGA/MCGA 320x200x256
 | 
			
		||||
   1) 256k Svga/VESA 640x400x256
 | 
			
		||||
   2) 512k Svga/VESA 640x480x256
 | 
			
		||||
   3) 512k Svga/VESA 800x600x256
 | 
			
		||||
   4) 1024k Svga/VESA 1024x768x256
 | 
			
		||||
 | 
			
		||||
  Tweaked 16-color
 | 
			
		||||
   0) 704x528x16
 | 
			
		||||
   1) 720x540x16
 | 
			
		||||
   2) 736x552x16
 | 
			
		||||
   3) 752x564x16
 | 
			
		||||
   4) 768x576x16
 | 
			
		||||
   5) 784x588x16
 | 
			
		||||
   6) 800x600x16
 | 
			
		||||
 | 
			
		||||
  Tweaked 256-color
 | 
			
		||||
   0) 320x400x256
 | 
			
		||||
   1) 320x480x256
 | 
			
		||||
   2) 360x480x256
 | 
			
		||||
   3) 376x564x256
 | 
			
		||||
   4) 400x564x256
 | 
			
		||||
   5) 400x600x256
 | 
			
		||||
 | 
			
		||||
----------------------------------------------------------------------------
 | 
			
		||||
INSTALLATION:
 | 
			
		||||
  Using the driver in existing programs is easy. (If you have the source)
 | 
			
		||||
 | 
			
		||||
  Check the files INITSVGA.C and INITSVGA.PAS for examples of installation
 | 
			
		||||
into C and Pascal programs.
 | 
			
		||||
 | 
			
		||||
----------------------------------------------------------------------------
 | 
			
		||||
NOTE: 
 | 
			
		||||
 | 
			
		||||
 - The mouse cursor may not work in all modes of my driver.  This is because
 | 
			
		||||
   most mouse drivers do not support SuperVGA/Tweak modes.
 | 
			
		||||
 | 
			
		||||
 - The registerbgidriver(*) function does not work. This is due to a limitation
 | 
			
		||||
   in the BGI kernel, which checks the linked in driver with a list of the
 | 
			
		||||
   standard BGI drivers (CGA,EGAVGA,etc..), and if it is not one of those,
 | 
			
		||||
   will not use the linked in driver.
 | 
			
		||||
 | 
			
		||||
 * However, registerfarbgidriver DOES work properly with C/C++... (8/1/91)
 | 
			
		||||
   Check INITSVGA.C and the makefile for examples of how to use.
 | 
			
		||||
 | 
			
		||||
 - Imagesize does not work. (the kernel does not call the driver to do this)
 | 
			
		||||
   Use the following formula:
 | 
			
		||||
    * imsize = ((xwid >> 1)+1)*ywid+4; 	(16-color)
 | 
			
		||||
    * imsize = xwid*ywid+4; 		(256-color)
 | 
			
		||||
 | 
			
		||||
----------------------------------------------------------------------------
 | 
			
		||||
WARNING: The drivers do not test to see if the card installed is
 | 
			
		||||
actually a VGA card (If the Svga drivers do not detect a SuperVGA card, they 
 | 
			
		||||
treat the card as a standard VGA), so DO NOT use the drivers if you do not 
 | 
			
		||||
have a VGA card installed.
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------
 | 
			
		||||
REGISTRATION:
 | 
			
		||||
  I have decided to release these drivers free of charge,
 | 
			
		||||
although donations would be greatly appreciated and certainly
 | 
			
		||||
expedite the release of future versions. :->
 | 
			
		||||
  The drivers have not been crippled in any way, though beta releases of new
 | 
			
		||||
drivers may have some functions yet unimplemented.  
 | 
			
		||||
 | 
			
		||||
Registration fees:
 | 
			
		||||
 | 
			
		||||
	SuperVGA 256 			$20
 | 
			
		||||
	SuperVGA 16			$20
 | 
			
		||||
	Tweak 16			$20
 | 
			
		||||
	Tweak 256			$20
 | 
			
		||||
 | 
			
		||||
	Any two:			$30
 | 
			
		||||
	All 4:				$50
 | 
			
		||||
 | 
			
		||||
With donations of $20 and up, you will be considered a registered user.
 | 
			
		||||
Registered users get the full source code and upgrades on future releases.
 | 
			
		||||
 | 
			
		||||
From September 1-May 8, please send checks/money to:
 | 
			
		||||
	Jordan Hargrave
 | 
			
		||||
	1000 Morewood Ave, Box #3277
 | 
			
		||||
	Pittsburgh, PA 15213
 | 
			
		||||
	(412) 268-4493
 | 
			
		||||
 | 
			
		||||
From May 8-September 1, send to:
 | 
			
		||||
	Jordan Hargrave
 | 
			
		||||
	1615 Burnley Road
 | 
			
		||||
	Charlotte, NC 28210
 | 
			
		||||
	(704) 553-2332
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
I have started working on a new graphics library that will support resolutions
 | 
			
		||||
from 160x200 (Ick! ;->) all the way up to 1280x1024, and from 1-bit color
 | 
			
		||||
to 24-bit color.  It will support a wide range of cards and I need testers
 | 
			
		||||
for XGA/8514/Hercules Graphics Station cards.
 | 
			
		||||
 | 
			
		||||
*===============================*===========================================*
 | 
			
		||||
| Jordan Powell Hargrave	|   Internet:	jh5y@andrew.cmu.edu	    |
 | 
			
		||||
| 1000 Morewood Ave, Box #3277  |     Bitnet:	jh5y%andrew.cmu.edu@cmccvb  |
 | 
			
		||||
| Pittsburgh, PA 15213		|       UUCP:	uunet!andrew.cmu.edu!jh5y   |
 | 
			
		||||
| (412) 268-4493	 	|    Prodigy:	HXNJ79A			    |
 | 
			
		||||
|			  	| Compuserve:	[72510,1143]		    |
 | 
			
		||||
*===============================*===========================================*
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										58
									
								
								BGI/REGISTER.DOC
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								BGI/REGISTER.DOC
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,58 @@
 | 
			
		||||
Registration Form
 | 
			
		||||
 | 
			
		||||
EMAIL ADDRESS:___________________________________________
 | 
			
		||||
 | 
			
		||||
NAME:____________________________________________________
 | 
			
		||||
ADDRESS:_________________________________________________
 | 
			
		||||
	_________________________________________________
 | 
			
		||||
	_________________________________________________
 | 
			
		||||
CITY:________________________ STATE:____ ZIP:____________
 | 
			
		||||
COUNTRY:____________
 | 
			
		||||
 | 
			
		||||
PHONE # (Data):  ___ ____ ______________
 | 
			
		||||
	(Voice): ___ ____ ______________
 | 
			
		||||
 | 
			
		||||
General info:
 | 
			
		||||
 | 
			
		||||
Machine type:  8088/6[_]  80286[_]  80386[_]  80486[_]  Other[_] 
 | 
			
		||||
Machine name: ________________________________________
 | 
			
		||||
 | 
			
		||||
Display type:  MDA[_]  CGA[_]  Herc[_]  EGA[_]  MCGA[_]  VGA[_]  SVGA[_]
 | 
			
		||||
Card name:_____________________________________________
 | 
			
		||||
 | 
			
		||||
Floppy drives:    3<> 720k[_]  3<> 1.44M[_]  3<> 2.88M[_]
 | 
			
		||||
		  5<> 360k[_]  5<> 1.2M [_]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Modem speed: 1200[_]  2400[_]  4800[_]  9600[_] 19200[_] Other: ________
 | 
			
		||||
Modem name:_____________________________
 | 
			
		||||
 | 
			
		||||
Other configuration:_________________________________________________
 | 
			
		||||
		    _________________________________________________
 | 
			
		||||
		    _________________________________________________
 | 
			
		||||
		    _________________________________________________
 | 
			
		||||
		    _________________________________________________
 | 
			
		||||
 | 
			
		||||
Driver type:	Svga 256     ____	@ $20
 | 
			
		||||
		Svga 16      ____	@ $20
 | 
			
		||||
		Tweak 256    ____	@ $20
 | 
			
		||||
		Tweak 16     ____	@ $30
 | 
			
		||||
 | 
			
		||||
		Two drivers  ____	@ $30 (check above)
 | 
			
		||||
		Four drivers ____	@ $50
 | 
			
		||||
 | 
			
		||||
Do you want a copy of the source? _____
 | 
			
		||||
 | 
			
		||||
From September 1-May 8, please send checks/money to:
 | 
			
		||||
	Jordan Hargrave
 | 
			
		||||
	1000 Morewood Ave, Box #3277
 | 
			
		||||
	Pittsburgh, PA 15213
 | 
			
		||||
	(412) 268-4493
 | 
			
		||||
 | 
			
		||||
From May 8-September 1, send to:
 | 
			
		||||
	Jordan Hargrave
 | 
			
		||||
	1615 Burnley Road
 | 
			
		||||
	Charlotte, NC 28210
 | 
			
		||||
	(704) 553-2332
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								BGI/SVGA16.BGI
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								BGI/SVGA16.BGI
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										48
									
								
								BGI/SVGA16.H
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								BGI/SVGA16.H
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
/************************************************/
 | 
			
		||||
/* 						*/
 | 
			
		||||
/*        SuperVGA 16 BGI driver defines	*/
 | 
			
		||||
/*		Copyright (c) 1991		*/
 | 
			
		||||
/*	    Jordan Hargraphix Software		*/
 | 
			
		||||
/*						*/
 | 
			
		||||
/************************************************/
 | 
			
		||||
 | 
			
		||||
#include <dos.h>
 | 
			
		||||
 | 
			
		||||
typedef unsigned char DacPalette16[16][3];
 | 
			
		||||
 | 
			
		||||
extern int far Svga16_fdriver[];
 | 
			
		||||
 | 
			
		||||
/* These are the currently supported modes */
 | 
			
		||||
#define SVGA320x200x16	0	/* 320x200x16 Standard EGA/VGA */
 | 
			
		||||
#define SVGA640x200x16	1	/* 640x200x16 Standard EGA/VGA */
 | 
			
		||||
#define SVGA640x350x16	2	/* 640x350x16 Standard EGA/VGA */
 | 
			
		||||
#define SVGA640x480x16	3	/* 640x480x16 Standard VGA */
 | 
			
		||||
#define SVGA800x600x16	4	/* 800x600x16 SuperVGA/VESA */
 | 
			
		||||
#define SVGA1024x768x16	5	/* 1024x768x16 SuperVGA/VESA */
 | 
			
		||||
 | 
			
		||||
#ifndef XNOR_PUT
 | 
			
		||||
#define	XNOR_PUT	5
 | 
			
		||||
#define NAND_PUT	6
 | 
			
		||||
#define NOR_PUT		7
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* 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,®);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										42
									
								
								BGI/SVGA16.INC
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								BGI/SVGA16.INC
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,42 @@
 | 
			
		||||
(************************************************)
 | 
			
		||||
(* 						*)
 | 
			
		||||
(*	  SuperVGA 16 BGI driver defines	*)
 | 
			
		||||
(*		Copyright (c) 1991		*)
 | 
			
		||||
(*	    Jordan Hargraphix Software		*)
 | 
			
		||||
(*						*)
 | 
			
		||||
(************************************************)
 | 
			
		||||
 | 
			
		||||
type DacPalette16 = array[0..15] of array[0..2] of Byte;
 | 
			
		||||
 | 
			
		||||
(* These are the currently supported modes *)
 | 
			
		||||
const
 | 
			
		||||
  SVGA320x200x16	= 0;	(* 320x200x16 Standard EGA/VGA *)
 | 
			
		||||
  SVGA640x200x16	= 1;	(* 640x200x16 Standard EGA/VGA *)
 | 
			
		||||
  SVGA640x350x16	= 2;	(* 640x350x16 Standard EGA/VGA *)
 | 
			
		||||
  SVGA640x480x16	= 3;	(* 640x480x16 Standard VGA *)
 | 
			
		||||
  SVGA800x600x16	= 4;	(* 800x600x16 SuperVGA/VESA *)
 | 
			
		||||
  SVGA1024x768x16	= 5;	(* 1024x768x16 SuperVGA/VESA *)
 | 
			
		||||
 | 
			
		||||
  XNOR_PUT		= 5;
 | 
			
		||||
  NAND_PUT		= 6;
 | 
			
		||||
  NOR_PUT		= 7;
 | 
			
		||||
 | 
			
		||||
(* Setvgapalette sets the entire 16 color palette *)
 | 
			
		||||
(* PalBuf contains RGB values for all 16 colors   *)
 | 
			
		||||
(* R,G,B values range from 0 to 63	           *)
 | 
			
		||||
procedure SetVGAPalette16(PalBuf : DacPalette16);
 | 
			
		||||
var
 | 
			
		||||
  Reg : Registers;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  reg.ax := $1012;
 | 
			
		||||
  reg.bx := 0;
 | 
			
		||||
  reg.cx := 16;
 | 
			
		||||
  reg.es := Seg(PalBuf);
 | 
			
		||||
  reg.dx := Ofs(PalBuf);
 | 
			
		||||
  intr($10,reg);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								BGI/SVGA256.BGI
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								BGI/SVGA256.BGI
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										47
									
								
								BGI/SVGA256.H
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								BGI/SVGA256.H
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
/************************************************/
 | 
			
		||||
/* 						*/
 | 
			
		||||
/*       SuperVGA 256 BGI driver defines	*/
 | 
			
		||||
/*		Copyright (c) 1991		*/
 | 
			
		||||
/*	    Jordan Hargraphix Software		*/
 | 
			
		||||
/*						*/
 | 
			
		||||
/************************************************/
 | 
			
		||||
 | 
			
		||||
#include <dos.h>
 | 
			
		||||
 | 
			
		||||
typedef unsigned char DacPalette256[256][3];
 | 
			
		||||
 | 
			
		||||
extern int far _Cdecl Svga256_fdriver[];
 | 
			
		||||
 | 
			
		||||
/* These are the currently supported modes */
 | 
			
		||||
#define	SVGA320x200x256		0	/* 320x200x256 Standard VGA */
 | 
			
		||||
#define	SVGA640x400x256		1	/* 640x400x256 Svga/VESA */
 | 
			
		||||
#define	SVGA640x480x256		2	/* 640x480x256 Svga/VESA */
 | 
			
		||||
#define	SVGA800x600x256		3	/* 800x600x256 Svga/VESA */
 | 
			
		||||
#define SVGA1024x768x256	4	/* 1024x768x256 Svga/VESA */
 | 
			
		||||
 | 
			
		||||
#ifndef XNOR_PUT
 | 
			
		||||
#define XNOR_PUT	5
 | 
			
		||||
#define NAND_PUT	6
 | 
			
		||||
#define NOR_PUT		7
 | 
			
		||||
#endif
 | 
			
		||||
#define TRANS_COPY_PUT	8
 | 
			
		||||
 | 
			
		||||
/* 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,®);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										38
									
								
								BGI/SVGA256.INC
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								BGI/SVGA256.INC
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,38 @@
 | 
			
		||||
(************************************************)
 | 
			
		||||
(* 						*)
 | 
			
		||||
(*	 SuperVGA 256 BGI driver defines	*)
 | 
			
		||||
(*		Copyright (c) 1991		*)
 | 
			
		||||
(*	    Jordan Hargraphix Software		*)
 | 
			
		||||
(*						*)
 | 
			
		||||
(************************************************)
 | 
			
		||||
 | 
			
		||||
type DacPalette256 = array[0..255] of array[0..2] of Byte;
 | 
			
		||||
 | 
			
		||||
(* These are the currently supported modes *)
 | 
			
		||||
const
 | 
			
		||||
  SVGA320x200x256	= 0;	(* 320x200x256 Standard VGA *)
 | 
			
		||||
  SVGA640x400x256	= 1;	(* 640x400x256 Svga *)
 | 
			
		||||
  SVGA640x480x256	= 2;	(* 640x480x256 Svga *)
 | 
			
		||||
  SVGA800x600x256	= 3;	(* 800x600x256 Svga *)
 | 
			
		||||
  SVGA1024x768x256	= 4;	(* 1024x768x256 Svga *)
 | 
			
		||||
 | 
			
		||||
  TRANS_COPY_PIX	= 8;
 | 
			
		||||
 | 
			
		||||
(* Setvgapalette sets the entire 256 color palette *)
 | 
			
		||||
(* PalBuf contains RGB values for all 256 colors   *)
 | 
			
		||||
(* R,G,B values range from 0 to 63	           *)
 | 
			
		||||
procedure SetVGAPalette256(PalBuf : DacPalette256);
 | 
			
		||||
var
 | 
			
		||||
  Reg : Registers;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  reg.ax := $1012;
 | 
			
		||||
  reg.bx := 0;
 | 
			
		||||
  reg.cx := 256;
 | 
			
		||||
  reg.es := Seg(PalBuf);
 | 
			
		||||
  reg.dx := Ofs(PalBuf);
 | 
			
		||||
  intr($10,reg);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								BGI/TWK16.BGI
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								BGI/TWK16.BGI
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										48
									
								
								BGI/TWK16.H
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								BGI/TWK16.H
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
/************************************************/
 | 
			
		||||
/* 						*/
 | 
			
		||||
/*        Tweaked 16 BGI driver defines		*/
 | 
			
		||||
/*		Copyright (c) 1991		*/
 | 
			
		||||
/*	    Jordan Hargraphix Software		*/
 | 
			
		||||
/*						*/
 | 
			
		||||
/************************************************/
 | 
			
		||||
 | 
			
		||||
#include <dos.h>
 | 
			
		||||
 | 
			
		||||
typedef unsigned char DacPalette16[16][3];
 | 
			
		||||
 | 
			
		||||
extern int far Twk16_fdriver[];
 | 
			
		||||
 | 
			
		||||
/* These are the currently supported modes */
 | 
			
		||||
#define TWK704x528x16	0	/* 704x528x16 Tweaked VGA */
 | 
			
		||||
#define TWK720x540x16	1	/* 720x540x16 Tweaked VGA */
 | 
			
		||||
#define TWK736x552x16	2	/* 736x552x16 Tweaked VGA */
 | 
			
		||||
#define TWK752x564x16	3	/* 752x564x16 Tweaked VGA */
 | 
			
		||||
#define TWK784x588x16	4	/* 784x588x16 Tweaked VGA */
 | 
			
		||||
#define TWK800x600x16	5	/* 800x600x16 Tweaked VGA */
 | 
			
		||||
 | 
			
		||||
#ifndef XNOR_PUT
 | 
			
		||||
#define	XNOR_PUT	5
 | 
			
		||||
#define NAND_PUT	6
 | 
			
		||||
#define NOR_PUT		7
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* 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,®);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								BGI/TWK16.INC
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								BGI/TWK16.INC
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,39 @@
 | 
			
		||||
(************************************************)
 | 
			
		||||
(* 						*)
 | 
			
		||||
(*	  SuperVGA 16 BGI driver defines	*)
 | 
			
		||||
(*		Copyright (c) 1991		*)
 | 
			
		||||
(*	    Jordan Hargraphix Software		*)
 | 
			
		||||
(*						*)
 | 
			
		||||
(************************************************)
 | 
			
		||||
 | 
			
		||||
type DacPalette16 = array[0..15] of array[0..2] of Byte;
 | 
			
		||||
 | 
			
		||||
(* These are the currently supported modes *)
 | 
			
		||||
const
 | 
			
		||||
 TWK704x528x16		= 0	(* 704x528x16 Tweaked VGA *)
 | 
			
		||||
 TWK720x540x16		= 1	(* 720x540x16 Tweaked VGA *)
 | 
			
		||||
 TWK736x552x16		= 2	(* 736x552x16 Tweaked VGA *)
 | 
			
		||||
 TWK752x564x16		= 3	(* 752x564x16 Tweaked VGA *)
 | 
			
		||||
 TWK784x588x16		= 4	(* 784x588x16 Tweaked VGA *)
 | 
			
		||||
 TWK800x600x16		= 5	(* 800x600x16 Tweaked VGA *)
 | 
			
		||||
 | 
			
		||||
  XNOR_PUT		= 5;
 | 
			
		||||
  NAND_PUT		= 6;
 | 
			
		||||
  NOR_PUT		= 7;
 | 
			
		||||
 | 
			
		||||
(* Setvgapalette sets the entire 16 color palette *)
 | 
			
		||||
(* PalBuf contains RGB values for all 16 colors   *)
 | 
			
		||||
(* R,G,B values range from 0 to 63	           *)
 | 
			
		||||
procedure SetVGAPalette16(PalBuf : DacPalette16);
 | 
			
		||||
var
 | 
			
		||||
  Reg : Registers;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  reg.ax := $1012;
 | 
			
		||||
  reg.bx := 0;
 | 
			
		||||
  reg.cx := 16;
 | 
			
		||||
  reg.es := Seg(PalBuf);
 | 
			
		||||
  reg.dx := Ofs(PalBuf);
 | 
			
		||||
  intr($10,reg);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								BGI/TWK256.BGI
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								BGI/TWK256.BGI
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										48
									
								
								BGI/TWK256.H
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								BGI/TWK256.H
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
/************************************************/
 | 
			
		||||
/* 						*/
 | 
			
		||||
/*        Tweaked 256 BGI driver defines	*/
 | 
			
		||||
/*		Copyright (c) 1991		*/
 | 
			
		||||
/*	    Jordan Hargraphix Software		*/
 | 
			
		||||
/*						*/
 | 
			
		||||
/************************************************/
 | 
			
		||||
 | 
			
		||||
#include <dos.h>
 | 
			
		||||
 | 
			
		||||
typedef unsigned char DacPalette256[256][3];
 | 
			
		||||
 | 
			
		||||
extern int far _Cdecl Twk256_fdriver[];
 | 
			
		||||
 | 
			
		||||
/* These are the currently supported modes */
 | 
			
		||||
#define	TWK320x400x256		0
 | 
			
		||||
#define	TWK320x480x256		1
 | 
			
		||||
#define	TWK360x480x256		2
 | 
			
		||||
#define	TWK376x564x256		3
 | 
			
		||||
#define	TWK400x564x256		4
 | 
			
		||||
#define	TWK400x600x256		5
 | 
			
		||||
 | 
			
		||||
#ifndef XNOR_PUT
 | 
			
		||||
#define XNOR_PUT	5
 | 
			
		||||
#define NAND_PUT	6
 | 
			
		||||
#define NOR_PUT		7
 | 
			
		||||
#endif
 | 
			
		||||
#define TRANS_COPY_PUT	8
 | 
			
		||||
 | 
			
		||||
/* 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,®);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										39
									
								
								BGI/TWK256.INC
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								BGI/TWK256.INC
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,39 @@
 | 
			
		||||
(************************************************)
 | 
			
		||||
(* 						*)
 | 
			
		||||
(*	  Tweaked 256 BGI driver defines	*)
 | 
			
		||||
(*		Copyright (c) 1991		*)
 | 
			
		||||
(*	    Jordan Hargraphix Software		*)
 | 
			
		||||
(*						*)
 | 
			
		||||
(************************************************)
 | 
			
		||||
 | 
			
		||||
type DacPalette256 = array[0..255] of array[0..2] of Byte;
 | 
			
		||||
 | 
			
		||||
(* These are the currently supported modes *)
 | 
			
		||||
const
 | 
			
		||||
  TWK320x400x256	= 0;
 | 
			
		||||
  TWK320x480x256	= 1;
 | 
			
		||||
  TWK360x480x256	= 2;
 | 
			
		||||
  TWK376x564x256	= 3;
 | 
			
		||||
  TWK400x564x256	= 4;
 | 
			
		||||
  TWK400x600x256	= 5;
 | 
			
		||||
 | 
			
		||||
  TRANS_COPY_PIX	= 8;
 | 
			
		||||
 | 
			
		||||
(* Setvgapalette sets the entire 256 color palette *)
 | 
			
		||||
(* PalBuf contains RGB values for all 256 colors   *)
 | 
			
		||||
(* R,G,B values range from 0 to 63	           *)
 | 
			
		||||
procedure SetVGAPalette256(PalBuf : DacPalette256);
 | 
			
		||||
var
 | 
			
		||||
  Reg : Registers;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  reg.ax := $1012;
 | 
			
		||||
  reg.bx := 0;
 | 
			
		||||
  reg.cx := 256;
 | 
			
		||||
  reg.es := Seg(PalBuf);
 | 
			
		||||
  reg.dx := Ofs(PalBuf);
 | 
			
		||||
  intr($10,reg);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								BGI/VGADEMO.EXE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								BGI/VGADEMO.EXE
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										1608
									
								
								BGI/VGADEMO.PAS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1608
									
								
								BGI/VGADEMO.PAS
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user