forked from windoze/tvision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dual.cc
52 lines (45 loc) · 956 Bytes
/
dual.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* Copyright (C) 1996-1998 Robert H”hne, see COPYING.RH for details */
/* This file is part of RHIDE. */
#define Uses_TScreen
#define Uses_TEventQueue
#include <tv.h>
#ifdef TVCompf_djgpp
#include <dpmi.h>
#include <sys/farptr.h>
#endif
int dual_display_supported()
{
#ifdef TVCompf_djgpp
__dpmi_regs r;
r.x.ax = 0x1a00;
__dpmi_int(0x10,&r);
if (r.h.al != 0x1a) return 0;
if (r.h.bh == 0x01) return 1;
#endif
/*
#ifdef TVOSf_Linux
extern unsigned short *mono_mem;
return (mono_mem != NULL);
#endif
*/
return 0;
}
void SetDualDisplay()
{
if (TDisplay::dual_display) return;
if (!dual_display_supported()) return;
TEventQueue::suspend();
TScreen::suspend();
TDisplay::dual_display = 1;
TScreen::resume();
TEventQueue::resume();
}
void SetNormalDisplay()
{
if (!TDisplay::dual_display) return;
TEventQueue::suspend();
TScreen::suspend();
TDisplay::dual_display = 0;
TScreen::resume();
TEventQueue::resume();
}