1 /* Public Domain Curses */
5 RCSID("$Id: pdcutil.c,v 1.24 2008/07/13 16:08:17 wmcbrine Exp $")
11 PDC_LOG(("PDC_beep() - called\n"));
13 regs
.W
.ax
= 0x0e07; /* Write ^G in TTY fashion */
18 void PDC_napms(int ms
)
21 long goal
, start
, current
;
23 PDC_LOG(("PDC_napms() - called: ms=%d\n", ms
));
25 goal
= DIVROUND((long)ms
, 50);
29 start
= getdosmemdword(0x46c);
33 while (goal
> (current
= getdosmemdword(0x46c)))
35 if (current
< start
) /* in case of midnight reset */
44 const char *PDC_sysname(void)
51 unsigned char getdosmembyte(int offset
)
55 dosmemget(offset
, sizeof(unsigned char), &b
);
59 unsigned short getdosmemword(int offset
)
63 dosmemget(offset
, sizeof(unsigned short), &w
);
67 unsigned long getdosmemdword(int offset
)
71 dosmemget(offset
, sizeof(unsigned long), &dw
);
75 void setdosmembyte(int offset
, unsigned char b
)
77 dosmemput(&b
, sizeof(unsigned char), offset
);
80 void setdosmemword(int offset
, unsigned short w
)
82 dosmemput(&w
, sizeof(unsigned short), offset
);
87 #if defined(__WATCOMC__) && defined(__386__)
89 void PDC_dpmi_int(int vector
, pdc_dpmi_regs
*rmregs
)
91 union REGPACK regs
= {0};
99 regs
.x
.edi
= FP_OFF(rmregs
);
100 regs
.x
.es
= FP_SEG(rmregs
);