void SetVGA(void); Sets screen mode to 13h (320x200x256colours) void SetTXT(void); Returns screen to Text mode void Quit(char message[]); Quits your program with text message. example: Quit("Not enough memory"); char InitGameBuff(unsigned long buffw,unsigned long buffd); Sets up the virtual screen or 'Game Buffer'. buffw=width of buffer. buffd=depth/height of buffer. This is the buffer where most of the graphics functions plot to, and where you can build up your display for each frame of your game. You then use DisplayBuffer(); or DWinBuffer(); to display a window of this buffer to the screen. You can make this a number of screens wide and tall for scrolling games. example: InitGameBuff(320,200); - (makes game buffer 1 screen in size). Returns 1 on success. void ClearBuffer(unsigned char colour); Erases the Game Buffer clean to the colour specified. void DisplayBuffer(int x,int y); Displays a 320x200 window of the Game Buffer to the screen. Specify the x,y coordinates of the top left of the window in the Game Buffer. void DWinBuffer(int buffx,int buffy,int scrx,int scry,int width,int height); Displays a window of specified size from the Game Buffer to the screen. Specify the x,y coordinates of the top left of the window in the Game Buffer, then the x,y coordinates of the window on screen and then the width & height of the window. example: DWinBuffer(10,10,0,0,200,200); - displays a 200x200 area of the Game Buffer from pos. 10,10 to the top left of the screen. void PutPixel(int x,int y,unsigned char colour); Plots a pixel at x,y in the Game Buffer in colour specified. void Rectangle(int x,int y,int width,int height,unsigned char colour,char fill); Draws a rectangle in the Game Buffer. x,y=top left corner. fill=0 for a wire frame/hollow rectangle, fill=1 for a solid rectangle. char LoadPic(char name[],int position); Loads a .PCX image into memory so it can be used in your program. position is a number form 0-199, used to identify the image when you want to display it. Loading an image into an occupied position overwrites the existing image. Returns a 1 on success. char LoadPic1(char name[],int position); Loads a .PCX image file into memory and sets the current palette to the image's, and also stores the palette for future resetting with the SetPal(); function. This is the easiest way to set the whole palette of you game. char LoadMBM(char name[],int position); Loads a .MBM image file (optimized masked bitmap), previously created from a PCX file with the PCX2MBM program. void SetColour(unsigned char colour,unsigned char red,unsigned char green,unsigned char blue); Set a single colour in the palette by each Red,Green and Blue values (0-255). example: SetColour(10,255,255,255); - sets colour 10 to white. void SetPal(void); Resets the palette to the last palette stored by the LoadPic1(); function. Usefull for after a change or setting of Screen mode. void PutPic(int no,int X,int Y); Plots a PCX file (previously loaded with the LoadPic() function), to the Game Buffer. void PutPicM(int no,int X,int Y); As above but leaves colour 0 pixels transparent. This a slow way of using masked sprites, it is much faster for large images to change the PCX int a .MBM file (with PCX2MBM.exe) and then use PutMBM() instead. void PutMBM(int no,int X,int Y); Plots an MBM file (previously loaded with the LoadMBM() function), to the Game Buffer. void Line(int x1,int y1,int x2,int y2,int colour); Draws a line from x1,y1 to x2,y2 in specified colour, in the Game Buffer. void CutOut(int x,int y,int width,int height,unsigned char *ptr); Saves a bitmap image of part of the Game Buffer into an area of memory pointed to by *ptr. The memory size needed to save the bitmap will be (width*height)+2. Maximum size = 255*255. This function is useful for scrolling games. You can make a large Game Buffer then for each frame save out the area under each forground object, plot the foreground objects, display an area of the buffer to the screen, then cover over the foreground objects (in the Game Buffer) with the function below. void PutBitmap(int x,int y,unsigned char *ptr); Plots a bitmap to the Game Buffer. The bitmap must be pointed to by *ptr and the first two bytes of data must contain the unsigned width and height of the bitmap. Use to plot a cut-out created with the above function. unsigned char TestBuffPix(int x,int y); Returns the value of a pixel in the Game Buffer at x,y. void InitKeyScan(); void CloseKeyScan(); These functions are to initialize the key scanning interupt at the start of you game and to close it down at the end. You must close it before program termination. char CheckKey(char kno); Checks to see if a key is currently pressed, returns 1 if it is. Must use InitKeyScan() at start of program to be able to use this function. kno = character scan code. A list of the code for each key is given in keycodes.txt. void FreeMem(void); Frees up all memory used for storing the game buffer and imported images. void LineVGA(int x1,int y1,int x2,int y2,int colour); As Line(...) function but plots direct to the VGA screen. void PutPicVGA(int no,int X,int Y); As PutPic(...) but straight to the VGA screen, good for splatting out title screens. That's all folks! Buy a registered copy for your joystick and mouse functions.