home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cdisk.zip / VDD / VDMBIOS.H < prev    next >
Text File  |  1993-01-08  |  24KB  |  625 lines

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