1 /* Public Domain Curses */
3 /* $Id: pdcdos.h,v 1.30 2008/07/13 16:08:17 wmcbrine Exp $ */
8 #if defined(_MSC_VER) || defined(_QC)
12 #if defined(__PACIFIC__) && !defined(__SMALL__)
16 #if defined(__HIGHC__) || MSC
20 /*----------------------------------------------------------------------
21 * MEMORY MODEL SUPPORT:
24 * TINY cs,ds,ss all in 1 segment (not enough memory!)
25 * SMALL cs:1 segment, ds:1 segment
26 * MEDIUM cs:many segments, ds:1 segment
27 * COMPACT cs:1 segment, ds:many segments
28 * LARGE cs:many segments, ds:many segments
29 * HUGE cs:many segments, ds:segments > 64K
53 extern unsigned char *pdc_atrtab;
54 extern int pdc_adapter;
55 extern int pdc_scrnmode;
57 extern bool pdc_direct_video;
58 extern bool pdc_bogus_adapter;
59 extern unsigned pdc_video_seg;
60 extern unsigned pdc_video_ofs;
62 #ifdef __DJGPP__ /* Note: works only in plain DOS... */
64 # define _FAR_POINTER(s,o) ((((int)(s)) << 4) + ((int)(o)))
66 # define _FAR_POINTER(s,o) (0xe0000000 + (((int)(s)) << 4) + ((int)(o)))
68 # define _FP_SEGMENT(p) (unsigned short)((((long)p) >> 4) & 0xffff)
71 # define _FAR_POINTER(s,o) MK_FP(s,o)
73 # if defined(__WATCOMC__) && defined(__FLAT__)
74 # define _FAR_POINTER(s,o) ((((int)(s)) << 4) + ((int)(o)))
76 # define _FAR_POINTER(s,o) (((long)s << 16) | (long)o)
79 # define _FP_SEGMENT(p) (unsigned short)(((long)p) >> 4)
81 #define _FP_OFFSET(p) ((unsigned short)p & 0x000f)
84 # include <sys/movedata.h>
85 unsigned char getdosmembyte(int offs);
86 unsigned short getdosmemword(int offs);
87 unsigned long getdosmemdword(int offs);
88 void setdosmembyte(int offs, unsigned char b);
89 void setdosmemword(int offs, unsigned short w);
91 # if SMALL || MEDIUM || MSC
96 # define getdosmembyte(offs) \
97 (*((unsigned char PDC_FAR *) _FAR_POINTER(0,offs)))
98 # define getdosmemword(offs) \
99 (*((unsigned short PDC_FAR *) _FAR_POINTER(0,offs)))
100 # define getdosmemdword(offs) \
101 (*((unsigned long PDC_FAR *) _FAR_POINTER(0,offs)))
102 # define setdosmembyte(offs,x) \
103 (*((unsigned char PDC_FAR *) _FAR_POINTER(0,offs)) = (x))
104 # define setdosmemword(offs,x) \
105 (*((unsigned short PDC_FAR *) _FAR_POINTER(0,offs)) = (x))
108 #if defined(__WATCOMC__) && defined(__386__)
114 unsigned long edi, esi, ebp, res, ebx, edx, ecx, eax;
119 unsigned short di, di_hi, si, si_hi, bp, bp_hi, res, res_hi,
120 bx, bx_hi, dx, dx_hi, cx, cx_hi, ax, ax_hi,
121 flags, es, ds, fs, gs, ip, cs, sp, ss;
126 unsigned char edi[4], esi[4], ebp[4], res[4],
127 bl, bh, ebx_b2, ebx_b3, dl, dh, edx_b2, edx_b3,
128 cl, ch, ecx_b2, ecx_b3, al, ah, eax_b2, eax_b3;
132 void PDC_dpmi_int(int, pdc_dpmi_regs *);
138 # define PDCREGS __dpmi_regs
139 # define PDCINT(vector, regs) __dpmi_int(vector, ®s)
143 # define PDCREGS pdc_dpmi_regs
144 # define PDCINT(vector, regs) PDC_dpmi_int(vector, ®s)
146 # define PDCREGS union REGPACK
147 # define PDCINT(vector, regs) intr(vector, ®s)
150 # define PDCREGS union REGS
151 # define PDCINT(vector, regs) int86(vector, ®s, ®s)
155 /* Wide registers in REGS: w or x? */
163 /* Monitor (terminal) type information */
168 _EGACOLOR = 0x04, _EGAMONO,
169 _VGACOLOR = 0x07, _VGAMONO,
170 _MCGACOLOR = 0x0a, _MCGAMONO,
174 /* Text-mode font size information */
180 _FONT15, /* GENIUS */
185 void movedata(unsigned, unsigned, unsigned, unsigned, unsigned);