home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / VDMBIOS.H < prev    next >
C/C++ Source or Header  |  1997-04-10  |  24KB  |  654 lines

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