curses 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push_gem.yml +48 -0
- data/History.md +3 -0
- data/curses.gemspec +1 -1
- metadata +8 -247
- data/vendor/PDCurses/.gitignore +0 -47
- data/vendor/PDCurses/.travis.yml +0 -49
- data/vendor/PDCurses/CMakeLists.txt +0 -68
- data/vendor/PDCurses/HISTORY.md +0 -2036
- data/vendor/PDCurses/IMPLEMNT.md +0 -327
- data/vendor/PDCurses/Makefile +0 -27
- data/vendor/PDCurses/README.md +0 -77
- data/vendor/PDCurses/acs_defs.h +0 -265
- data/vendor/PDCurses/appveyor.yml +0 -218
- data/vendor/PDCurses/cmake/README.md +0 -71
- data/vendor/PDCurses/cmake/build_dependencies.cmake +0 -178
- data/vendor/PDCurses/cmake/build_options.cmake +0 -25
- data/vendor/PDCurses/cmake/dll_version.cmake +0 -26
- data/vendor/PDCurses/cmake/gen_config_header.cmake +0 -43
- data/vendor/PDCurses/cmake/get_version.cmake +0 -17
- data/vendor/PDCurses/cmake/make_uninstall.cmake +0 -19
- data/vendor/PDCurses/cmake/project_common.cmake +0 -121
- data/vendor/PDCurses/cmake/resource.in.cmake +0 -52
- data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +0 -83
- data/vendor/PDCurses/cmake/target_arch.cmake +0 -36
- data/vendor/PDCurses/cmake/version.in.cmake +0 -73
- data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +0 -96
- data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +0 -106
- data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +0 -105
- data/vendor/PDCurses/curses.h +0 -1846
- data/vendor/PDCurses/curspriv.h +0 -134
- data/vendor/PDCurses/demos/README.md +0 -25
- data/vendor/PDCurses/demos/firework.c +0 -144
- data/vendor/PDCurses/demos/newtest.c +0 -581
- data/vendor/PDCurses/demos/ozdemo.c +0 -447
- data/vendor/PDCurses/demos/ptest.c +0 -283
- data/vendor/PDCurses/demos/rain.c +0 -157
- data/vendor/PDCurses/demos/testcurs.c +0 -1607
- data/vendor/PDCurses/demos/tui.c +0 -1048
- data/vendor/PDCurses/demos/tui.h +0 -65
- data/vendor/PDCurses/demos/tuidemo.c +0 -233
- data/vendor/PDCurses/demos/version.c +0 -61
- data/vendor/PDCurses/demos/worm.c +0 -432
- data/vendor/PDCurses/demos/xmas.c +0 -955
- data/vendor/PDCurses/dos/CMakeLists.txt +0 -47
- data/vendor/PDCurses/dos/Makefile +0 -105
- data/vendor/PDCurses/dos/Makefile.bcc +0 -83
- data/vendor/PDCurses/dos/Makefile.dmc +0 -257
- data/vendor/PDCurses/dos/Makefile.msc +0 -113
- data/vendor/PDCurses/dos/Makefile.wcc +0 -107
- data/vendor/PDCurses/dos/README.md +0 -51
- data/vendor/PDCurses/dos/bccdos.lrf +0 -9
- data/vendor/PDCurses/dos/mscdos.lrf +0 -50
- data/vendor/PDCurses/dos/pdcclip.c +0 -132
- data/vendor/PDCurses/dos/pdcdisp.c +0 -135
- data/vendor/PDCurses/dos/pdcdos.h +0 -194
- data/vendor/PDCurses/dos/pdcgetsc.c +0 -98
- data/vendor/PDCurses/dos/pdckbd.c +0 -513
- data/vendor/PDCurses/dos/pdcscrn.c +0 -785
- data/vendor/PDCurses/dos/pdcsetsc.c +0 -101
- data/vendor/PDCurses/dos/pdcutil.c +0 -212
- data/vendor/PDCurses/libobjs.mif +0 -26
- data/vendor/PDCurses/makedist.mif +0 -20
- data/vendor/PDCurses/man/Makefile +0 -37
- data/vendor/PDCurses/man/README.md +0 -21
- data/vendor/PDCurses/man/intro.md +0 -361
- data/vendor/PDCurses/man/manext.c +0 -119
- data/vendor/PDCurses/man/sdl.md +0 -152
- data/vendor/PDCurses/man/sdl2.md +0 -58
- data/vendor/PDCurses/man/x11.md +0 -407
- data/vendor/PDCurses/ncurses/CMakeLists.txt +0 -66
- data/vendor/PDCurses/ncurses/README.md +0 -26
- data/vendor/PDCurses/ncurses/makefile +0 -29
- data/vendor/PDCurses/os2/CMakeLists.txt +0 -41
- data/vendor/PDCurses/os2/Makefile +0 -132
- data/vendor/PDCurses/os2/Makefile.bcc +0 -90
- data/vendor/PDCurses/os2/Makefile.wcc +0 -43
- data/vendor/PDCurses/os2/README.md +0 -43
- data/vendor/PDCurses/os2/iccos2.lrf +0 -50
- data/vendor/PDCurses/os2/iccos2.mak +0 -256
- data/vendor/PDCurses/os2/pdcclip.c +0 -188
- data/vendor/PDCurses/os2/pdcdisp.c +0 -93
- data/vendor/PDCurses/os2/pdcgetsc.c +0 -89
- data/vendor/PDCurses/os2/pdckbd.c +0 -521
- data/vendor/PDCurses/os2/pdcos2.h +0 -55
- data/vendor/PDCurses/os2/pdcscrn.c +0 -449
- data/vendor/PDCurses/os2/pdcsetsc.c +0 -112
- data/vendor/PDCurses/os2/pdcutil.c +0 -52
- data/vendor/PDCurses/panel.h +0 -56
- data/vendor/PDCurses/pdcurses/README.md +0 -25
- data/vendor/PDCurses/pdcurses/addch.c +0 -693
- data/vendor/PDCurses/pdcurses/addchstr.c +0 -245
- data/vendor/PDCurses/pdcurses/addstr.c +0 -240
- data/vendor/PDCurses/pdcurses/attr.c +0 -359
- data/vendor/PDCurses/pdcurses/beep.c +0 -68
- data/vendor/PDCurses/pdcurses/bkgd.c +0 -223
- data/vendor/PDCurses/pdcurses/border.c +0 -411
- data/vendor/PDCurses/pdcurses/clear.c +0 -159
- data/vendor/PDCurses/pdcurses/color.c +0 -298
- data/vendor/PDCurses/pdcurses/debug.c +0 -109
- data/vendor/PDCurses/pdcurses/delch.c +0 -96
- data/vendor/PDCurses/pdcurses/deleteln.c +0 -211
- data/vendor/PDCurses/pdcurses/deprec.c +0 -27
- data/vendor/PDCurses/pdcurses/getch.c +0 -417
- data/vendor/PDCurses/pdcurses/getstr.c +0 -474
- data/vendor/PDCurses/pdcurses/getyx.c +0 -139
- data/vendor/PDCurses/pdcurses/inch.c +0 -127
- data/vendor/PDCurses/pdcurses/inchstr.c +0 -214
- data/vendor/PDCurses/pdcurses/initscr.c +0 -367
- data/vendor/PDCurses/pdcurses/inopts.c +0 -324
- data/vendor/PDCurses/pdcurses/insch.c +0 -271
- data/vendor/PDCurses/pdcurses/insstr.c +0 -264
- data/vendor/PDCurses/pdcurses/instr.c +0 -246
- data/vendor/PDCurses/pdcurses/kernel.c +0 -259
- data/vendor/PDCurses/pdcurses/keyname.c +0 -157
- data/vendor/PDCurses/pdcurses/mouse.c +0 -438
- data/vendor/PDCurses/pdcurses/move.c +0 -57
- data/vendor/PDCurses/pdcurses/outopts.c +0 -159
- data/vendor/PDCurses/pdcurses/overlay.c +0 -214
- data/vendor/PDCurses/pdcurses/pad.c +0 -260
- data/vendor/PDCurses/pdcurses/panel.c +0 -633
- data/vendor/PDCurses/pdcurses/printw.c +0 -126
- data/vendor/PDCurses/pdcurses/refresh.c +0 -279
- data/vendor/PDCurses/pdcurses/scanw.c +0 -578
- data/vendor/PDCurses/pdcurses/scr_dump.c +0 -213
- data/vendor/PDCurses/pdcurses/scroll.c +0 -101
- data/vendor/PDCurses/pdcurses/slk.c +0 -591
- data/vendor/PDCurses/pdcurses/termattr.c +0 -182
- data/vendor/PDCurses/pdcurses/terminfo.c +0 -217
- data/vendor/PDCurses/pdcurses/touch.c +0 -163
- data/vendor/PDCurses/pdcurses/util.c +0 -312
- data/vendor/PDCurses/pdcurses/window.c +0 -569
- data/vendor/PDCurses/sdl1/Makefile +0 -129
- data/vendor/PDCurses/sdl1/Makefile.mng +0 -110
- data/vendor/PDCurses/sdl1/README.md +0 -31
- data/vendor/PDCurses/sdl1/deffont.h +0 -385
- data/vendor/PDCurses/sdl1/deficon.h +0 -23
- data/vendor/PDCurses/sdl1/pdcclip.c +0 -131
- data/vendor/PDCurses/sdl1/pdcdisp.c +0 -373
- data/vendor/PDCurses/sdl1/pdcgetsc.c +0 -30
- data/vendor/PDCurses/sdl1/pdckbd.c +0 -405
- data/vendor/PDCurses/sdl1/pdcscrn.c +0 -414
- data/vendor/PDCurses/sdl1/pdcsdl.h +0 -31
- data/vendor/PDCurses/sdl1/pdcsetsc.c +0 -64
- data/vendor/PDCurses/sdl1/pdcutil.c +0 -40
- data/vendor/PDCurses/sdl1/sdltest.c +0 -79
- data/vendor/PDCurses/sdl2/CMakeLists.txt +0 -76
- data/vendor/PDCurses/sdl2/Makefile +0 -135
- data/vendor/PDCurses/sdl2/Makefile.vc +0 -164
- data/vendor/PDCurses/sdl2/README.md +0 -34
- data/vendor/PDCurses/sdl2/deffont.h +0 -385
- data/vendor/PDCurses/sdl2/deficon.h +0 -23
- data/vendor/PDCurses/sdl2/pdcclip.c +0 -93
- data/vendor/PDCurses/sdl2/pdcdisp.c +0 -534
- data/vendor/PDCurses/sdl2/pdcgetsc.c +0 -30
- data/vendor/PDCurses/sdl2/pdckbd.c +0 -480
- data/vendor/PDCurses/sdl2/pdcscrn.c +0 -443
- data/vendor/PDCurses/sdl2/pdcsdl.h +0 -33
- data/vendor/PDCurses/sdl2/pdcsetsc.c +0 -67
- data/vendor/PDCurses/sdl2/pdcutil.c +0 -39
- data/vendor/PDCurses/sdl2/sdltest.c +0 -81
- data/vendor/PDCurses/term.h +0 -48
- data/vendor/PDCurses/version.mif +0 -7
- data/vendor/PDCurses/vt/CMakeLists.txt +0 -28
- data/vendor/PDCurses/vt/Makefile +0 -135
- data/vendor/PDCurses/vt/Makefile.bcc +0 -111
- data/vendor/PDCurses/vt/Makefile.dmc +0 -258
- data/vendor/PDCurses/vt/Makefile.vc +0 -144
- data/vendor/PDCurses/vt/Makefile.wcc +0 -107
- data/vendor/PDCurses/vt/README.md +0 -64
- data/vendor/PDCurses/vt/pdcclip.c +0 -20
- data/vendor/PDCurses/vt/pdcdisp.c +0 -284
- data/vendor/PDCurses/vt/pdcgetsc.c +0 -27
- data/vendor/PDCurses/vt/pdckbd.c +0 -394
- data/vendor/PDCurses/vt/pdcscrn.c +0 -434
- data/vendor/PDCurses/vt/pdcsetsc.c +0 -45
- data/vendor/PDCurses/vt/pdcutil.c +0 -43
- data/vendor/PDCurses/vt/pdcvt.h +0 -16
- data/vendor/PDCurses/watcom.mif +0 -68
- data/vendor/PDCurses/wincon/CMakeLists.txt +0 -27
- data/vendor/PDCurses/wincon/Makefile.bcc +0 -88
- data/vendor/PDCurses/wincon/Makefile.dmc +0 -256
- data/vendor/PDCurses/wincon/Makefile.lcc +0 -273
- data/vendor/PDCurses/wincon/Makefile.mng +0 -176
- data/vendor/PDCurses/wincon/Makefile.vc +0 -144
- data/vendor/PDCurses/wincon/Makefile.wcc +0 -51
- data/vendor/PDCurses/wincon/README.md +0 -85
- data/vendor/PDCurses/wincon/pdcclip.c +0 -174
- data/vendor/PDCurses/wincon/pdcdisp.c +0 -143
- data/vendor/PDCurses/wincon/pdcgetsc.c +0 -55
- data/vendor/PDCurses/wincon/pdckbd.c +0 -786
- data/vendor/PDCurses/wincon/pdcscrn.c +0 -717
- data/vendor/PDCurses/wincon/pdcsetsc.c +0 -91
- data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
- data/vendor/PDCurses/wincon/pdcurses.rc +0 -28
- data/vendor/PDCurses/wincon/pdcutil.c +0 -41
- data/vendor/PDCurses/wincon/pdcwin.h +0 -31
- data/vendor/PDCurses/wingui/CMakeLists.txt +0 -27
- data/vendor/PDCurses/wingui/Makefile.bcc +0 -85
- data/vendor/PDCurses/wingui/Makefile.dmc +0 -259
- data/vendor/PDCurses/wingui/Makefile.lcc +0 -273
- data/vendor/PDCurses/wingui/Makefile.mng +0 -171
- data/vendor/PDCurses/wingui/Makefile.vc +0 -144
- data/vendor/PDCurses/wingui/Makefile.wcc +0 -51
- data/vendor/PDCurses/wingui/README.md +0 -93
- data/vendor/PDCurses/wingui/pdcclip.c +0 -174
- data/vendor/PDCurses/wingui/pdcdisp.c +0 -718
- data/vendor/PDCurses/wingui/pdcgetsc.c +0 -30
- data/vendor/PDCurses/wingui/pdckbd.c +0 -143
- data/vendor/PDCurses/wingui/pdcscrn.c +0 -2797
- data/vendor/PDCurses/wingui/pdcsetsc.c +0 -89
- data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
- data/vendor/PDCurses/wingui/pdcurses.rc +0 -28
- data/vendor/PDCurses/wingui/pdcutil.c +0 -61
- data/vendor/PDCurses/wingui/pdcwin.h +0 -122
- data/vendor/PDCurses/x11/Makefile.in +0 -754
- data/vendor/PDCurses/x11/PDCurses.spec +0 -82
- data/vendor/PDCurses/x11/README.md +0 -62
- data/vendor/PDCurses/x11/ScrollBox.c +0 -319
- data/vendor/PDCurses/x11/ScrollBox.h +0 -51
- data/vendor/PDCurses/x11/ScrollBoxP.h +0 -70
- data/vendor/PDCurses/x11/aclocal.m4 +0 -994
- data/vendor/PDCurses/x11/big_icon.xbm +0 -46
- data/vendor/PDCurses/x11/compose.h +0 -201
- data/vendor/PDCurses/x11/config.guess +0 -1500
- data/vendor/PDCurses/x11/config.h.in +0 -100
- data/vendor/PDCurses/x11/config.sub +0 -1616
- data/vendor/PDCurses/x11/configure +0 -6700
- data/vendor/PDCurses/x11/configure.ac +0 -295
- data/vendor/PDCurses/x11/debian/changelog +0 -6
- data/vendor/PDCurses/x11/debian/compat +0 -1
- data/vendor/PDCurses/x11/debian/control +0 -11
- data/vendor/PDCurses/x11/debian/copyright +0 -27
- data/vendor/PDCurses/x11/debian/rules +0 -98
- data/vendor/PDCurses/x11/install-sh +0 -253
- data/vendor/PDCurses/x11/little_icon.xbm +0 -14
- data/vendor/PDCurses/x11/ncurses_cfg.h +0 -45
- data/vendor/PDCurses/x11/pdcclip.c +0 -173
- data/vendor/PDCurses/x11/pdcdisp.c +0 -85
- data/vendor/PDCurses/x11/pdcgetsc.c +0 -28
- data/vendor/PDCurses/x11/pdckbd.c +0 -104
- data/vendor/PDCurses/x11/pdcscrn.c +0 -258
- data/vendor/PDCurses/x11/pdcsetsc.c +0 -95
- data/vendor/PDCurses/x11/pdcutil.c +0 -52
- data/vendor/PDCurses/x11/pdcx11.c +0 -316
- data/vendor/PDCurses/x11/pdcx11.h +0 -191
- data/vendor/PDCurses/x11/sb.c +0 -155
- data/vendor/PDCurses/x11/x11.c +0 -3686
- data/vendor/PDCurses/x11/xcurses-config.in +0 -81
@@ -1,785 +0,0 @@
|
|
1
|
-
/* Public Domain Curses */
|
2
|
-
|
3
|
-
#include "pdcdos.h"
|
4
|
-
|
5
|
-
#include <stdlib.h>
|
6
|
-
|
7
|
-
#ifdef CHTYPE_LONG
|
8
|
-
# define PDC_OFFSET 32
|
9
|
-
#else
|
10
|
-
# define PDC_OFFSET 8
|
11
|
-
#endif
|
12
|
-
|
13
|
-
/* COLOR_PAIR to attribute encoding table. */
|
14
|
-
|
15
|
-
unsigned char *pdc_atrtab = (unsigned char *)NULL;
|
16
|
-
|
17
|
-
int pdc_adapter; /* screen type */
|
18
|
-
int pdc_scrnmode; /* default screen mode */
|
19
|
-
int pdc_font; /* default font size */
|
20
|
-
bool pdc_direct_video; /* allow direct screen memory writes */
|
21
|
-
bool pdc_bogus_adapter; /* TRUE if adapter has insane values */
|
22
|
-
unsigned pdc_video_seg; /* video base segment */
|
23
|
-
unsigned pdc_video_ofs; /* video base offset */
|
24
|
-
|
25
|
-
static short curstoreal[16], realtocurs[16] =
|
26
|
-
{
|
27
|
-
COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED,
|
28
|
-
COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE, COLOR_BLACK + 8,
|
29
|
-
COLOR_BLUE + 8, COLOR_GREEN + 8, COLOR_CYAN + 8, COLOR_RED + 8,
|
30
|
-
COLOR_MAGENTA + 8, COLOR_YELLOW + 8, COLOR_WHITE + 8
|
31
|
-
};
|
32
|
-
|
33
|
-
static bool sizeable = FALSE; /* TRUE if adapter is resizeable */
|
34
|
-
|
35
|
-
static unsigned short *saved_screen = NULL;
|
36
|
-
static int saved_lines = 0;
|
37
|
-
static int saved_cols = 0;
|
38
|
-
|
39
|
-
static int saved_scrnmode[3];
|
40
|
-
static int saved_font[3];
|
41
|
-
|
42
|
-
/* special purpose function keys */
|
43
|
-
static int PDC_shutdown_key[PDC_MAX_FUNCTION_KEYS] = { 0, 0, 0, 0, 0 };
|
44
|
-
|
45
|
-
/* Thanks to Jeff Duntemann, K16RA for providing the impetus
|
46
|
-
(through the Dr. Dobbs Journal, March 1989 issue) for getting
|
47
|
-
the routines below merged into Bjorn Larsson's PDCurses 1.3...
|
48
|
-
-- frotz@dri.com 900730 */
|
49
|
-
|
50
|
-
/* _get_font() - Get the current font size */
|
51
|
-
|
52
|
-
static int _get_font(void)
|
53
|
-
{
|
54
|
-
int retval;
|
55
|
-
|
56
|
-
retval = getdosmemword(0x485);
|
57
|
-
|
58
|
-
/* Assume the MDS Genius is in 66 line mode. */
|
59
|
-
|
60
|
-
if ((retval == 0) && (pdc_adapter == _MDS_GENIUS))
|
61
|
-
retval = _FONT15;
|
62
|
-
|
63
|
-
switch (pdc_adapter)
|
64
|
-
{
|
65
|
-
case _MDA:
|
66
|
-
retval = 10; /* POINTS is not certain on MDA/Hercules */
|
67
|
-
break;
|
68
|
-
|
69
|
-
case _EGACOLOR:
|
70
|
-
case _EGAMONO:
|
71
|
-
switch (retval)
|
72
|
-
{
|
73
|
-
case _FONT8:
|
74
|
-
case _FONT14:
|
75
|
-
break;
|
76
|
-
default:
|
77
|
-
retval = _FONT14;
|
78
|
-
}
|
79
|
-
break;
|
80
|
-
|
81
|
-
case _CGA:
|
82
|
-
retval = _FONT8;
|
83
|
-
}
|
84
|
-
|
85
|
-
return retval;
|
86
|
-
}
|
87
|
-
|
88
|
-
/* _set_font() - Sets the current font size, if the adapter allows such a
|
89
|
-
change. It is an error to attempt to change the font size on a
|
90
|
-
"bogus" adapter. The reason for this is that we have a known video
|
91
|
-
adapter identity problem. e.g. Two adapters report the same identifying
|
92
|
-
characteristics. */
|
93
|
-
|
94
|
-
static void _set_font(int size)
|
95
|
-
{
|
96
|
-
PDCREGS regs;
|
97
|
-
|
98
|
-
if (pdc_bogus_adapter)
|
99
|
-
return;
|
100
|
-
|
101
|
-
switch (pdc_adapter)
|
102
|
-
{
|
103
|
-
case _CGA:
|
104
|
-
case _MDA:
|
105
|
-
case _MCGACOLOR:
|
106
|
-
case _MCGAMONO:
|
107
|
-
case _MDS_GENIUS:
|
108
|
-
break;
|
109
|
-
|
110
|
-
case _EGACOLOR:
|
111
|
-
case _EGAMONO:
|
112
|
-
if (sizeable && (pdc_font != size))
|
113
|
-
{
|
114
|
-
switch (size)
|
115
|
-
{
|
116
|
-
case _FONT8:
|
117
|
-
regs.W.ax = 0x1112;
|
118
|
-
regs.h.bl = 0x00;
|
119
|
-
PDCINT(0x10, regs);
|
120
|
-
break;
|
121
|
-
case _FONT14:
|
122
|
-
regs.W.ax = 0x1111;
|
123
|
-
regs.h.bl = 0x00;
|
124
|
-
PDCINT(0x10, regs);
|
125
|
-
}
|
126
|
-
}
|
127
|
-
break;
|
128
|
-
|
129
|
-
case _VGACOLOR:
|
130
|
-
case _VGAMONO:
|
131
|
-
if (sizeable && (pdc_font != size))
|
132
|
-
{
|
133
|
-
switch (size)
|
134
|
-
{
|
135
|
-
case _FONT8:
|
136
|
-
regs.W.ax = 0x1112;
|
137
|
-
regs.h.bl = 0x00;
|
138
|
-
PDCINT(0x10, regs);
|
139
|
-
break;
|
140
|
-
case _FONT14:
|
141
|
-
regs.W.ax = 0x1111;
|
142
|
-
regs.h.bl = 0x00;
|
143
|
-
PDCINT(0x10, regs);
|
144
|
-
break;
|
145
|
-
case _FONT16:
|
146
|
-
regs.W.ax = 0x1114;
|
147
|
-
regs.h.bl = 0x00;
|
148
|
-
PDCINT(0x10, regs);
|
149
|
-
}
|
150
|
-
}
|
151
|
-
}
|
152
|
-
|
153
|
-
curs_set(SP->visibility);
|
154
|
-
|
155
|
-
pdc_font = _get_font();
|
156
|
-
}
|
157
|
-
|
158
|
-
/* _set_80x25() - force a known screen state: 80x25 text mode. Forces the
|
159
|
-
appropriate 80x25 alpha mode given the display adapter. */
|
160
|
-
|
161
|
-
static void _set_80x25(void)
|
162
|
-
{
|
163
|
-
PDCREGS regs;
|
164
|
-
|
165
|
-
switch (pdc_adapter)
|
166
|
-
{
|
167
|
-
case _CGA:
|
168
|
-
case _EGACOLOR:
|
169
|
-
case _EGAMONO:
|
170
|
-
case _VGACOLOR:
|
171
|
-
case _VGAMONO:
|
172
|
-
case _MCGACOLOR:
|
173
|
-
case _MCGAMONO:
|
174
|
-
regs.h.ah = 0x00;
|
175
|
-
regs.h.al = 0x03;
|
176
|
-
PDCINT(0x10, regs);
|
177
|
-
break;
|
178
|
-
case _MDA:
|
179
|
-
regs.h.ah = 0x00;
|
180
|
-
regs.h.al = 0x07;
|
181
|
-
PDCINT(0x10, regs);
|
182
|
-
}
|
183
|
-
}
|
184
|
-
|
185
|
-
/* _get_scrn_mode() - Return the current BIOS video mode */
|
186
|
-
|
187
|
-
static int _get_scrn_mode(void)
|
188
|
-
{
|
189
|
-
PDCREGS regs;
|
190
|
-
|
191
|
-
regs.h.ah = 0x0f;
|
192
|
-
PDCINT(0x10, regs);
|
193
|
-
|
194
|
-
return (int)regs.h.al;
|
195
|
-
}
|
196
|
-
|
197
|
-
/* _set_scrn_mode() - Sets the BIOS Video Mode Number only if it is
|
198
|
-
different from the current video mode. */
|
199
|
-
|
200
|
-
static void _set_scrn_mode(int new_mode)
|
201
|
-
{
|
202
|
-
PDCREGS regs;
|
203
|
-
|
204
|
-
if (_get_scrn_mode() != new_mode)
|
205
|
-
{
|
206
|
-
regs.h.ah = 0;
|
207
|
-
regs.h.al = (unsigned char) new_mode;
|
208
|
-
PDCINT(0x10, regs);
|
209
|
-
}
|
210
|
-
|
211
|
-
pdc_font = _get_font();
|
212
|
-
pdc_scrnmode = new_mode;
|
213
|
-
LINES = PDC_get_rows();
|
214
|
-
COLS = PDC_get_columns();
|
215
|
-
}
|
216
|
-
|
217
|
-
/* _sanity_check() - A video adapter identification sanity check. This
|
218
|
-
routine will force sane values for various control flags. */
|
219
|
-
|
220
|
-
static int _sanity_check(int adapter)
|
221
|
-
{
|
222
|
-
int fontsize = _get_font();
|
223
|
-
int rows = PDC_get_rows();
|
224
|
-
|
225
|
-
PDC_LOG(("_sanity_check() - called: Adapter %d\n", adapter));
|
226
|
-
|
227
|
-
switch (adapter)
|
228
|
-
{
|
229
|
-
case _EGACOLOR:
|
230
|
-
case _EGAMONO:
|
231
|
-
switch (rows)
|
232
|
-
{
|
233
|
-
case 25:
|
234
|
-
case 43:
|
235
|
-
break;
|
236
|
-
default:
|
237
|
-
pdc_bogus_adapter = TRUE;
|
238
|
-
}
|
239
|
-
|
240
|
-
switch (fontsize)
|
241
|
-
{
|
242
|
-
case _FONT8:
|
243
|
-
case _FONT14:
|
244
|
-
break;
|
245
|
-
default:
|
246
|
-
pdc_bogus_adapter = TRUE;
|
247
|
-
}
|
248
|
-
break;
|
249
|
-
|
250
|
-
case _VGACOLOR:
|
251
|
-
case _VGAMONO:
|
252
|
-
break;
|
253
|
-
|
254
|
-
case _CGA:
|
255
|
-
case _MDA:
|
256
|
-
case _MCGACOLOR:
|
257
|
-
case _MCGAMONO:
|
258
|
-
switch (rows)
|
259
|
-
{
|
260
|
-
case 25:
|
261
|
-
break;
|
262
|
-
default:
|
263
|
-
pdc_bogus_adapter = TRUE;
|
264
|
-
}
|
265
|
-
break;
|
266
|
-
|
267
|
-
default:
|
268
|
-
pdc_bogus_adapter = TRUE;
|
269
|
-
}
|
270
|
-
|
271
|
-
if (pdc_bogus_adapter)
|
272
|
-
{
|
273
|
-
sizeable = FALSE;
|
274
|
-
pdc_direct_video = FALSE;
|
275
|
-
}
|
276
|
-
|
277
|
-
return adapter;
|
278
|
-
}
|
279
|
-
|
280
|
-
/* _query_adapter_type() - Determine PC video adapter type. */
|
281
|
-
|
282
|
-
static int _query_adapter_type(void)
|
283
|
-
{
|
284
|
-
PDCREGS regs;
|
285
|
-
int retval = _NONE;
|
286
|
-
|
287
|
-
/* thanks to paganini@ax.apc.org for the GO32 fix */
|
288
|
-
|
289
|
-
#if !defined(__DJGPP__) && !defined(__WATCOMC__)
|
290
|
-
struct SREGS segs;
|
291
|
-
#endif
|
292
|
-
short video_base = getdosmemword(0x463);
|
293
|
-
|
294
|
-
PDC_LOG(("_query_adapter_type() - called\n"));
|
295
|
-
|
296
|
-
/* attempt to call VGA Identify Adapter Function */
|
297
|
-
|
298
|
-
regs.W.ax = 0x1a00;
|
299
|
-
PDCINT(0x10, regs);
|
300
|
-
|
301
|
-
if ((regs.h.al == 0x1a) && (retval == _NONE))
|
302
|
-
{
|
303
|
-
/* We know that the PS/2 video BIOS is alive and well. */
|
304
|
-
|
305
|
-
switch (regs.h.al)
|
306
|
-
{
|
307
|
-
case 0:
|
308
|
-
retval = _NONE;
|
309
|
-
break;
|
310
|
-
case 1:
|
311
|
-
retval = _MDA;
|
312
|
-
break;
|
313
|
-
case 2:
|
314
|
-
retval = _CGA;
|
315
|
-
break;
|
316
|
-
case 4:
|
317
|
-
retval = _EGACOLOR;
|
318
|
-
sizeable = TRUE;
|
319
|
-
break;
|
320
|
-
case 5:
|
321
|
-
retval = _EGAMONO;
|
322
|
-
break;
|
323
|
-
case 26: /* ...alt. VGA BIOS... */
|
324
|
-
case 7:
|
325
|
-
retval = _VGACOLOR;
|
326
|
-
sizeable = TRUE;
|
327
|
-
break;
|
328
|
-
case 8:
|
329
|
-
retval = _VGAMONO;
|
330
|
-
break;
|
331
|
-
case 10:
|
332
|
-
case 13:
|
333
|
-
retval = _MCGACOLOR;
|
334
|
-
break;
|
335
|
-
case 12:
|
336
|
-
retval = _MCGAMONO;
|
337
|
-
break;
|
338
|
-
default:
|
339
|
-
retval = _CGA;
|
340
|
-
}
|
341
|
-
}
|
342
|
-
else
|
343
|
-
{
|
344
|
-
/* No VGA BIOS, check for an EGA BIOS by selecting an
|
345
|
-
Alternate Function Service...
|
346
|
-
|
347
|
-
bx == 0x0010 --> return EGA information */
|
348
|
-
|
349
|
-
regs.h.ah = 0x12;
|
350
|
-
regs.W.bx = 0x10;
|
351
|
-
PDCINT(0x10, regs);
|
352
|
-
|
353
|
-
if ((regs.h.bl != 0x10) && (retval == _NONE))
|
354
|
-
{
|
355
|
-
/* An EGA BIOS exists */
|
356
|
-
|
357
|
-
regs.h.ah = 0x12;
|
358
|
-
regs.h.bl = 0x10;
|
359
|
-
PDCINT(0x10, regs);
|
360
|
-
|
361
|
-
if (regs.h.bh == 0)
|
362
|
-
retval = _EGACOLOR;
|
363
|
-
else
|
364
|
-
retval = _EGAMONO;
|
365
|
-
}
|
366
|
-
else if (retval == _NONE)
|
367
|
-
{
|
368
|
-
/* Now we know we only have CGA or MDA */
|
369
|
-
|
370
|
-
PDCINT(0x11, regs);
|
371
|
-
|
372
|
-
switch (regs.h.al & 0x30)
|
373
|
-
{
|
374
|
-
case 0x10:
|
375
|
-
case 0x20:
|
376
|
-
retval = _CGA;
|
377
|
-
break;
|
378
|
-
case 0x30:
|
379
|
-
retval = _MDA;
|
380
|
-
break;
|
381
|
-
default:
|
382
|
-
retval = _NONE;
|
383
|
-
}
|
384
|
-
}
|
385
|
-
}
|
386
|
-
|
387
|
-
if (video_base == 0x3d4)
|
388
|
-
{
|
389
|
-
pdc_video_seg = 0xb800;
|
390
|
-
switch (retval)
|
391
|
-
{
|
392
|
-
case _EGAMONO:
|
393
|
-
retval = _EGACOLOR;
|
394
|
-
break;
|
395
|
-
case _VGAMONO:
|
396
|
-
retval = _VGACOLOR;
|
397
|
-
}
|
398
|
-
}
|
399
|
-
|
400
|
-
if (video_base == 0x3b4)
|
401
|
-
{
|
402
|
-
pdc_video_seg = 0xb000;
|
403
|
-
switch (retval)
|
404
|
-
{
|
405
|
-
case _EGACOLOR:
|
406
|
-
retval = _EGAMONO;
|
407
|
-
break;
|
408
|
-
case _VGACOLOR:
|
409
|
-
retval = _VGAMONO;
|
410
|
-
}
|
411
|
-
}
|
412
|
-
|
413
|
-
if ((retval == _NONE)
|
414
|
-
#ifndef CGA_DIRECT
|
415
|
-
|| (retval == _CGA)
|
416
|
-
#endif
|
417
|
-
)
|
418
|
-
pdc_direct_video = FALSE;
|
419
|
-
|
420
|
-
if ((unsigned)pdc_video_seg == 0xb000)
|
421
|
-
SP->mono = TRUE;
|
422
|
-
else
|
423
|
-
SP->mono = FALSE;
|
424
|
-
|
425
|
-
/* Check for DESQview shadow buffer
|
426
|
-
thanks to paganini@ax.apc.org for the GO32 fix */
|
427
|
-
|
428
|
-
#ifndef __WATCOMC__
|
429
|
-
regs.h.ah = 0xfe;
|
430
|
-
regs.h.al = 0;
|
431
|
-
regs.x.di = pdc_video_ofs;
|
432
|
-
# ifdef __DJGPP__
|
433
|
-
regs.x.es = pdc_video_seg;
|
434
|
-
__dpmi_int(0x10, ®s);
|
435
|
-
pdc_video_seg = regs.x.es;
|
436
|
-
# else
|
437
|
-
segs.es = pdc_video_seg;
|
438
|
-
int86x(0x10, ®s, ®s, &segs);
|
439
|
-
pdc_video_seg = segs.es;
|
440
|
-
# endif
|
441
|
-
pdc_video_ofs = regs.x.di;
|
442
|
-
#endif
|
443
|
-
if (!pdc_adapter)
|
444
|
-
pdc_adapter = retval;
|
445
|
-
|
446
|
-
return _sanity_check(retval);
|
447
|
-
}
|
448
|
-
|
449
|
-
/* close the physical screen -- may restore the screen to its state
|
450
|
-
before PDC_scr_open(); miscellaneous cleanup */
|
451
|
-
|
452
|
-
void PDC_scr_close(void)
|
453
|
-
{
|
454
|
-
#if SMALL || MEDIUM
|
455
|
-
# ifndef __PACIFIC__
|
456
|
-
struct SREGS segregs;
|
457
|
-
# endif
|
458
|
-
int ds;
|
459
|
-
#endif
|
460
|
-
PDC_LOG(("PDC_scr_close() - called\n"));
|
461
|
-
|
462
|
-
if (getenv("PDC_RESTORE_SCREEN") && saved_screen)
|
463
|
-
{
|
464
|
-
#ifdef __DJGPP__
|
465
|
-
dosmemput(saved_screen, saved_lines * saved_cols * 2,
|
466
|
-
(unsigned long)_FAR_POINTER(pdc_video_seg,
|
467
|
-
pdc_video_ofs));
|
468
|
-
#else
|
469
|
-
# if (SMALL || MEDIUM)
|
470
|
-
# ifdef __PACIFIC__
|
471
|
-
ds = FP_SEG((void far *)saved_screen);
|
472
|
-
# else
|
473
|
-
segread(&segregs);
|
474
|
-
ds = segregs.ds;
|
475
|
-
# endif
|
476
|
-
movedata(ds, (int)saved_screen, pdc_video_seg, pdc_video_ofs,
|
477
|
-
(saved_lines * saved_cols * 2));
|
478
|
-
# else
|
479
|
-
memcpy((void *)_FAR_POINTER(pdc_video_seg, pdc_video_ofs),
|
480
|
-
(void *)saved_screen, (saved_lines * saved_cols * 2));
|
481
|
-
# endif
|
482
|
-
#endif
|
483
|
-
free(saved_screen);
|
484
|
-
saved_screen = NULL;
|
485
|
-
}
|
486
|
-
|
487
|
-
reset_shell_mode();
|
488
|
-
|
489
|
-
if (SP->visibility != 1)
|
490
|
-
curs_set(1);
|
491
|
-
|
492
|
-
/* Position cursor to the bottom left of the screen. */
|
493
|
-
|
494
|
-
PDC_gotoyx(PDC_get_rows() - 2, 0);
|
495
|
-
}
|
496
|
-
|
497
|
-
void PDC_scr_free(void)
|
498
|
-
{
|
499
|
-
if (SP)
|
500
|
-
free(SP);
|
501
|
-
if (pdc_atrtab)
|
502
|
-
free(pdc_atrtab);
|
503
|
-
|
504
|
-
pdc_atrtab = (unsigned char *)NULL;
|
505
|
-
}
|
506
|
-
|
507
|
-
/* open the physical screen -- allocate SP, miscellaneous intialization,
|
508
|
-
and may save the existing screen for later restoration */
|
509
|
-
|
510
|
-
int PDC_scr_open(int argc, char **argv)
|
511
|
-
{
|
512
|
-
#if SMALL || MEDIUM
|
513
|
-
# ifndef __PACIFIC__
|
514
|
-
struct SREGS segregs;
|
515
|
-
# endif
|
516
|
-
int ds;
|
517
|
-
#endif
|
518
|
-
int i;
|
519
|
-
|
520
|
-
PDC_LOG(("PDC_scr_open() - called\n"));
|
521
|
-
|
522
|
-
SP = calloc(1, sizeof(SCREEN));
|
523
|
-
pdc_atrtab = calloc(PDC_COLOR_PAIRS * PDC_OFFSET, 1);
|
524
|
-
|
525
|
-
if (!SP || !pdc_atrtab)
|
526
|
-
return ERR;
|
527
|
-
|
528
|
-
for (i = 0; i < 16; i++)
|
529
|
-
curstoreal[realtocurs[i]] = i;
|
530
|
-
|
531
|
-
SP->orig_attr = FALSE;
|
532
|
-
|
533
|
-
pdc_direct_video = TRUE; /* Assume that we can */
|
534
|
-
pdc_video_seg = 0xb000; /* Base screen segment addr */
|
535
|
-
pdc_video_ofs = 0x0; /* Base screen segment ofs */
|
536
|
-
|
537
|
-
pdc_adapter = _query_adapter_type();
|
538
|
-
pdc_scrnmode = _get_scrn_mode();
|
539
|
-
pdc_font = _get_font();
|
540
|
-
|
541
|
-
SP->lines = PDC_get_rows();
|
542
|
-
SP->cols = PDC_get_columns();
|
543
|
-
|
544
|
-
SP->mouse_wait = PDC_CLICK_PERIOD;
|
545
|
-
SP->audible = TRUE;
|
546
|
-
|
547
|
-
/* If the environment variable PDCURSES_BIOS is set, the DOS int10()
|
548
|
-
BIOS calls are used in place of direct video memory access. */
|
549
|
-
|
550
|
-
if (getenv("PDCURSES_BIOS"))
|
551
|
-
pdc_direct_video = FALSE;
|
552
|
-
|
553
|
-
/* This code for preserving the current screen. */
|
554
|
-
|
555
|
-
if (getenv("PDC_RESTORE_SCREEN"))
|
556
|
-
{
|
557
|
-
saved_lines = SP->lines;
|
558
|
-
saved_cols = SP->cols;
|
559
|
-
|
560
|
-
saved_screen = malloc(saved_lines * saved_cols * 2);
|
561
|
-
|
562
|
-
if (!saved_screen)
|
563
|
-
{
|
564
|
-
SP->_preserve = FALSE;
|
565
|
-
return OK;
|
566
|
-
}
|
567
|
-
#ifdef __DJGPP__
|
568
|
-
dosmemget((unsigned long)_FAR_POINTER(pdc_video_seg, pdc_video_ofs),
|
569
|
-
saved_lines * saved_cols * 2, saved_screen);
|
570
|
-
#else
|
571
|
-
# if SMALL || MEDIUM
|
572
|
-
# ifdef __PACIFIC__
|
573
|
-
ds = FP_SEG((void far *) saved_screen);
|
574
|
-
# else
|
575
|
-
segread(&segregs);
|
576
|
-
ds = segregs.ds;
|
577
|
-
# endif
|
578
|
-
movedata(pdc_video_seg, pdc_video_ofs, ds, (int)saved_screen,
|
579
|
-
(saved_lines * saved_cols * 2));
|
580
|
-
# else
|
581
|
-
memcpy((void *)saved_screen,
|
582
|
-
(void *)_FAR_POINTER(pdc_video_seg, pdc_video_ofs),
|
583
|
-
(saved_lines * saved_cols * 2));
|
584
|
-
# endif
|
585
|
-
#endif
|
586
|
-
}
|
587
|
-
|
588
|
-
SP->_preserve = (getenv("PDC_PRESERVE_SCREEN") != NULL);
|
589
|
-
|
590
|
-
return OK;
|
591
|
-
}
|
592
|
-
|
593
|
-
/* the core of resize_term() */
|
594
|
-
|
595
|
-
int PDC_resize_screen(int nlines, int ncols)
|
596
|
-
{
|
597
|
-
PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n",
|
598
|
-
nlines, ncols));
|
599
|
-
|
600
|
-
if( !stdscr) /* window hasn't been created yet; we're */
|
601
|
-
{ /* specifying its size before doing so */
|
602
|
-
return OK; /* ...which doesn't work in DOS */
|
603
|
-
}
|
604
|
-
|
605
|
-
/* Trash the stored value of orig_cursor -- it's only good if the
|
606
|
-
video mode doesn't change */
|
607
|
-
|
608
|
-
SP->orig_cursor = 0x0607;
|
609
|
-
|
610
|
-
switch (pdc_adapter)
|
611
|
-
{
|
612
|
-
case _EGACOLOR:
|
613
|
-
if (nlines >= 43)
|
614
|
-
_set_font(_FONT8);
|
615
|
-
else
|
616
|
-
_set_80x25();
|
617
|
-
break;
|
618
|
-
|
619
|
-
case _VGACOLOR:
|
620
|
-
if (nlines > 28)
|
621
|
-
_set_font(_FONT8);
|
622
|
-
else
|
623
|
-
if (nlines > 25)
|
624
|
-
_set_font(_FONT14);
|
625
|
-
else
|
626
|
-
_set_80x25();
|
627
|
-
}
|
628
|
-
|
629
|
-
PDC_set_blink(COLORS == 8);
|
630
|
-
|
631
|
-
return OK;
|
632
|
-
}
|
633
|
-
|
634
|
-
void PDC_reset_prog_mode(void)
|
635
|
-
{
|
636
|
-
PDC_LOG(("PDC_reset_prog_mode() - called.\n"));
|
637
|
-
}
|
638
|
-
|
639
|
-
void PDC_reset_shell_mode(void)
|
640
|
-
{
|
641
|
-
PDC_LOG(("PDC_reset_shell_mode() - called.\n"));
|
642
|
-
}
|
643
|
-
|
644
|
-
void PDC_restore_screen_mode(int i)
|
645
|
-
{
|
646
|
-
if (i >= 0 && i <= 2)
|
647
|
-
{
|
648
|
-
pdc_font = _get_font();
|
649
|
-
_set_font(saved_font[i]);
|
650
|
-
|
651
|
-
if (_get_scrn_mode() != saved_scrnmode[i])
|
652
|
-
_set_scrn_mode(saved_scrnmode[i]);
|
653
|
-
}
|
654
|
-
}
|
655
|
-
|
656
|
-
void PDC_save_screen_mode(int i)
|
657
|
-
{
|
658
|
-
if (i >= 0 && i <= 2)
|
659
|
-
{
|
660
|
-
saved_font[i] = pdc_font;
|
661
|
-
saved_scrnmode[i] = pdc_scrnmode;
|
662
|
-
}
|
663
|
-
}
|
664
|
-
|
665
|
-
void PDC_init_pair(short pair, short fg, short bg)
|
666
|
-
{
|
667
|
-
unsigned char att, temp_bg;
|
668
|
-
chtype i;
|
669
|
-
|
670
|
-
fg = curstoreal[fg];
|
671
|
-
bg = curstoreal[bg];
|
672
|
-
|
673
|
-
for (i = 0; i < PDC_OFFSET; i++)
|
674
|
-
{
|
675
|
-
att = fg | (bg << 4);
|
676
|
-
|
677
|
-
if (i & (A_REVERSE >> PDC_ATTR_SHIFT))
|
678
|
-
att = bg | (fg << 4);
|
679
|
-
if (i & (A_UNDERLINE >> PDC_ATTR_SHIFT))
|
680
|
-
att = 1;
|
681
|
-
if (i & (A_INVIS >> PDC_ATTR_SHIFT))
|
682
|
-
{
|
683
|
-
temp_bg = att >> 4;
|
684
|
-
att = temp_bg << 4 | temp_bg;
|
685
|
-
}
|
686
|
-
if (i & (A_BOLD >> PDC_ATTR_SHIFT))
|
687
|
-
att |= 8;
|
688
|
-
if (i & (A_BLINK >> PDC_ATTR_SHIFT))
|
689
|
-
att |= 128;
|
690
|
-
|
691
|
-
pdc_atrtab[pair * PDC_OFFSET + i] = att;
|
692
|
-
}
|
693
|
-
}
|
694
|
-
|
695
|
-
int PDC_pair_content(short pair, short *fg, short *bg)
|
696
|
-
{
|
697
|
-
*fg = realtocurs[pdc_atrtab[pair * PDC_OFFSET] & 0x0F];
|
698
|
-
*bg = realtocurs[(pdc_atrtab[pair * PDC_OFFSET] & 0xF0) >> 4];
|
699
|
-
|
700
|
-
return OK;
|
701
|
-
}
|
702
|
-
|
703
|
-
/* _egapal() - Find the EGA palette value (0-63) for the color (0-15).
|
704
|
-
On VGA, this is an index into the DAC. */
|
705
|
-
|
706
|
-
static short _egapal(short color)
|
707
|
-
{
|
708
|
-
PDCREGS regs;
|
709
|
-
|
710
|
-
regs.W.ax = 0x1007;
|
711
|
-
regs.h.bl = curstoreal[color];
|
712
|
-
|
713
|
-
PDCINT(0x10, regs);
|
714
|
-
|
715
|
-
return regs.h.bh;
|
716
|
-
}
|
717
|
-
|
718
|
-
bool PDC_can_change_color(void)
|
719
|
-
{
|
720
|
-
return (pdc_adapter == _VGACOLOR);
|
721
|
-
}
|
722
|
-
|
723
|
-
/* These are only valid when pdc_adapter == _VGACOLOR */
|
724
|
-
|
725
|
-
int PDC_color_content(short color, short *red, short *green, short *blue)
|
726
|
-
{
|
727
|
-
PDCREGS regs;
|
728
|
-
|
729
|
-
/* Read single DAC register */
|
730
|
-
|
731
|
-
regs.W.ax = 0x1015;
|
732
|
-
regs.h.bl = _egapal(color);
|
733
|
-
|
734
|
-
PDCINT(0x10, regs);
|
735
|
-
|
736
|
-
/* Scale and store */
|
737
|
-
|
738
|
-
*red = DIVROUND((unsigned)(regs.h.dh) * 1000, 63);
|
739
|
-
*green = DIVROUND((unsigned)(regs.h.ch) * 1000, 63);
|
740
|
-
*blue = DIVROUND((unsigned)(regs.h.cl) * 1000, 63);
|
741
|
-
|
742
|
-
return OK;
|
743
|
-
}
|
744
|
-
|
745
|
-
int PDC_init_color(short color, short red, short green, short blue)
|
746
|
-
{
|
747
|
-
PDCREGS regs;
|
748
|
-
|
749
|
-
/* Scale */
|
750
|
-
|
751
|
-
regs.h.dh = DIVROUND((unsigned)red * 63, 1000);
|
752
|
-
regs.h.ch = DIVROUND((unsigned)green * 63, 1000);
|
753
|
-
regs.h.cl = DIVROUND((unsigned)blue * 63, 1000);
|
754
|
-
|
755
|
-
/* Set single DAC register */
|
756
|
-
|
757
|
-
regs.W.ax = 0x1010;
|
758
|
-
regs.W.bx = _egapal(color);
|
759
|
-
|
760
|
-
PDCINT(0x10, regs);
|
761
|
-
|
762
|
-
return OK;
|
763
|
-
}
|
764
|
-
|
765
|
-
/* Does nothing in the DOS (or OS/2 or Win32 console) flavors of PDCurses,
|
766
|
-
which lack user resizing. See X11 or Win32a versions of this function for
|
767
|
-
details of what it does on platforms that do support user resizing. */
|
768
|
-
|
769
|
-
void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
|
770
|
-
const int new_min_cols, const int new_max_cols)
|
771
|
-
{
|
772
|
-
}
|
773
|
-
|
774
|
-
/* PDC_set_function_key() does nothing on this platform */
|
775
|
-
int PDC_set_function_key( const unsigned function, const int new_key)
|
776
|
-
{
|
777
|
-
int old_key = -1;
|
778
|
-
|
779
|
-
if( function < PDC_MAX_FUNCTION_KEYS)
|
780
|
-
{
|
781
|
-
old_key = PDC_shutdown_key[function];
|
782
|
-
PDC_shutdown_key[function] = new_key;
|
783
|
-
}
|
784
|
-
return( old_key);
|
785
|
-
}
|