Category : C Source Code
Archive   : YICONS24.ZIP
Filename : XLIB.H

 
Output of file : XLIB.H contained in archive : YICONS24.ZIP
/*----------------------------------------------------------------------
;
; XLIB - header file
;
;
;
; ****** XLIB - Mode X graphics library ****************
; ****** ****************
; ****** Written By Themie Gouthas ****************
;
; [email protected]
; [email protected]
;
; Header file contributed by Darren Lyon ([email protected])
;
;
; Terminology & notes:
; VRAM == Video RAM
; SRAM == System RAM
; X coordinates are in pixels unless explicitly stated
;
;----------------------------------------------------------------------*/

#ifndef _XLIB_H_
#define _XLIB_H_

#define BYTE unsigned char
#define WORD unsigned int

#define X_MODE_320x200 0
#define X_MODE_320x240 1
#define X_MODE_360x200 2
#define X_MODE_360x240 3
#define X_MODE_376x282 4
#define X_MODE_320x400 5
#define X_MODE_320x480 6
#define X_MODE_360x400 7
#define X_MODE_360x480 8
#define X_MODE_360x360 9
#define X_MODE_376x308 10
#define X_MODE_376x564 11


#define BACKWARD 0
#define FORWARD 1

#define X_MODE_INVALID -1
#define ERROR 1
#define OK 0

/* FUNCTIONS =========================================================== */
extern "C" {
extern WORD x_set_mode(
WORD mode, /* Initialize x mode */
WORD WidthInPixels);

extern void x_select_default_plane( /*Enables Read/Write access to a */
BYTE plane); /* a specified plane */

extern void x_set_splitscreen( /* set the split screen start */
WORD line); /*scan line (initialize) */

extern void x_set_start_addr(
WORD X, /* Set the screen start */
WORD Y); /* address in video ram */

extern void x_hide_splitscreen(void); /* Disable the split screen (Split */
/* Screen RAM remains reserved) */

extern void x_show_splitscreen(void); /* Enable the split screen (given it */
/* was previously "hidden") */


extern void x_adjust_splitscreen( /* Adjust the start scan line of the */
WORD line); /* split screen */


extern WORD x_set_doublebuffer( /* Enable double buffering with a */
WORD PageHeight); /* specified page height */


extern void x_page_flip( /* Swap visible page (only when double */
WORD X, /* buffering is active) & sets virt start*/
WORD Y);

extern void x_set_cliprect( /* Define the clipping rectangle */
WORD left, /* NOTE: left and right are in bytes */
WORD top,
WORD righ,
WORD bottom);

extern void x_text_mode(void); /* return to text mode */
extern void x_wait_vsync(void); /* wait for vsync */


/* VARIABLES =========================================================== */

extern BYTE InGraphics; /* non zero if in X graphics mode */
extern WORD CurrXMode; /* contains current X graphics mode id */
extern WORD ScrnPhysicalByteWidth; /* Physical screen width in bytes */
extern WORD ScrnPhysicalPixelWidth; /* Physical screen width in pixels */
extern WORD ScrnPhysicalHeight; /* Physical screen height in pixels */
extern WORD ErrorValue; /* Error return value */
extern WORD SplitScrnOffs; /* Offset in VRAM of split screen */
extern WORD SplitScrnScanLine; /* Scan line split screen starts at */
/* initially. Resizing the split scrn */
/* using the other functions does not */
/* change this value */
extern WORD SplitScrnVisibleHeight; /* Height of the visible portion of the*/
/* split screen. */
extern WORD Page0_Offs; /* Offset in VRAM of main virt. screen */
extern WORD Page1_Offs; /* Offset in VRAM of 2nd virt. screen */
extern WORD ScrnLogicalByteWidth; /* Virtual screen width in bytes */
extern WORD ScrnLogicalPixelWidth; /* Virtual screen width in pixels */
extern WORD ScrnLogicalHeight; /* Virtual screen height in pixels */
extern WORD MaxScrollX; /* Max X position of physical screen */
/* within virtual screen */
extern WORD MaxScrollY; /* Max Y position of physical screen */
/* within virtual screen */
extern WORD DoubleBufferActive; /* Indicates whether double buffering */
/* is active */
extern WORD VisiblePageIdx; /* Index number of visible page 0 or 1 */
extern WORD HiddenPageOffs; /* Offset of Hidden Pg | only valid */
extern WORD VisiblePageOffs; /* Offset of Visible Pg| for D.B. mode */
extern WORD NonVisual_Offs; /* Offset of first non-visible VRAM */

extern WORD TopClip; /* Clipping rectangle */
extern WORD BottomClip;
extern WORD LeftClip;
extern WORD RightClip;

extern WORD PhysicalStartPixelX; /* Coordinates of physical (visible) */
extern WORD PhysicalStartByteX; /* screen relative to the virtual */
extern WORD PhysicalStartY; /* screen's U.L. corner */
}
#endif




  3 Responses to “Category : C Source Code
Archive   : YICONS24.ZIP
Filename : XLIB.H

  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/