home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / H_DBCS / VDMBIOS.H < prev    next >
Text File  |  1995-04-14  |  25KB  |  655 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /***    VDMBIOS.H
  14.  *
  15.  *      SCCSID = @(#)vdmbios.h  6.6 92/03/04
  16.  *
  17.  *      MVDM ROM BIOS Data Definitions
  18.  *
  19.  *      For include file hierarchy, see MVDM.H
  20.  *
  21.  *
  22.  *      MODIFICATION HISTORY
  23.  *          09/20/88  JTP    Created.
  24.  *          12/04/88  JTP    Converted to structure.
  25.  *  @235    03/18/91 GAG        Allow disk seek but do verify sector instead
  26.  */
  27.  
  28. /***ET+ Low memory/ROM and EBIOS defines - used by VBIOS */
  29.  
  30. //c-begin
  31. #define ROMDATA_START   (IVT_START+IVT_LEN)
  32. #define ROMDATA_LEN     0x101   // sizeof(ROMDATA)-IVT_LEN
  33.  
  34. #define ROMBIOS_START   0xF0000
  35. #define ROMBIOS_LEN     0x10000
  36. #define ROMBIOS_PAGES   PAGESFROMBYTES(ROMBIOS_LEN)
  37.  
  38. #define PS2BIOS_START   0xE0000
  39. #define PS2BIOS_LEN     0x20000
  40. #define PS2BIOS_PAGES   PAGESFROMBYTES(PS2BIOS_LEN)
  41.  
  42. #define PS2BIOS4K_START 0xE0000                                       //J-YF001
  43. #define PS2BIOS4K_LEN   0x01000                                       //J-YF001
  44. #define PS2BIOS4K_PAGES PAGESFROMBYTES(PS2BIOS4K_LEN)                 //J-YF001
  45.  
  46. #define PS55BIOS_START  0xE1000                                       //J-YF001
  47. #define PS55BIOS_LEN    0x1F000                                       //J-YF001
  48. #define PS55BIOS_PAGES  PAGESFROMBYTES(PS2BIOS_LEN)                   //J-YF001
  49.  
  50. #define EXTROM_START    0xC0000 // where and how far to
  51. #define EXTROM_LEN      0x40000 // search for external adapter ROMs
  52. #define EXTROM_PAGES    PAGESFROMBYTES(EXTROM_LEN)
  53.  
  54. #define EBIOSDATA_START 0x9FC00
  55. #define EBIOSDATA_LEN   0x00400
  56. #define EBIOSDATA_PAGES PAGESFROMBYTES(EBIOSDATA_LEN)
  57.  
  58. #if     ROMDATA_START   != IVT_START+IVT_LEN
  59. #error  ROMDATA_START not equal to IVT_START+IVT_LEN
  60. #endif
  61.  
  62. #if     defined(IVT_START) && defined(DCA_START)
  63.  
  64. #if     DCA_START       != ROMDATA_START+ROMDATA_LEN
  65. #error  DCA_START not equal to ROMDATA_START+ROMDATA_LEN
  66. #endif
  67.  
  68. #define LOWMEM_START    IVT_START
  69. #define LOWMEM_LEN      (IVT_LEN+ROMDATA_LEN+DCA_LEN)
  70. #define LOWMEM_COPYLEN  (IVT_LEN+ROMDATA_LEN)
  71. #define LOWMEM_PAGES    PAGESFROMBYTES(LOWMEM_LEN)
  72.  
  73. #endif
  74. //c-end
  75. /*end*/
  76.  
  77.  
  78. /***    BIOS Interrupt Vectors
  79.  */
  80.  
  81. #define BIOSINT_PARITYCHECK     0x02
  82. #define BIOSINT_PRINTSCREEN     0x05
  83. #define BIOSINT_TIMERINTERRUPT  0x08
  84. #define BIOSINT_KEYINTERRUPT    0x09
  85. #define BIOSINT_COM2INTERRUPT   0x0B
  86. #define BIOSINT_COM1INTERRUPT   0x0C
  87. #define BIOSINT_LPT2INTERRUPT   0x0D
  88. #define BIOSINT_FLOPPYINTERRUPT 0x0E
  89. #define BIOSINT_LPT1INTERRUPT   0x0F
  90. #define BIOSINT_VIDEO           0x10
  91. #define BIOSINT_EQUIPMENTCHECK  0x11
  92. #define BIOSINT_MEMORYCHECK     0x12
  93. #define BIOSINT_DISKIO          0x13
  94. #define BIOSINT_COMIO           0x14
  95. #define BIOSINT_OSHOOK          0x15
  96. #define BIOSINT_KEYBOARD        0x16
  97. #define BIOSINT_PRINTERIO       0x17
  98. #define BIOSINT_ROMBASIC        0x18
  99. #define BIOSINT_REBOOT          0x19
  100. #define BIOSINT_TIMEOFDAY       0x1A
  101. #define BIOSINT_KEYBREAK        0x1B
  102. #define BIOSINT_CLOCKTICK       0x1C
  103. #define BIOSINT_VIDEOPARMS      0x1D
  104. #define BIOSINT_DISKPARMS       0x1E
  105. #define BIOSINT_VIDEOGRAPH      0x1F
  106. #define BIOSINT_OLDDISKIO       0x40
  107. #define BIOSINT_HDISK1PARMS     0x41
  108. #define BIOSINT_OLDVIDEO        0x42
  109. #define BIOSINT_EXTVIDEOGRAPH   0x43
  110. #define BIOSINT_HDISK2PARMS     0x46
  111.  
  112.  
  113. /***    Int 10h Equates (AH values)
  114.  */
  115.  
  116. #define INT10_SETMODE           0x00
  117. #define INT10_SETCURSORTYPE     0x01
  118. #define INT10_SETCURSORPOS      0x02
  119. #define INT10_QUERYCURSORPOS    0x03
  120. #define INT10_QUERYLPEN         0x04
  121. #define INT10_SETACTIVEPAGE     0x05
  122. #define INT10_SCROLLUP          0x06
  123. #define INT10_SCROLLDOWN        0x07
  124. #define INT10_READCHARATTR      0x08
  125. #define INT10_WRITECHARATTR     0x09
  126. #define INT10_WRITECHAR         0x0A
  127. #define INT10_SETPALETTE        0x0B
  128. #define INT10_WRITEPIXEL        0x0C
  129. #define INT10_READPIXEL         0x0D
  130. #define INT10_WRITETTY          0x0E
  131. #define INT10_QUERYMODE         0x0F
  132. #define INT10_EGASETPALETTE     0x10
  133. #define INT10_EGASELECTFONT     0x11
  134. #define INT10_EGASELECTMISC     0x12
  135. #define INT10_EGAWRITESTRING    0x13
  136. #define INT10_VGADISPLAYCODES   0x1A
  137. #define INT10_VGAQUERYSTATE     0x1B
  138. #define INT10_VGASAVERESTORE    0x1C
  139.  
  140.  
  141. /***    Int 13h Equates (AH values)
  142.  */
  143.  
  144. #define INT13_DISKRESET         0x00
  145. #define INT13_DISKSTATUS        0x01
  146. #define INT13_READSECTORS       0x02
  147. #define INT13_WRITESECTORS      0x03
  148. #define INT13_VERIFYSECTORS     0x04
  149. #define INT13_FORMATTRACK       0x05
  150. #define INT13_QUERYDRVPARMS     0x08
  151. #define INT13_DISKSEEK          0x0C            //@235
  152. #define INT13_QUERYDASDTYPE     0x15
  153. #define INT13_QUERYCHANGE       0x16
  154. #define INT13_SETDISKTYPE       0x17
  155. #define INT13_SETMEDIATYPE      0x18
  156.  
  157.  
  158. /***    Int 13h Status Equates (return in AH)
  159.  */
  160.  
  161. #define INT13STATUS_SUCCESS     0x00    //successful completion
  162. #define INT13STATUS_BADCMD      0x01    //bad command
  163. #define INT13STATUS_BADADDRMARK 0x02    //address mark not found
  164. #define INT13STATUS_WRTPROTECT  0x03    //write on write-protected disk
  165. #define INT13STATUS_RECNOTFOUND 0x04    //sector not found
  166. #define INT13STATUS_BADRESET    0x05    //reset failed (HD)
  167. #define INT13STATUS_MEDIACHANGE 0x06    //media changed
  168. #define INT13STATUS_INITFAIL    0x07    //parm. act. failed (HD)
  169. #define INT13STATUS_BADDMA      0x08    //DMA overrun
  170. #define INT13STATUS_DMABOUNDARY 0x09    //DMA across 64K boundary
  171. #define INT13STATUS_BADSECTOR   0x0a    //bad sector detected (HD)
  172. #define INT13STATUS_BADTRACK    0x0b    //bad track detected (HD)
  173. #define INT13STATUS_BADMEDIATYPE 0x0c   //unsupported track (HD)
  174. #define INT13STATUS_BADFMTSECNUM 0x0d   //bad # of sectors on format (HD)
  175. #define INT13STATUS_ADDRMARKDET 0x0e    //ctrl data addr mark detected (HD
  176. #define INT13STATUS_DMAARBERR   0x0f    //DMA arbitration error (HD)
  177. #define INT13STATUS_BADCRCECC   0x10    //bad CRC/ECC
  178. #define INT13STATUS_DATACORRECT 0x11    //data ECC corrected
  179. #define INT13STATUS_BADCNTLR    0x20    //controller failure
  180. #define INT13STATUS_BADSEEK     0x40    //seek failed
  181. #define INT13STATUS_TIMEOUT     0x80    //time out
  182. #define INT13STATUS_DRVNOTREADY 0xaa    //drive not ready (HD)
  183. #define INT13STATUS_UNDEFERR    0xbb    //undefined error (HD)
  184. #define INT13STATUS_WRITEFAULT  0xcc    //write fault (HD)
  185. #define INT13STATUS_STATUSERROR 0xe0    //status register error (HD)
  186. #define INT13STATUS_SENSEFAIL   0xff    //sense operation failed (HD)
  187.  
  188.  
  189. /***    Int 15h Equates (AH values)
  190.  */
  191.  
  192. #define INT15AH_KEYINTERCEPT    0x4f
  193. #define INT15AH_KEYSYSREQ       0x85
  194. #define INT15AH_DEVBUSY         0x90
  195. #define INT15AH_INTCOMPLETE     0x91
  196.  
  197.  
  198. /***    Int 15h Equates (AL values)
  199.  */
  200.  
  201. #define INT15AL_DISKETTE        0x01
  202. #define INT15AL_KEYBOARD        0x02
  203.  
  204.  
  205. /***    Int 16h Equates (AH values)
  206.  */
  207. #define INT16_READCHAR          0x00
  208. #define INT16_PEEKCHAR          0x01
  209. #define INT16_QUERYSHIFT        0x02
  210. #define INT16_SETDELAYS         0x03
  211. #define INT16_WRITECHAR         0x05
  212. #define INT16_READEXTCHAR       0x10
  213. #define INT16_PEEKEXTCHAR       0x11
  214. #define INT16_QUERYEXTSHIFT     0x12
  215. #define INT16_READ122CHAR       0x20
  216. #define INT16_PEEK122CHAR       0x21
  217. #define INT16_QUERY122SHIFT     0x22
  218.  
  219.  
  220. /***    Diskette Parameter Table (pointed by vector BIOSINT_DISKPARMS (1Eh))
  221.  */
  222.  
  223. typedef struct fdparmtable_s {
  224.     BYTE    fdp_bSpecify1;              // step-rate, head-unload
  225.     BYTE    fdp_bSpecify2;              // head-load, DMA mode
  226.     BYTE    fdp_bMotorOff;              // motor-off delay
  227.     BYTE    fdp_bSectorSize;            // bytes/sec (0=128,1=256,2=512,3=1024)
  228.     BYTE    fdp_nLastSector;            // (or think of it as # sectors/track)
  229.     BYTE    fdp_lenGapRW;               //
  230.     BYTE    fdp_lenData;                //
  231.     BYTE    fdp_lenGapFormat;           //
  232.     BYTE    fdp_bFormatData;            // format initialization byte
  233.     BYTE    fdp_bSettle;                // head settle time
  234.     BYTE    fdp_bMotorOn;               // motor start-up time
  235. } FDPARMTABLE;
  236. typedef FDPARMTABLE *PFDPARMTABLE;      // pointer to diskette parameter table
  237.  
  238.  
  239. /***    Fixed Disk Parameter Table
  240.  */
  241.  
  242. typedef struct hdparmtable_s {
  243.     WORD    hdp_wMaxCylinders;          // maximum number of cylinders
  244.     BYTE    hdp_bMaxHeads;              // maximum number of heads
  245.     WORD    hdp_wReserve1;              // reserved (not used)
  246.     WORD    hdp_wWritePrecompCyl;       // starting write precompensation cyl.
  247.     BYTE    hdp_bMaxECCDataBurstLen;    // maximum ECC data burst length
  248.     BYTE    hdp_bControl;               // control byte
  249.     BYTE    hdp_abReserve2[3];          // reserved (not used)
  250.     WORD    hdp_wLandingZone;           // landing zone for head parking
  251.     BYTE    hdp_bSectorsPerTrack;       // number of sectors per track
  252.     BYTE    hdp_bReserve3;              // reserved for future use
  253. } HDPARMTABLE;
  254. typedef HDPARMTABLE *PHDPARMTABLE;      // pointer to hard disk parameter table
  255.  
  256.  
  257. /***    Hard disk parameter - control byte bit mask
  258.  */
  259.  
  260. #define HDPCTRL_DISABLERETRY    0xc0    // disable retries
  261. #define HDPCTRL_EXCEED8HEADS    0x08    // more than 8 heads
  262.  
  263.  
  264. /***    Model byte equates (located at F000:FFFE in actual ROM)
  265.  */
  266. #define ROMMODEL_PC1    0x0FF           // PC-1, Expansion, Old PC2 (PC)
  267. #define ROMMODEL_PC2    0x0FE           // PC-2, Newer              (XT)
  268. #define ROMMODEL_JR     0x0FD           // HALO                     (JR)
  269. #define ROMMODEL_AT     0x0FC           // Salmon (PC-3)            (AT)
  270.  
  271.  
  272. /***    ROM format
  273.  */
  274. #define ROMHDR_SIGNATURE        0xAA55
  275. #define ROMHDR_INCR             2048
  276. #define BLOCKSIZE               512
  277. #define BLOCKSPERPAGE           (PAGESIZE / BLOCKSIZE)
  278.  
  279. //c-begin
  280. #define PAGESFROMBLOCKS(nbl)    ((nbl+BLOCKSPERPAGE-1) / BLOCKSPERPAGE)
  281. #define BLOCKSFROMBYTES(nb)     ((nb+BLOCKSIZE-1) / BLOCKSIZE)
  282. //c-end
  283.  
  284. typedef struct romhdr_s {
  285.     WORD romhdr_wSignature;     // should be ROMHDR_SIGNATURE
  286.     BYTE romhdr_bnBlocks;       // # of ROM blocks
  287.     BYTE romhdr_abFiller[ROMHDR_INCR-3];
  288. } ROMHDR;
  289.  
  290. typedef ROMHDR *PROMHDR;
  291.  
  292.  
  293. /***    ROM BIOS Data Area
  294.  */
  295. typedef struct romdata_s {
  296.  
  297. VPVOID  rb_avpIVT[IVT_LEN/4];   // interrupt vector table
  298.  
  299.  
  300. /***    Start of ROM BIOS Data Areas (0400h)
  301.  */
  302. WORD    rb_awCOM[4];            // RS232_BASE   (addresses of serial cards)
  303. WORD    rb_awLPT[4];            // PRINTER_BASE (addresses of printer cards)
  304. WORD    rb_fsEquip;             // EQUIP_FLAG   (installed hardware)
  305.  
  306. #define BIOSEQUIP_FLOPPY        0x00001     // machine has a floppy
  307. #define BIOSEQUIP_X87           0x00002     // X87=1 if coprocessor installed
  308. #define BIOSEQUIP_VIDEOMASK     0x00030     // video configuration bits
  309. #define BIOSEQUIP_COLOR40VIDEO  0x00010     //
  310. #define BIOSEQUIP_COLOR80VIDEO  0x00020     //
  311. #define BIOSEQUIP_MONOVIDEO     0x00030     //
  312. #define BIOSEQUIP_FLOPPYMASK    0x000C0     // # floppies-1 (if IPLDISK=1)
  313. #define BIOSEQUIP_COMMASK       0x00E00     // # COM ports
  314. #define BIOSEQUIP_PRINTERMASK   0x0C000     // # LPT ports
  315.  
  316. BBOOL   rb_bfMfgTest;           // MFG_TST      (initialization flag)
  317. WORD    rb_wMemSize;            // MEMORY_SIZE  (memory size in Kbytes)
  318. BBOOL   rb_bfMfgError[2];       // MFG_ERR_FLAG (scratchpad for manufacturing)
  319.  
  320.  
  321. /***    Start of keyboard data area (0417h)
  322.  */
  323. BYTE    rb_fbKFlag;             // KB_FLAG      (keyboard shift states)
  324.  
  325. #define BIOSKFLAG_RIGHTSHIFT    0x01
  326. #define BIOSKFLAG_LEFTSHIFT     0x02
  327. #define BIOSKFLAG_SHIFTMASK     0x03
  328. #define BIOSKFLAG_CTRL          0x04
  329. #define BIOSKFLAG_ALT           0x08
  330. #define BIOSKFLAG_SCROLLLOCK    0x10
  331. #define BIOSKFLAG_NUMLOCK       0x20
  332. #define BIOSKFLAG_CAPSLOCK      0x40
  333. #define BIOSKFLAG_INSERT        0x80
  334.  
  335. BYTE    rb_fbKFlag1;            // KB_FLAG_1    (second byte of keyboard status)
  336.  
  337. #define BIOSKFLAG1_LEFTCTRL     0x01        // left CTRL down
  338. #define BIOSKFLAG1_LEFTALT      0x02        // left ALT down
  339. #define BIOSKFLAG1_SYSSHIFT     0x04        // SysReq pressed and held
  340. #define BIOSKFLAG1_HOLDSTATE    0x08        // Ctrl-NumLock has been pressed
  341. #define BIOSKFLAG1_SCROLLDOWN   0x10
  342. #define BIOSKFLAG1_NUMDOWN      0x20
  343. #define BIOSKFLAG1_CAPSDOWN     0x40
  344. #define BIOSKFLAG1_INSDOWN      0x80
  345.  
  346. BYTE    rb_bKAlt;               // ALT_INPUT    (storage for Alt-keypad entry)
  347. WORD    rb_npKHead;             // BUFFER_HEAD  (advanced at task-time)
  348. WORD    rb_npKTail;             // BUFFER_TAIL  (advanced at interrupt-time)
  349. WORD    rb_abKBuf[16];          // KB_BUFFER
  350.  
  351.  
  352. /***    Start of floppy data area (043Eh)
  353.  */
  354. BYTE    rb_fbFSeekStatus;       // SEEK_STATUS
  355.  
  356. #define BIOSSEEK_DRV0NORECAL    0x01
  357. #define BIOSSEEK_DRV1NORECAL    0x02
  358. #define BIOSSEEK_DRV2NORECAL    0x04
  359. #define BIOSSEEK_DRV3NORECAL    0x08
  360. #define BIOSSEEK_DRVINTERRUPT   0x80
  361.  
  362. BYTE    rb_fbFMotorStatus;      // MOTOR_STATUS
  363.  
  364. #define BIOSMOTOR_DRV0RUNNING   0x01
  365. #define BIOSMOTOR_DRV1RUNNING   0x02
  366. #define BIOSMOTOR_DRV2RUNNING   0x04
  367. #define BIOSMOTOR_DRV3RUNNING   0x08
  368. #define BIOSMOTOR_DRVSELECT     0x30
  369. #define BIOSMOTOR_WRTOPERATION  0x80
  370.  
  371. BYTE    rb_bFMotorCount;        // MOTOR_COUNT
  372. BYTE    rb_bFStatus;            // DISKETTE_STATUS
  373. BYTE    rb_abFCtlStatus[7];     // NEC_STATUS (also CMD_BLOCK and HD_ERROR)
  374.  
  375.  
  376. /***    Start of video data area (0449h)
  377.  */
  378. BYTE    rb_bVMode;              // CRT_MODE
  379.  
  380. #define BIOSVMODE_BW40           0x00
  381. #define BIOSVMODE_CO40           0x01
  382. #define BIOSVMODE_BW80           0x02
  383. #define BIOSVMODE_CO80           0x03
  384. #define BIOSVMODE_CO320X200X4    0x04
  385. #define BIOSVMODE_BW320X200X4    0x05
  386. #define BIOSVMODE_CO640X200X2    0x06
  387. #define BIOSVMODE_MONO80         0x07
  388. #define BIOSVMODE_PCJR1          0x08
  389. #define BIOSVMODE_PCJR2          0x09
  390. #define BIOSVMODE_PCJR3          0x0A
  391. #define BIOSVMODE_COLRFONT       0x0B
  392. #define BIOSVMODE_MONOFONT       0x0C
  393. #define BIOSVMODE_CO320X200X16   0x0D
  394. #define BIOSVMODE_CO640X200X16   0x0E
  395. #define BIOSVMODE_MONO640X350X4  0x0F
  396. #define BIOSVMODE_CO640X350X16   0x10
  397. #define BIOSVMODE_CO640X480X2    0x11
  398. #define BIOSVMODE_CO640X480X16   0x12
  399. #define BIOSVMODE_CO320X200X256  0x13
  400.  
  401. WORD    rb_nVCols;              // CRT_COLS
  402. WORD    rb_wVLen;               // CRT_LEN
  403. WORD    rb_wVStart;             // CRT_START
  404. WORD    rb_awVCursorPos[8];     // CURSOR_POSN
  405. WORD    rb_wVCursorMode;        // CURSOR_MODE
  406. BYTE    rb_bVPage;              // ACTIVE_PAGE
  407. WORD    rb_wVPort;              // ADDR_6845
  408. BYTE    rb_bVModeByte;          // CRT_MODE_SET
  409. BYTE    rb_bVPalByte;           // CRT_PALETTE
  410.  
  411.  
  412. /***    Start of POST data area (0467h)
  413.  */
  414. VPVOID  rb_vpRomInit;           // IO_ROM_INIT and IO_ROM_SEG
  415. BBOOL   rb_fInterrupt;          // INTR_FLAG
  416.  
  417.  
  418. /***    Start of timer data area (046Ch)
  419.  */
  420. ULONG   rb_ulTickCount;         // TIMER_LOW and TIMER_HIGH
  421. BYTE    rb_bTickOverflow;       // TIMER_OFL
  422.  
  423.  
  424. /***    Start of system data area (0471h)
  425.  */
  426. BBOOL   rb_fBreak;              // BIOS_BREAK
  427.  
  428. #define BIOSBREAK_SET           0x80
  429.  
  430. SBOOL   rb_fReset;              // RESET_FLAG
  431.  
  432. #define BIOSRESET_WARMBOOT      0x1234
  433.  
  434.  
  435. /***    Start of hard disk data area (0474h)
  436.  */
  437. BYTE    rb_bDStatus;            // DISK_STATUS1 (fixed disk status byte)
  438. BYTE    rb_nDTotal;             // HF_NUM       (count of fixed disk drives)
  439. BYTE    rb_bDControl;           // CONTROL_BYTE (control byte drive options)
  440. BYTE    rb_bDPortOffset;        // PORT_OFF     (port offset)
  441.  
  442.  
  443. /***    Start of COM and LPT time-out data area (0478h)
  444.  */
  445. BYTE    rb_abLPTtimeout[4];     // PRINT_TIM_OUT
  446. BYTE    rb_abCOMtimeout[4];     // RS232_TIM_OUT
  447.  
  448.  
  449. /***    Start of additional keyboard data area (0480h)
  450.  */
  451. WORD    rb_npKBufStart;         // BUFFER_START
  452. WORD    rb_npKBufEnd;           // BUFFER_END
  453.  
  454.  
  455. /***    Start of EGA/VGA data area (0484h)
  456.  */
  457. BYTE    rb_nVRows;              // ROWS         (# rows-1)
  458. WORD    rb_nVCharHeight;        // POINTS       (height of char in pixels)
  459. BYTE    rb_bVInfo;              // INFO
  460.  
  461. #define BIOSVINFO_NOEMULATE     0x01    // (controls cursor emulation)
  462. #define BIOSVINFO_EGAMONO       0x02    //
  463. #define BIOSVINFO_WAITRETRC     0x04    //
  464. #define BIOSVINFO_EGAINACTIVE   0x08    //
  465. #define BIOSVINFO_MEMMASK       0x60    // (00=64k, 01=128k, 10=192k, 11=256k)
  466. #define BIOSVINFO_DONTCLEAR     0x80    // (don't clear screen on resets)
  467.  
  468. BYTE    rb_bVSwitches;          // INFO_3
  469.  
  470. #define BIOSVSW_SW1OFF          0x01
  471. #define BIOSVSW_SW2OFF          0x02
  472. #define BIOSVSW_SW3OFF          0x04
  473. #define BIOSVSW_SW4OFF          0x08
  474. #define BIOSVSW_FEATUREBITS     0xF0
  475.  
  476. BYTE    rb_bVFlags;             // Flags (for VGA and MCGA)
  477.  
  478. #define BIOSVFLAGS_VGAACTIVE    0x01
  479. #define BIOSVFLAGS_GRAYSCALES   0x02
  480. #define BIOSVFLAGS_VGAMONO      0x04
  481. #define BIOSVFLAGS_NODEFPALETTE 0x08
  482. #define BIOSVFLAGS_DSPSWITCHING 0x40
  483.  
  484. #define BIOSVFLAGS_350LINES     0x00
  485. #define BIOSVFLAGS_400LINES     0x10
  486. #define BIOSVFLAGS_200LINES     0x80
  487. #define BIOSVFLAGS_RESRVDLINES  0x90
  488.  
  489.  
  490. /***    Reserved area (048Ah)
  491.  */
  492. BYTE    rb_bReserved1[1];       // reserved
  493.  
  494.  
  495. /***    Start of additional diskette data area (048Bh)
  496.  */
  497. BYTE    rb_bFLastRate;          // LASTRATE
  498.  
  499.  
  500. /***    Start of additional hard disk data area (048Ch)
  501.  */
  502. BYTE    rb_bDStatusReg;         // HF_STATUS
  503. BYTE    rb_bDErrorReg;          // HF_ERROR
  504. BBOOL   rb_fDInterrupt;         // HF_INT_FLAG
  505. BBOOL   rb_fDCombo;             // HF_CNTRL     (combo hard disk/diskette card)
  506.  
  507.  
  508. /***    Start of additional diskette data area (0490h)
  509.  */
  510. BYTE    rb_bF0State;            // DSK_STATE    (drive 0 media state)
  511. BYTE    rb_bF1State;            //              (drive 1 media state)
  512. BYTE    rb_bF0StartState;       //              (drive 0 operation start state)
  513. BYTE    rb_bF1StartState;       //              (drive 1 operation start state)
  514. BYTE    rb_bF0Cyl;              // DSK_TRK      (drive 0 current cylinder)
  515. BYTE    rb_bF1Cyl;              //              (drive 1 current cylinder)
  516.  
  517.  
  518. /***    Start of additional keyboard data area (0496h)
  519.  */
  520. BYTE    rb_fbKFlag3;            // KB_FLAG_3
  521.  
  522. #define BIOSKFLAG3_E1PREFIX     0x01    // supported
  523. #define BIOSKFLAG3_SECPREFIX    0x02    // supported
  524. #define BIOSKFLAG3_RIGHTCTRL    0x04    // right CTRL down
  525. #define BIOSKFLAG3_RIGHTALT     0x08    // right ALT down
  526. #define BIOSKFLAG3_KBX          0x10    // supported
  527. #define BIOSKFLAG3_SETNUMLOCK   0x20    // supported
  528. #define BIOSKFLAG3_LASTID       0x40    // supported
  529. #define BIOSKFLAG3_READINGID    0x80    // supported (we never SET it though!)
  530.  
  531. BYTE    rb_fbKFlag2;            // KB_FLAG_2
  532.  
  533. #define BIOSKFLAG2_LEDS         0x07    // supported
  534. #define BIOSKFLAG2_ACK          0x10    // supported
  535. #define BIOSKFLAG2_RESEND       0x20    // supported
  536. #define BIOSKFLAG2_LEDUPDATE    0x40    // always clear
  537. #define BIOSKFLAG2_XMITERROR    0x80    // always clear
  538.  
  539.  
  540. /***    Start of real-time CMOS clock data area (0498h)
  541.  */
  542. VPVOID  rb_vpWaitFlag;          // USER_FLAG and USER_FLAG_SEG
  543. ULONG   rb_ulWaitFlag;          // RTC_LOW and RTC_HIGH
  544. BBOOL   rb_fWaitActive;         // RTC_WAIT_FLAG
  545.  
  546. BYTE    rb_bReserved2[7];        // this should "ORG" us to 04A8h
  547.  
  548.  
  549. /***    Start of additional EGA/VGA data area (04A8h)
  550.  */
  551. VPVOID  rb_vpVideoPtrTable;
  552.  
  553. /***    Format of VideoPtrTable:
  554.  *
  555.  *       VPVOID[0]      Parameter Table Pointer
  556.  *                      Initialized to BIOS Video Parameter Table.
  557.  *                      This value MUST exist.  For a VGA, the table is:
  558.  *
  559.  *                      BYTE    Value for CRT_COLS
  560.  *                      BYTE    Value for ROWS
  561.  *                      BYTE    Value for POINTS
  562.  *                      WORD    Value for CRT_LEN
  563.  *                      BYTE*4  Values for SEQ registers 1-4
  564.  *                      BYTE    Value for Miscellaneous Output register
  565.  *                      BYTE*25 Values for CRT registers 0-18h
  566.  *                      BYTE*20 Values for ATC registers 0-13h
  567.  *                      BYTE*9  Values for GDC registers 0-8
  568.  *
  569.  *       VPVOID[1]      Parameter Save Area Pointer
  570.  *                      Initialized to 0000:0000, this value is optional.
  571.  *                      When non-zero, this pointer will be used as pointer
  572.  *                      to a RAM area where certain dynamic values are to
  573.  *                      be saved. When in EGA operation this RAM area will
  574.  *                      hold the 16 EGA palette register values plus
  575.  *                      the overscan value in bytes 00h-10h respectively.
  576.  *                      At least 256 bytes must be allocated for this area.
  577.  *
  578.  *       VPVOID[2]      Alpha Character Set Override Pointer
  579.  *                      Initialized to 0000:0000, this value is optional.
  580.  *                      When non-zero, this pointer is used as a pointer
  581.  *                      to a tables described as follows:
  582.  *
  583.  *                      BYTE    Bytes/character
  584.  *
  585.  *                      BYTE    Block to load, should be zero for normal
  586.  *                              operation
  587.  *
  588.  *                      WORD    Count to store, should be 256 for normal
  589.  *                              operation
  590.  *
  591.  *                      WORD    Character offset, should be zero for normal
  592.  *                              operation
  593.  *
  594.  *                      VPVOID  Pointer to a font table
  595.  *
  596.  *                      BYTE    Displayable rows
  597.  *                              if 'FF' the maximum calculated value will be
  598.  *                              used, else this value will be used
  599.  *
  600.  *                      BYTE    Consecutive bytes of mode values for which
  601.  *                              this font description is to be used.
  602.  *                              The end of this stream is indicated by a
  603.  *                              byte code of 'FF'
  604.  *
  605.  *       VPVOID[3]      Graphics Character Set Override Pointer
  606.  *                      Initialized to 0000:0000, this value is optional.
  607.  *                      When non-zero, this pointer is used as a pointer
  608.  *                      to a tables described as follows:
  609.  *
  610.  *                      BYTE    Displayable rows
  611.  *
  612.  *                      WORD    Bytes per character
  613.  *
  614.  *                      VPVOID  Pointer to a font table
  615.  *
  616.  *                      BYTE    Consecutive bytes of mode values for which
  617.  *                              this font description is to be used.
  618.  *                              The end of this stream is indicated by a
  619.  *                              byte code of 'FF'
  620.  *
  621.  *       VPVOID[4]      Address of Secondary Video Pointer Table (VGA ONLY):
  622.  *
  623.  *                      WORD    Length of this table, in bytes
  624.  *                      VPVOID  Pointer to Display Combination Code Table
  625.  *                      VPVOID  Pointer to second Alpha Character Set Override
  626.  *                      VPVOID  Pointer to User Palette Profile Table
  627.  *                      VPVOID  Reserved
  628.  *                      VPVOID  Reserved
  629.  *                      VPVOID  Reserved
  630.  *
  631.  *       VPVOID[5]      Reserved and set to 0000:0000.
  632.  *
  633.  *       VPVOID[6]      Reserved and set to 0000:0000.
  634.  */
  635.  
  636. BYTE    rb_bReserved3[0x54];    // this should "ORG" us to 0500h
  637.  
  638. /***    Extra data area (0500h)
  639.  */
  640. BYTE    rb_bPrtScrStatus;       // STATUS_BYTE
  641. } ROMDATA;
  642.  
  643. typedef ROMDATA *PROMDATA;
  644.  
  645.  
  646. //c-begin
  647. typedef PROMDATA PVDMBASE;
  648. #define VDMBase (*(PVDMBASE)0)
  649. //c-end
  650.  
  651. //masm-begin
  652. //VDMBase   equ <ds:[0]>
  653. //.errnz  (size romdata_s NE 0501h)
  654. //masm-end
  655.