Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3942 lines
116 KiB

  1. /*++
  2. Copyright (c) 1992-1996 Microsoft Corporation
  3. Module Name:
  4. wddata.h
  5. Abstract:
  6. This module contains all the global data used by the Western Digital driver.
  7. Environment:
  8. Kernel mode
  9. Revision History:
  10. --*/
  11. #include "dderror.h"
  12. #include "devioctl.h"
  13. #include "miniport.h"
  14. #include "ntddvdeo.h"
  15. #include "video.h"
  16. #include "wdvga.h"
  17. #include "cmdcnst.h"
  18. #include "pvgaequ.h"
  19. //
  20. // On machines without a SVGA BIOS, we need to reset the WD chip into a
  21. // state where the standard VGA BIOS can set a mode. The reset code
  22. // below sets the WD chip back into this state.
  23. //
  24. USHORT Reset[] =
  25. {
  26. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  27. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  28. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  29. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  30. //
  31. // a strange strip which duplicates scan lines appears on the
  32. // stn panel if I execute this reset code.
  33. //
  34. // here is the line which causes the problem. Lets just leave it
  35. // out. If I need it for the other thinkpads, I'll figure out
  36. // a way to add it back.
  37. //
  38. //OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  39. //OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_244LP ,
  40. OW, GRAPH_ADDRESS_PORT, 0x0009,
  41. OW, GRAPH_ADDRESS_PORT, 0x000a,
  42. OW, GRAPH_ADDRESS_PORT, 0x400e,
  43. OW, CRTC_ADDRESS_PORT_COLOR, 0x4f09,
  44. OW, CRTC_ADDRESS_PORT_COLOR, 0x0d0a,
  45. OW, CRTC_ADDRESS_PORT_COLOR, 0x0e0b,
  46. OW, GRAPH_ADDRESS_PORT, 0xc50b,
  47. OW, GRAPH_ADDRESS_PORT, 0xc52b,
  48. OW, SEQ_ADDRESS_PORT, 0x6511,
  49. OW, SEQ_ADDRESS_PORT, 0x0d31,
  50. /*
  51. OW, 0x24, 0x4f09,
  52. OW, 0x24, 0x0d0a,
  53. OW, 0x24, 0x0e0b,
  54. OW, 0x1e, 0xc50b,
  55. OW, 0x1e, 0xc52b,
  56. OW, 0x14, 0x6511,
  57. OW, 0x14, 0x0d31,
  58. */
  59. EOD
  60. };
  61. //
  62. //
  63. // Make everything else in this module pageable
  64. //
  65. //
  66. #if defined(ALLOC_PRAGMA)
  67. #pragma data_seg("PAGE")
  68. #endif
  69. //
  70. // This structure describes to which ports access is required.
  71. //
  72. VIDEO_ACCESS_RANGE VgaAccessRange[] = {
  73. {
  74. VGA_BASE_IO_PORT, 0x00000000, // 64-bit linear base address
  75. // of range
  76. VGA_START_BREAK_PORT - VGA_BASE_IO_PORT + 1, // # of ports
  77. 1, // range is in I/O space
  78. 1, // range should be visible
  79. 0 // range should be shareable
  80. },
  81. {
  82. VGA_END_BREAK_PORT, 0x00000000,
  83. VGA_MAX_IO_PORT - VGA_END_BREAK_PORT + 1,
  84. 1,
  85. 1,
  86. 0
  87. },
  88. {
  89. 0x000A0000, 0x00000000,
  90. 0x00020000,
  91. 0,
  92. 1,
  93. 0
  94. },
  95. //
  96. // These are extended registers found only on SOME advanced WD cards.
  97. // so try to map them in if possible
  98. //
  99. {
  100. WD_EXT_PORT_START, 0x00000000,
  101. WD_EXT_PORT_END - WD_EXT_PORT_START + 1,
  102. 1,
  103. 1,
  104. 0
  105. },
  106. //
  107. // Video Setup
  108. //
  109. {
  110. 0x00000102,
  111. 0x00000000,
  112. 1,
  113. 1,
  114. 1,
  115. 0
  116. },
  117. //
  118. // Flat Panel Control Addresss/Data
  119. //
  120. {
  121. 0x00000D00,
  122. 0x00000000,
  123. 2,
  124. 1,
  125. 1,
  126. 0
  127. },
  128. //
  129. // IBM's System Management API Port location
  130. //
  131. {
  132. 0x000015EE,
  133. 0x00000000,
  134. 2,
  135. 1,
  136. 1,
  137. 0
  138. }
  139. };
  140. //
  141. // Validator Port list.
  142. // This structure describes all the ports that must be hooked out of the V86
  143. // emulator when a DOS app goes to full-screen mode.
  144. // The structure determines to which routine the data read or written to a
  145. // specific port should be sent.
  146. //
  147. EMULATOR_ACCESS_ENTRY VgaEmulatorAccessEntries[] = {
  148. //
  149. // Traps for byte OUTs.
  150. //
  151. {
  152. 0x000003b0, // range start I/O address
  153. 0xC, // range length
  154. Uchar, // access size to trap
  155. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS, // types of access to trap
  156. FALSE, // does not support string accesses
  157. (PVOID)VgaValidatorUcharEntry // routine to which to trap
  158. },
  159. {
  160. 0x000003c0, // range start I/O address
  161. 0x20, // range length
  162. Uchar, // access size to trap
  163. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS, // types of access to trap
  164. FALSE, // does not support string accesses
  165. (PVOID)VgaValidatorUcharEntry // routine to which to trap
  166. },
  167. //
  168. // Let the BIOS read the extended registers when it's running a DOS
  169. // app from fullscreen
  170. //
  171. {
  172. WD_EXT_PORT_START, // range start I/O address
  173. WD_EXT_PORT_END - WD_EXT_PORT_START + 1, // length
  174. Uchar, // access size to trap
  175. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS, // types of access to trap
  176. FALSE, // does not support string accesses
  177. (PVOID)VgaValidatorUcharEntry // routine to which to trap
  178. },
  179. //
  180. // Traps for word OUTs.
  181. //
  182. {
  183. 0x000003b0,
  184. 0x06,
  185. Ushort,
  186. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS,
  187. FALSE,
  188. (PVOID)VgaValidatorUshortEntry
  189. },
  190. {
  191. 0x000003c0,
  192. 0x10,
  193. Ushort,
  194. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS,
  195. FALSE,
  196. (PVOID)VgaValidatorUshortEntry
  197. },
  198. //
  199. // Let the BIOS read the extended registers when it's running a DOS
  200. // app from fullscreen
  201. //
  202. {
  203. WD_EXT_PORT_START,
  204. (WD_EXT_PORT_END - WD_EXT_PORT_START + 1)/2,
  205. Ushort,
  206. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS,
  207. FALSE,
  208. (PVOID)VgaValidatorUshortEntry
  209. },
  210. //
  211. // Traps for dword OUTs.
  212. //
  213. {
  214. 0x000003b0,
  215. 0x03,
  216. Ulong,
  217. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS,
  218. FALSE,
  219. (PVOID)VgaValidatorUlongEntry
  220. },
  221. {
  222. 0x000003c0,
  223. 0x08,
  224. Ulong,
  225. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS,
  226. FALSE,
  227. (PVOID)VgaValidatorUlongEntry
  228. },
  229. //
  230. // Let the BIOS read the extended registers when it's running a DOS
  231. // app from fullscreen
  232. //
  233. {
  234. WD_EXT_PORT_START,
  235. (WD_EXT_PORT_END - WD_EXT_PORT_START + 1)/4,
  236. Ulong,
  237. EMULATOR_READ_ACCESS | EMULATOR_WRITE_ACCESS,
  238. FALSE,
  239. (PVOID)VgaValidatorUlongEntry
  240. }
  241. };
  242. //
  243. // Used to trap only the sequncer and the misc output registers
  244. //
  245. VIDEO_ACCESS_RANGE MinimalVgaValidatorAccessRange[] = {
  246. {
  247. VGA_BASE_IO_PORT, 0x00000000,
  248. VGA_START_BREAK_PORT - VGA_BASE_IO_PORT + 1,
  249. 1,
  250. 1, // <- enable range IOPM so that it is not trapped.
  251. 0
  252. },
  253. {
  254. VGA_END_BREAK_PORT, 0x00000000,
  255. VGA_MAX_IO_PORT - VGA_END_BREAK_PORT + 1,
  256. 1,
  257. 1,
  258. 0
  259. },
  260. {
  261. VGA_BASE_IO_PORT + MISC_OUTPUT_REG_WRITE_PORT, 0x00000000,
  262. 0x00000001,
  263. 1,
  264. 0,
  265. 0
  266. },
  267. {
  268. VGA_BASE_IO_PORT + SEQ_ADDRESS_PORT, 0x00000000,
  269. 0x00000002,
  270. 1,
  271. 0,
  272. 0
  273. }
  274. };
  275. //
  276. // Used to trap all registers
  277. //
  278. VIDEO_ACCESS_RANGE FullVgaValidatorAccessRange[] = {
  279. {
  280. VGA_BASE_IO_PORT, 0x00000000,
  281. VGA_START_BREAK_PORT - VGA_BASE_IO_PORT + 1,
  282. 1,
  283. 0, // <- disable range in the IOPM so that it is trapped.
  284. 0
  285. },
  286. {
  287. VGA_END_BREAK_PORT, 0x00000000,
  288. VGA_MAX_IO_PORT - VGA_END_BREAK_PORT + 1,
  289. 1,
  290. 0,
  291. 0
  292. }
  293. };
  294. USHORT MODESET_MODEX_320_200[] = {
  295. OW,
  296. SEQ_ADDRESS_PORT,
  297. 0x0604,
  298. OWM,
  299. CRTC_ADDRESS_PORT_COLOR,
  300. 2,
  301. 0xe317,
  302. 0x0014,
  303. EOD
  304. };
  305. USHORT MODESET_MODEX_320_240[] = {
  306. OWM,
  307. SEQ_ADDRESS_PORT,
  308. 2,
  309. 0x0604,
  310. 0x0100,
  311. OB,
  312. MISC_OUTPUT_REG_WRITE_PORT,
  313. 0xe3,
  314. OW,
  315. SEQ_ADDRESS_PORT,
  316. 0x0300,
  317. OB,
  318. CRTC_ADDRESS_PORT_COLOR,
  319. 0x11,
  320. METAOUT+MASKOUT,
  321. CRTC_DATA_PORT_COLOR,
  322. 0x7f, 0x00,
  323. OWM,
  324. CRTC_ADDRESS_PORT_COLOR,
  325. 10,
  326. 0x0d06,
  327. 0x3e07,
  328. 0x4109,
  329. 0xea10,
  330. 0xac11,
  331. 0xdf12,
  332. 0x0014,
  333. 0xe715,
  334. 0x0616,
  335. 0xe317,
  336. OW,
  337. SEQ_ADDRESS_PORT,
  338. 0x0f02,
  339. EOD
  340. };
  341. USHORT MODESET_MODEX_320_400[] = {
  342. OW,
  343. SEQ_ADDRESS_PORT,
  344. 0x0604,
  345. OWM,
  346. CRTC_ADDRESS_PORT_COLOR,
  347. 3,
  348. 0xe317,
  349. 0x0014,
  350. 0x4009,
  351. EOD
  352. };
  353. USHORT MODESET_MODEX_320_480[] = {
  354. OWM,
  355. SEQ_ADDRESS_PORT,
  356. 2,
  357. 0x0604,
  358. 0x0100,
  359. OB,
  360. MISC_OUTPUT_REG_WRITE_PORT,
  361. 0xe3,
  362. OW,
  363. SEQ_ADDRESS_PORT,
  364. 0x0300,
  365. OB,
  366. CRTC_ADDRESS_PORT_COLOR,
  367. 0x11,
  368. METAOUT+MASKOUT,
  369. CRTC_DATA_PORT_COLOR,
  370. 0x7f, 0x00,
  371. OWM,
  372. CRTC_ADDRESS_PORT_COLOR,
  373. 10,
  374. 0x0d06,
  375. 0x3e07,
  376. 0x4109,
  377. 0xea10,
  378. 0xac11,
  379. 0xdf12,
  380. 0x0014,
  381. 0xe715,
  382. 0x0616,
  383. 0xe317,
  384. OW,
  385. SEQ_ADDRESS_PORT,
  386. 0x0f02,
  387. OW,
  388. CRTC_ADDRESS_PORT_COLOR,
  389. 0x4009,
  390. EOD
  391. };
  392. /**************************************************************************
  393. * *
  394. * Western Digital Color text mode, 640x350, 8x14 char *
  395. * *
  396. **************************************************************************/
  397. USHORT WDVGA_TEXT_1[] = {
  398. // SEQ index 7h-9h, 10h-14h
  399. OWM, // start sync reset program up sequencer
  400. SEQ_ADDRESS_PORT,
  401. 8,
  402. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  403. OWM,
  404. SEQ_ADDRESS_PORT,
  405. 5,
  406. 0x0100,0x0101,0x0302,0x0003,0x0204, // program up sequencer
  407. OB,
  408. MISC_OUTPUT_REG_WRITE_PORT,
  409. 0xa3,
  410. OW,
  411. GRAPH_ADDRESS_PORT,
  412. 0x0e06,
  413. // EndSyncResetCmd
  414. OB,
  415. SEQ_ADDRESS_PORT,
  416. IND_SYNC_RESET,
  417. OB,
  418. SEQ_DATA_PORT,
  419. END_SYNC_RESET_VALUE,
  420. // CRTC index 2ah-30h, 3eh
  421. METAOUT+INDXOUT, // program crtc registers
  422. CRTC_ADDRESS_PORT_COLOR,
  423. 7, // count
  424. 0x2a, // start index
  425. 0xf0,0x05,0x00,0x00,0x00,0x42,0x00,
  426. OW, //
  427. CRTC_ADDRESS_PORT_COLOR,
  428. 0x003e,
  429. OW,
  430. CRTC_ADDRESS_PORT_COLOR,
  431. 0x0511,
  432. METAOUT+INDXOUT, // program crtc registers
  433. CRTC_ADDRESS_PORT_COLOR,
  434. VGA_NUM_CRTC_PORTS, // count
  435. 0, // start index
  436. 0x5F,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,0x00,0x4d,0xb,0xc,0x0,0x0,0x0,0x0,
  437. 0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,0xFF,
  438. IB, // prepare atc for writing
  439. INPUT_STATUS_1_COLOR,
  440. METAOUT+ATCOUT, //
  441. ATT_ADDRESS_PORT, // port
  442. VGA_NUM_ATTRIB_CONT_PORTS, // count
  443. 0, // start index
  444. 0x0,0x1,0x2,0x3,0x4,0x5,0x14,0x7,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  445. 0x00,0x0,0x0F,0x0,0x0,
  446. METAOUT+INDXOUT, // program graphics controller registers
  447. GRAPH_ADDRESS_PORT, // port
  448. 7, // count
  449. 9, // start index
  450. 0x00,0x00,0xc6,0x02,0x00,0x00,0x05,
  451. METAOUT+INDXOUT, //
  452. GRAPH_ADDRESS_PORT, // port
  453. VGA_NUM_GRAPH_CONT_PORTS, // count
  454. 0, // start index
  455. 0x00,0x0,0x0,0x0,0x0,0x10,0x0e,0x0,0x0FF,
  456. OB,
  457. DAC_PIXEL_MASK_PORT,
  458. 0xFF,
  459. IB, // prepare atc for writing
  460. INPUT_STATUS_1_COLOR,
  461. OB, // turn video on.
  462. ATT_ADDRESS_PORT,
  463. VIDEO_ENABLE,
  464. EOD
  465. };
  466. USHORT WDVGA_640x480x256_60hz[] = {
  467. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  468. OW, GRAPH_ADDRESS_PORT, 0x410e,
  469. OW, GRAPH_ADDRESS_PORT, 0x412e,
  470. OW, SEQ_ADDRESS_PORT, 0x1d31,
  471. /*
  472. OW, 0x24, 0x8c11,
  473. OW, 0x1e, 0x410e,
  474. OW, 0x1e, 0x412e,
  475. OW, 0x14, 0x1d31,
  476. */
  477. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  478. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  479. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  480. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  481. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  482. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  483. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  484. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_s32 ,
  485. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  486. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  487. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  488. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  489. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  490. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  491. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  492. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  493. // CRTC shadows
  494. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  495. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_s32 & ~0x80),
  496. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_s32 ,
  497. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_s32 ,
  498. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_s32 ,
  499. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_s32 ,
  500. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_s32 ,
  501. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_s32 ,
  502. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_s32 ,
  503. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  504. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_s32 ,
  505. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_s32 ,
  506. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_s32 ,
  507. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_s32 ,
  508. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  509. // SEQ index 1h-4h
  510. OWM,
  511. SEQ_ADDRESS_PORT,
  512. 5,
  513. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  514. OB,
  515. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  516. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  517. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x0d ,
  518. // Dot Clock = 25.175MHz
  519. OB, // EndSyncResetCmd
  520. SEQ_ADDRESS_PORT,
  521. IND_SYNC_RESET,
  522. OB,
  523. SEQ_DATA_PORT,
  524. END_SYNC_RESET_VALUE,
  525. OW, // Unlock CRTC registers 0-7
  526. CRTC_ADDRESS_PORT_COLOR,
  527. 0x2c11,
  528. METAOUT+INDXOUT, // program crtc registers
  529. CRTC_ADDRESS_PORT_COLOR,
  530. VGA_NUM_CRTC_PORTS, // count
  531. 0, // start index
  532. 0x5F,0x4F,0x50,0x82,0x53,0x9f,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  533. 0xEA,0x2C,0xDF,0x50,0x40,0xE7,0x4,0xE3,0xFF,
  534. IB, // prepare atc for writing
  535. INPUT_STATUS_1_COLOR,
  536. METAOUT+ATCOUT, // program attribute controller registers
  537. ATT_ADDRESS_PORT, // port
  538. VGA_NUM_ATTRIB_CONT_PORTS, // count
  539. 0, // start index
  540. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  541. 0x41,0x0,0x0F,0x0,0x0,
  542. METAOUT+INDXOUT, // program graphics controller registers
  543. GRAPH_ADDRESS_PORT, // port
  544. VGA_NUM_GRAPH_CONT_PORTS, // count
  545. 0, // start index
  546. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  547. IB, // prepare atc for writing
  548. INPUT_STATUS_1_COLOR,
  549. OB, // turn video on
  550. ATT_ADDRESS_PORT,
  551. VIDEO_ENABLE,
  552. OB, // feature control
  553. FEAT_CTRL_WRITE_PORT_COLOR,
  554. 0x04,
  555. OB, // DAC mask registers
  556. DAC_PIXEL_MASK_PORT,
  557. 0xFF,
  558. EOD
  559. };
  560. //
  561. // Video Mode: 640x480x8bpp @ 72Hz
  562. // Displays: 640x480 Color TFT LCD + External CRT simultaneous display mode
  563. //
  564. USHORT WDVGA_640x480x256_72hz[] = {
  565. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  566. OW, GRAPH_ADDRESS_PORT, 0x410e,
  567. OW, GRAPH_ADDRESS_PORT, 0x412e,
  568. OW, SEQ_ADDRESS_PORT, 0x1d31,
  569. OW, 0x24, 0x8c11,
  570. OW, 0x1e, 0x410e,
  571. OW, 0x1e, 0x412e,
  572. OW, 0x14, 0x1d31,
  573. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  574. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  575. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  576. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  577. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  578. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  579. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  580. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_s32 ,
  581. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  582. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  583. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  584. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  585. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  586. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  587. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  588. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  589. // CRTC shadows
  590. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  591. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_s32 & ~0x80),
  592. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * 0x63 ,
  593. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_s32 ,
  594. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * 0x86 ,
  595. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * 0x54 ,
  596. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * 0x99 ,
  597. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_s32 ,
  598. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_s32 ,
  599. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  600. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_s32 ,
  601. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_s32 ,
  602. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_s32 ,
  603. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_s32 ,
  604. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  605. // SEQ index 1h-4h
  606. OWM,
  607. SEQ_ADDRESS_PORT,
  608. 5,
  609. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  610. OB,
  611. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  612. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  613. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x1d ,
  614. // Dot Clock = 31.500MHz
  615. OB, // EndSyncResetCmd
  616. SEQ_ADDRESS_PORT,
  617. IND_SYNC_RESET,
  618. OB,
  619. SEQ_DATA_PORT,
  620. END_SYNC_RESET_VALUE,
  621. OW, // Unlock CRTC registers 0-7
  622. CRTC_ADDRESS_PORT_COLOR,
  623. 0x2F11,
  624. METAOUT+INDXOUT, // program crtc registers
  625. CRTC_ADDRESS_PORT_COLOR,
  626. VGA_NUM_CRTC_PORTS, // count
  627. 0, // start index
  628. 0x63,0x4F,0x50,0x86,0x54,0x99,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  629. 0xEC,0x2F,0xDF,0x50,0x40,0xE7,0x4,0xE3,0xFF,
  630. IB, // prepare atc for writing
  631. INPUT_STATUS_1_COLOR,
  632. METAOUT+ATCOUT, // program attribute controller registers
  633. ATT_ADDRESS_PORT, // port
  634. VGA_NUM_ATTRIB_CONT_PORTS, // count
  635. 0, // start index
  636. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  637. 0x41,0x0,0x0F,0x0,0x0,
  638. METAOUT+INDXOUT, // program graphics controller registers
  639. GRAPH_ADDRESS_PORT, // port
  640. VGA_NUM_GRAPH_CONT_PORTS, // count
  641. 0, // start index
  642. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  643. IB, // prepare atc for writing
  644. INPUT_STATUS_1_COLOR,
  645. OB, // turn video on
  646. ATT_ADDRESS_PORT,
  647. VIDEO_ENABLE,
  648. OB, // feature control
  649. FEAT_CTRL_WRITE_PORT_COLOR,
  650. 0x04,
  651. OB, // DAC mask registers
  652. DAC_PIXEL_MASK_PORT,
  653. 0xFF,
  654. EOD
  655. };
  656. //
  657. // Video Mode: 640x480x8bpp @ 75Hz
  658. // Displays: 640x480 Color TFT LCD + External CRT simultaneous display mode
  659. //
  660. USHORT WDVGA_640x480x256_75hz[] = {
  661. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  662. OW, GRAPH_ADDRESS_PORT, 0x410e,
  663. OW, GRAPH_ADDRESS_PORT, 0x412e,
  664. OW, SEQ_ADDRESS_PORT, 0x1d31,
  665. OW, 0x24, 0x8c11,
  666. OW, 0x1e, 0x410e,
  667. OW, 0x1e, 0x412e,
  668. OW, 0x14, 0x1d31,
  669. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  670. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  671. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  672. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  673. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  674. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  675. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  676. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_s32 ,
  677. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  678. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  679. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  680. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  681. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  682. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  683. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  684. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  685. // CRTC shadows
  686. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  687. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_s32 & ~0x80),
  688. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_s32 ,
  689. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_s32 ,
  690. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_s32 ,
  691. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_s32 ,
  692. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_s32 ,
  693. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_s32 ,
  694. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_s32 ,
  695. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  696. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_s32 ,
  697. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_s32 ,
  698. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_s32 ,
  699. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_s32 ,
  700. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  701. // SEQ index 1h-4h
  702. OWM,
  703. SEQ_ADDRESS_PORT,
  704. 5,
  705. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  706. OB,
  707. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  708. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  709. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x1d ,
  710. // Dot Clock = 31.500MHz
  711. OB, // EndSyncResetCmd
  712. SEQ_ADDRESS_PORT,
  713. IND_SYNC_RESET,
  714. OB,
  715. SEQ_DATA_PORT,
  716. END_SYNC_RESET_VALUE,
  717. OW, // Unlock CRTC registers 0-7
  718. CRTC_ADDRESS_PORT_COLOR,
  719. 0x2C11,
  720. METAOUT+INDXOUT, // program crtc registers
  721. CRTC_ADDRESS_PORT_COLOR,
  722. VGA_NUM_CRTC_PORTS, // count
  723. 0, // start index
  724. 0x5F,0x4F,0x50,0x82,0x53,0x9f,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  725. 0xEA,0x2C,0xDF,0x50,0x40,0xE7,0x4,0xE3,0xFF,
  726. IB, // prepare atc for writing
  727. INPUT_STATUS_1_COLOR,
  728. METAOUT+ATCOUT, // program attribute controller registers
  729. ATT_ADDRESS_PORT, // port
  730. VGA_NUM_ATTRIB_CONT_PORTS, // count
  731. 0, // start index
  732. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  733. 0x41,0x0,0x0F,0x0,0x0,
  734. METAOUT+INDXOUT, // program graphics controller registers
  735. GRAPH_ADDRESS_PORT, // port
  736. VGA_NUM_GRAPH_CONT_PORTS, // count
  737. 0, // start index
  738. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  739. IB, // prepare atc for writing
  740. INPUT_STATUS_1_COLOR,
  741. OB, // turn video on
  742. ATT_ADDRESS_PORT,
  743. VIDEO_ENABLE,
  744. OB, // feature control
  745. FEAT_CTRL_WRITE_PORT_COLOR,
  746. 0x04,
  747. OB, // DAC mask registers
  748. DAC_PIXEL_MASK_PORT,
  749. 0xFF,
  750. EOD
  751. };
  752. //
  753. // Video Mode: 640x480x16bpp @ 60Hz
  754. // Displays: 640x480 Color TFT LCD + External CRT simultaneous display mode
  755. //
  756. USHORT WDVGA_640x480x64k_60hz[] = {
  757. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  758. OW, GRAPH_ADDRESS_PORT, 0x410e,
  759. OW, GRAPH_ADDRESS_PORT, 0x412e,
  760. OW, SEQ_ADDRESS_PORT, 0x1d31,
  761. OW, 0x24, 0x8c11,
  762. OW, 0x1e, 0x410e,
  763. OW, 0x1e, 0x412e,
  764. OW, 0x14, 0x1d31,
  765. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  766. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  767. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  768. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  769. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  770. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * (pr17_all | 0x10) ,
  771. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  772. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_s32 ,
  773. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  774. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  775. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  776. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  777. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  778. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  779. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  780. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  781. // CRTC shadows
  782. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  783. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_s32 & ~0x80),
  784. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_s32 ,
  785. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_s32 ,
  786. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_s32 ,
  787. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_s32 ,
  788. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_s32 ,
  789. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_s32 ,
  790. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_s32 ,
  791. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  792. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_s32 ,
  793. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_s32 ,
  794. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_s32 ,
  795. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_s32 ,
  796. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  797. // SEQ index 1h-4h
  798. OWM,
  799. SEQ_ADDRESS_PORT,
  800. 5,
  801. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  802. OB,
  803. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  804. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  805. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x0d ,
  806. // Dot Clock = 25.175MHz
  807. OB, // EndSyncResetCmd
  808. SEQ_ADDRESS_PORT,
  809. IND_SYNC_RESET,
  810. OB,
  811. SEQ_DATA_PORT,
  812. END_SYNC_RESET_VALUE,
  813. OW, // Unlock CRTC registers 0-7
  814. CRTC_ADDRESS_PORT_COLOR,
  815. 0x2C11,
  816. METAOUT+INDXOUT, // program crtc registers
  817. CRTC_ADDRESS_PORT_COLOR,
  818. VGA_NUM_CRTC_PORTS, // count
  819. 0, // start index
  820. 0x5F,0x4F,0x50,0x82,0x53,0x9f,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  821. 0xEA,0x2C,0xDF,0xA0,0x40,0xE7,0x4,0xE3,0xFF,
  822. IB, // prepare atc for writing
  823. INPUT_STATUS_1_COLOR,
  824. METAOUT+ATCOUT, // program attribute controller registers
  825. ATT_ADDRESS_PORT, // port
  826. VGA_NUM_ATTRIB_CONT_PORTS, // count
  827. 0, // start index
  828. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  829. 0x41,0x0,0x0F,0x0,0x0,
  830. METAOUT+INDXOUT, // program graphics controller registers
  831. GRAPH_ADDRESS_PORT, // port
  832. VGA_NUM_GRAPH_CONT_PORTS, // count
  833. 0, // start index
  834. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  835. IB, // prepare atc for writing
  836. INPUT_STATUS_1_COLOR,
  837. OB, // turn video on
  838. ATT_ADDRESS_PORT,
  839. VIDEO_ENABLE,
  840. OB, // feature control
  841. FEAT_CTRL_WRITE_PORT_COLOR,
  842. 0x04,
  843. OB, // DAC mask registers
  844. DAC_PIXEL_MASK_PORT,
  845. 0xFF,
  846. EOD
  847. };
  848. //
  849. // Video Mode: 640x480x16bpp @ 72Hz
  850. // Displays: 640x480 Color TFT LCD + External CRT simultaneous display mode
  851. //
  852. USHORT WDVGA_640x480x64k_72hz[] = {
  853. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  854. OW, GRAPH_ADDRESS_PORT, 0x410e,
  855. OW, GRAPH_ADDRESS_PORT, 0x412e,
  856. OW, SEQ_ADDRESS_PORT, 0x1d31,
  857. OW, 0x24, 0x8c11,
  858. OW, 0x1e, 0x410e,
  859. OW, 0x1e, 0x412e,
  860. OW, 0x14, 0x1d31,
  861. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  862. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  863. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  864. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  865. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  866. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * (pr17_all | 0x10) ,
  867. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  868. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_s32 ,
  869. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  870. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  871. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  872. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  873. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  874. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  875. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  876. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  877. // CRTC shadows
  878. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  879. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_s32 & ~0x80),
  880. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * 0x63 ,
  881. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_s32 ,
  882. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * 0x86 ,
  883. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * 0x54 ,
  884. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * 0x99 ,
  885. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_s32 ,
  886. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_s32 ,
  887. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  888. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_s32 ,
  889. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_s32 ,
  890. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_s32 ,
  891. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_s32 ,
  892. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  893. // SEQ index 1h-4h
  894. OWM,
  895. SEQ_ADDRESS_PORT,
  896. 5,
  897. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  898. OB,
  899. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  900. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  901. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x1d ,
  902. // Dot Clock = 31.500MHz
  903. OB, // EndSyncResetCmd
  904. SEQ_ADDRESS_PORT,
  905. IND_SYNC_RESET,
  906. OB,
  907. SEQ_DATA_PORT,
  908. END_SYNC_RESET_VALUE,
  909. OW, // Unlock CRTC registers 0-7
  910. CRTC_ADDRESS_PORT_COLOR,
  911. 0x2F11,
  912. METAOUT+INDXOUT, // program crtc registers
  913. CRTC_ADDRESS_PORT_COLOR,
  914. VGA_NUM_CRTC_PORTS, // count
  915. 0, // start index
  916. 0x63,0x4F,0x50,0x86,0x54,0x99,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  917. 0xEC,0x2F,0xDF,0xA0,0x40,0xE7,0x4,0xE3,0xFF,
  918. IB, // prepare atc for writing
  919. INPUT_STATUS_1_COLOR,
  920. METAOUT+ATCOUT, // program attribute controller registers
  921. ATT_ADDRESS_PORT, // port
  922. VGA_NUM_ATTRIB_CONT_PORTS, // count
  923. 0, // start index
  924. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  925. 0x41,0x0,0x0F,0x0,0x0,
  926. METAOUT+INDXOUT, // program graphics controller registers
  927. GRAPH_ADDRESS_PORT, // port
  928. VGA_NUM_GRAPH_CONT_PORTS, // count
  929. 0, // start index
  930. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  931. IB, // prepare atc for writing
  932. INPUT_STATUS_1_COLOR,
  933. OB, // turn video on
  934. ATT_ADDRESS_PORT,
  935. VIDEO_ENABLE,
  936. OB, // feature control
  937. FEAT_CTRL_WRITE_PORT_COLOR,
  938. 0x04,
  939. OB, // DAC mask registers
  940. DAC_PIXEL_MASK_PORT,
  941. 0xFF,
  942. EOD
  943. };
  944. //
  945. // Video Mode: 640x480x16bpp @ 75Hz
  946. // Displays: 640x480 Color TFT LCD + External CRT simultaneous display mode
  947. //
  948. USHORT WDVGA_640x480x64k_75hz[] = {
  949. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  950. OW, GRAPH_ADDRESS_PORT, 0x410e,
  951. OW, GRAPH_ADDRESS_PORT, 0x412e,
  952. OW, SEQ_ADDRESS_PORT, 0x1d31,
  953. OW, 0x24, 0x8c11,
  954. OW, 0x1e, 0x410e,
  955. OW, 0x1e, 0x412e,
  956. OW, 0x14, 0x1d31,
  957. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  958. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  959. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  960. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  961. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  962. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * (pr17_all | 0x10) ,
  963. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  964. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_s32 ,
  965. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  966. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  967. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  968. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  969. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  970. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  971. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  972. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  973. // CRTC shadows
  974. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  975. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_s32 & ~0x80),
  976. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_s32 ,
  977. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_s32 ,
  978. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_s32 ,
  979. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_s32 ,
  980. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_s32 ,
  981. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_s32 ,
  982. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_s32 ,
  983. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  984. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_s32 ,
  985. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_s32 ,
  986. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_s32 ,
  987. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_s32 ,
  988. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  989. // SEQ index 1h-4h
  990. OWM,
  991. SEQ_ADDRESS_PORT,
  992. 5,
  993. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  994. OB,
  995. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  996. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  997. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x1d ,
  998. // Dot Clock = 31.500MHz
  999. OB, // EndSyncResetCmd
  1000. SEQ_ADDRESS_PORT,
  1001. IND_SYNC_RESET,
  1002. OB,
  1003. SEQ_DATA_PORT,
  1004. END_SYNC_RESET_VALUE,
  1005. OW, // Unlock CRTC registers 0-7
  1006. CRTC_ADDRESS_PORT_COLOR,
  1007. 0x2C11,
  1008. METAOUT+INDXOUT, // program crtc registers
  1009. CRTC_ADDRESS_PORT_COLOR,
  1010. VGA_NUM_CRTC_PORTS, // count
  1011. 0, // start index
  1012. 0x5F,0x4F,0x50,0x82,0x53,0x9f,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  1013. 0xEA,0x2C,0xDF,0xA0,0x40,0xE7,0x4,0xE3,0xFF,
  1014. IB, // prepare atc for writing
  1015. INPUT_STATUS_1_COLOR,
  1016. METAOUT+ATCOUT, // program attribute controller registers
  1017. ATT_ADDRESS_PORT, // port
  1018. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1019. 0, // start index
  1020. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1021. 0x41,0x0,0x0F,0x0,0x0,
  1022. METAOUT+INDXOUT, // program graphics controller registers
  1023. GRAPH_ADDRESS_PORT, // port
  1024. VGA_NUM_GRAPH_CONT_PORTS, // count
  1025. 0, // start index
  1026. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1027. IB, // prepare atc for writing
  1028. INPUT_STATUS_1_COLOR,
  1029. OB, // turn video on
  1030. ATT_ADDRESS_PORT,
  1031. VIDEO_ENABLE,
  1032. OB, // feature control
  1033. FEAT_CTRL_WRITE_PORT_COLOR,
  1034. 0x04,
  1035. OB, // DAC mask registers
  1036. DAC_PIXEL_MASK_PORT,
  1037. 0xFF,
  1038. EOD
  1039. };
  1040. //
  1041. // Video Mode: 800x600x8bpp @ 60Hz
  1042. // Displays: 800x600 Color TFT LCD + External CRT simultaneous display mode
  1043. //
  1044. USHORT WDVGA_800x600x256_SVGA[] = {
  1045. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1046. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1047. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1048. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1049. OW, 0x24, 0x8c11,
  1050. OW, 0x1e, 0x410e,
  1051. OW, 0x1e, 0x412e,
  1052. OW, 0x14, 0x1d31,
  1053. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1054. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1055. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1056. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  1057. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1058. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  1059. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  1060. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_tft800 ,
  1061. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  1062. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_tft800 ,
  1063. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1064. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  1065. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1066. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1067. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1068. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1069. // CRTC shadows
  1070. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1071. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_tft800 & ~0x80),
  1072. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_tft800,
  1073. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_tft800,
  1074. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_tft800,
  1075. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_tft800,
  1076. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_tft800,
  1077. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_tft800,
  1078. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_tft800,
  1079. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x20 ,
  1080. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_tft800,
  1081. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_tft800,
  1082. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_tft800,
  1083. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_tft800,
  1084. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  1085. // SEQ index 1h-4h
  1086. OWM,
  1087. SEQ_ADDRESS_PORT,
  1088. 5,
  1089. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1090. OB,
  1091. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1092. ( 0x23 | 0x00 | 0x00 ), // Sync Polarity (H,V)=(+,+)
  1093. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x15 ,
  1094. // Dot Clock = 39.822MHz
  1095. OB, // EndSyncResetCmd
  1096. SEQ_ADDRESS_PORT,
  1097. IND_SYNC_RESET,
  1098. OB,
  1099. SEQ_DATA_PORT,
  1100. END_SYNC_RESET_VALUE,
  1101. OW, // Unlock CRTC registers 0-7
  1102. CRTC_ADDRESS_PORT_COLOR,
  1103. 0x2c11,
  1104. METAOUT+INDXOUT, // program crtc registers
  1105. CRTC_ADDRESS_PORT_COLOR,
  1106. VGA_NUM_CRTC_PORTS, // count
  1107. 0, // start index
  1108. 0x7f,0x63,0x64,0x82,0x6b,0x1b,0x72,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  1109. 0x58,0x2c,0x57,0x64,0x40,0x58,0x71,0xe3,0xff,
  1110. IB, // prepare atc for writing
  1111. INPUT_STATUS_1_COLOR,
  1112. METAOUT+ATCOUT, // program attribute controller registers
  1113. ATT_ADDRESS_PORT, // port
  1114. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1115. 0, // start index
  1116. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1117. 0x41,0x0,0x0F,0x0,0x0,
  1118. METAOUT+INDXOUT, // program graphics controller registers
  1119. GRAPH_ADDRESS_PORT, // port
  1120. VGA_NUM_GRAPH_CONT_PORTS, // count
  1121. 0, // start index
  1122. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1123. IB, // prepare atc for writing
  1124. INPUT_STATUS_1_COLOR,
  1125. OB, // turn video on
  1126. ATT_ADDRESS_PORT,
  1127. VIDEO_ENABLE,
  1128. OB, // feature control
  1129. FEAT_CTRL_WRITE_PORT_COLOR,
  1130. 0x04,
  1131. OB, // DAC mask registers
  1132. DAC_PIXEL_MASK_PORT,
  1133. 0xFF,
  1134. EOD
  1135. };
  1136. //
  1137. // Video Mode: 800x600x16bpp @ 56Hz
  1138. // Displays: 800x600 Color TFT LCD + External CRT simultaneous display mode
  1139. //
  1140. USHORT WDVGA_800x600x64K_SVGA[] = {
  1141. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1142. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1143. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1144. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1145. OW, 0x24, 0x8c11,
  1146. OW, 0x1e, 0x410e,
  1147. OW, 0x1e, 0x412e,
  1148. OW, 0x14, 0x1d31,
  1149. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1150. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1151. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1152. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * (pr15_all | 0x40) ,
  1153. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1154. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * (pr17_all | 0x10) ,
  1155. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_s32 ,
  1156. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_tft800 ,
  1157. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_s32 ,
  1158. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_tft800 ,
  1159. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1160. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_s32 ,
  1161. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1162. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1163. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1164. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1165. // CRTC shadows
  1166. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1167. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_tft800 & ~0x80),
  1168. OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * 0x7b ,
  1169. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_tft800,
  1170. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * 0x9e ,
  1171. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * 0x69 ,
  1172. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * 0x92 ,
  1173. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * 0x6f ,
  1174. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_tft800,
  1175. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x20 ,
  1176. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_tft800,
  1177. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * 0x2a ,
  1178. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_tft800,
  1179. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * 0x6f ,
  1180. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  1181. // SEQ index 1h-4h
  1182. OWM,
  1183. SEQ_ADDRESS_PORT,
  1184. 5,
  1185. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1186. OB,
  1187. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1188. ( 0x23 | 0x00 | 0x0c ), // Sync Polarity (H,V)=(+,+)
  1189. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x0d ,
  1190. // Dot Clock = 36.000MHz
  1191. OB, // EndSyncResetCmd
  1192. SEQ_ADDRESS_PORT,
  1193. IND_SYNC_RESET,
  1194. OB,
  1195. SEQ_DATA_PORT,
  1196. END_SYNC_RESET_VALUE,
  1197. OW, // Unlock CRTC registers 0-7
  1198. CRTC_ADDRESS_PORT_COLOR,
  1199. 0x2a11,
  1200. METAOUT+INDXOUT, // program crtc registers
  1201. CRTC_ADDRESS_PORT_COLOR,
  1202. VGA_NUM_CRTC_PORTS, // count
  1203. 0, // start index
  1204. 0x7b,0x63,0x64,0x9e,0x69,0x92,0x6f,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  1205. 0x58,0x2a,0x57,0xc8,0x40,0x58,0x6f,0xe3,0xff,
  1206. IB, // prepare atc for writing
  1207. INPUT_STATUS_1_COLOR,
  1208. METAOUT+ATCOUT, // program attribute controller registers
  1209. ATT_ADDRESS_PORT, // port
  1210. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1211. 0, // start index
  1212. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1213. 0x41,0x0,0x0F,0x0,0x0,
  1214. METAOUT+INDXOUT, // program graphics controller registers
  1215. GRAPH_ADDRESS_PORT, // port
  1216. VGA_NUM_GRAPH_CONT_PORTS, // count
  1217. 0, // start index
  1218. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1219. IB, // prepare atc for writing
  1220. INPUT_STATUS_1_COLOR,
  1221. OB, // turn video on
  1222. ATT_ADDRESS_PORT,
  1223. VIDEO_ENABLE,
  1224. OB, // feature control
  1225. FEAT_CTRL_WRITE_PORT_COLOR,
  1226. 0x04,
  1227. OB, // DAC mask registers
  1228. DAC_PIXEL_MASK_PORT,
  1229. 0xFF,
  1230. EOD
  1231. };
  1232. //
  1233. // Video Mode: 800x600x8bpp @ 60Hz
  1234. // Displays: External CRT only display mode
  1235. //
  1236. USHORT WDVGA_800x600x256_60hz[] = {
  1237. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1238. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1239. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1240. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1241. OW, 0x24, 0x8c11,
  1242. OW, 0x1e, 0x410e,
  1243. OW, 0x1e, 0x412e,
  1244. OW, 0x14, 0x1d31,
  1245. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1246. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1247. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1248. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  1249. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1250. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  1251. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_crt_tft ,
  1252. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_crt ,
  1253. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_crt ,
  1254. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  1255. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1256. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_crt ,
  1257. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1258. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1259. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1260. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1261. // CRTC shadows
  1262. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1263. // SEQ index 1h-4h
  1264. OWM,
  1265. SEQ_ADDRESS_PORT,
  1266. 5,
  1267. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1268. OB,
  1269. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1270. ( 0x23 | 0x00 | 0x00 ), // Sync Polarity (H,V)=(+,+)
  1271. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x15 ,
  1272. // Dot Clock = 39.822MHz
  1273. OB, // EndSyncResetCmd
  1274. SEQ_ADDRESS_PORT,
  1275. IND_SYNC_RESET,
  1276. OB,
  1277. SEQ_DATA_PORT,
  1278. END_SYNC_RESET_VALUE,
  1279. OW, // Unlock CRTC registers 0-7
  1280. CRTC_ADDRESS_PORT_COLOR,
  1281. 0x2c11,
  1282. METAOUT+INDXOUT, // program crtc registers
  1283. CRTC_ADDRESS_PORT_COLOR,
  1284. VGA_NUM_CRTC_PORTS, // count
  1285. 0, // start index
  1286. 0x7f,0x63,0x64,0x82,0x6b,0x1b,0x72,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  1287. 0x58,0x2c,0x57,0x64,0x40,0x58,0x71,0xe3,0xff,
  1288. IB, // prepare atc for writing
  1289. INPUT_STATUS_1_COLOR,
  1290. METAOUT+ATCOUT, // program attribute controller registers
  1291. ATT_ADDRESS_PORT, // port
  1292. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1293. 0, // start index
  1294. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1295. 0x41,0x0,0x0F,0x0,0x0,
  1296. METAOUT+INDXOUT, // program graphics controller registers
  1297. GRAPH_ADDRESS_PORT, // port
  1298. VGA_NUM_GRAPH_CONT_PORTS, // count
  1299. 0, // start index
  1300. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1301. IB, // prepare atc for writing
  1302. INPUT_STATUS_1_COLOR,
  1303. OB, // turn video on
  1304. ATT_ADDRESS_PORT,
  1305. VIDEO_ENABLE,
  1306. OB, // feature control
  1307. FEAT_CTRL_WRITE_PORT_COLOR,
  1308. 0x04,
  1309. OB, // DAC mask registers
  1310. DAC_PIXEL_MASK_PORT,
  1311. 0xFF,
  1312. EOD
  1313. };
  1314. //
  1315. // Video Mode: 800x600x8bpp @ 72Hz
  1316. // Displays: External CRT only display mode
  1317. //
  1318. USHORT WDVGA_800x600x256_72hz[] = {
  1319. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1320. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1321. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1322. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1323. OW, 0x24, 0x8c11,
  1324. OW, 0x1e, 0x410e,
  1325. OW, 0x1e, 0x412e,
  1326. OW, 0x14, 0x1d31,
  1327. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1328. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1329. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1330. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  1331. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1332. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  1333. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_crt_tft ,
  1334. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_crt ,
  1335. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_crt ,
  1336. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  1337. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1338. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_crt ,
  1339. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1340. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1341. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1342. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1343. // CRTC shadows
  1344. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1345. // SEQ index 1h-4h
  1346. OWM,
  1347. SEQ_ADDRESS_PORT,
  1348. 5,
  1349. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1350. OB,
  1351. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1352. ( 0x23 | 0x00 | 0x04 ), // Sync Polarity (H,V)=(+,+)
  1353. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x15 ,
  1354. // Dot Clock = 50.114MHz
  1355. OB, // EndSyncResetCmd
  1356. SEQ_ADDRESS_PORT,
  1357. IND_SYNC_RESET,
  1358. OB,
  1359. SEQ_DATA_PORT,
  1360. END_SYNC_RESET_VALUE,
  1361. OW, // Unlock CRTC registers 0-7
  1362. CRTC_ADDRESS_PORT_COLOR,
  1363. 0x7311,
  1364. METAOUT+INDXOUT, // program crtc registers
  1365. CRTC_ADDRESS_PORT_COLOR,
  1366. VGA_NUM_CRTC_PORTS, // count
  1367. 0, // start index
  1368. 0x7E,0x63,0x64,0x81,0x6B,0x1A,0x96,0xF0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  1369. 0x6D,0x73,0x57,0x64,0x40,0x5A,0x94,0xE3,0xFF,
  1370. IB, // prepare atc for writing
  1371. INPUT_STATUS_1_COLOR,
  1372. METAOUT+ATCOUT, // program attribute controller registers
  1373. ATT_ADDRESS_PORT, // port
  1374. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1375. 0, // start index
  1376. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1377. 0x41,0x0,0x0F,0x0,0x0,
  1378. METAOUT+INDXOUT, // program graphics controller registers
  1379. GRAPH_ADDRESS_PORT, // port
  1380. VGA_NUM_GRAPH_CONT_PORTS, // count
  1381. 0, // start index
  1382. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1383. IB, // prepare atc for writing
  1384. INPUT_STATUS_1_COLOR,
  1385. OB, // turn video on
  1386. ATT_ADDRESS_PORT,
  1387. VIDEO_ENABLE,
  1388. OB, // feature control
  1389. FEAT_CTRL_WRITE_PORT_COLOR,
  1390. 0x04,
  1391. OB, // DAC mask registers
  1392. DAC_PIXEL_MASK_PORT,
  1393. 0xFF,
  1394. EOD
  1395. };
  1396. //
  1397. // Video Mode: 800x600x16bpp @ 56Hz
  1398. // Displays: External CRT only display mode
  1399. //
  1400. USHORT WDVGA_800x600x64k_56hz[] = {
  1401. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1402. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1403. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1404. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1405. OW, 0x24, 0x8c11,
  1406. OW, 0x1e, 0x410e,
  1407. OW, 0x1e, 0x412e,
  1408. OW, 0x14, 0x1d31,
  1409. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1410. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1411. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1412. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * (pr15_all | 0x40) ,
  1413. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1414. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * (pr17_all | 0x10) ,
  1415. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_crt_tft ,
  1416. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_crt ,
  1417. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_crt ,
  1418. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  1419. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1420. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_crt ,
  1421. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1422. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1423. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1424. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1425. // CRTC shadows
  1426. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1427. // SEQ index 1h-4h
  1428. OWM,
  1429. SEQ_ADDRESS_PORT,
  1430. 5,
  1431. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1432. OB,
  1433. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1434. ( 0x23 | 0x00 | 0x0c ), // Sync Polarity (H,V)=(+,+)
  1435. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x0d ,
  1436. // Dot Clock = 36.000MHz
  1437. OB, // EndSyncResetCmd
  1438. SEQ_ADDRESS_PORT,
  1439. IND_SYNC_RESET,
  1440. OB,
  1441. SEQ_DATA_PORT,
  1442. END_SYNC_RESET_VALUE,
  1443. OW, // Unlock CRTC registers 0-7
  1444. CRTC_ADDRESS_PORT_COLOR,
  1445. 0x2a11,
  1446. METAOUT+INDXOUT, // program crtc registers
  1447. CRTC_ADDRESS_PORT_COLOR,
  1448. VGA_NUM_CRTC_PORTS, // count
  1449. 0, // start index
  1450. 0x7b,0x63,0x64,0x9e,0x69,0x92,0x6f,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  1451. 0x58,0x2a,0x57,0xc8,0x40,0x58,0x6f,0xe3,0xff,
  1452. IB, // prepare atc for writing
  1453. INPUT_STATUS_1_COLOR,
  1454. METAOUT+ATCOUT, // program attribute controller registers
  1455. ATT_ADDRESS_PORT, // port
  1456. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1457. 0, // start index
  1458. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1459. 0x41,0x0,0x0F,0x0,0x0,
  1460. METAOUT+INDXOUT, // program graphics controller registers
  1461. GRAPH_ADDRESS_PORT, // port
  1462. VGA_NUM_GRAPH_CONT_PORTS, // count
  1463. 0, // start index
  1464. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1465. IB, // prepare atc for writing
  1466. INPUT_STATUS_1_COLOR,
  1467. OB, // turn video on
  1468. ATT_ADDRESS_PORT,
  1469. VIDEO_ENABLE,
  1470. OB, // feature control
  1471. FEAT_CTRL_WRITE_PORT_COLOR,
  1472. 0x04,
  1473. OB, // DAC mask registers
  1474. DAC_PIXEL_MASK_PORT,
  1475. 0xFF,
  1476. EOD
  1477. };
  1478. //
  1479. // Video Mode: 1024x768x8bpp @ 60Hz
  1480. // Displays: External CRT only display mode
  1481. //
  1482. USHORT WDVGA_1024x768x256_60hz[] = {
  1483. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1484. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1485. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1486. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1487. OW, 0x24, 0x8c11,
  1488. OW, 0x1e, 0x410e,
  1489. OW, 0x1e, 0x412e,
  1490. OW, 0x14, 0x1d31,
  1491. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1492. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1493. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1494. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * (pr15_all | 0x40) ,
  1495. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1496. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  1497. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_crt_tft ,
  1498. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_crt ,
  1499. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_crt ,
  1500. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  1501. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1502. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_crt ,
  1503. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1504. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1505. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1506. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1507. // CRTC shadows
  1508. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1509. // SEQ index 1h-4h
  1510. OWM,
  1511. SEQ_ADDRESS_PORT,
  1512. 5,
  1513. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1514. OB,
  1515. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1516. ( 0x23 | 0xc0 | 0x08 ), // Sync Polarity (H,V)=(-,-)
  1517. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x0d ,
  1518. // Dot Clock = 65.000MHz
  1519. OB, // EndSyncResetCmd
  1520. SEQ_ADDRESS_PORT,
  1521. IND_SYNC_RESET,
  1522. OB,
  1523. SEQ_DATA_PORT,
  1524. END_SYNC_RESET_VALUE,
  1525. OW, // Unlock CRTC registers 0-7
  1526. CRTC_ADDRESS_PORT_COLOR,
  1527. 0x2711,
  1528. METAOUT+INDXOUT, // program crtc registers
  1529. CRTC_ADDRESS_PORT_COLOR,
  1530. VGA_NUM_CRTC_PORTS, // count
  1531. 0, // start index
  1532. 0xa3,0x7f,0x80,0x06,0x84,0x95,0x24,0xfd,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  1533. 0x01,0x27,0xff,0x80,0x40,0x00,0x24,0xe3,0xff,
  1534. IB, // prepare atc for writing
  1535. INPUT_STATUS_1_COLOR,
  1536. METAOUT+ATCOUT, // program attribute controller registers
  1537. ATT_ADDRESS_PORT, // port
  1538. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1539. 0, // start index
  1540. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1541. 0x41,0x0,0x0F,0x0,0x0,
  1542. METAOUT+INDXOUT, // program graphics controller registers
  1543. GRAPH_ADDRESS_PORT, // port
  1544. VGA_NUM_GRAPH_CONT_PORTS, // count
  1545. 0, // start index
  1546. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1547. IB, // prepare atc for writing
  1548. INPUT_STATUS_1_COLOR,
  1549. OB, // turn video on
  1550. ATT_ADDRESS_PORT,
  1551. VIDEO_ENABLE,
  1552. OB, // feature control
  1553. FEAT_CTRL_WRITE_PORT_COLOR,
  1554. 0x04,
  1555. OB, // DAC mask registers
  1556. DAC_PIXEL_MASK_PORT,
  1557. 0xFF,
  1558. EOD
  1559. };
  1560. //
  1561. // Video Mode: 1024x768x8bpp @ 43.5Hz (interlaced)
  1562. // Displays: External CRT only display mode
  1563. //
  1564. USHORT WDVGA_1024x768x256_int[] = {
  1565. OW, CRTC_ADDRESS_PORT_COLOR, 0x8c11,
  1566. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1567. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1568. OW, SEQ_ADDRESS_PORT, 0x1d31,
  1569. OW, 0x24, 0x8c11,
  1570. OW, 0x1e, 0x410e,
  1571. OW, 0x1e, 0x412e,
  1572. OW, 0x14, 0x1d31,
  1573. // OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_all ,
  1574. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * 0x34 ,
  1575. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * 0x2a ,
  1576. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * 0x4b ,
  1577. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 0x00) ,
  1578. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_all ,
  1579. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_crt_tft ,
  1580. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_crt ,
  1581. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_crt ,
  1582. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_all ,
  1583. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1584. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_crt ,
  1585. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1586. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1587. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1588. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1589. // CRTC shadows
  1590. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1591. // SEQ index 1h-4h
  1592. OWM,
  1593. SEQ_ADDRESS_PORT,
  1594. 5,
  1595. 0x0100, 0x0101,0x0f02,0x0303,0x0e04,
  1596. OB,
  1597. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1598. ( 0x23 | 0x00 | 0x08 ), // Sync Polarity (H,V)=(+,+)
  1599. OW, SEQ_ADDRESS_PORT , pr69 + 0x100 * 0x64 ,
  1600. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x05 ,
  1601. // Dot Clock = 44.744MHz
  1602. OB, // EndSyncResetCmd
  1603. SEQ_ADDRESS_PORT,
  1604. IND_SYNC_RESET,
  1605. OB,
  1606. SEQ_DATA_PORT,
  1607. END_SYNC_RESET_VALUE,
  1608. OW, // Unlock CRTC registers 0-7
  1609. CRTC_ADDRESS_PORT_COLOR,
  1610. 0x2311,
  1611. METAOUT+INDXOUT, // program crtc registers
  1612. CRTC_ADDRESS_PORT_COLOR,
  1613. VGA_NUM_CRTC_PORTS, // count
  1614. 0, // start index
  1615. 0x99,0x7F,0x7F,0x1C,0x82,0x19,0x97,0x1F,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  1616. 0x7F,0x23,0x7F,0x80,0x40,0x7F,0x96,0xE3,0xFF,
  1617. IB, // prepare atc for writing
  1618. INPUT_STATUS_1_COLOR,
  1619. METAOUT+ATCOUT, // program attribute controller registers
  1620. ATT_ADDRESS_PORT, // port
  1621. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1622. 0, // start index
  1623. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1624. 0x41,0x0,0x0F,0x0,0x0,
  1625. METAOUT+INDXOUT, // program graphics controller registers
  1626. GRAPH_ADDRESS_PORT, // port
  1627. VGA_NUM_GRAPH_CONT_PORTS, // count
  1628. 0, // start index
  1629. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1630. IB, // prepare atc for writing
  1631. INPUT_STATUS_1_COLOR,
  1632. OB, // turn video on
  1633. ATT_ADDRESS_PORT,
  1634. VIDEO_ENABLE,
  1635. OB, // feature control
  1636. FEAT_CTRL_WRITE_PORT_COLOR,
  1637. 0x04,
  1638. OB, // DAC mask registers
  1639. DAC_PIXEL_MASK_PORT,
  1640. 0xFF,
  1641. EOD
  1642. };
  1643. //
  1644. // Video Mode: 640x480x8bpp @ 60Hz
  1645. // Displays: 640x480 Color DSTN LCD + External CRT simultaneous display mode
  1646. //
  1647. USHORT WDVGA_640x480_60STN[] = {
  1648. OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_244LP ,
  1649. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1650. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1651. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  1652. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 00) ,
  1653. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_244LP ,
  1654. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_stnc ,
  1655. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_stnc ,
  1656. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_stnc ,
  1657. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_stnc ,
  1658. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1659. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_stnc ,
  1660. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1661. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1662. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1663. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1664. // CRTC shadows
  1665. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1666. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_stnc & ~0x80),
  1667. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_stnc_a2 ,
  1668. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_stnc_a2 ,
  1669. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * 0x53 ,
  1670. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * 0x9f ,
  1671. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * 0x0b ,
  1672. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_stnc ,
  1673. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * 0x53 ,
  1674. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_stnc ,
  1675. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_stnc ,
  1676. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_stnc ,
  1677. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  1678. // SEQ index 1h-4h
  1679. OWM,
  1680. SEQ_ADDRESS_PORT,
  1681. 5,
  1682. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  1683. OB,
  1684. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1685. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  1686. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x0d ,
  1687. // Dot Clock = 25.175MHz
  1688. OB, // EndSyncResetCmd
  1689. SEQ_ADDRESS_PORT,
  1690. IND_SYNC_RESET,
  1691. OB,
  1692. SEQ_DATA_PORT,
  1693. END_SYNC_RESET_VALUE,
  1694. OW, // Unlock CRTC registers 0-7
  1695. CRTC_ADDRESS_PORT_COLOR,
  1696. 0x2C11,
  1697. METAOUT+INDXOUT, // program crtc registers
  1698. CRTC_ADDRESS_PORT_COLOR,
  1699. VGA_NUM_CRTC_PORTS, // count
  1700. 0, // start index
  1701. 0x5F,0x4F,0x50,0x82,0x53,0x9f,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  1702. 0xEA,0x8C,0xDF,0x50,0x40,0xE7,0x4,0xE3,0xFF,
  1703. IB, // prepare atc for writing
  1704. INPUT_STATUS_1_COLOR,
  1705. METAOUT+ATCOUT, // program attribute controller registers
  1706. ATT_ADDRESS_PORT, // port
  1707. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1708. 0, // start index
  1709. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1710. 0x41,0x0,0x0F,0x0,0x0,
  1711. METAOUT+INDXOUT, // program graphics controller registers
  1712. GRAPH_ADDRESS_PORT, // port
  1713. VGA_NUM_GRAPH_CONT_PORTS, // count
  1714. 0, // start index
  1715. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1716. IB, // prepare atc for writing
  1717. INPUT_STATUS_1_COLOR,
  1718. OB, // turn video on
  1719. ATT_ADDRESS_PORT,
  1720. VIDEO_ENABLE,
  1721. OB, // feature control
  1722. FEAT_CTRL_WRITE_PORT_COLOR,
  1723. 0x04,
  1724. OW, GRAPH_ADDRESS_PORT, 0x8d0b,
  1725. OW, GRAPH_ADDRESS_PORT, 0x010c,
  1726. OW, GRAPH_ADDRESS_PORT, 0x410e,
  1727. OW, GRAPH_ADDRESS_PORT, 0x8d2b,
  1728. OW, GRAPH_ADDRESS_PORT, 0x012c,
  1729. OW, GRAPH_ADDRESS_PORT, 0x412e,
  1730. OB, // DAC mask registers
  1731. DAC_PIXEL_MASK_PORT,
  1732. 0xFF,
  1733. EOD
  1734. };
  1735. //
  1736. // Video Mode: 640x480x8bpp @ 72Hz
  1737. // Displays: 640x480 Color DSTN LCD + External CRT simultaneous display mode
  1738. //
  1739. USHORT WDVGA_640x480_72STN[] = {
  1740. /*
  1741. OW, 0x24, 0x8c11,
  1742. OW, 0x1e, 0x410e,
  1743. OW, 0x1e, 0x412e,
  1744. OW, 0x14, 0x1d31,
  1745. */
  1746. OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_244LP ,
  1747. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1748. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1749. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  1750. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 00) ,
  1751. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_244LP ,
  1752. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_stnc ,
  1753. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_stnc ,
  1754. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_stnc ,
  1755. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_stnc ,
  1756. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1757. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_stnc ,
  1758. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1759. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1760. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1761. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1762. // CRTC shadows
  1763. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1764. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_stnc & ~0x80),
  1765. //OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_stnc_a2 ,
  1766. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_stnc_a2 ,
  1767. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_stnc_a2 ,
  1768. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_stnc_a2 ,
  1769. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_stnc_a2 ,
  1770. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_stnc ,
  1771. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_stnc ,
  1772. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  1773. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_stnc ,
  1774. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_stnc ,
  1775. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_stnc ,
  1776. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_stnc ,
  1777. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  1778. // SEQ index 1h-4h
  1779. OWM,
  1780. SEQ_ADDRESS_PORT,
  1781. 5,
  1782. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  1783. OB,
  1784. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1785. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  1786. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x1d ,
  1787. // Dot Clock = 31.500MHz
  1788. OB, // EndSyncResetCmd
  1789. SEQ_ADDRESS_PORT,
  1790. IND_SYNC_RESET,
  1791. OB,
  1792. SEQ_DATA_PORT,
  1793. END_SYNC_RESET_VALUE,
  1794. OW, // Unlock CRTC registers 0-7
  1795. CRTC_ADDRESS_PORT_COLOR,
  1796. 0x2F11,
  1797. METAOUT+INDXOUT, // program crtc registers
  1798. CRTC_ADDRESS_PORT_COLOR,
  1799. VGA_NUM_CRTC_PORTS, // count
  1800. 0, // start index
  1801. 0x63,0x4F,0x50,0x86,0x54,0x99,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  1802. 0xEC,0x8F,0xDF,0x50,0x40,0xE7,0x4,0xE3,0xFF,
  1803. // ^ many need to by 0x8F
  1804. IB, // prepare atc for writing
  1805. INPUT_STATUS_1_COLOR,
  1806. METAOUT+ATCOUT, // program attribute controller registers
  1807. ATT_ADDRESS_PORT, // port
  1808. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1809. 0, // start index
  1810. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1811. 0x41,0x0,0x0F,0x0,0x0,
  1812. METAOUT+INDXOUT, // program graphics controller registers
  1813. GRAPH_ADDRESS_PORT, // port
  1814. VGA_NUM_GRAPH_CONT_PORTS, // count
  1815. 0, // start index
  1816. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1817. IB, // prepare atc for writing
  1818. INPUT_STATUS_1_COLOR,
  1819. OB, // turn video on
  1820. ATT_ADDRESS_PORT,
  1821. VIDEO_ENABLE,
  1822. OB, // feature control
  1823. FEAT_CTRL_WRITE_PORT_COLOR,
  1824. 0x04,
  1825. OW, 0x1e, 0x8d0b,
  1826. OW, 0x1e, 0x010c,
  1827. OW, 0x1e, 0x410e,
  1828. OW, 0x1e, 0x8d2b,
  1829. OW, 0x1e, 0x012c,
  1830. OW, 0x1e, 0x412e,
  1831. OB, // DAC mask registers
  1832. DAC_PIXEL_MASK_PORT,
  1833. 0xFF,
  1834. EOD
  1835. };
  1836. //
  1837. // Video Mode: 640x480x8bpp @ 75Hz
  1838. // Displays: 640x480 Color DSTN LCD + External CRT simultaneous display mode
  1839. //
  1840. USHORT WDVGA_640x480_75STN[] = {
  1841. /*
  1842. OW, 0x24, 0x8c11,
  1843. OW, 0x1e, 0x410e,
  1844. OW, 0x1e, 0x412e,
  1845. OW, 0x14, 0x1d31,
  1846. */
  1847. OW, CRTC_ADDRESS_PORT_COLOR, pr12 + 0x100 * pr12_244LP ,
  1848. OW, CRTC_ADDRESS_PORT_COLOR, pr13 + 0x100 * pr13_all ,
  1849. OW, CRTC_ADDRESS_PORT_COLOR, pr14 + 0x100 * pr14_all ,
  1850. OW, CRTC_ADDRESS_PORT_COLOR, pr15 + 0x100 * pr15_all ,
  1851. OW, CRTC_ADDRESS_PORT_COLOR, pr16 + 0x100 * (pr16_all & 00) ,
  1852. OW, CRTC_ADDRESS_PORT_COLOR, pr17 + 0x100 * pr17_244LP ,
  1853. OW, CRTC_ADDRESS_PORT_COLOR, pr18 + 0x100 * pr18_stnc ,
  1854. OW, CRTC_ADDRESS_PORT_COLOR, pr19 + 0x100 * pr19_stnc ,
  1855. OW, CRTC_ADDRESS_PORT_COLOR, pr39 + 0x100 * pr39_stnc ,
  1856. OW, CRTC_ADDRESS_PORT_COLOR, pr1a + 0x100 * pr1a_stnc ,
  1857. OW, CRTC_ADDRESS_PORT_COLOR, pr36 + 0x100 * pr36_all ,
  1858. OW, CRTC_ADDRESS_PORT_COLOR, pr37 + 0x100 * pr37_stnc ,
  1859. OW, CRTC_ADDRESS_PORT_COLOR, pr18a+ 0x100 * pr18a_all ,
  1860. // OW, CRTC_ADDRESS_PORT_COLOR, pr41 + 0x100 * pr41_all ,
  1861. OW, CRTC_ADDRESS_PORT_COLOR, pr44 + 0x100 * pr44_all ,
  1862. OW, CRTC_ADDRESS_PORT_COLOR, pr35 + 0x100 * pr35_all ,
  1863. // CRTC shadows
  1864. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock ,
  1865. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * (crtc11_stnc & ~0x80),
  1866. //OW, CRTC_ADDRESS_PORT_COLOR, 0x00 + 0x100 * crtc00_stnc_iso_a2 ,
  1867. OW, CRTC_ADDRESS_PORT_COLOR, 0x02 + 0x100 * crtc02_stnc_iso_a2 ,
  1868. OW, CRTC_ADDRESS_PORT_COLOR, 0x03 + 0x100 * crtc03_stnc_iso_a2 ,
  1869. OW, CRTC_ADDRESS_PORT_COLOR, 0x04 + 0x100 * crtc04_stnc_iso_a2 ,
  1870. OW, CRTC_ADDRESS_PORT_COLOR, 0x05 + 0x100 * crtc05_stnc_iso_a2 ,
  1871. OW, CRTC_ADDRESS_PORT_COLOR, 0x06 + 0x100 * crtc06_stnc ,
  1872. OW, CRTC_ADDRESS_PORT_COLOR, 0x07 + 0x100 * crtc07_stnc ,
  1873. OW, CRTC_ADDRESS_PORT_COLOR, 0x09 + 0x100 * 0x00 ,
  1874. OW, CRTC_ADDRESS_PORT_COLOR, 0x10 + 0x100 * crtc10_stnc ,
  1875. OW, CRTC_ADDRESS_PORT_COLOR, 0x11 + 0x100 * crtc11_stnc ,
  1876. OW, CRTC_ADDRESS_PORT_COLOR, 0x15 + 0x100 * crtc15_stnc ,
  1877. OW, CRTC_ADDRESS_PORT_COLOR, 0x16 + 0x100 * crtc16_stnc ,
  1878. OW, CRTC_ADDRESS_PORT_COLOR, pr1b + 0x100 * pr1b_unlock_pr ,
  1879. // SEQ index 1h-4h
  1880. OWM,
  1881. SEQ_ADDRESS_PORT,
  1882. 5,
  1883. 0x0100, 0x0101,0x0f02,0x0003,0x0e04,
  1884. OB,
  1885. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  1886. ( 0x23 | 0xc0 | 0x00 ), // Sync Polarity (H,V)=(-,-)
  1887. OW, SEQ_ADDRESS_PORT , pr68 + 0x100 * 0x1d ,
  1888. // Dot Clock = 31.500MHz
  1889. OB, // EndSyncResetCmd
  1890. SEQ_ADDRESS_PORT,
  1891. IND_SYNC_RESET,
  1892. OB,
  1893. SEQ_DATA_PORT,
  1894. END_SYNC_RESET_VALUE,
  1895. OW, // Unlock CRTC registers 0-7
  1896. CRTC_ADDRESS_PORT_COLOR,
  1897. 0x2C11,
  1898. METAOUT+INDXOUT, // program crtc registers
  1899. CRTC_ADDRESS_PORT_COLOR,
  1900. VGA_NUM_CRTC_PORTS, // count
  1901. 0, // start index
  1902. 0x5F,0x4F,0x50,0x82,0x53,0x9f,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  1903. 0xEA,0x8C,0xDF,0x50,0x40,0xE7,0x4,0xE3,0xFF,
  1904. IB, // prepare atc for writing
  1905. INPUT_STATUS_1_COLOR,
  1906. METAOUT+ATCOUT, // program attribute controller registers
  1907. ATT_ADDRESS_PORT, // port
  1908. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1909. 0, // start index
  1910. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  1911. 0x41,0x0,0x0F,0x0,0x0,
  1912. METAOUT+INDXOUT, // program graphics controller registers
  1913. GRAPH_ADDRESS_PORT, // port
  1914. VGA_NUM_GRAPH_CONT_PORTS, // count
  1915. 0, // start index
  1916. 0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,0xff,
  1917. IB, // prepare atc for writing
  1918. INPUT_STATUS_1_COLOR,
  1919. OB, // turn video on
  1920. ATT_ADDRESS_PORT,
  1921. VIDEO_ENABLE,
  1922. OB, // feature control
  1923. FEAT_CTRL_WRITE_PORT_COLOR,
  1924. 0x04,
  1925. OW, 0x1e, 0x8d0b,
  1926. OW, 0x1e, 0x010c,
  1927. OW, 0x1e, 0x410e,
  1928. OW, 0x1e, 0x8d2b,
  1929. OW, 0x1e, 0x012c,
  1930. OW, 0x1e, 0x412e,
  1931. OB, // DAC mask registers
  1932. DAC_PIXEL_MASK_PORT,
  1933. 0xFF,
  1934. EOD
  1935. };
  1936. #ifndef INT10_MODE_SET // should be #ifndef
  1937. /**************************************************************************
  1938. * *
  1939. * Western Digital Color text mode, 720x400, 9x16 char *
  1940. * *
  1941. **************************************************************************/
  1942. USHORT WDVGA_TEXT_0[] = {
  1943. // SEQ index 7h-9h, 10h-14h
  1944. OWM, // start sync reset program up sequencer
  1945. SEQ_ADDRESS_PORT,
  1946. 8,
  1947. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  1948. OWM,
  1949. SEQ_ADDRESS_PORT,
  1950. 5,
  1951. 0x0100,0x0001,0x0302,0x0003,0x0204, // program up sequencer
  1952. OB,
  1953. MISC_OUTPUT_REG_WRITE_PORT,
  1954. 0x67,
  1955. OW,
  1956. GRAPH_ADDRESS_PORT,
  1957. 0x0e06,
  1958. // EndSyncResetCmd
  1959. OB,
  1960. SEQ_ADDRESS_PORT,
  1961. IND_SYNC_RESET,
  1962. OB,
  1963. SEQ_DATA_PORT,
  1964. END_SYNC_RESET_VALUE,
  1965. // CRTC index 2ah-30h, 3eh
  1966. METAOUT+INDXOUT, // program crtc registers
  1967. CRTC_ADDRESS_PORT_COLOR,
  1968. 7, // count
  1969. 0x2a, // start index
  1970. 0xf0,0x05,0x00,0x00,0x00,0x42,0x00,
  1971. OW, //
  1972. CRTC_ADDRESS_PORT_COLOR,
  1973. 0x003e,
  1974. OW,
  1975. CRTC_ADDRESS_PORT_COLOR,
  1976. 0x0E11,
  1977. METAOUT+INDXOUT, // program crtc registers
  1978. CRTC_ADDRESS_PORT_COLOR,
  1979. VGA_NUM_CRTC_PORTS, // count
  1980. 0, // start index
  1981. 0x5F,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,0x00,0x4f,0xd,0xe,0x0,0x0,0x0,0x0,
  1982. 0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,0xFF,
  1983. IB, // prepare atc for writing
  1984. INPUT_STATUS_1_COLOR,
  1985. METAOUT+ATCOUT, //
  1986. ATT_ADDRESS_PORT, // port
  1987. VGA_NUM_ATTRIB_CONT_PORTS, // count
  1988. 0, // start index
  1989. 0x0,0x1,0x2,0x3,0x4,0x5,0x14,0x7,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
  1990. 0x04,0x0,0x0F,0x8,0x0,
  1991. METAOUT+INDXOUT, // program graphics controller registers
  1992. GRAPH_ADDRESS_PORT, // port
  1993. 7, // count
  1994. 9, // start index
  1995. 0x00,0x00,0xc6,0x02,0x00,0x00,0x05,
  1996. METAOUT+INDXOUT, //
  1997. GRAPH_ADDRESS_PORT, // port
  1998. VGA_NUM_GRAPH_CONT_PORTS, // count
  1999. 0, // start index
  2000. 0x00,0x0,0x0,0x0,0x0,0x10,0x0e,0x0,0x0FF,
  2001. OB,
  2002. DAC_PIXEL_MASK_PORT,
  2003. 0xFF,
  2004. IB, // prepare atc for writing
  2005. INPUT_STATUS_1_COLOR,
  2006. OB, // turn video on.
  2007. ATT_ADDRESS_PORT,
  2008. VIDEO_ENABLE,
  2009. EOD
  2010. };
  2011. /**************************************************************************
  2012. * *
  2013. * Western Digital Color graphics mode 0x12, 640x480 16 colors *
  2014. * *
  2015. **************************************************************************/
  2016. USHORT WDVGA_640x480[] = {
  2017. // SEQ index 7h-9h, 10h-14h
  2018. OWM, // start sync reset program up sequencer
  2019. SEQ_ADDRESS_PORT,
  2020. 8,
  2021. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  2022. OWM, // start sync reset program up sequencer
  2023. SEQ_ADDRESS_PORT,
  2024. 5,
  2025. 0x0100,0x0101,0x0f02,0x0003,0x0604,
  2026. OB,
  2027. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2028. 0xe3,
  2029. OW, // Set chain mode in sync reset
  2030. GRAPH_ADDRESS_PORT,
  2031. 0x0506,
  2032. OB, // EndSyncResetCmd
  2033. SEQ_ADDRESS_PORT,
  2034. IND_SYNC_RESET,
  2035. OB,
  2036. SEQ_DATA_PORT,
  2037. END_SYNC_RESET_VALUE,
  2038. // CRTC index 2ah-30h, 3eh
  2039. METAOUT+INDXOUT, // program crtc registers
  2040. CRTC_ADDRESS_PORT_COLOR,
  2041. 7, // count
  2042. 0x2a, // start index
  2043. 0xf0,0x05,0x00,0x00,0x00,0x42,0x00,
  2044. OW, //
  2045. CRTC_ADDRESS_PORT_COLOR,
  2046. 0x003e,
  2047. OW, // Unlock CRTC registers 0-7
  2048. CRTC_ADDRESS_PORT_COLOR,
  2049. 0x0511,
  2050. METAOUT+INDXOUT, // program crtc registers
  2051. CRTC_ADDRESS_PORT_COLOR,
  2052. VGA_NUM_CRTC_PORTS, // count
  2053. 0, // start index
  2054. 0x5F,0x4F,0x50,0x82,0x54,0x80,0x0B,0x3E,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  2055. 0xEA,0x8C,0xDF,0x28,0x0,0xE7,0x4,0xE3,0xFF,
  2056. IB, // prepare atc for writing
  2057. INPUT_STATUS_1_COLOR,
  2058. METAOUT+ATCOUT, // program attribute controller registers
  2059. ATT_ADDRESS_PORT, // port
  2060. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2061. 0, // start index
  2062. 0x0,0x1,0x2,0x3,0x4,0x5,0x14,0x7,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  2063. 0x01,0x0,0x0F,0x0,0x0,
  2064. METAOUT+INDXOUT, // program graphics controller registers
  2065. GRAPH_ADDRESS_PORT, // port
  2066. 7, // count
  2067. 9, // start index
  2068. 0x00,0x00,0xc6,0x02,0x00,0x00,0x05,
  2069. METAOUT+INDXOUT, // program graphics controller registers
  2070. GRAPH_ADDRESS_PORT, // port
  2071. VGA_NUM_GRAPH_CONT_PORTS, // count
  2072. 0, // start index
  2073. 0x00,0x0,0x0,0x0,0x0,0x0,0x05,0x0F,0x0FF,
  2074. OB, // DAC mask registers
  2075. DAC_PIXEL_MASK_PORT,
  2076. 0xFF,
  2077. IB, // prepare atc for writing
  2078. INPUT_STATUS_1_COLOR,
  2079. OB, // turn video on.
  2080. ATT_ADDRESS_PORT,
  2081. VIDEO_ENABLE,
  2082. EOD
  2083. };
  2084. /********************************************************************
  2085. * Western Digital 800x600 modes - vRefresh 60Hz. *
  2086. * *
  2087. *********************************************************************/
  2088. //
  2089. // Color graphics mode 0x58, 800x600 16 colors 60Hz.
  2090. //
  2091. USHORT WDVGA_800x600_60hz[] = {
  2092. // SEQ index 7h-9h, 10h-14h
  2093. OWM, // start sync reset program up sequencer
  2094. SEQ_ADDRESS_PORT,
  2095. 8,
  2096. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  2097. OWM, // start sync reset program up sequencer
  2098. SEQ_ADDRESS_PORT,
  2099. 5,
  2100. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2101. OB,
  2102. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2103. 0x23,
  2104. OW, // Set chain mode in sync reset
  2105. GRAPH_ADDRESS_PORT,
  2106. 0x0506,
  2107. OB, // EndSyncResetCmd
  2108. SEQ_ADDRESS_PORT,
  2109. IND_SYNC_RESET,
  2110. OB,
  2111. SEQ_DATA_PORT,
  2112. END_SYNC_RESET_VALUE,
  2113. // CRTC index 2ah-30h, 3eh
  2114. METAOUT+INDXOUT, // program crtc registers
  2115. CRTC_ADDRESS_PORT_COLOR,
  2116. 7, // count
  2117. 0x2a, // start index
  2118. 0xf0,0x45,0x00,0x00,0x00,0x00,0x00,
  2119. OW, // CRTC index 3e
  2120. CRTC_ADDRESS_PORT_COLOR,
  2121. 0x003e,
  2122. OW, // Unlock CRTC registers 0-7
  2123. CRTC_ADDRESS_PORT_COLOR,
  2124. 0x0511,
  2125. METAOUT+INDXOUT, // program crtc registers
  2126. CRTC_ADDRESS_PORT_COLOR,
  2127. VGA_NUM_CRTC_PORTS, // count
  2128. 0, // start index
  2129. 0x7f,0x63,0x64,0x82,0x6b,0x1b,0x72,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  2130. 0x58,0x8c,0x57,0x32,0x0,0x58,0x71,0xE3,0xFF,
  2131. IB, // prepare atc for writing
  2132. INPUT_STATUS_1_COLOR,
  2133. METAOUT+ATCOUT, // program attribute controller registers
  2134. ATT_ADDRESS_PORT, // port
  2135. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2136. 0, // start index
  2137. 0x0,0x1,0x2,0x3,0x4,0x5,0x14,0x7,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  2138. 0x01,0x0,0x0F,0x0,0x0,
  2139. // GRAPH index 9-fh
  2140. METAOUT+INDXOUT, // program graphics controller registers
  2141. GRAPH_ADDRESS_PORT, // port
  2142. 7, // count
  2143. 9, // start index
  2144. 0x00,0x00,0xc6,0x00,0x00,0x00,0x05,
  2145. METAOUT+INDXOUT, // program graphics controller registers
  2146. GRAPH_ADDRESS_PORT, // port
  2147. VGA_NUM_GRAPH_CONT_PORTS, // count
  2148. 0, // start index
  2149. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2150. OB, // DAC mask registers
  2151. DAC_PIXEL_MASK_PORT,
  2152. 0xFF,
  2153. IB, // prepare atc for writing
  2154. INPUT_STATUS_1_COLOR,
  2155. OB, // turn video on.
  2156. ATT_ADDRESS_PORT,
  2157. VIDEO_ENABLE,
  2158. EOD
  2159. };
  2160. /********************************************************************
  2161. * Western Digital 800x600 modes - vRefresh6 72Hz. *
  2162. * *
  2163. *********************************************************************/
  2164. //
  2165. // Color graphics mode 0x58, 800x600 16 colors 72Hz.
  2166. //
  2167. USHORT WDVGA_800x600_72hz[] = {
  2168. // SEQ index 7h-9h, 10h-14h
  2169. OWM, // start sync reset program up sequencer
  2170. SEQ_ADDRESS_PORT,
  2171. 8,
  2172. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  2173. OWM, // start sync reset program up sequencer
  2174. SEQ_ADDRESS_PORT,
  2175. 5,
  2176. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2177. OB,
  2178. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2179. 0x27,
  2180. OW, // Set chain mode in sync reset
  2181. GRAPH_ADDRESS_PORT,
  2182. 0x0506,
  2183. OB, // EndSyncResetCmd
  2184. SEQ_ADDRESS_PORT,
  2185. IND_SYNC_RESET,
  2186. OB,
  2187. SEQ_DATA_PORT,
  2188. END_SYNC_RESET_VALUE,
  2189. // CRTC index 2ah-30h, 3eh
  2190. METAOUT+INDXOUT, // program crtc registers
  2191. CRTC_ADDRESS_PORT_COLOR,
  2192. 7, // count
  2193. 0x2a, // start index
  2194. 0xf0,0x85,0x00,0x00,0x00,0x00,0x00,
  2195. OW, // CRTC index 3e
  2196. CRTC_ADDRESS_PORT_COLOR,
  2197. 0x003e,
  2198. OW, // Unlock CRTC registers 0-7
  2199. CRTC_ADDRESS_PORT_COLOR,
  2200. 0x0511,
  2201. METAOUT+INDXOUT, // program crtc registers
  2202. CRTC_ADDRESS_PORT_COLOR,
  2203. VGA_NUM_CRTC_PORTS, // count
  2204. 0, // start index
  2205. 0x7e,0x63,0x64,0x81,0x6b,0x1a,0x96,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  2206. 0x6d,0xf3,0x57,0x32,0x0,0x5a,0x94,0xE3,0xFF,
  2207. IB, // prepare atc for writing
  2208. INPUT_STATUS_1_COLOR,
  2209. METAOUT+ATCOUT, // program attribute controller registers
  2210. ATT_ADDRESS_PORT, // port
  2211. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2212. 0, // start index
  2213. 0x0,0x1,0x2,0x3,0x4,0x5,0x14,0x7,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  2214. 0x01,0x0,0x0F,0x0,0x0,
  2215. // GRAPH index 9-fh
  2216. METAOUT+INDXOUT, // program graphics controller registers
  2217. GRAPH_ADDRESS_PORT, // port
  2218. 7, // count
  2219. 9, // start index
  2220. 0x00,0x00,0xc6,0x00,0x00,0x00,0x05,
  2221. METAOUT+INDXOUT, // program graphics controller registers
  2222. GRAPH_ADDRESS_PORT, // port
  2223. VGA_NUM_GRAPH_CONT_PORTS, // count
  2224. 0, // start index
  2225. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2226. OB, // DAC mask registers
  2227. DAC_PIXEL_MASK_PORT,
  2228. 0xFF,
  2229. IB, // prepare atc for writing
  2230. INPUT_STATUS_1_COLOR,
  2231. OB, // turn video on.
  2232. ATT_ADDRESS_PORT,
  2233. VIDEO_ENABLE,
  2234. EOD
  2235. };
  2236. /********************************************************************
  2237. * Western Digital 800x600 modes - vRefresh 56Hz. *
  2238. * *
  2239. *********************************************************************/
  2240. //
  2241. // Color graphics mode 0x58, 800x600 16 colors 56Hz.
  2242. //
  2243. USHORT WDVGA_800x600_56hz[] = {
  2244. // SEQ index 7h-9h, 10h-14h
  2245. OWM, // start sync reset program up sequencer
  2246. SEQ_ADDRESS_PORT,
  2247. 8,
  2248. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  2249. OWM, // start sync reset program up sequencer
  2250. SEQ_ADDRESS_PORT,
  2251. 5,
  2252. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2253. OB,
  2254. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2255. 0xef,
  2256. OW, // Set chain mode in sync reset
  2257. GRAPH_ADDRESS_PORT,
  2258. 0x0506,
  2259. OB, // EndSyncResetCmd
  2260. SEQ_ADDRESS_PORT,
  2261. IND_SYNC_RESET,
  2262. OB,
  2263. SEQ_DATA_PORT,
  2264. END_SYNC_RESET_VALUE,
  2265. // CRTC index 2ah-30h, 3eh
  2266. METAOUT+INDXOUT, // program crtc registers
  2267. CRTC_ADDRESS_PORT_COLOR,
  2268. 7, // count
  2269. 0x2a, // start index
  2270. 0xf0,0x05,0x00,0x00,0x00,0x00,0x00,
  2271. OW, // CRTC index 3e
  2272. CRTC_ADDRESS_PORT_COLOR,
  2273. 0x003e,
  2274. OW, // Unlock CRTC registers 0-7
  2275. CRTC_ADDRESS_PORT_COLOR,
  2276. 0x0511,
  2277. METAOUT+INDXOUT, // program crtc registers
  2278. CRTC_ADDRESS_PORT_COLOR,
  2279. VGA_NUM_CRTC_PORTS, // count
  2280. 0, // start index
  2281. 0x7b,0x63,0x64,0x9e,0x69,0x92,0x6f,0xf0,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  2282. 0x58,0x8a,0x57,0x32,0x0,0x58,0x6f,0xE3,0xFF,
  2283. IB, // prepare atc for writing
  2284. INPUT_STATUS_1_COLOR,
  2285. METAOUT+ATCOUT, // program attribute controller registers
  2286. ATT_ADDRESS_PORT, // port
  2287. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2288. 0, // start index
  2289. 0x0,0x1,0x2,0x3,0x4,0x5,0x14,0x7,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  2290. 0x01,0x0,0x0F,0x0,0x0,
  2291. // GRAPH index 9-fh
  2292. METAOUT+INDXOUT, // program graphics controller registers
  2293. GRAPH_ADDRESS_PORT, // port
  2294. 7, // count
  2295. 9, // start index
  2296. 0x00,0x00,0xc6,0x02,0x00,0x00,0x05,
  2297. METAOUT+INDXOUT, // program graphics controller registers
  2298. GRAPH_ADDRESS_PORT, // port
  2299. VGA_NUM_GRAPH_CONT_PORTS, // count
  2300. 0, // start index
  2301. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2302. OB, // DAC mask registers
  2303. DAC_PIXEL_MASK_PORT,
  2304. 0xFF,
  2305. IB, // prepare atc for writing
  2306. INPUT_STATUS_1_COLOR,
  2307. OB, // turn video on.
  2308. ATT_ADDRESS_PORT,
  2309. VIDEO_ENABLE,
  2310. EOD
  2311. };
  2312. /**************************************************************************
  2313. * Western Digital 1024x768 modes - vRefresh 60Hz. *
  2314. * *
  2315. **************************************************************************/
  2316. //
  2317. // Color graphics mode 0x5d, 1024x768 16 colors. 60Hz non-interlace
  2318. //
  2319. USHORT WDVGA_1024x768_60hz[] = {
  2320. // SEQ index 7h-9h, 10h-14h
  2321. OWM, // start sync reset program up sequencer
  2322. SEQ_ADDRESS_PORT,
  2323. 8,
  2324. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  2325. OWM, // start sync reset program up sequencer
  2326. SEQ_ADDRESS_PORT,
  2327. 5,
  2328. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2329. OB,
  2330. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2331. 0xeb,
  2332. OW, // Set chain mode in sync reset
  2333. GRAPH_ADDRESS_PORT,
  2334. 0x0506,
  2335. OB, // EndSyncResetCmd
  2336. SEQ_ADDRESS_PORT,
  2337. IND_SYNC_RESET,
  2338. OB,
  2339. SEQ_DATA_PORT,
  2340. END_SYNC_RESET_VALUE,
  2341. // CRTC index 2ah-30h, 3eh
  2342. METAOUT+INDXOUT, // program crtc registers
  2343. CRTC_ADDRESS_PORT_COLOR,
  2344. 7, // count
  2345. 0x2a, // start index
  2346. 0xf0,0x95,0x00,0x00,0x01,0x00,0x00,
  2347. OW, //
  2348. CRTC_ADDRESS_PORT_COLOR,
  2349. 0x003e,
  2350. OW, // Unlock CRTC registers 0-7
  2351. CRTC_ADDRESS_PORT_COLOR,
  2352. 0x0511,
  2353. METAOUT+INDXOUT, // program crtc registers
  2354. CRTC_ADDRESS_PORT_COLOR,
  2355. VGA_NUM_CRTC_PORTS, // count
  2356. 0, // start index
  2357. 0xa3,0x7f,0x80,0x06,0x87,0x98,0x24,0xf1,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  2358. 0xff,0x85,0xff,0x40,0x0,0xff,0x23,0xE3,0xFF,
  2359. IB, // prepare atc for writing
  2360. INPUT_STATUS_1_COLOR,
  2361. METAOUT+ATCOUT, // program attribute controller registers
  2362. ATT_ADDRESS_PORT, // port
  2363. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2364. 0, // start index
  2365. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  2366. 0x01,0x0,0x0F,0x0,0x0,
  2367. METAOUT+INDXOUT, // program graphics controller registers
  2368. GRAPH_ADDRESS_PORT, // port
  2369. 7, // count
  2370. 9, // start index
  2371. 0x00,0x00,0xc6,0x02,0x00,0x00,0x05,
  2372. METAOUT+INDXOUT, // program graphics controller registers
  2373. GRAPH_ADDRESS_PORT, // port
  2374. VGA_NUM_GRAPH_CONT_PORTS, // count
  2375. 0, // start index
  2376. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2377. OB, // DAC mask registers
  2378. DAC_PIXEL_MASK_PORT,
  2379. 0xFF,
  2380. IB, // prepare atc for writing
  2381. INPUT_STATUS_1_COLOR,
  2382. OB, // turn video on.
  2383. ATT_ADDRESS_PORT,
  2384. VIDEO_ENABLE,
  2385. //start of enable 64k read/write bank mode.
  2386. OW, // enable 64k single read/write bank
  2387. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2388. 0xe511,
  2389. OW, // enable PR0B register
  2390. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2391. 0xce0b,
  2392. //end of enable 64k read/write bank mode.
  2393. EOD
  2394. };
  2395. /**************************************************************************
  2396. * Western Digital 1024x768 modes - vRefresh 70Hz. *
  2397. * *
  2398. **************************************************************************/
  2399. //
  2400. // Color graphics mode 0x5d, 1024x768 16 colors. 70Hz non-interlace
  2401. //
  2402. USHORT WDVGA_1024x768_70hz[] = {
  2403. // SEQ index 7h-9h, 10h-14h
  2404. OWM, // start sync reset program up sequencer
  2405. SEQ_ADDRESS_PORT,
  2406. 8,
  2407. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0012,0x8013,0x1014,
  2408. OWM, // start sync reset program up sequencer
  2409. SEQ_ADDRESS_PORT,
  2410. 5,
  2411. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2412. OB,
  2413. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2414. 0xeb,
  2415. OW, // Set chain mode in sync reset
  2416. GRAPH_ADDRESS_PORT,
  2417. 0x0506,
  2418. OB, // EndSyncResetCmd
  2419. SEQ_ADDRESS_PORT,
  2420. IND_SYNC_RESET,
  2421. OB,
  2422. SEQ_DATA_PORT,
  2423. END_SYNC_RESET_VALUE,
  2424. // CRTC index 2ah-30h, 3eh
  2425. METAOUT+INDXOUT, // program crtc registers
  2426. CRTC_ADDRESS_PORT_COLOR,
  2427. 7, // count
  2428. 0x2a, // start index
  2429. 0xf0,0xa5,0x00,0x00,0x01,0x00,0x00,
  2430. OW, //
  2431. CRTC_ADDRESS_PORT_COLOR,
  2432. 0x003e,
  2433. OW, // Unlock CRTC registers 0-7
  2434. CRTC_ADDRESS_PORT_COLOR,
  2435. 0x0511,
  2436. METAOUT+INDXOUT, // program crtc registers
  2437. CRTC_ADDRESS_PORT_COLOR,
  2438. VGA_NUM_CRTC_PORTS, // count
  2439. 0, // start index
  2440. 0xa1,0x7f,0x80,0x04,0x86,0x97,0x24,0xf1,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  2441. 0xff,0x85,0xff,0x40,0x0,0xff,0x23,0xE3,0xFF,
  2442. IB, // prepare atc for writing
  2443. INPUT_STATUS_1_COLOR,
  2444. METAOUT+ATCOUT, // program attribute controller registers
  2445. ATT_ADDRESS_PORT, // port
  2446. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2447. 0, // start index
  2448. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  2449. 0x01,0x0,0x0F,0x0,0x0,
  2450. METAOUT+INDXOUT, // program graphics controller registers
  2451. GRAPH_ADDRESS_PORT, // port
  2452. 7, // count
  2453. 9, // start index
  2454. 0x00,0x00,0xc6,0x02,0x00,0x00,0x05,
  2455. METAOUT+INDXOUT, // program graphics controller registers
  2456. GRAPH_ADDRESS_PORT, // port
  2457. VGA_NUM_GRAPH_CONT_PORTS, // count
  2458. 0, // start index
  2459. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2460. OB, // DAC mask registers
  2461. DAC_PIXEL_MASK_PORT,
  2462. 0xFF,
  2463. IB, // prepare atc for writing
  2464. INPUT_STATUS_1_COLOR,
  2465. OB, // turn video on.
  2466. ATT_ADDRESS_PORT,
  2467. VIDEO_ENABLE,
  2468. //start of enable 64k read/write bank mode.
  2469. OW, // enable 64k single read/write bank
  2470. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2471. 0xe511,
  2472. OW, // enable PR0B register
  2473. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2474. 0xce0b,
  2475. //end of enable 64k read/write bank mode.
  2476. EOD
  2477. };
  2478. /**************************************************************************
  2479. * Western Digital 1024x768 modes - vRefresh 72Hz. *
  2480. * *
  2481. **************************************************************************/
  2482. //
  2483. // Color graphics mode 0x5d, 1024x768 16 colors. 72Hz non-interlace
  2484. //
  2485. USHORT WDVGA_1024x768_72hz[] = {
  2486. // SEQ index 7h-9h, 10h-14h
  2487. OWM, // start sync reset program up sequencer
  2488. SEQ_ADDRESS_PORT,
  2489. 8,
  2490. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0012,0x8013,0x1014,
  2491. OWM, // start sync reset program up sequencer
  2492. SEQ_ADDRESS_PORT,
  2493. 5,
  2494. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2495. OB,
  2496. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2497. 0xef,
  2498. OW, // Set chain mode in sync reset
  2499. GRAPH_ADDRESS_PORT,
  2500. 0x0506,
  2501. OB, // EndSyncResetCmd
  2502. SEQ_ADDRESS_PORT,
  2503. IND_SYNC_RESET,
  2504. OB,
  2505. SEQ_DATA_PORT,
  2506. END_SYNC_RESET_VALUE,
  2507. // CRTC index 2ah-30h, 3eh
  2508. METAOUT+INDXOUT, // program crtc registers
  2509. CRTC_ADDRESS_PORT_COLOR,
  2510. 7, // count
  2511. 0x2a, // start index
  2512. 0xf0,0xb5,0x00,0x00,0x01,0x00,0x00,
  2513. OW, //
  2514. CRTC_ADDRESS_PORT_COLOR,
  2515. 0x003e,
  2516. OW, // Unlock CRTC registers 0-7
  2517. CRTC_ADDRESS_PORT_COLOR,
  2518. 0x0511,
  2519. METAOUT+INDXOUT, // program crtc registers
  2520. CRTC_ADDRESS_PORT_COLOR,
  2521. VGA_NUM_CRTC_PORTS, // count
  2522. 0, // start index
  2523. 0xa3,0x7f,0x80,0x06,0x81,0x92,0x37,0xfd,0x00,0x60,0x0,0x0,0x0,0x0,0x0,0x0,
  2524. 0x01,0x87,0xff,0x40,0x0,0x00,0x37,0xE3,0xFF,
  2525. IB, // prepare atc for writing
  2526. INPUT_STATUS_1_COLOR,
  2527. METAOUT+ATCOUT, // program attribute controller registers
  2528. ATT_ADDRESS_PORT, // port
  2529. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2530. 0, // start index
  2531. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  2532. 0x01,0x0,0x0F,0x0,0x0,
  2533. METAOUT+INDXOUT, // program graphics controller registers
  2534. GRAPH_ADDRESS_PORT, // port
  2535. 7, // count
  2536. 9, // start index
  2537. 0x00,0x00,0xc6,0x00,0x00,0x00,0x05,
  2538. METAOUT+INDXOUT, // program graphics controller registers
  2539. GRAPH_ADDRESS_PORT, // port
  2540. VGA_NUM_GRAPH_CONT_PORTS, // count
  2541. 0, // start index
  2542. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2543. OB, // DAC mask registers
  2544. DAC_PIXEL_MASK_PORT,
  2545. 0xFF,
  2546. IB, // prepare atc for writing
  2547. INPUT_STATUS_1_COLOR,
  2548. OB, // turn video on.
  2549. ATT_ADDRESS_PORT,
  2550. VIDEO_ENABLE,
  2551. //start of enable 64k read/write bank mode.
  2552. OW, // enable 64k single read/write bank
  2553. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2554. 0xe511,
  2555. OW, // enable PR0B register
  2556. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2557. 0xce0b,
  2558. //end of enable 64k read/write bank mode.
  2559. EOD
  2560. };
  2561. /**************************************************************************
  2562. * Western Digital 1024x768 modes - vRefresh Interlace. *
  2563. * *
  2564. **************************************************************************/
  2565. //
  2566. // Color graphics mode 0x5d, 1024x768 16 colors. Default - Interlace
  2567. //
  2568. USHORT WDVGA_1024x768_int[] = {
  2569. // SEQ index 7h-9h, 10h-14h
  2570. OWM, // start sync reset program up sequencer
  2571. SEQ_ADDRESS_PORT,
  2572. 8,
  2573. 0xf807,0x0008,0x0009,0xc510,0x6511,0x0412,0x8013,0x1014,
  2574. OWM, // start sync reset program up sequencer
  2575. SEQ_ADDRESS_PORT,
  2576. 5,
  2577. 0x0300,0x0101,0x0f02,0x0003,0x0604,
  2578. OB,
  2579. MISC_OUTPUT_REG_WRITE_PORT, // Misc output register
  2580. 0x2f,
  2581. OW, // Set chain mode in sync reset
  2582. GRAPH_ADDRESS_PORT,
  2583. 0x0506,
  2584. OB, // EndSyncResetCmd
  2585. SEQ_ADDRESS_PORT,
  2586. IND_SYNC_RESET,
  2587. OB,
  2588. SEQ_DATA_PORT,
  2589. END_SYNC_RESET_VALUE,
  2590. // CRTC index 2ah-30h, 3eh
  2591. METAOUT+INDXOUT, // program crtc registers
  2592. CRTC_ADDRESS_PORT_COLOR,
  2593. 7, // count
  2594. 0x2a, // start index
  2595. 0xf0,0x05,0x34,0x2a,0x0b,0x00,0x00,
  2596. OW, //
  2597. CRTC_ADDRESS_PORT_COLOR,
  2598. 0x003e,
  2599. OW, // Unlock CRTC registers 0-7
  2600. CRTC_ADDRESS_PORT_COLOR,
  2601. 0x0511,
  2602. METAOUT+INDXOUT, // program crtc registers
  2603. CRTC_ADDRESS_PORT_COLOR,
  2604. VGA_NUM_CRTC_PORTS, // count
  2605. 0, // start index
  2606. 0x99,0x7f,0x7f,0x1c,0x83,0x19,0x97,0x1f,0x00,0x40,0x0,0x0,0x0,0x0,0x0,0x0,
  2607. 0x7f,0x83,0x7F,0x40,0x0,0x7f,0x96,0xE3,0xFF,
  2608. IB, // prepare atc for writing
  2609. INPUT_STATUS_1_COLOR,
  2610. METAOUT+ATCOUT, // program attribute controller registers
  2611. ATT_ADDRESS_PORT, // port
  2612. VGA_NUM_ATTRIB_CONT_PORTS, // count
  2613. 0, // start index
  2614. 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xA,0xB,0xC,0xD,0xE,0xF,
  2615. 0x01,0x0,0x0F,0x0,0x0,
  2616. METAOUT+INDXOUT, // program graphics controller registers
  2617. GRAPH_ADDRESS_PORT, // port
  2618. 7, // count
  2619. 9, // start index
  2620. 0x00,0x00,0xc6,0x00,0x00,0x00,0x05,
  2621. METAOUT+INDXOUT, // program graphics controller registers
  2622. GRAPH_ADDRESS_PORT, // port
  2623. VGA_NUM_GRAPH_CONT_PORTS, // count
  2624. 0, // start index
  2625. 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x0FF,
  2626. OB, // DAC mask registers
  2627. DAC_PIXEL_MASK_PORT,
  2628. 0xFF,
  2629. IB, // prepare atc for writing
  2630. INPUT_STATUS_1_COLOR,
  2631. OB, // turn video on.
  2632. ATT_ADDRESS_PORT,
  2633. VIDEO_ENABLE,
  2634. //start of enable 64k read/write bank mode.
  2635. OW, // enable 64k single read/write bank
  2636. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2637. 0xe511,
  2638. OW, // enable PR0B register
  2639. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2640. 0xce0b,
  2641. //end of enable 64k read/write bank mode.
  2642. EOD
  2643. };
  2644. #else//!INT10_MODE_SET
  2645. USHORT WDVGA_1K_WIDE[] = {
  2646. OW, // stretch scans to 1k
  2647. CRTC_ADDRESS_PORT_COLOR,
  2648. 0x8013,
  2649. EOD
  2650. };
  2651. USHORT WDVGA_RW_BANK[] = {
  2652. OW, //unlock SEQ ext. regs for 90c11
  2653. SEQ_ADDRESS_PORT,
  2654. 0x4806,
  2655. OB,
  2656. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2657. 0x11,
  2658. METAOUT+MASKOUT,
  2659. SEQ_DATA_PORT,
  2660. 0x7f,
  2661. 0x80,
  2662. OB, // enable PR0B register
  2663. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2664. 0x0b,
  2665. METAOUT+MASKOUT,
  2666. GRAPH_DATA_PORT,
  2667. 0xf7,
  2668. 0x08,
  2669. EOD
  2670. };
  2671. USHORT WDVGA_RW_BANK_1K_WIDE[] = {
  2672. OW, // stretch scans to 1k
  2673. CRTC_ADDRESS_PORT_COLOR,
  2674. 0x8013,
  2675. OW, //unlock SEQ ext. regs for 90c11
  2676. SEQ_ADDRESS_PORT,
  2677. 0x4806,
  2678. OB,
  2679. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2680. 0x11,
  2681. METAOUT+MASKOUT,
  2682. SEQ_DATA_PORT,
  2683. 0x7f,
  2684. 0x80,
  2685. OB, // enable PR0B register
  2686. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2687. 0x0b,
  2688. METAOUT+MASKOUT,
  2689. GRAPH_DATA_PORT,
  2690. 0xf7,
  2691. 0x08,
  2692. EOD
  2693. };
  2694. USHORT WDVGA_1928_STRETCH[] = {
  2695. OW,
  2696. CRTC_ADDRESS_PORT_COLOR,
  2697. 0xf113, // stretch to 1928 bytes
  2698. OW, //unlock SEQ ext. regs for 90c11
  2699. SEQ_ADDRESS_PORT,
  2700. 0x4806,
  2701. OB,
  2702. SEQ_ADDRESS_PORT, // set 3c4.11 bit #7
  2703. 0x11,
  2704. METAOUT+MASKOUT,
  2705. SEQ_DATA_PORT,
  2706. 0x7f,
  2707. 0x80,
  2708. OB, // enable PR0B register
  2709. GRAPH_ADDRESS_PORT, // set 3ce.0b bit #3
  2710. 0x0b,
  2711. METAOUT+MASKOUT,
  2712. GRAPH_DATA_PORT,
  2713. 0xf7,
  2714. 0x08,
  2715. EOD
  2716. };
  2717. #endif
  2718. //
  2719. // Memory map table -
  2720. //
  2721. // These memory maps are used to save and restore the physical video buffer.
  2722. //
  2723. MEMORYMAPS MemoryMaps[] = {
  2724. // length start
  2725. // ------ -----
  2726. { 0x08000, 0xB0000}, // all mono text modes (7)
  2727. { 0x08000, 0xB8000}, // all color text modes (0, 1, 2, 3,
  2728. { 0x20000, 0xA0000}, // all VGA graphics modes
  2729. };
  2730. //
  2731. // Video mode table - contains information and commands for initializing each
  2732. // mode. These entries must correspond with those in VIDEO_MODE_VGA. The first
  2733. // entry is commented; the rest follow the same format, but are not so
  2734. // heavily commented.
  2735. //
  2736. VIDEOMODE ModesVGA[] = {
  2737. //
  2738. // Standard VGA modes.
  2739. //
  2740. //
  2741. // Mode index 0
  2742. // Color text mode 3, 720x400, 9x16 char cell (VGA).
  2743. //
  2744. {
  2745. VIDEO_MODE_COLOR, // flags that this mode is a color mode, but not graphics
  2746. 4, // four planes
  2747. 1, // one bit of color per plane
  2748. 80, 25, // 80x25 text resolution
  2749. 720, 400, // 720x400 pixels on screen
  2750. 160, 0x10000, // 160 bytes per scan line, 64K of CPU-addressable bitmap
  2751. 60, 0, // set frequency, non-interlaced mode.
  2752. NoBanking, // no banking supported or needed in this mode
  2753. MemMap_CGA, // the memory mapping is the standard CGA memory mapping
  2754. // of 32K at B8000
  2755. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2756. FALSE, // Is mode valid or not
  2757. #ifdef INT10_MODE_SET
  2758. 0xFF, 0x00, // mask to AND in for frequency
  2759. // Value used to set the frequency
  2760. 0x3, // int10 mode number
  2761. NULL,
  2762. NULL,
  2763. #else
  2764. WDVGA_TEXT_0, // pointer to the command strings
  2765. #endif
  2766. },
  2767. //
  2768. // Mode index 1.
  2769. // Color text mode 3, 640x350, 8x14 char cell (EGA).
  2770. //
  2771. {
  2772. VIDEO_MODE_COLOR, 4, 1, 80, 25,
  2773. 640, 350, 160, 0x10000, 60, 0, NoBanking, MemMap_CGA,
  2774. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2775. FALSE,
  2776. #ifdef INT10_MODE_SET
  2777. 0xFF, 0x00,
  2778. 0x3,
  2779. NULL,
  2780. NULL,
  2781. #else
  2782. WDVGA_TEXT_1, // pointer to the command strings
  2783. #endif
  2784. },
  2785. //
  2786. //
  2787. // Mode index 2
  2788. // Standard VGA Color graphics mode 0x12, 640x480 16 colors.
  2789. //
  2790. {
  2791. VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 80, 30,
  2792. 640, 480, 80, 0x10000, 60, 0, NoBanking, MemMap_VGA,
  2793. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2794. FALSE,
  2795. #ifdef INT10_MODE_SET
  2796. 0xFF, 0x00,
  2797. 0x12,
  2798. NULL,
  2799. NULL,
  2800. #else
  2801. WDVGA_640x480, // pointer to the command strings
  2802. #endif
  2803. },
  2804. #ifdef INT10_MODE_SET
  2805. //
  2806. // ModeX modes!
  2807. //
  2808. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 8, 1, 80,30,
  2809. 320, 200, 80, 0x10000, 70, 0, NoBanking, MemMap_VGA,
  2810. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2811. FALSE,
  2812. 0xFF, 0x00,
  2813. 0x13,
  2814. NULL,
  2815. MODESET_MODEX_320_200
  2816. },
  2817. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 8, 1, 80,30,
  2818. 320, 240, 80, 0x10000, 60, 0, NoBanking, MemMap_VGA,
  2819. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2820. FALSE,
  2821. 0xFF, 0x00,
  2822. 0x13,
  2823. NULL,
  2824. MODESET_MODEX_320_240
  2825. },
  2826. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 8, 1, 80,30,
  2827. 320, 400, 80, 0x10000, 70, 0, NoBanking, MemMap_VGA,
  2828. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2829. FALSE,
  2830. 0xFF, 0x00,
  2831. 0x13,
  2832. NULL,
  2833. MODESET_MODEX_320_400
  2834. },
  2835. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 8, 1, 80,30,
  2836. 320, 480, 80, 0x10000, 60, 0, NoBanking, MemMap_VGA,
  2837. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC | STN_MONO_LCD | UNKNOWN_LCD,
  2838. FALSE,
  2839. 0xFF, 0x00,
  2840. 0x13,
  2841. NULL,
  2842. MODESET_MODEX_320_480
  2843. },
  2844. #endif
  2845. //
  2846. // Beginning of SVGA modes
  2847. //
  2848. //
  2849. // Mode index 3
  2850. // 800x600 16 colors. 60hz
  2851. //
  2852. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 100, 37,
  2853. 800, 600, 100, 0x10000, 60, 0, NoBanking, MemMap_VGA,
  2854. MONITOR | IBM_F8532,
  2855. FALSE,
  2856. #ifdef INT10_MODE_SET
  2857. 0x3F, 0x40,
  2858. 0x58,
  2859. NULL,
  2860. NULL,
  2861. #else
  2862. WDVGA_800x600_60hz, // pointer to the command strings
  2863. #endif
  2864. },
  2865. //
  2866. // Mode index 4
  2867. // 800x600 16 colors. 72hz
  2868. //
  2869. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 100, 37,
  2870. 800, 600, 100, 0x10000, 72, 0, NoBanking, MemMap_VGA,
  2871. MONITOR,
  2872. FALSE,
  2873. #ifdef INT10_MODE_SET
  2874. 0x3F, 0x80,
  2875. 0x58,
  2876. NULL,
  2877. NULL,
  2878. #else
  2879. WDVGA_800x600_72hz, // pointer to the command strings
  2880. #endif
  2881. },
  2882. //
  2883. // Mode index 5
  2884. // 800x600 16 colors. 56hz
  2885. //
  2886. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 100, 37,
  2887. 800, 600, 100, 0x10000, 56, 0, NoBanking, MemMap_VGA,
  2888. MONITOR,
  2889. FALSE,
  2890. #ifdef INT10_MODE_SET
  2891. 0x3F, 0x00,
  2892. 0x58,
  2893. NULL,
  2894. NULL,
  2895. #else
  2896. WDVGA_800x600_56hz, // pointer to the command strings
  2897. #endif
  2898. },
  2899. //
  2900. // Mode index 6
  2901. // 1024x768 non-interlaced 16 colors. 60hz
  2902. // Assumes 512K.
  2903. //
  2904. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 128, 48,
  2905. 1024, 768, 128, 0x20000, 60, 0, NormalBanking, MemMap_VGA,
  2906. MONITOR,
  2907. FALSE,
  2908. #ifdef INT10_MODE_SET
  2909. 0xCF, 0x10,
  2910. 0x5d,
  2911. NULL,
  2912. WDVGA_RW_BANK,
  2913. #else
  2914. WDVGA_1024x768_60hz, // pointer to the command strings
  2915. #endif
  2916. },
  2917. //
  2918. // Mode index 7
  2919. // 1024x768 non-interlaced 16 colors. 70hz
  2920. // Assumes 512K.
  2921. //
  2922. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 128, 48,
  2923. 1024, 768, 128, 0x20000, 70, 0, NormalBanking, MemMap_VGA,
  2924. MONITOR,
  2925. FALSE,
  2926. #ifdef INT10_MODE_SET
  2927. 0xCF, 0x20,
  2928. 0x5d,
  2929. NULL,
  2930. WDVGA_RW_BANK,
  2931. #else
  2932. WDVGA_1024x768_70hz, // pointer to the command strings
  2933. #endif
  2934. },
  2935. //
  2936. // Mode index 8
  2937. // 1024x768 non-interlaced 16 colors. 72hz
  2938. // Assumes 512K.
  2939. //
  2940. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 128, 48,
  2941. 1024, 768, 128, 0x20000, 72, 0, NormalBanking, MemMap_VGA,
  2942. MONITOR,
  2943. FALSE,
  2944. #ifdef INT10_MODE_SET
  2945. 0xCF, 0x30,
  2946. 0x5d,
  2947. NULL,
  2948. WDVGA_RW_BANK,
  2949. #else
  2950. WDVGA_1024x768_72hz, // pointer to the command strings
  2951. #endif
  2952. },
  2953. //
  2954. // Mode index 9
  2955. // 1024x768 interlaced 16 colors. 44hz
  2956. // Assumes 512K.
  2957. //
  2958. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 4, 1, 128, 48,
  2959. 1024, 768, 128, 0x20000, 44, 1, NormalBanking, MemMap_VGA,
  2960. MONITOR,
  2961. FALSE,
  2962. #ifdef INT10_MODE_SET
  2963. 0xCF, 0x00,
  2964. 0x5d,
  2965. NULL,
  2966. WDVGA_RW_BANK,
  2967. #else
  2968. WDVGA_1024x768_int, // pointer to the command strings
  2969. #endif
  2970. },
  2971. #ifdef INT10_MODE_SET
  2972. // NOTE: 800x600 modes need 1Meg until we support broken rasters
  2973. //
  2974. // Mode index 11
  2975. // 800x600x256 56Hz
  2976. //
  2977. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  2978. 800, 600, 1024, 0x100000, 56, 0, NormalBanking, MemMap_VGA,
  2979. MONITOR,
  2980. FALSE,
  2981. 0x3F, 0x00,
  2982. 0x5c,
  2983. NULL,
  2984. WDVGA_RW_BANK_1K_WIDE,
  2985. },
  2986. //
  2987. // Mode index 12
  2988. // 800x600x256 60Hz
  2989. //
  2990. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  2991. 800, 600, 1024, 0x100000, 60, 0, NormalBanking, MemMap_VGA,
  2992. MONITOR | IBM_F8532,
  2993. FALSE,
  2994. 0x3F, 0x40,
  2995. 0x5c,
  2996. WDVGA_800x600x256_60hz,
  2997. WDVGA_RW_BANK_1K_WIDE,
  2998. },
  2999. //
  3000. // Mode index 13
  3001. // 800x600x256 72Hz
  3002. //
  3003. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3004. 800, 600, 1024, 0x100000, 72, 0, NormalBanking, MemMap_VGA,
  3005. MONITOR | IBM_F8532,
  3006. FALSE,
  3007. 0x3F, 0x80,
  3008. 0x5c,
  3009. WDVGA_800x600x256_72hz,
  3010. WDVGA_RW_BANK_1K_WIDE,
  3011. },
  3012. //
  3013. // Mode index 14
  3014. // 1024x768x256 60Hz
  3015. //
  3016. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3017. 1024, 768, 1024, 0x100000, 60, 0, NormalBanking, MemMap_VGA,
  3018. MONITOR,
  3019. FALSE,
  3020. 0xCF, 0x10,
  3021. 0x60,
  3022. WDVGA_1024x768x256_60hz,
  3023. WDVGA_RW_BANK,
  3024. },
  3025. //
  3026. // Mode index 15
  3027. // 1024x768x256 70hz
  3028. //
  3029. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3030. 1024, 768, 1024, 0x100000, 70, 0, NormalBanking, MemMap_VGA,
  3031. MONITOR,
  3032. FALSE,
  3033. 0xCF, 0x20,
  3034. 0x60,
  3035. NULL,
  3036. WDVGA_RW_BANK,
  3037. },
  3038. //
  3039. //
  3040. // Mode index 16
  3041. // 1024x768x256 72hz
  3042. //
  3043. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3044. 1024, 768, 1024, 0x100000, 72, 0, NormalBanking, MemMap_VGA,
  3045. MONITOR,
  3046. FALSE,
  3047. 0xCF, 0x30,
  3048. 0x60,
  3049. NULL,
  3050. WDVGA_RW_BANK,
  3051. },
  3052. // Mode index 17
  3053. // 1024x768x256 44Hz (Interlaced)
  3054. //
  3055. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3056. 1024, 768, 1024, 0x100000, 44, 1, NormalBanking, MemMap_VGA,
  3057. MONITOR,
  3058. FALSE,
  3059. 0xCF, 0x00,
  3060. 0x60,
  3061. WDVGA_1024x768x256_int,
  3062. WDVGA_RW_BANK,
  3063. },
  3064. //
  3065. // Mode index 18
  3066. //
  3067. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 16, 80, 30,
  3068. 640, 480, 1928, 0x100000, 60, 0, NormalBanking, MemMap_VGA,
  3069. MONITOR | IBM_F8515 | IBM_F8532 | TOSHIBA_DSTNC,
  3070. FALSE,
  3071. 0xFF, 0x00,
  3072. 0x01110072,
  3073. NULL,
  3074. WDVGA_1928_STRETCH,
  3075. },
  3076. #endif//INT10_MODE_SET
  3077. #ifdef INT10_MODE_SET
  3078. //
  3079. // Mode index 10
  3080. // 640x480x256
  3081. //
  3082. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3083. 640, 480, 1024, 0x80000, 60, 0, NormalBanking, MemMap_VGA,
  3084. IBM_F8515 | IBM_F8532 | UNKNOWN_LCD,
  3085. FALSE,
  3086. 0xFF, 0x00,
  3087. 0x5f,
  3088. WDVGA_640x480x256_60hz,
  3089. WDVGA_RW_BANK_1K_WIDE,
  3090. },
  3091. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3092. 640, 480, 1024, 0x80000, 72, 0, NormalBanking, MemMap_VGA,
  3093. IBM_F8515 | IBM_F8532,
  3094. FALSE,
  3095. 0xFF, 0x00,
  3096. 0x5f,
  3097. WDVGA_640x480x256_72hz,
  3098. WDVGA_RW_BANK_1K_WIDE,
  3099. },
  3100. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3101. 640, 480, 1024, 0x80000, 75, 0, NormalBanking, MemMap_VGA,
  3102. IBM_F8515 | IBM_F8532,
  3103. FALSE,
  3104. 0xFF, 0x00,
  3105. 0x5f,
  3106. WDVGA_640x480x256_75hz,
  3107. WDVGA_RW_BANK_1K_WIDE,
  3108. },
  3109. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3110. 640, 480, 1024, 0x80000, 60, 0, NormalBanking, MemMap_VGA,
  3111. TOSHIBA_DSTNC,
  3112. FALSE,
  3113. 0xFF, 0x00,
  3114. 0x5f,
  3115. WDVGA_640x480_60STN,
  3116. WDVGA_RW_BANK_1K_WIDE,
  3117. },
  3118. { VIDEO_MODE_COLOR+VIDEO_MODE_GRAPHICS, 1, 8, 80, 30,
  3119. 640, 480, 1024, 0x80000, 60, 0, NormalBanking, MemMap_VGA,
  3120. MONITOR,
  3121. FALSE,
  3122. 0xFF, 0x00,
  3123. 0x5f,
  3124. NULL,
  3125. WDVGA_RW_BANK_1K_WIDE,
  3126. },
  3127. #endif
  3128. };
  3129. ULONG NumVideoModes = sizeof(ModesVGA) / sizeof(VIDEOMODE);
  3130. //
  3131. //
  3132. // Data used to set the Graphics and Sequence Controllers to put the
  3133. // VGA into a planar state at A0000 for 64K, with plane 2 enabled for
  3134. // reads and writes, so that a font can be loaded, and to disable that mode.
  3135. //
  3136. // Settings to enable planar mode with plane 2 enabled.
  3137. //
  3138. USHORT EnableA000Data[] = {
  3139. OWM,
  3140. SEQ_ADDRESS_PORT,
  3141. 1,
  3142. 0x0100,
  3143. OWM,
  3144. GRAPH_ADDRESS_PORT,
  3145. 3,
  3146. 0x0204, // Read Map = plane 2
  3147. 0x0005, // Graphics Mode = read mode 0, write mode 0
  3148. 0x0406, // Graphics Miscellaneous register = A0000 for 64K, not odd/even,
  3149. // graphics mode
  3150. OWM,
  3151. SEQ_ADDRESS_PORT,
  3152. 3,
  3153. 0x0402, // Map Mask = write to plane 2 only
  3154. 0x0404, // Memory Mode = not odd/even, not full memory, graphics mode
  3155. 0x0300, // end sync reset
  3156. EOD
  3157. };
  3158. //
  3159. // Settings to disable the font-loading planar mode.
  3160. //
  3161. USHORT DisableA000Color[] = {
  3162. OWM,
  3163. SEQ_ADDRESS_PORT,
  3164. 1,
  3165. 0x0100,
  3166. OWM,
  3167. GRAPH_ADDRESS_PORT,
  3168. 3,
  3169. 0x0004, 0x1005, 0x0E06,
  3170. OWM,
  3171. SEQ_ADDRESS_PORT,
  3172. 3,
  3173. 0x0302, 0x0204, 0x0300, // end sync reset
  3174. EOD
  3175. };
  3176. #if defined(ALLOC_PRAGMA)
  3177. #pragma data_seg()
  3178. #endif