]> 4ch.mooo.com Git - 16.git/blob - src/lib/modex16/192x144.h
efbff3a56876b74d24772cf932bec26b63e292ff
[16.git] / src / lib / modex16 / 192x144.h
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 \r
23 #ifndef _SMALLMODEXRES_H_\r
24 #define _SMALLMODEXRES_H_\r
25 \r
26 #include "src/lib/types.h"\r
27 \r
28 /*static const word ModeX_320x240regs[75] =\r
29 {\r
30         0x3c2, 0x00, 0xe3,\r
31         0x3d4, 0x00, 0x5f,\r
32         0x3d4, 0x01, 0x4f,\r
33         0x3d4, 0x02, 0x50,\r
34         0x3d4, 0x03, 0x82,\r
35         0x3d4, 0x04, 0x54,\r
36         0x3d4, 0x05, 0x80,\r
37         0x3d4, 0x06, 0x0d,\r
38         0x3d4, 0x07, 0x3e,\r
39         0x3d4, 0x08, 0x00,\r
40         0x3d4, 0x09, 0x41,\r
41         0x3d4, 0x10, 0xea,\r
42         0x3d4, 0x11, 0xac,\r
43         0x3d4, 0x12, 0xdf,\r
44         0x3d4, 0x13, 0x28,\r
45         0x3d4, 0x14, 0x00,\r
46         0x3d4, 0x15, 0xe7,\r
47         0x3d4, 0x16, 0x06,\r
48         0x3d4, 0x17, 0xe3,\r
49         0x3c4, 0x01, 0x01,\r
50         0x3c4, 0x04, 0x06,\r
51         0x3ce, 0x05, 0x40,\r
52         0x3ce, 0x06, 0x05,\r
53         0x3c0, 0x10, 0x41,\r
54         0x3c0, 0x13, 0x00\r
55 };*/\r
56 \r
57 static const word ModeX_192x144regs[] = {\r
58         0x4f01,         /* horizontal display enable end */\r
59         0x5002,         /* Start horizontal blanking */\r
60         0x5404,         /* End horizontal blanking */\r
61         0x8005,         /* End horizontal retrace */\r
62         0x0d06,          /* vertical total */\r
63         0x3e07,          /* overflow (bit 8 of vertical counts) */\r
64         0x4109,          /* cell height (2 to double-scan */\r
65         0xea10,          /* v sync start */\r
66         0xac11,          /* v sync end and protect cr0-cr7 */\r
67         0xdf12,          /* vertical displayed */\r
68         0x2813,         /* offset/logical width */\r
69         0x0014,          /* turn off dword mode */\r
70         0xe715,          /* v blank start */\r
71         0x0616,          /* v blank end */\r
72         0xe317            /* turn on byte mode */\r
73 };//12*9\r
74 \r
75 #endif /*_SMALLMODEXRES_H_*/\r
76 /*\r
77 voidtg::mode160x120(){\r
78     int crtc11;    outp(0x3d4, 0x11); // unlock crtc\r
79     crtc11 = inp(0x3d5) & 0x7f;\r
80     outp(0x3d4, 0x11);\r
81     outp(0x3d5, crtc11);\r
82 \r
83     width   = 160;\r
84     height  = 120;\r
85     maxx    = 159;\r
86     maxy    = 119;\r
87     pages   = 13;\r
88     lineSize = 40;\r
89     pageSize = 19200;\r
90     modeName = "160x120";\r
91 \r
92     outp(0x3c2, 0xe3);   // mor\r
93 \r
94     outp(0x3d4, 0x00); // crtc\r
95     outp(0x3d5, 0x32);\r
96 \r
97     outp(0x3d4, 0x01); // crtc\r
98     outp(0x3d5, 0x27);\r
99 \r
100     outp(0x3d4, 0x02); // crtc\r
101     outp(0x3d5, 0x28);\r
102 \r
103     outp(0x3d4, 0x03); // crtc\r
104     outp(0x3d5, 0x20);\r
105 \r
106     outp(0x3d4, 0x04); // crtc\r
107     outp(0x3d5, 0x2b);\r
108 \r
109     outp(0x3d4, 0x05); // crtc\r
110     outp(0x3d5, 0x70);\r
111 \r
112     outp(0x3d4, 0x06); // crtc\r
113     outp(0x3d5, 0x0d);\r
114 \r
115     outp(0x3d4, 0x07); // crtc\r
116     outp(0x3d5, 0x3e);\r
117 \r
118     outp(0x3d4, 0x08); // crtc\r
119     outp(0x3d5, 0x00);\r
120 \r
121     outp(0x3d4, 0x09); // crtc\r
122     outp(0x3d5, 0x43);\r
123 \r
124     outp(0x3d4, 0x10); // crtc\r
125     outp(0x3d5, 0xea);\r
126 \r
127     outp(0x3d4, 0x11); // crtc\r
128     outp(0x3d5, 0xac);\r
129 \r
130     outp(0x3d4, 0x12); // crtc\r
131     outp(0x3d5, 0xdf);\r
132 \r
133     outp(0x3d4, 0x13); // crtc\r
134     outp(0x3d5, 0x14);\r
135 \r
136     outp(0x3d4, 0x14); // crtc\r
137     outp(0x3d5, 0x00);\r
138 \r
139     outp(0x3d4, 0x15); // crtc\r
140     outp(0x3d5, 0xe7);\r
141 \r
142     outp(0x3d4, 0x16); // crtc\r
143     outp(0x3d5, 0x06);\r
144 \r
145     outp(0x3d4, 0x17); // crtc\r
146     outp(0x3d5, 0xe3);\r
147 \r
148     outp(0x3c4, 0x01); // seq\r
149     outp(0x3c5, 0x01);\r
150 \r
151     outp(0x3c4, 0x03); // seq\r
152     outp(0x3c5, 0x00);\r
153 \r
154     outp(0x3c4, 0x04); // seq\r
155     outp(0x3c5, 0x06);\r
156 \r
157     outp(0x3ce, 0x05); // gcr\r
158     outp(0x3cf, 0x40);\r
159 \r
160     outp(0x3ce, 0x06); // gcr\r
161     outp(0x3cf, 0x05);\r
162 \r
163     inp(0x3da);          // acr\r
164     outp(0x3c0, 0x10 | 0x20);\r
165     outp(0x3c0, 0x41);\r
166 \r
167     inp(0x3da);          // acr\r
168     outp(0x3c0, 0x11 | 0x20);\r
169     outp(0x3c0, 0x00);\r
170 \r
171     inp(0x3da);          // acr\r
172     outp(0x3c0, 0x12 | 0x20);\r
173     outp(0x3c0, 0x0f);\r
174 \r
175     inp(0x3da);          // acr\r
176     outp(0x3c0, 0x13 | 0x20);\r
177     outp(0x3c0, 0x00);\r
178 \r
179     inp(0x3da);          // acr\r
180     outp(0x3c0, 0x14 | 0x20);\r
181     outp(0x3c0, 0x00);\r
182 \r
183     outp(0x3d4, 0x11); // lock crtc\r
184     crtc11 = inp(0x3d5) | 0x80;\r
185     outp(0x3d4, 0x11);\r
186     outp(0x3d5, crtc11);\r
187 }\r
188 */\r