home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / PCHDECL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  3.2 KB  |  96 lines

  1. /*
  2.     pchdecl.h
  3.  
  4.     % declarations for PC hardware/event stuff
  5.  
  6.     2/28/89  by Ted.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1986, 1987, 1988 by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      4/09/89 ted:    pulled static hdata struct out of pcdata struct and made it
  15.                     static on its own. Included a ptr to it in pcdatastruc.
  16.      5/09/89 ted    Renamed from pchard.h
  17.      8/24/89 ted    Added curmouseshape pointer to pchdata.
  18. */
  19. /* -------------------------------------------------------------------------- */
  20. typedef struct {
  21.     int         ismouse;
  22.     boolean        eventchecked;
  23.     opcoord        xlastmou;
  24.     opcoord        ylastmou;
  25.     unsigned    blastmou;
  26.     opcoord        xmouscale;
  27.     opcoord        ymouscale;
  28.     mouseshape_struct *curmouseshape; /* backup copy of current mouse shape */
  29.  
  30.     boolean        soundon;
  31. } pchdata_struct;
  32.  
  33. OEXTERN pchdata_struct pchdatastruc;
  34. #define pchdata     (&(pchdatastruc))
  35.  
  36. /* pchard.c */
  37. extern void pc_hOpen(_arg1(dig_struct *digp));
  38. extern dig_hTimer_func        (pc_hTimer);
  39. /* -------------------------------------------------------------------------- */
  40. #ifdef OAK_DOS386
  41.  
  42. /* Note: as a kluge for DOS Extender, dx and di are identical for buffer ptrs */
  43. typedef union {
  44.     struct { unsigned short ax, bx, cx, dx, es, ds, si, di; } x;
  45.     struct { byte al, ah, bl, bh, cl, ch, dl, dh; } h;
  46.     struct { short duma, dumb, dumc; VOID *esdx; } a; /* NOTE: no 'far' esdx */
  47. } OREGS;
  48. extern unsigned DIGPRIV oakint86(_arg2(unsigned intno, OREGS *regs));
  49. extern unsigned DIGPRIV oakint86es(_arg3(unsigned intno, OREGS *regs, unsigned bufsize));
  50.  
  51. #else
  52. /* NOTE ds for output only. es also, unless esin is TRUE. */
  53. typedef union {
  54.     struct { unsigned short ax, bx, cx, dx, es, ds, si, di; } x;
  55.     struct { byte al, ah, bl, bh, cl, ch, dl, dh; } h;
  56.     struct { short duma, dumb, dumc; VOID far *esdx; } a;
  57. } OREGS;
  58. extern unsigned DIGPRIV _oakint86(_arg3(unsigned intno, OREGS *regs, boolean esin));
  59. #define oakint86(intno, regs)            _oakint86(intno, regs, FALSE)
  60. #define oakint86es(intno, regs, bsiz)    _oakint86(intno, regs, TRUE)
  61.  
  62. #endif
  63. /* -------------------------------------------------------------------------- */
  64. /* BIOS & DOS interrupt definitions */
  65. /* -------------------------------------------------------------------------- */
  66. #define BIOS_KBINT            0x16
  67. #define KBINT_READ            0x00
  68. #define    KBINT_STATUS        0x01
  69. #define KBINT_GETSHIFT        0x02
  70. #define PC_CFLAG            0x01
  71. #define PC_ZFLAG            0x40
  72.  
  73. #define BIOS_MOUSEINT        0x33
  74. #define BMOU_INIT            0x00
  75. #define BMOU_SHOW            0x01
  76. #define BMOU_HIDE            0x02
  77. #define BMOU_GETPOS            0x03
  78. #define BMOU_XRANGE            0x07
  79. #define BMOU_YRANGE            0x08
  80. #define BMOU_MSHAPE            0x09
  81. #define BMOU_TMSHAPE        0x0A
  82.  
  83. #define DOS_INT                0x21
  84. #define DOS_GETTIME            0x2c
  85. #define DOS_GETIVEC            0x35
  86.  
  87. /* -------------------------------------------------------------------------- */
  88. /* addresses and counts */
  89. /* -------------------------------------------------------------------------- */
  90. #define    DOS_PORTB        0x61        /* speaker control port */
  91. #define    SPKR_TIMER2        0x42        /* timer channel 2 addresses */
  92. #define SPKR_CNTRL2        0x43
  93. #define    SPKR_MODE3        0xB6        /* timer mode 3, square wave */
  94. /* -------------------------------------------------------------------------- */
  95.  
  96.