]> 4ch.mooo.com Git - 16.git/blob - 16/x/modex.pas
^^ ok!
[16.git] / 16 / x / modex.pas
1 (*\r
2    Turbo Pascal interface to the MODEX library\r
3    Copyright (c) 1993,1994 by Alessandro Scotti\r
4 *)\r
5 unit ModeX;\r
6 interface\r
7 \r
8 const\r
9   (* Video modes *)\r
10   MX_TEXT       = 0;\r
11   MX_320x175    = 1;\r
12   MX_320x200    = 2;\r
13   MX_320x240    = 3;\r
14   MX_320x350    = 4;\r
15   MX_320x400    = 5;\r
16   MX_320x480    = 6;\r
17   MX_360x175    = 7;\r
18   MX_360x200    = 8;\r
19   MX_360x240    = 9;\r
20   MX_360x350    = 10;\r
21   MX_360x400    = 11;\r
22   MX_360x480    = 12;\r
23   MX_400x600    = 13;\r
24 \r
25   (* Fade effects *)\r
26   MX_FADEIN     = 0;\r
27   MX_FADEOUT    = 1;\r
28 \r
29   (* Raster ops *)\r
30   OP_SET        = 0;\r
31   OP_AND        = 1;\r
32   OP_OR         = 2;\r
33   OP_XOR        = 3;\r
34   OP_TRANS      = 4;\r
35   OP_ADD        = 5;\r
36   OP_MOVE       = 0;                    (* Alias for OP_SET *)\r
37 \r
38 procedure mxBitBlt( SX, SY: integer; Width, Height: word; DX, DY: integer );\r
39 procedure mxCircle( CX, CY: integer; Radius: word; Color: byte );\r
40 procedure mxChangeMode( Mode: word );\r
41 procedure mxColorToGray( ColorPalette, GrayPalette: pointer; Count: word );\r
42 procedure mxFadePalette( Palette: pointer; Cmd, Start, Count, R, G, B: word );\r
43 procedure mxFillBox( X, Y: integer; Width, Height: word; Color: byte; Op: word );\r
44 procedure mxGammaCorrect( ColorPalette, GammaPalette: pointer; Count: word );\r
45 procedure mxGetAspect( var AspectX, AspectY: word );\r
46 function  mxGetClipRegion( var X1, Y1, Width, Height: word ): boolean;\r
47 function  mxGetClip: boolean;\r
48 procedure mxGetImage( Image: pointer; X, Y: integer; Width, Height: word );\r
49 procedure mxGetPalette( Palette: pointer; Start, Count: word );\r
50 function  mxGetPixel( X, Y: word ): byte;\r
51 procedure mxGetScreenSize( var Width, Height: word );\r
52 procedure mxGetTextStep( var DeltaX, DeltaY: integer );\r
53 function  mxGetVersion: word;\r
54 procedure mxGetVirtualScreen( var Width, Height: word );\r
55 procedure mxInit;\r
56 procedure mxLine( X1, Y1, X2, Y2: integer; Color, Op: word );\r
57 procedure mxOutChar( X, Y: integer; C: char );\r
58 procedure mxOutText( X, Y: integer; S: pointer );\r
59 procedure mxPan( X, Y: word );\r
60 procedure mxPutImage( Image: pointer; X, Y: integer; Width, Height, Op: word );\r
61 procedure mxPutPixel( X, Y: word; C: byte );\r
62 procedure mxPutTile( Tile: pointer; X, Y: integer; Width, Height: word );\r
63 procedure mxReadPlane( Plane: byte );\r
64 procedure mxRotatePalette( Palette: pointer; Count: word; Step: integer );\r
65 procedure mxRowAddress( RowAddress: byte );\r
66 function  mxSetClip( Clip: boolean ): boolean;\r
67 procedure mxSetClipRegion( X1, Y1, Width, Height: word );\r
68 procedure mxSetColor( Index, R, G, B: word );\r
69 procedure mxSetFont( Font: pointer; Width, Height: word );\r
70 procedure mxSetMode( Mode: word );\r
71 procedure mxSetPalette( Palette: pointer; Start, Count: word );\r
72 procedure mxSetTextColor( Color, Op: word );\r
73 procedure mxSetTextStep( DeltaX, DeltaY: integer );\r
74 procedure mxSetVirtualScreen( Width, Height: word );\r
75 procedure mxStretchImage( Image: pointer; X, Y: integer; Width, Height, NewWidth, NewHeight, Op: word );\r
76 procedure mxSplitScreen( Line: word );\r
77 procedure mxStartAddress( StartAddress: word );\r
78 procedure mxStartLine( Line: word );\r
79 procedure mxTerm;\r
80 procedure mxTransPutTile( Tile: pointer; X, Y: integer; Width, Height: word );\r
81 procedure mxWaitDisplay;\r
82 procedure mxWaitRetrace;\r
83 procedure mxWriteMode( Mode: byte );\r
84 procedure mxWritePlane( Plane: byte );\r
85 \r
86 procedure mxFillPoly( Count: word; var Map, Points; Color: word );\r
87 procedure mxGouraudPoly( Count: word; var Map, Points, Colors; BaseColor: word );\r
88 procedure mxTexturePoly( Count: word; var Map, Points, ImgPoints, Texture; Width: word );\r
89 \r
90 procedure mxOutStr( X, Y: integer; S: string );\r
91 \r
92 implementation\r
93 \r
94 procedure mxBitBlt;                                             external;\r
95 procedure mxChangeMode( Mode: word );                           external;\r
96 procedure mxCircle;                                             external;\r
97 procedure mxColorToGray;                                        external;\r
98 procedure mxFadePalette;                                        external;\r
99 procedure mxFillBox;                                            external;\r
100 procedure mxGammaCorrect;                                       external;\r
101 procedure mxGetAspect( var AspectX, AspectY: word );            external;\r
102 function  mxGetClipRegion;                                      external;\r
103 function  mxGetClip: boolean;                                   external;\r
104 procedure mxGetImage;                                           external;\r
105 procedure mxGetPalette( Palette: pointer; Start, Count: word ); external;\r
106 function  mxGetPixel( X, Y: word ): byte;                       external;\r
107 procedure mxGetScreenSize( var Width, Height: word );           external;\r
108 procedure mxGetTextStep( var DeltaX, DeltaY: integer );         external;\r
109 function  mxGetVersion: word;                                   external;\r
110 procedure mxGetVirtualScreen( var Width, Height: word );        external;\r
111 procedure mxInit;                                               external;\r
112 procedure mxLine( X1, Y1, X2, Y2: integer; Color, Op: word );   external;\r
113 procedure mxOutChar( X, Y: integer; C: char );                  external;\r
114 procedure mxOutText( X, Y: integer; S: pointer );               external;\r
115 procedure mxPan( X, Y: word );                                  external;\r
116 procedure mxPutImage;                                           external;\r
117 procedure mxPutPixel( X, Y: word; C: byte );                    external;\r
118 procedure mxPutTile;                                            external;\r
119 procedure mxReadPlane( Plane: byte );                           external;\r
120 procedure mxRotatePalette;                                      external;\r
121 procedure mxRowAddress( RowAddress: byte );                     external;\r
122 function  mxSetClip( Clip: boolean ): boolean;                  external;\r
123 procedure mxSetClipRegion( X1, Y1, Width, Height: word );       external;\r
124 procedure mxSetColor( Index, R, G, B: word );                   external;\r
125 procedure mxSetFont( Font: pointer; Width, Height: word );      external;\r
126 procedure mxSetMode( Mode: word );                              external;\r
127 procedure mxSetPalette( Palette: pointer; Start, Count: word ); external;\r
128 procedure mxSetTextColor( Color, Op: word );                    external;\r
129 procedure mxSetTextStep( DeltaX, DeltaY: integer );             external;\r
130 procedure mxSetVirtualScreen( Width, Height: word );            external;\r
131 procedure mxSplitScreen( Line: word );                          external;\r
132 procedure mxStartAddress( StartAddress: word );                 external;\r
133 procedure mxStartLine;                                          external;\r
134 procedure mxStretchImage;                                       external;\r
135 procedure mxTerm;                                               external;\r
136 procedure mxTransPutTile;                                       external;\r
137 procedure mxWaitDisplay;                                        external;\r
138 procedure mxWaitRetrace;                                        external;\r
139 procedure mxWriteMode( Mode: byte );                            external;\r
140 procedure mxWritePlane( Plane: byte );                          external;\r
141 \r
142 procedure mxFillPoly;                                           external;\r
143 procedure mxGouraudPoly;                                        external;\r
144 procedure mxTexturePoly;                                        external;\r
145 {$L MXPB}\r
146 {$L MXPF}\r
147 {$L MXPG}\r
148 {$L MXPT}\r
149 \r
150 {$L MXBB}\r
151 {$L MXCC}\r
152 {$L MXCG}\r
153 {$L MXCL}\r
154 {$L MXCR}\r
155 {$L MXFB}\r
156 {$L MXFP}\r
157 {$L MXGI}\r
158 {$L MXGM}\r
159 {$L MXGP}\r
160 {$L MXGV}\r
161 {$L MXHL}\r
162 {$L MXIT}\r
163 {$L MXLN}\r
164 {$L MXOT}\r
165 {$L MXPI}\r
166 {$L MXPN}\r
167 {$L MXPP}\r
168 {$L MXRA}\r
169 {$L MXRP}\r
170 {$L MXSA}\r
171 {$L MXSC}\r
172 {$L MXSI}\r
173 {$L MXSL}\r
174 {$L MXSM}\r
175 {$L MXSP}\r
176 {$L MXSS}\r
177 {$L MXTL}\r
178 {$L MXVS}\r
179 {$L MXWD}\r
180 {$L MXWM}\r
181 {$L MXWP}\r
182 {$L MXWR}\r
183 \r
184 (*\r
185    Prints a Turbo Pascal string.\r
186    Note: BP 7.0 supports ASCIIZ strings (PChar type).\r
187 *)\r
188 procedure mxOutStr;\r
189 begin\r
190   S := S + #0;\r
191   mxOutText( X, Y, @S[1] );\r
192 end;\r
193 \r
194 end.\r