home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
archiver
/
peek_221.arj
/
XMTASK2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-07
|
2KB
|
128 lines
/**********************************************************/
/* Try to find out if we're running under a multitasker */
/**********************************************************/
#include "peeker.h"
static union REGS rg;
static int pascal is_dv (void);
static int pascal is_ddos (void);
static int pascal is_mos (void);
static int pascal is_tv (void);
static int pascal is_os2 (void);
extern void pascal pause_dv (void);
extern void pascal pause_ddos (void);
extern void pascal pause_tv (void);
extern void pascal pause_mos (void);
extern void pascal pause_os2 (void);
extern void pascal pause_dos (void);
void pascal (*pause_mtask)(void) = pause_dos;
void pascal
set_mtask (void)
{
if (is_dv ()) {
pause_mtask = pause_dv;
}
else if (is_ddos ()) {
pause_mtask = pause_ddos;
}
else if (is_mos ()) {
pause_mtask = pause_mos;
}
else if (is_tv ()) {
pause_mtask = pause_tv;
}
else if (is_os2 ()) {
pause_mtask = pause_os2;
}
}
static int pascal
is_dv (void)
{
rg.x.cx = 0x4445;
rg.x.dx = 0x5351;
rg.x.ax = 0x2b01;
int86 (0x21, &rg, &rg);
return rg.h.al != 0xff;
/*
rg.h.al = 2;
int86(0x21,&rg,&rg);
if(rg.h.al != 0xff) {
dvshadow = rg.x.dx;
maxy = rg.h.bh;
maxx = rg.h.bl;
}
*/
}
static int pascal
is_ddos (void)
{
rg.h.ah = 0xe4;
int86 (0x21, &rg, &rg);
if (rg.h.al == 1 || rg.h.al == 2)
return 1;
return 0;
}
static int pascal
is_mos (void)
{
int temp;
rg.h.ah = 0x30;
int86 (0x21, &rg, &rg);
temp = rg.x.ax;
rg.x.ax = 0x3000;
rg.x.bx = 0x3000;
rg.x.cx = 0x3000;
rg.x.dx = 0x3000;
int86 (0x21, &rg, &rg);
if (rg.x.ax == temp)
return temp;
return 0;
}
static int pascal
is_tv (void)
{
rg.x.ax = 0x1022;
rg.x.bx = 0;
int86 (0x15, &rg, &rg);
if (!rg.x.bx)
return 0;
return rg.x.bx;
}
static int pascal
is_os2 (void)
{
struct SREGS sg;
rg.x.ax = 0x352f;
int86x(0x21,&rg,&rg,&sg);
if(!(rg.x.bx | sg.es)) return 0;
rg.x.ax = 0x1600;
int86 (0x2f, &rg, &rg);
return (rg.h.al == 0);
}