Category : Files from Magazines
Archive   : PJ82.ZIP
Filename : GRABTEST.C

 
Output of file : GRABTEST.C contained in archive : PJ82.ZIP
/* GrabTest.C */
/* Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. */

/****************************************************************************

This is a simple test program, for testing the pcxBeginPaletteGrab
and the pcxEndPaletteGrab functions.

Compile: CL /c /AS GrabTest.C
link GrabTest+pcxPG;

Microsoft C version 5.1 Programmer: Chris Howard 11/30/89

*****************************************************************************/

#include
#include

/* Declarations */
#define pcxSUCCESS 0
#define PALMARK (unsigned char) 0xFF

/* External Function declarations */
extern int far pascal pcxBeginPaletteGrab (char far *palbuf);
extern int far pascal pcxEndPaletteGrab (void);

/* Global variables */
unsigned char palBuffer[256];

/**********/

void main(void)

{
union REGS inregs,outregs;
int i,retcode;

/* Display a header */
printf("\n\nPalette Grab Test Program\n\n");

/* Mark the palette as uninitialized */
palBuffer[0] = PALMARK;

/* Begin monitoring the palette */
if ((retcode = pcxBeginPaletteGrab(palBuffer)) == pcxSUCCESS) {

/* Now, we can continue with other intialization code, make our */
/* program a TSR, or whatever else we want to do ... but for now */
/* we will just reset the mode, in order to force a palette */
/* update. Just reset Text mode, but any mode would do it. */
inregs.h.ah = 0x00;
inregs.h.al = 0x03;
int86(0x10,&inregs,&outregs);

/* Test whether it grabbed the palette */
if (palBuffer[0] != PALMARK) {
/* We grabbed it! */
printf("Palette successfully grabbed: \n\n");
for (i=0; i<17; i++)
printf("%02X ",palBuffer[i]);
printf("\n\n");
}
else {
/* We didn't get anything ... */
printf("Palette unsuccessfully grabbed ...\n");
}

/* Now uninstall the palette grabbing */
if ((retcode = pcxEndPaletteGrab()) != pcxSUCCESS) {
/* Error ending palette grab */
printf("pcxEndPaletteGrab error: %d\n",retcode);
}
}
else {
/* Error initializing palette grab */
printf("pcxBeginPaletteGrab error: %d\n",retcode);
}

} /* end of main */

  3 Responses to “Category : Files from Magazines
Archive   : PJ82.ZIP
Filename : GRABTEST.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/