3 // wolf compatability
\r
7 void Quit (char *error);
\r
9 //===========================================================================
\r
12 #define SC_INDEX 0x3C4
\r
15 #define SC_MAPMASK 2
\r
16 #define SC_CHARMAP 3
\r
17 #define SC_MEMMODE 4
\r
19 #define CRTC_INDEX 0x3D4
\r
20 #define CRTC_H_TOTAL 0
\r
21 #define CRTC_H_DISPEND 1
\r
22 #define CRTC_H_BLANK 2
\r
23 #define CRTC_H_ENDBLANK 3
\r
24 #define CRTC_H_RETRACE 4
\r
25 #define CRTC_H_ENDRETRACE 5
\r
26 #define CRTC_V_TOTAL 6
\r
27 #define CRTC_OVERFLOW 7
\r
28 #define CRTC_ROWSCAN 8
\r
29 #define CRTC_MAXSCANLINE 9
\r
30 #define CRTC_CURSORSTART 10
\r
31 #define CRTC_CURSOREND 11
\r
32 #define CRTC_STARTHIGH 12
\r
33 #define CRTC_STARTLOW 13
\r
34 #define CRTC_CURSORHIGH 14
\r
35 #define CRTC_CURSORLOW 15
\r
36 #define CRTC_V_RETRACE 16
\r
37 #define CRTC_V_ENDRETRACE 17
\r
38 #define CRTC_V_DISPEND 18
\r
39 #define CRTC_OFFSET 19
\r
40 #define CRTC_UNDERLINE 20
\r
41 #define CRTC_V_BLANK 21
\r
42 #define CRTC_V_ENDBLANK 22
\r
43 #define CRTC_MODE 23
\r
44 #define CRTC_LINECOMPARE 24
\r
47 #define GC_INDEX 0x3CE
\r
48 #define GC_SETRESET 0
\r
49 #define GC_ENABLESETRESET 1
\r
50 #define GC_COLORCOMPARE 2
\r
51 #define GC_DATAROTATE 3
\r
52 #define GC_READMAP 4
\r
54 #define GC_MISCELLANEOUS 6
\r
55 #define GC_COLORDONTCARE 7
\r
56 #define GC_BITMASK 8
\r
58 #define ATR_INDEX 0x3c0
\r
60 #define ATR_OVERSCAN 17
\r
61 #define ATR_COLORPLANEENABLE 18
\r
62 #define ATR_PELPAN 19
\r
63 #define ATR_COLORSELECT 20
\r
65 #define STATUS_REGISTER_1 0x3da
\r
67 #define PEL_WRITE_ADR 0x3c8
\r
68 #define PEL_READ_ADR 0x3c7
\r
69 #define PEL_DATA 0x3c9
\r
72 //===========================================================================
\r
74 #define SCREENSEG 0xa000
\r
76 #define SCREENWIDTH 80 // default screen width in bytes
\r
77 #define MAXSCANLINES 200 // size of ylookup table
\r
82 //===========================================================================
\r
84 extern unsigned bufferofs; // all drawing is reletive to this
\r
85 extern unsigned displayofs,pelpan; // last setscreen coordinates
\r
87 extern unsigned screenseg; // set to 0xa000 for asm convenience
\r
89 extern unsigned linewidth;
\r
90 extern unsigned ylookup[MAXSCANLINES];
\r
92 extern boolean screenfaded;
\r
93 extern unsigned bordercolor;
\r
95 //===========================================================================
\r
98 // VGA hardware routines
\r
101 #define VGAWRITEMODE(x) asm{\
\r
113 #define VGAMAPMASK(x) asm{cli;mov dx,SC_INDEX;mov al,SC_MAPMASK;mov ah,x;out dx,ax;sti;}
\r
114 #define VGAREADMAP(x) asm{cli;mov dx,GC_INDEX;mov al,GC_READMAP;mov ah,x;out dx,ax;sti;}
\r
117 void VL_Startup (void);
\r
118 void VL_Shutdown (void);
\r
120 void VL_SetVGAPlane (void);
\r
121 void VL_SetTextMode (void);
\r
122 void VL_DePlaneVGA (void);
\r
123 void VL_SetVGAPlaneMode (void);
\r
124 void VL_ClearVideo (byte color);
\r
126 void VL_SetLineWidth (unsigned width);
\r
127 void VL_SetSplitScreen (int linenum);
\r
129 void VL_WaitVBL (int vbls);
\r
130 void VL_CrtcStart (int crtc);
\r
131 void VL_SetScreen (int crtc, int pelpan);
\r
133 void VL_FillPalette (int red, int green, int blue);
\r
134 void VL_SetColor (int color, int red, int green, int blue);
\r
135 void VL_GetColor (int color, int *red, int *green, int *blue);
\r
136 void VL_SetPalette (byte far *palette);
\r
137 void VL_GetPalette (byte far *palette);
\r
138 void VL_FadeOut (int start, int end, int red, int green, int blue, int steps);
\r
139 void VL_FadeIn (int start, int end, byte far *palette, int steps);
\r
140 void VL_ColorBorder (int color);
\r
142 void VL_Plot (int x, int y, int color);
\r
143 void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color);
\r
144 void VL_Vlin (int x, int y, int height, int color);
\r
145 void VL_Bar (int x, int y, int width, int height, int color);
\r
147 void VL_MungePic (byte far *source, unsigned width, unsigned height);
\r
148 void VL_DrawPicBare (int x, int y, byte far *pic, int width, int height);
\r
149 void VL_MemToLatch (byte far *source, int width, int height, unsigned dest);
\r
150 void VL_ScreenToScreen (unsigned source, unsigned dest,int width, int height);
\r
151 void VL_MemToScreen (byte far *source, int width, int height, int x, int y);
\r
152 void VL_MaskedToScreen (byte far *source, int width, int height, int x, int y);
\r
154 void VL_DrawTile8String (char *str, char far *tile8ptr, int printx, int printy);
\r
155 void VL_DrawLatch8String (char *str, unsigned tile8ptr, int printx, int printy);
\r
156 void VL_SizeTile8String (char *str, int *width, int *height);
\r
157 void VL_DrawPropString (char *str, unsigned tile8ptr, int printx, int printy);
\r
158 void VL_SizePropString (char *str, int *width, int *height, char far *font);
\r
160 void VL_TestPaletteSet (void);
\r