home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
PCHDECL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-15
|
6KB
|
170 lines
/*
pchdecl.h
% declarations for PC hardware/event stuff
2/28/89 by Ted.
OWL-PC 1.2
Copyright (c) 1986, 1987, 1988 by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
4/09/89 ted: pulled static hdata struct out of pcdata struct and made it
static on its own. Included a ptr to it in pcdatastruc.
5/09/89 ted Renamed from pchard.h
8/24/89 ted Added curmouseshape pointer to pchdata.
11/05/89 ted Added OAK_RATIONAL #ifdef for DOS_ZEROSEG macro for Rational's DOS extender.
11/08/89 ted Added xdata and xdatasize pchdata elements for use by dispcurr.
2/22/90 ted Made pc_hControl public.
2/28/90 ted Added desqview #define's and flag.
2/29/90 ted Added OCDECL's for assembly functions.
3/28/90 jmd ansi-fied
5/29/90 ted Added oak_int86ds for taking ds as input for new oakdir scheme.
6/05/90 mla Added more DOS int 21 function code defines.
7/25/90 ted Added OCDECL for DOS386 int86 functions.
7/28/90 ted Added extended registers to 386 version of OREGS struct.
8/14/90 ted Added another DOS int 21 function code define.
9/09/90 ted Added element for extended keyboard access.
10/05/90 mla Added another DOS int 21 function code define (DOS_GETCD).
10/10/90 ted Replaced OCDECL with oasm_func for assembly funcs for TC++.
10/11/90 ted Added pc_cbrk functions.
12/15/90 mla Added DOS_GETDRIVE
*/
#ifndef OAK_OS2
#ifndef OAK_RATIONAL
#ifndef OAK_DOS386
# define OAK_DESQVIEW
#endif
#endif
#endif
#ifndef OAK_RATIONAL
#ifndef OAK_DOS386
# define OAK_CBRK
#endif
#endif
/* -------------------------------------------------------------------------- */
#define getmoupos_func(fname) boolean DIGPRIV fname(moupos_struct *mouposp)
typedef boolean (DIGPRIV *getmoupos_fptr)(moupos_struct *mouposp);
typedef struct _pchdata {
int ismouse;
boolean eventchecked;
opcoord xlastmou;
opcoord ylastmou;
unsigned blastmou;
opcoord xmouscale;
opcoord ymouscale;
getmoupos_fptr getmoupos;
mouseshape_struct *curmouseshape; /* backup copy of current mouse shape */
boolean soundon;
boolean desqview;
byte xkbint; /* Offset for KBINT extended function calls */
VOID *xdata; /* pointer for chaining to extended data block */
SIZE_T xdatasize; /* size of extended data block */
} pchdata_struct;
OEXTERN pchdata_struct pchdatastruc;
#define pchdata (&(pchdatastruc))
/* PCHARD.C */
extern void pc_hOpen(dig_struct *digp);
extern boolean DIGPRIV pch_IsDESQview(void);
extern dig_hTimer_func (pc_hTimer);
extern dig_hControl_func (pc_hControl);
/* -------------------------------------------------------------------------- */
#ifdef OAK_DOS386
typedef union _oregs {
struct { unsigned short ax, axh, bx, bxh, cx, cxh, dx, es, ds, si, sih, di, dih; } x;
struct { byte al, ah, ah1, ah2, bl, bh, bh1, bh2, cl, ch, ch1, ch2, dl, dh; } h;
struct { unsigned duma, dumb, dumc; VOID *esdx; } a; /* NOTE: no 'far' esdx */
struct { unsigned eax, ebx, ecx, edx; short dsdum; unsigned esi, edi; } d;
} OREGS;
/* PLOINT86.ASM */
extern oasm_func(unsigned, oakint86, (unsigned intno, OREGS *regs));
/* Note: as a kluge for DOS Extender, dx and di are identical for buffer ptrs */
extern oasm_func(unsigned, oakint86x, (unsigned intno, OREGS *regs, int opt, unsigned bufsize));
# define oakint86es(intno, regs, bsiz) oakint86x(intno, regs, 1, bsiz)
# define oakint86ds(intno, regs, bsiz) oakint86x(intno, regs, 2, bsiz)
#else
typedef union _oregs {
struct { unsigned short ax, bx, cx, dx, es, ds, si, di; } x;
struct { byte al, ah, bl, bh, cl, ch, dl, dh; } h;
struct { short duma, dumb, dumc; VOID far *esdx; } a;
} OREGS;
/* PCOINT86.ASM */
/* NOTE: es & ds for output only, unless esdsin is not 0. 1 means es, 2 means ds */
extern oasm_func(unsigned, _oakint86, (unsigned intno, OREGS *regs, int esdsin));
# define oakint86(intno, regs) _oakint86(intno, regs, 0)
# define oakint86es(intno, regs, bsiz) _oakint86(intno, regs, 1)
# define oakint86ds(intno, regs, bsiz) _oakint86(intno, regs, 2)
/* PCCBRK.ASM */
extern oasm_func(void, pc_catchcbrk, (void));
extern oasm_func(void, pc_restorecbrk, (void));
extern oasm_func(boolean, pc_checkcbrk, (int cleanup));
#endif
/* -------------------------------------------------------------------------- */
/* BIOS & DOS interrupt definitions */
/* -------------------------------------------------------------------------- */
#define BIOS_KBINT 0x16
#define KBINT_READ 0x00
#define KBINT_STATUS 0x01
#define KBINT_GETSHIFT 0x02
#define PC_CFLAG 0x01
#define PC_ZFLAG 0x40
#define BIOS_MOUSEINT 0x33
#define BMOU_INIT 0x00
#define BMOU_SHOW 0x01
#define BMOU_HIDE 0x02
#define BMOU_GETPOS 0x03
#define BMOU_XRANGE 0x07
#define BMOU_YRANGE 0x08
#define BMOU_MSHAPE 0x09
#define BMOU_TMSHAPE 0x0A
#define DOS_INT 0x21
#define DOS_KBCHK 0x0b
#define DOS_SETDTA 0x1a
#define DOS_GETDRIVE 0x19
#define DOS_GETTIME 0x2c
#define DOS_GETDTA 0x2f
#define DOS_GETIVEC 0x35
#define DOS_DELETE 0x41
#define DOS_ATTR 0x43
#define DOS_GETCD 0x47
#define DOS_FINDFIRST 0x4e
#define DOS_FINDNEXT 0x4f
#define DOS_DVPRESENT 0x2B01
#define DV_INT 0x15
#define DVC_PAUSE 0x1000
/* -------------------------------------------------------------------------- */
/* addresses and counts */
/* -------------------------------------------------------------------------- */
#define DOS_PORTB 0x61 /* speaker control port */
#define SPKR_TIMER2 0x42 /* timer channel 2 addresses */
#define SPKR_CNTRL2 0x43
#define SPKR_MODE3 0xB6 /* timer mode 3, square wave */
/* Use custom selector for the 0 segment for Rational Systems's 286 DOS Extender */
#ifdef OAK_RATIONAL
# define DOS_ZEROSEG 0x38
#else
# define DOS_ZEROSEG 0
#endif
/* -------------------------------------------------------------------------- */