2 Copyright (C) 1998 BJ Eirich (aka vecna)
\r
3 This program is free software; you can redistribute it and/or
\r
4 modify it under the terms of the GNU General Public License
\r
5 as published by the Free Software Foundation; either version 2
\r
6 of the License, or (at your option) any later version.
\r
7 This program is distributed in the hope that it will be useful,
\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
10 See the GNU General Public Lic
\r
11 See the GNU General Public License for more details.
\r
12 You should have received a copy of the GNU General Public License
\r
13 along with this program; if not, write to the Free Software
\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
19 #include "mode13h.h"
\r
22 // ================================= Data ====================================
\r
24 // Driver function-pointers.
\r
25 int (*ShutdownVideo) (void);
\r
26 int (*ShowPage) (void);
\r
27 int (*CopySprite) (int x, int y, int width, int height, char *src);
\r
28 int (*CCopySprite) (int x, int y, int width, int height, char *src);
\r
29 int (*TCCopySprite) (int x, int y, int width, int height, char *src);
\r
30 int (*TCopySprite) (int x, int y, int width, int height, char *src);
\r
31 int (*CopyTile) (int x, int y, char *src);
\r
32 int (*FilledBox) (int x, int y, int width, int height, char c);
\r
33 int (*VLine) (int x, int y, int height, char color);
\r
34 int (*HLine) (int x, int y, int width, char color);
\r
35 int (*ColorGrid) (int x, int y, char c);
\r
36 int (*ClearScreen) (void);
\r
37 int (*CopySpriteLucentClip) (int x, int y, int width, int height, unsigned char *src);
\r
39 unsigned char pal[768], pal2[768];
\r
40 unsigned char *screen=0;
\r
48 // ================================= Code ====================================
\r
50 void InitVideo(int mode)
\r
54 case 0: InitMode13h(); break;
\r
55 case 1: InitModeX(); // 320x240
\r
60 void SetPalette(unsigned char *pall)
\r
64 for (i=0; i<768; i++)
\r
65 outp(0x03c9,pall[i]);
\r
68 void GetPalette(void)
\r
72 for (i=0; i<768; i++)
\r
76 void set_intensity(unsigned int n)
\r
79 for (i=0; i<768; i++)
\r
80 pal2[i]=(pal[i]*n)>>6;
\r
85 #define byte unsigned char
\r
86 int cx1=16, cy1=16, cx2=336, cy2=256;
\r
89 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
90 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
91 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
92 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
93 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
94 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
95 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
96 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
97 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
98 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
99 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
100 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
101 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
102 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r
103 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,
\r
104 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
\r