1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
\r
4 * This file is part of Project 16.
\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
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
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
26 #include "src/lib/types.h"
\r
28 /*static const word ModeX_256x224regs[75] =
\r
57 static const word ModeX_256x192regs[] = {
\r
58 0x3200, /* Horizontal total */
\r
59 0x2701, /* horizontal display enable end */
\r
60 0x2802, /* Start horizontal blanking */
\r
61 0x2003, /* End horizontal blanking */
\r
62 0x2b04, /* Start horizontal retrace */
\r
63 0x7005, /* End horizontal retrace */
\r
64 0x0d06, /* vertical total */
\r
65 0x3e07, /* overflow (bit 8 of vertical counts) */
\r
66 0x4309, /* cell height (2 to double-scan */
\r
67 0xea10, /* v sync start */
\r
68 0xac11, /* v sync end and protect cr0-cr7 */
\r
69 0xdf12, /* vertical displayed */
\r
70 0x1413, /* offset/logical width */
\r
71 0x0014, /* turn off dword mode */
\r
72 0xe715, /* v blank start */
\r
73 0x0616, /* v blank end */
\r
74 0xe317 /* turn on byte mode */
\r
83 outp(0x3d4, 0x11); // unlock crtc
\r
84 crtc11 = inp(0x3d5) & 0x7f;
\r
86 outp(0x3d5, crtc11);
\r
95 modeName = "160x120";
\r
97 outp(0x3c2, 0xe3); // mor
\r
99 outp(0x3d4, 0x00); // crtc
\r
102 outp(0x3d4, 0x01); // crtc
\r
105 outp(0x3d4, 0x02); // crtc
\r
108 outp(0x3d4, 0x03); // crtc
\r
111 outp(0x3d4, 0x04); // crtc
\r
114 outp(0x3d4, 0x05); // crtc
\r
117 outp(0x3d4, 0x06); // crtc
\r
120 outp(0x3d4, 0x07); // crtc
\r
123 outp(0x3d4, 0x08); // crtc
\r
126 outp(0x3d4, 0x09); // crtc
\r
129 outp(0x3d4, 0x10); // crtc
\r
132 outp(0x3d4, 0x11); // crtc
\r
135 outp(0x3d4, 0x12); // crtc
\r
138 outp(0x3d4, 0x13); // crtc
\r
141 outp(0x3d4, 0x14); // crtc
\r
144 outp(0x3d4, 0x15); // crtc
\r
147 outp(0x3d4, 0x16); // crtc
\r
150 outp(0x3d4, 0x17); // crtc
\r
153 outp(0x3c4, 0x01); // seq
\r
156 outp(0x3c4, 0x03); // seq
\r
159 outp(0x3c4, 0x04); // seq
\r
162 outp(0x3ce, 0x05); // gcr
\r
165 outp(0x3ce, 0x06); // gcr
\r
169 outp(0x3c0, 0x10 | 0x20);
\r
173 outp(0x3c0, 0x11 | 0x20);
\r
177 outp(0x3c0, 0x12 | 0x20);
\r
181 outp(0x3c0, 0x13 | 0x20);
\r
185 outp(0x3c0, 0x14 | 0x20);
\r
188 outp(0x3d4, 0x11); // lock crtc
\r
189 crtc11 = inp(0x3d5) | 0x80;
\r
191 outp(0x3d5, crtc11);
\r