-
Notifications
You must be signed in to change notification settings - Fork 1
/
SVGACC.H
277 lines (218 loc) · 10.1 KB
/
SVGACC.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/* SVGACC Include File for MS C/C++/QuickC and Borland C/C++
* Copyright 1994 by Stephen L. Balkum and Daniel A. Sill
* Zephyr Software P.O. Box 7704, Austin, Texas 78713-7704
*/
#ifndef SVGACC_H
#define SVGACC_H
typedef unsigned char byte;
typedef struct {
char r;
char g;
char b;
} RGB;
typedef RGB PaletteData[256];
typedef struct {
byte hotspotx;
byte hotspoty;
byte data[384];
} MouseCursor;
typedef struct {
byte width;
byte height;
byte data[4096];
} Font;
typedef enum {
NO_ACTION = 0,
SET,
XOR,
OR,
AND
} PixelMode;
typedef enum {
UNKNOWN = 0,
ACUMOS,
ATI,
AHEADA,
AHEADB,
CHIPSTECH,
CIRRUS,
EVEREX,
GENOA,
NCR,
OAKTECH,
PARADISE,
REALTEK,
TRIDENT,
TSENG3,
TSENG4,
VESA,
VIDEO7,
AVANCE,
MXIC,
PRIMUS
} VGAChipset;
typedef struct {
unsigned int width;
unsigned int height;
byte data[1];
} RasterBlock;
typedef struct {
int x;
int y;
} D2Point;
typedef struct {
int x;
int y;
int z;
} D3Point;
typedef struct {
int eyex;
int eyey;
int eyez;
int scrd;
int theta;
int phi;
} ProjParameters;
#ifdef __cplusplus
extern "C" {
#endif
/* Global variables */
extern const int far maxx;
extern const int far maxy;
extern const int far viewx1;
extern const int far viewy1;
extern const int far viewx2;
extern const int far viewy2;
/* 'BLocK' methods to manipulate RasterBlocks on and off the screen */
extern int far blkget (int x1, int y1, int x2, int y2, RasterBlock far *gfxblk);
extern void far blkput (PixelMode mode, int x, int y, RasterBlock far *gfxblk);
extern void far blkresize (unsigned newxsize, unsigned newysize, RasterBlock far *sourcegfxblk, RasterBlock far *destgfxblk);
extern int far blkrotate (int ang, int backfill, RasterBlock far *sourcegfxblk, RasterBlock far *destgfxblk);
extern int far blkrotatesize (int ang, RasterBlock far *sourcegfxblk);
/* 'BYTECOPY' method for fast memory copy */
extern void far bytecopy (void far *src, void far *dst, unsigned long numbytes);
/* '2D' methods to transform D2Points */
extern void far d2rotate (int points, int xorigin, int yorigin, int ang, D2Point far *inary, D2Point far *outary);
extern void far d2scale (int points, int xscale, int yscale, D2Point far *inary, D2Point far *outary);
extern void far d2translate (int points, int xtrans, int ytrans, D2Point far *inary, D2Point far *outary);
/* '3D' methods to transform D3Points */
extern int far d3project (int points, ProjParameters far *params, D3Point far *inary, D2Point far *outary);
extern void far d3rotate (int points, int xorigin, int yorigin, int zorigin, int zrang, int yrang, int xrang, D3Point far *inary, D3Point far *outary);
extern void far d3scale (int points, int xscale, int yscale, int zscale, D3Point far *inary, D3Point far *outary);
extern void far d3translate (int points, int xtrans, int ytrans, int ztrans, D3Point far *inary, D3Point far *outary);
/* 'DRaW' methods for placing text and graphics primitives on screen */
extern void far drwbox (PixelMode mode, int colr, int x1, int y1, int x2, int y2);
extern void far drwcircle (PixelMode mode, int colr, int centerx, int centery, int radius);
extern void far drwellipse (PixelMode mode, int colr, int centerx, int centery, int radiusx, int radiusy);
extern void far drwfillbox (PixelMode mode, int colr, int x1, int y1, int x2, int y2);
extern void far drwfillcircle (PixelMode mode, int colr, int centerx, int centery, int radius);
extern void far drwfillellipse (PixelMode mode, int colr, int centerx, int centery, int radiusx, int radiusy);
extern void far drwline (PixelMode mode, int colr, int x1, int y1, int x2, int y2);
extern void far drwpoint (PixelMode mode, int colr, int x, int y);
extern void far drwstring (PixelMode mode, int fcolr, int bcolr, const char far *strng, int x, int y);
extern void far drwstringdn (PixelMode mode, int fcolr, int bcolr, const char far *strng, int x, int y);
extern void far drwstringlt (PixelMode mode, int fcolr, int bcolr, const char far *strng, int x, int y);
extern void far drwstringrt (PixelMode mode, int fcolr, int bcolr, const char far *strng, int x, int y);
/* 'FILL' methods for filling various regions on screen with a color */
extern void far fillarea (int xseed, int yseed, int bordercolr, int fillcolr);
extern void far fillconvexpoly (int colr, int points, D2Point far *inary);
extern void far fillcolor (int xseed, int yseed, int oldcolr, int newcolr);
extern void far fillpage (int colr);
extern void far fillscreen (int colr);
extern void far fillview (int colr);
/* 'FONT' methods for setting the current font */
extern void far fontgetinfo (int far *wdth, int far *hght);
extern void far fontset (Font far *font);
extern void far fontsystem (void);
/* 'GET' methods to return information held by library */
extern void far getlaststring (RasterBlock far *strnggfxblk);
extern long far getarccos (long cosvalue);
extern long far getarcsin (long sinvalue);
extern long far getarctan (long tanvalue);
extern long far getcos (long angle);
extern int far getpoint (int x, int y);
extern long far getsin (long angle);
extern long far gettan (long angle);
/* 'GIF' methods to read / write GIF files and place images on screen */
extern int far gifgetinfo (const char far *name, int far *gifxsize, int far *gifysize, int far *numcolors, RGB far *pal);
extern int far gifmake (int x1, int y1, int x2, int y2, const char far *name);
extern int far gifput (PixelMode mode, int xloc, int yloc, const char far *name);
/* 'JOYSTICK' method to read joysticks' status */
extern void far joystickinfo (int far *jax, int far *jay, int far *jabuts, int far *jbx, int far *jby, int far *jbbuts);
/* 'MOUSE' methods to interact with mouse driver */
extern void far mousebutpress (int reqbut, int far *xloc, int far *yloc, int far *num, int far *mbuts);
extern void far mousebutrelease (int reqbut, int far *xloc, int far *yloc, int far *num, int far *mbuts);
extern void far mousecursordefault (void);
extern void far mousecursorset (MouseCursor far *mousecursor);
extern void far mouseenter (void);
extern void far mouseexit (void);
extern void far mousehide (void);
extern void far mouseinfo (int far *drvmajorver, int far *drvminorver, int far *mousetype, int far *irqnumber);
extern void far mouselocset (int xloc, int yloc);
extern void far mouserangeset (int x1, int y1, int x2, int y2);
extern void far mouserestorestate (byte far *mousebuf);
extern void far mousesavestate (byte far *mousebuf);
extern void far mousesensset (int xsens, int ysens, int dblspdthresh);
extern void far mouseshow (void);
extern void far mousestatus (int far *x, int far *y, int far *mbuts);
extern int far mousestoragesize (void);
extern void far overscanset (int colr);
/* 'PAGE' methods to control paging abilities */
extern int far pageactive (int page);
extern int far pagedisplay (int x, int y, int page);
/* 'PALette' methods to manipulate and activate palettes */
extern void far palchgauto (RGB far *pal, RGB far *newpal, int firstcolr, int lastcolr, int speed);
extern void far palchgstep (RGB far *pal, RGB far *newpal, int firstcolr, int lastcolr, int percent);
extern void far palcopy (RGB far *srcpal, RGB far *destpal, int firstcolr, int lastcolr);
extern void far paldimstep (RGB far *pal, int firstcolr, int lastcolr, int percent);
extern void far palget (RGB far *pal, int firstcolr, int lastcolr);
extern void far palioauto (RGB far *pal, int firstcolr, int lastcolr, int speed);
extern void far palrotate (RGB far *pal, int firstcolr, int lastcolr, int shift);
extern void far palset (RGB far *pal, int firstcolr, int lastcolr);
/* 'RESolution' methods to set various video modes */
extern int far res320 (void);
extern int far res640 (void);
extern int far res640l (void);
extern int far res800 (void);
extern int far res1024 (void);
extern int far res1280 (void);
extern int far restext (void);
/* 'SCROLL' methods for scrolling various sections of the screen */
extern void far scrolldn (int x1, int y1, int x2, int y2, int num, int colr);
extern void far scrolllt (int x1, int y1, int x2, int y2, int num, int colr);
extern void far scrollrt (int x1, int y1, int x2, int y2, int num, int colr);
extern void far scrollup (int x1, int y1, int x2, int y2, int num, int colr);
/* 'Sync' DELAY method */
extern void far sdelay (int count);
/* 'SET' methods to adjust library internal variables */
extern void far setcard (VGAChipset chip, int mem);
extern void far setview (int x1, int y1, int x2, int y2);
/* 'SPRITE' methods for manipulating sprites on and off screen */
extern int far spritecolldetect (int transcolr, int x1, int y1, int x2, int y2, RasterBlock far *sprite1, RasterBlock far *sprite2);
extern void far spritegap (int transcolr, int x, int y, RasterBlock far *sprite, RasterBlock far *spritebkgnd);
extern void far spriteget (int transcolr, int x, int y, RasterBlock far *sprite, RasterBlock far *spritebkgnd);
extern void far spriteput (PixelMode mode, int transcolr, int x, int y, RasterBlock far *sprite);
/* 'VIDEO' methods to interact with video mode and display */
extern int far videomodeget (void);
extern void far videomodeset (int videomode);
extern void far videooff (void);
extern void far videoon (void);
/* 'Identification' methods to discover WHICH hardware is available */
extern int far whichcpu (void);
extern int far whichjoystick (void);
extern int far whichmem (void);
extern int far whichmouse (void);
extern VGAChipset far whichvga (void);
extern int far whichxms (unsigned int far *xmskbytesavail, unsigned int far *xmshandlesavail);
/* 'XMS' methods to store and retrieve extended memory */
extern int far xmsallocate (unsigned int reqkbytes);
extern int far xmscopy (int xmssrchandle, long srcoffset, int xmsdesthandle, long destoffset, unsigned long count);
extern int far xmserror (void);
extern int far xmsfree (int xmshandle);
extern int far xmsget (int xmshandle, long offset, void far *destmem, unsigned long count);
extern int far xmsput (void far *sourcemem, int xmshandle, long offset, unsigned long count);
#ifdef __cplusplus
}
#endif
#endif
/* SVGACC_H */