vgamodes.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. //
  16. // vgamodes.h: VGA mode set tables
  17. //
  18. #include "vregset.h"
  19. int VGA_InitMode (viddef_t *vid, vmode_t *pcurrentmode);
  20. void VGA_SwapBuffers (viddef_t *vid, vmode_t *pcurrentmode, vrect_t *rects);
  21. void VGA_SetPalette (viddef_t *vid, vmode_t *pcurrentmode,
  22. unsigned char *pal);
  23. ///////////////////////////////////////////////////////////////////////////
  24. // the following base mode descriptors plus extra data together provide all
  25. // the data needed to do VGA mode sets
  26. ///////////////////////////////////////////////////////////////////////////
  27. typedef struct {
  28. int vidbuffer;
  29. int *pregset;
  30. } vextra_t;
  31. int vrsnull[] = {
  32. VRS_END,
  33. };
  34. int vrs320x200x256planar[] = {
  35. //
  36. // switch to linear, non-chain4 mode
  37. //
  38. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  39. VRS_BYTE_OUT, SC_DATA, 1,
  40. VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
  41. VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
  42. VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
  43. VRS_BYTE_RMW, GC_DATA, ~0x13, 0x00,
  44. VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
  45. VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
  46. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  47. VRS_BYTE_OUT, SC_DATA, 3,
  48. //
  49. // change the CRTC from doubleword to byte mode
  50. //
  51. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  52. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  53. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  54. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  55. VRS_END,
  56. };
  57. int vrs360x200x256planar[] = {
  58. //
  59. // switch to linear, non-chain4 mode
  60. //
  61. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  62. VRS_BYTE_OUT, SC_DATA, 1,
  63. VRS_WORD_OUT, SC_INDEX, 0x0604,
  64. VRS_BYTE_OUT, MISC_OUTPUT, 0x67,
  65. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  66. VRS_BYTE_OUT, SC_DATA, 3,
  67. //
  68. // unprotect CRTC0 through CRTC0
  69. //
  70. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  71. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  72. //
  73. // change the CRTC from doubleword to byte mode
  74. //
  75. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  76. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  77. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  78. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  79. //
  80. // set up the CRT Controller
  81. //
  82. VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
  83. VRS_WORD_OUT, CRTC_INDEX, 0x5901,
  84. VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
  85. VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
  86. VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
  87. VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
  88. VRS_WORD_OUT, CRTC_INDEX, 0x3013,
  89. VRS_END,
  90. };
  91. int vrs320x240x256planar[] = {
  92. //
  93. // switch to linear, non-chain4 mode
  94. //
  95. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  96. VRS_BYTE_OUT, SC_DATA, 1,
  97. VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
  98. VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
  99. VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
  100. VRS_BYTE_RMW, GC_DATA, ~0x13, 0x00,
  101. VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
  102. VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
  103. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  104. VRS_BYTE_OUT, SC_DATA, 3,
  105. //
  106. // unprotect CRTC0 through CRTC0
  107. //
  108. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  109. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  110. //
  111. // set up the CRT Controller
  112. //
  113. VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
  114. VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
  115. VRS_WORD_OUT, CRTC_INDEX, 0x4109,
  116. VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
  117. VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
  118. VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
  119. VRS_WORD_OUT, CRTC_INDEX, 0x0014,
  120. VRS_WORD_OUT, CRTC_INDEX, 0xE715,
  121. VRS_WORD_OUT, CRTC_INDEX, 0x0616,
  122. VRS_WORD_OUT, CRTC_INDEX, 0xE317,
  123. VRS_END,
  124. };
  125. int vrs360x240x256planar[] = {
  126. //
  127. // switch to linear, non-chain4 mode
  128. //
  129. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  130. VRS_BYTE_OUT, SC_DATA, 1,
  131. VRS_WORD_OUT, SC_INDEX, 0x0604,
  132. VRS_BYTE_OUT, MISC_OUTPUT, 0xE7,
  133. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  134. VRS_BYTE_OUT, SC_DATA, 3,
  135. //
  136. // unprotect CRTC0 through CRTC0
  137. //
  138. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  139. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  140. //
  141. // set up the CRT Controller
  142. //
  143. VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
  144. VRS_WORD_OUT, CRTC_INDEX, 0x5901,
  145. VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
  146. VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
  147. VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
  148. VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
  149. VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
  150. VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
  151. VRS_WORD_OUT, CRTC_INDEX, 0x4109,
  152. VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
  153. VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
  154. VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
  155. VRS_WORD_OUT, CRTC_INDEX, 0x3013,
  156. VRS_WORD_OUT, CRTC_INDEX, 0x0014,
  157. VRS_WORD_OUT, CRTC_INDEX, 0xE715,
  158. VRS_WORD_OUT, CRTC_INDEX, 0x0616,
  159. VRS_WORD_OUT, CRTC_INDEX, 0xE317,
  160. VRS_END,
  161. };
  162. int vrs320x350x256planar[] = {
  163. //
  164. // switch to linear, non-chain4 mode
  165. //
  166. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  167. VRS_BYTE_OUT, SC_DATA, 1,
  168. VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
  169. VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
  170. VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
  171. VRS_BYTE_RMW, GC_DATA, ~0x10, 0x00,
  172. VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
  173. VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
  174. VRS_BYTE_OUT, MISC_OUTPUT, 0xA3, // 350-scan-line scan rate
  175. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  176. VRS_BYTE_OUT, SC_DATA, 3,
  177. //
  178. // unprotect CRTC0 through CRTC0
  179. //
  180. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  181. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  182. //
  183. // stop scanning each line twice
  184. //
  185. VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
  186. VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
  187. //
  188. // change the CRTC from doubleword to byte mode
  189. //
  190. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  191. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  192. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  193. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  194. //
  195. // set the vertical counts for 350-scan-line mode
  196. //
  197. VRS_WORD_OUT, CRTC_INDEX, 0xBF06,
  198. VRS_WORD_OUT, CRTC_INDEX, 0x1F07,
  199. VRS_WORD_OUT, CRTC_INDEX, 0x8310,
  200. VRS_WORD_OUT, CRTC_INDEX, 0x8511,
  201. VRS_WORD_OUT, CRTC_INDEX, 0x5D12,
  202. VRS_WORD_OUT, CRTC_INDEX, 0x6315,
  203. VRS_WORD_OUT, CRTC_INDEX, 0xBA16,
  204. VRS_END,
  205. };
  206. int vrs360x350x256planar[] = {
  207. //
  208. // switch to linear, non-chain4 mode
  209. //
  210. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  211. VRS_BYTE_OUT, SC_DATA, 1,
  212. VRS_WORD_OUT, SC_INDEX, 0x0604,
  213. VRS_BYTE_OUT, MISC_OUTPUT, 0xA7, // 350-scan-line scan rate
  214. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  215. VRS_BYTE_OUT, SC_DATA, 3,
  216. //
  217. // unprotect CRTC0 through CRTC0
  218. //
  219. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  220. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  221. //
  222. // stop scanning each line twice
  223. //
  224. VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
  225. VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
  226. //
  227. // change the CRTC from doubleword to byte mode
  228. //
  229. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  230. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  231. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  232. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  233. //
  234. // set the vertical counts for 350-scan-line mode and 360 pixels across
  235. //
  236. VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
  237. VRS_WORD_OUT, CRTC_INDEX, 0x5901,
  238. VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
  239. VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
  240. VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
  241. VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
  242. VRS_WORD_OUT, CRTC_INDEX, 0xBF06,
  243. VRS_WORD_OUT, CRTC_INDEX, 0x1F07,
  244. VRS_WORD_OUT, CRTC_INDEX, 0x8310,
  245. VRS_WORD_OUT, CRTC_INDEX, 0x8511,
  246. VRS_WORD_OUT, CRTC_INDEX, 0x5D12,
  247. VRS_WORD_OUT, CRTC_INDEX, 0x3013,
  248. VRS_WORD_OUT, CRTC_INDEX, 0x6315,
  249. VRS_WORD_OUT, CRTC_INDEX, 0xBA16,
  250. VRS_END,
  251. };
  252. int vrs320x400x256planar[] = {
  253. //
  254. // switch to linear, non-chain4 mode
  255. //
  256. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  257. VRS_BYTE_OUT, SC_DATA, 1,
  258. VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
  259. VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
  260. VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
  261. VRS_BYTE_RMW, GC_DATA, ~0x10, 0x00,
  262. VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
  263. VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
  264. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  265. VRS_BYTE_OUT, SC_DATA, 3,
  266. //
  267. // stop scanning each line twice
  268. //
  269. VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
  270. VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
  271. //
  272. // change the CRTC from doubleword to byte mode
  273. //
  274. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  275. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  276. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  277. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  278. VRS_END,
  279. };
  280. int vrs360x400x256planar[] = {
  281. //
  282. // switch to linear, non-chain4 mode
  283. //
  284. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  285. VRS_BYTE_OUT, SC_DATA, 1,
  286. VRS_WORD_OUT, SC_INDEX, 0x0604,
  287. VRS_BYTE_OUT, MISC_OUTPUT, 0x67,
  288. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  289. VRS_BYTE_OUT, SC_DATA, 3,
  290. //
  291. // unprotect CRTC0 through CRTC0
  292. //
  293. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  294. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  295. //
  296. // stop scanning each line twice
  297. //
  298. VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
  299. VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
  300. //
  301. // change the CRTC from doubleword to byte mode
  302. //
  303. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  304. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  305. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  306. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  307. //
  308. // set up the CRT Controller
  309. //
  310. VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
  311. VRS_WORD_OUT, CRTC_INDEX, 0x5901,
  312. VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
  313. VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
  314. VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
  315. VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
  316. VRS_WORD_OUT, CRTC_INDEX, 0x3013,
  317. VRS_END,
  318. };
  319. int vrs320x480x256planar[] = {
  320. //
  321. // switch to linear, non-chain4 mode
  322. //
  323. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  324. VRS_BYTE_OUT, SC_DATA, 1,
  325. VRS_BYTE_OUT, SC_INDEX, MEMORY_MODE,
  326. VRS_BYTE_RMW, SC_DATA, ~0x08, 0x04,
  327. VRS_BYTE_OUT, GC_INDEX, GRAPHICS_MODE,
  328. VRS_BYTE_RMW, GC_DATA, ~0x10, 0x00,
  329. VRS_BYTE_OUT, GC_INDEX, MISCELLANOUS,
  330. VRS_BYTE_RMW, GC_DATA, ~0x02, 0x00,
  331. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  332. VRS_BYTE_OUT, SC_DATA, 3,
  333. //
  334. // unprotect CRTC0 through CRTC0
  335. //
  336. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  337. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  338. //
  339. // stop scanning each line twice
  340. //
  341. VRS_BYTE_OUT, CRTC_INDEX, MAX_SCAN_LINE,
  342. VRS_BYTE_RMW, CRTC_DATA, ~0x1F, 0x00,
  343. //
  344. // change the CRTC from doubleword to byte mode
  345. //
  346. VRS_BYTE_OUT, CRTC_INDEX, UNDERLINE,
  347. VRS_BYTE_RMW, CRTC_DATA, ~0x40, 0x00,
  348. VRS_BYTE_OUT, CRTC_INDEX, MODE_CONTROL,
  349. VRS_BYTE_RMW, CRTC_DATA, ~0x00, 0x40,
  350. //
  351. // set up the CRT Controller
  352. //
  353. VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
  354. VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
  355. VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
  356. VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
  357. VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
  358. VRS_WORD_OUT, CRTC_INDEX, 0xE715,
  359. VRS_WORD_OUT, CRTC_INDEX, 0x0616,
  360. VRS_END,
  361. };
  362. int vrs360x480x256planar[] = {
  363. //
  364. // switch to linear, non-chain4 mode
  365. //
  366. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  367. VRS_BYTE_OUT, SC_DATA, 1,
  368. VRS_WORD_OUT, SC_INDEX, 0x0604,
  369. VRS_BYTE_OUT, MISC_OUTPUT, 0xE7,
  370. VRS_BYTE_OUT, SC_INDEX, SYNC_RESET,
  371. VRS_BYTE_OUT, SC_DATA, 3,
  372. //
  373. // unprotect CRTC0 through CRTC0
  374. //
  375. VRS_BYTE_OUT, CRTC_INDEX, 0x11,
  376. VRS_BYTE_RMW, CRTC_DATA, ~0x80, 0x00,
  377. //
  378. // set up the CRT Controller
  379. //
  380. VRS_WORD_OUT, CRTC_INDEX, 0x6B00,
  381. VRS_WORD_OUT, CRTC_INDEX, 0x5901,
  382. VRS_WORD_OUT, CRTC_INDEX, 0x5A02,
  383. VRS_WORD_OUT, CRTC_INDEX, 0x8E03,
  384. VRS_WORD_OUT, CRTC_INDEX, 0x5E04,
  385. VRS_WORD_OUT, CRTC_INDEX, 0x8A05,
  386. VRS_WORD_OUT, CRTC_INDEX, 0x0D06,
  387. VRS_WORD_OUT, CRTC_INDEX, 0x3E07,
  388. VRS_WORD_OUT, CRTC_INDEX, 0x4009,
  389. VRS_WORD_OUT, CRTC_INDEX, 0xEA10,
  390. VRS_WORD_OUT, CRTC_INDEX, 0xAC11,
  391. VRS_WORD_OUT, CRTC_INDEX, 0xDF12,
  392. VRS_WORD_OUT, CRTC_INDEX, 0x3013,
  393. VRS_WORD_OUT, CRTC_INDEX, 0x0014,
  394. VRS_WORD_OUT, CRTC_INDEX, 0xE715,
  395. VRS_WORD_OUT, CRTC_INDEX, 0x0616,
  396. VRS_WORD_OUT, CRTC_INDEX, 0xE317,
  397. VRS_END,
  398. };
  399. //
  400. // extra VGA-specific data for vgavidmodes
  401. //
  402. vextra_t extra320x200x256linear = {
  403. 1, vrsnull
  404. };
  405. vextra_t extra320x200x256planar = {
  406. 1, vrs320x200x256planar
  407. };
  408. vextra_t extra360x200x256planar = {
  409. 1, vrs360x200x256planar
  410. };
  411. vextra_t extra320x240x256planar = {
  412. 1, vrs320x240x256planar
  413. };
  414. vextra_t extra360x240x256planar = {
  415. 1, vrs360x240x256planar
  416. };
  417. vextra_t extra320x350x256planar = {
  418. 1, vrs320x350x256planar
  419. };
  420. vextra_t extra360x350x256planar = {
  421. 1, vrs360x350x256planar
  422. };
  423. vextra_t extra320x400x256planar = {
  424. 1, vrs320x400x256planar
  425. };
  426. vextra_t extra360x400x256planar = {
  427. 1, vrs360x400x256planar
  428. };
  429. vextra_t extra320x480x256planar = {
  430. 1, vrs320x480x256planar
  431. };
  432. vextra_t extra360x480x256planar = {
  433. 1, vrs360x480x256planar
  434. };
  435. //
  436. // base mode descriptors, in ascending order of number of pixels
  437. //
  438. vmode_t vgavidmodes[] = {
  439. {
  440. NULL,
  441. "320x200", " ***** standard VGA modes ***** ",
  442. 320, 200, (200.0/320.0)*(320.0/240.0), 320, 0, 1, &extra320x200x256linear,
  443. VGA_InitMode, VGA_SwapBuffers, VGA_SetPalette,
  444. VGA_BeginDirectRect, VGA_EndDirectRect
  445. },
  446. {
  447. NULL,
  448. "320x200", " ***** Mode X-style modes ***** ",
  449. 320, 200, (200.0/320.0)*(320.0/240.0), 320, 1, 1, &extra320x200x256planar,
  450. VGA_InitMode, VGA_SwapBuffers, VGA_SetPalette,
  451. VGA_BeginDirectRect, VGA_EndDirectRect
  452. },
  453. {
  454. NULL,
  455. "360x200", NULL, 360, 200, (200.0/360.0)*(320.0/240.0),
  456. 384, 1, 1, &extra360x200x256planar, VGA_InitMode,
  457. VGA_SwapBuffers,
  458. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  459. },
  460. {
  461. NULL,
  462. "320x240", NULL, 320, 240, (240.0/320.0)*(320.0/240.0),
  463. 320, 1, 1, &extra320x240x256planar, VGA_InitMode,
  464. VGA_SwapBuffers,
  465. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  466. },
  467. {
  468. NULL,
  469. "360x240", NULL, 360, 240, (240.0/360.0)*(320.0/240.0),
  470. 384, 1, 1, &extra360x240x256planar,
  471. VGA_InitMode, VGA_SwapBuffers, VGA_SetPalette,
  472. VGA_BeginDirectRect, VGA_EndDirectRect
  473. },
  474. {
  475. NULL,
  476. "320x350", NULL, 320, 350, (350.0/320.0)*(320.0/240.0),
  477. 320, 1, 1, &extra320x350x256planar, VGA_InitMode,
  478. VGA_SwapBuffers,
  479. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  480. },
  481. {
  482. NULL,
  483. "360x350", NULL, 360, 350, (350.0/360.0)*(320.0/240.0),
  484. 384, 1, 1, &extra360x350x256planar, VGA_InitMode,
  485. VGA_SwapBuffers,
  486. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  487. },
  488. {
  489. NULL,
  490. "320x400", NULL, 320, 400, (400.0/320.0)*(320.0/240.0), 320,
  491. 1, 1, &extra320x400x256planar, VGA_InitMode,
  492. VGA_SwapBuffers,
  493. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  494. },
  495. {
  496. NULL,
  497. "360x400", NULL, 360, 400, (400.0/360.0)*(320.0/240.0),
  498. 384, 1, 1, &extra360x400x256planar, VGA_InitMode,
  499. VGA_SwapBuffers,
  500. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  501. },
  502. {
  503. NULL,
  504. "320x480", NULL, 320, 480, (480.0/320.0)*(320.0/240.0),
  505. 320, 1, 1, &extra320x480x256planar, VGA_InitMode,
  506. VGA_SwapBuffers,
  507. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  508. },
  509. {
  510. NULL,
  511. "360x480", NULL, 360, 480, (480.0/360.0)*(320.0/240.0),
  512. 384, 1, 1, &extra360x480x256planar, VGA_InitMode,
  513. VGA_SwapBuffers,
  514. VGA_SetPalette, VGA_BeginDirectRect, VGA_EndDirectRect
  515. },
  516. };