]> 4ch.mooo.com Git - 16.git/blob - 16/xlib/xlib.h
added xlib to the project and i gotta convert the damn makefile -.-
[16.git] / 16 / xlib / xlib.h
1 /*----------------------------------------------------------------------\r
2 ;\r
3 ; XLIB - header file\r
4 ;\r
5 ;\r
6 ;\r
7 ; ****** XLIB - Mode X graphics library                ****************\r
8 ; ******                                               ****************\r
9 ; ****** Written By Themie Gouthas                     ****************\r
10 ;\r
11 ; egg@dstos3.dsto.gov.au\r
12 ; teg@bart.dsto.gov.au\r
13 ;\r
14 ; Header file contributed by Darren Lyon (darren@nicky.DIALix.oz.au)\r
15 ;\r
16 ;\r
17 ;  Terminology & notes:\r
18 ;         VRAM ==   Video RAM\r
19 ;         SRAM ==   System RAM\r
20 ;         X coordinates are in pixels unless explicitly stated\r
21 ;\r
22 ;----------------------------------------------------------------------*/\r
23 \r
24 #ifndef _XLIB_H_\r
25 #define _XLIB_H_\r
26 \r
27 #define BYTE unsigned char\r
28 #define WORD unsigned int\r
29 \r
30 \r
31 #define X_MODE_320x200  0\r
32 #define X_MODE_320x240  1\r
33 #define X_MODE_360x200  2\r
34 #define X_MODE_360x240  3\r
35 #define X_MODE_376x282  4\r
36 #define X_MODE_320x400  5\r
37 #define X_MODE_320x480  6\r
38 #define X_MODE_360x400  7\r
39 #define X_MODE_360x480  8\r
40 #define X_MODE_360x360  9\r
41 #define X_MODE_376x308  10\r
42 #define X_MODE_376x564  11\r
43 #define X_MODE_256x400  12\r
44 #define X_MODE_256x480  13\r
45 \r
46 \r
47 #define BACKWARD 0\r
48 #define FORWARD  1\r
49 \r
50 #define X_MODE_INVALID  -1\r
51 #define ERROR            1\r
52 #define OK               0\r
53 \r
54 /* FUNCTIONS =========================================================== */\r
55 \r
56 #ifdef __cplusplus\r
57 extern "C" {\r
58 #endif\r
59 \r
60  WORD x_set_mode(\r
61                 WORD mode,                /* Initialize x mode           */\r
62                 WORD WidthInPixels);\r
63 \r
64   void x_select_default_plane( /*Enables Read/Write access to a    */\r
65                 BYTE plane);   /* a specified plane                */\r
66 \r
67  void x_set_splitscreen(            /* set the split screen start  */\r
68                 WORD line);         /*scan line (initialize)       */\r
69 \r
70  void x_set_start_addr(\r
71                 WORD X,             /* Set the screen start        */\r
72                 WORD Y);            /* address in video ram        */\r
73 \r
74  void x_hide_splitscreen(void); /* Disable the split screen (Split */\r
75                                 /* Screen RAM remains reserved)    */\r
76 \r
77  void x_show_splitscreen(void); /* Enable the split screen (given it */\r
78                                 /* was previously "hidden")          */\r
79 \r
80 \r
81  void x_adjust_splitscreen(   /* Adjust the start scan line of the */\r
82                 WORD line);   /* split screen                      */\r
83 \r
84 \r
85  WORD x_set_doublebuffer(         /* Enable double buffering with a    */\r
86                 WORD PageHeight); /* specified page height             */\r
87 \r
88  WORD x_set_tripplebuffer(         /* Enable tripple buffering with a    */\r
89                                 WORD PageHeight); /* specified page height             */\r
90 \r
91 \r
92  void x_page_flip(        /* Swap visible page (only when double   */\r
93                 WORD X,   /* buffering is active) & sets virt start*/\r
94                 WORD Y);\r
95 \r
96  void x_set_cliprect(      /* Define the clipping rectangle */\r
97                 WORD left, /* NOTE: left and right are in bytes */\r
98                 WORD top,\r
99                 WORD righ,\r
100                 WORD bottom);\r
101 \r
102  void x_text_mode(void);   /* return to text mode */\r
103  void x_wait_vsync(void);  /* wait for vsync */\r
104 \r
105 #ifdef __cplusplus\r
106 }\r
107 #endif\r
108 \r
109 \r
110 /* VARIABLES =========================================================== */\r
111 \r
112 extern BYTE InGraphics;             /* non zero if in X graphics mode      */\r
113 extern WORD CurrXMode;              /* contains current X graphics mode id */\r
114 extern WORD ScrnPhysicalByteWidth;  /* Physical screen width in bytes      */\r
115 extern WORD ScrnPhysicalPixelWidth; /* Physical screen width in pixels     */\r
116 extern WORD ScrnPhysicalHeight;     /* Physical screen height in pixels    */\r
117 extern WORD ErrorValue;             /* Error return value                  */\r
118 extern WORD SplitScrnOffs;          /* Offset in VRAM  of split screen     */\r
119 extern WORD SplitScrnScanLine;      /* Scan line split screen starts at    */\r
120                                     /* initially. Resizing the split scrn  */\r
121                                     /* using the other functions does not  */\r
122                                     /* change this value                   */\r
123 extern WORD SplitScrnVisibleHeight; /* Height of the visible portion of the*/\r
124                                     /* split screen.                       */\r
125 extern WORD Page0_Offs;             /* Offset in VRAM of main virt. screen */\r
126 extern WORD Page1_Offs;             /* Offset in VRAM of 2nd virt. screen  */\r
127 extern WORD Page2_Offs;             /* Offset in VRAM of 3rd virt. screen  */\r
128 extern WORD ScrnLogicalByteWidth;   /* Virtual screen width in bytes       */\r
129 extern WORD ScrnLogicalPixelWidth;  /* Virtual screen width in pixels      */\r
130 extern WORD ScrnLogicalHeight;      /* Virtual screen height in pixels     */\r
131 extern WORD MaxScrollX;             /* Max X position of physical screen   */\r
132                                     /*  within virtual screen              */\r
133 extern WORD MaxScrollY;             /* Max Y position of physical screen   */\r
134                                     /*  within virtual screen              */\r
135 extern WORD DoubleBufferActive;     /* Indicates whether double buffering  */\r
136                                                                         /* is active                           */\r
137 extern WORD TrippleBufferActive;    /* Indicates whether tripple           */\r
138                                     /* buffering is active                 */\r
139 extern WORD VisiblePageIdx;         /* Index number of visible page 0 or 1 */\r
140 extern WORD HiddenPageOffs;         /* Offset of Hidden Pg | only valid    */\r
141 extern WORD VisiblePageOffs;        /* Offset of Visible Pg| for D.B. mode */\r
142 extern WORD WaitingPageOffs;        /* Offset of Waiting Pg| for T.B. mode */\r
143 extern WORD NonVisual_Offs;         /* Offset of first non-visible VRAM    */\r
144 \r
145 extern WORD StartAddressFlag;\r
146 \r
147 extern WORD TopClip;                /* Clipping rectangle                  */\r
148 extern WORD BottomClip;\r
149 extern WORD LeftClip;\r
150 extern WORD RightClip;\r
151 \r
152 extern WORD PhysicalStartPixelX;    /* Coordinates of physical (visible) */\r
153 extern WORD PhysicalStartByteX;     /* screen relative to the virtual    */\r
154 extern WORD PhysicalStartY;         /* screen's U.L. corner              */\r
155 \r
156 extern char* VsyncPaletteBuffer;\r
157 \r
158 #endif\r
159 \r
160 \r