Hi
I am trying to read the VGA palette color table using the following code in c:
#include
<limits.h>#include
<stdlib.h>#include
<string.h>#include
<conio.h>#include
<ctype.h>#include
<stdio.h>#include
<dos.h>#ifdef
__cplusplusextern
"C" {#endif
//#include <iostream>
//using namespace std;
typedef
struct RGB_t{ unsigned char r; unsigned char g; unsigned char b; unsigned char a;}RGB_t;
typedef
RGB_t Palette[256];/*void SetMode13h(void)
{
union REGS regs;
regs.w.ax = 0x0013;
int386(0x10, ®s, ®s);
}*/
void
GetPalette(Palette pal, int startColor, int endColor){
int index; /* Set the palette data */ for (index = startColor; index <= endColor; index++) {outp(0x3C7, index);
pal[index].r = inp(0x3C9);
pal[index].g = inp(0x3C9);
pal[index].b = inp(0x3C9);
}
}
int
main(){
int
i;int
n;Palette pal;
GetPalette(pal,0,256);
printf(
"Data display \n");printf(
"Rea Green Blue\n");for
(i=0;i<256;i++){
printf(
"%u %u %u\n",pal[ i ].r,pal[ i ].g,pal[ i ].b);}
getchar();
return
0;}
#ifdef
__cplusplus};
#endif
and i have this error when i compile it in VC++ 8
1>Linking...
1>P_test1.obj : error LNK2019: unresolved external symbol _inp referenced in function _GetPalette
1>P_test1.obj : error LNK2019: unresolved external symbol _outp referenced in function _GetPalette
1>C:\Documents and Settings\User\Desktop\Reem\Thesis\Videocrd\palette1\Debug\palette1.exe : fatal error LNK1120: 2 unresolved externals
any suggestions please