mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-25 00:05:16 +00:00
Made "direct_video" DOS-only.
This commit is contained in:
10
curses.h
10
curses.h
@@ -15,7 +15,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: curses.h,v 1.153 2006/03/26 01:17:01 wmcbrine Exp $ */
|
||||
/* $Id: curses.h,v 1.154 2006/03/27 04:35:41 wmcbrine Exp $ */
|
||||
|
||||
/*----------------------------------------------------------------------*
|
||||
* PDCurses *
|
||||
@@ -613,7 +613,6 @@ typedef struct
|
||||
bool orgcbr; /* original MSDOS ^-BREAK setting */
|
||||
bool visible_cursor; /* TRUE if cursor is visible */
|
||||
bool audible; /* FALSE if the bell is visual */
|
||||
bool direct_video; /* Allow Direct Screen Memory writes */
|
||||
bool mono; /* TRUE if current screen is mono */
|
||||
bool sizeable; /* TRUE if adapter is resizeable */
|
||||
bool resized; /* TRUE if TERM has been resized */
|
||||
@@ -670,9 +669,10 @@ typedef struct
|
||||
#endif
|
||||
|
||||
#ifdef DOS
|
||||
int video_page; /* Current PC video page */
|
||||
unsigned video_seg; /* video base segment */
|
||||
unsigned video_ofs; /* video base offset */
|
||||
bool direct_video; /* Allow Direct Screen Memory writes */
|
||||
int video_page; /* Current PC video page */
|
||||
unsigned video_seg; /* video base segment */
|
||||
unsigned video_ofs; /* video base offset */
|
||||
#endif
|
||||
|
||||
#ifdef XCURSES
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
const char *rcsid_PDCdisp =
|
||||
"$Id: pdcdisp.c,v 1.21 2006/03/25 13:49:31 wmcbrine Exp $";
|
||||
"$Id: pdcdisp.c,v 1.22 2006/03/27 04:35:41 wmcbrine Exp $";
|
||||
#endif
|
||||
|
||||
extern unsigned char atrtab[MAX_ATRTAB];
|
||||
@@ -321,6 +321,10 @@ int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr)
|
||||
|
||||
bool PDC_transform_line(int lineno)
|
||||
{
|
||||
/* this should be enough for the maximum width of a screen. */
|
||||
|
||||
unsigned short temp_line[256];
|
||||
|
||||
chtype *srcp;
|
||||
int j, x, len;
|
||||
|
||||
@@ -333,34 +337,18 @@ bool PDC_transform_line(int lineno)
|
||||
len = curscr->_lastch[lineno] - x + 1;
|
||||
srcp = curscr->_y[lineno] + x;
|
||||
|
||||
if (SP->direct_video)
|
||||
{
|
||||
/* this should be enough for the maximum width of a
|
||||
screen. */
|
||||
/* replace the attribute part of the chtype with the
|
||||
actual colour value for each chtype in the line */
|
||||
|
||||
unsigned short temp_line[256];
|
||||
for (j = 0; j < len; j++)
|
||||
temp_line[j] = chtype_attr(srcp[j]) | (srcp[j] & A_CHARTEXT);
|
||||
|
||||
/* replace the attribute part of the chtype with the
|
||||
actual colour value for each chtype in the line */
|
||||
|
||||
for (j = 0; j < len; j++)
|
||||
temp_line[j] = chtype_attr(srcp[j]) |
|
||||
(srcp[j] & A_CHARTEXT);
|
||||
#ifdef EMXVIDEO
|
||||
v_putline((char*)temp_line, x, lineno, len);
|
||||
v_putline((char*)temp_line, x, lineno, len);
|
||||
#else
|
||||
VioWrtCellStr((PCH)temp_line,
|
||||
(USHORT)(len * sizeof(unsigned short)),
|
||||
(USHORT)lineno, (USHORT)x, 0);
|
||||
VioWrtCellStr((PCH)temp_line, (USHORT)(len * sizeof(unsigned short)),
|
||||
(USHORT)lineno, (USHORT)x, 0);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
for (j = 0; j < len; j++)
|
||||
{
|
||||
PDC_gotoxy(lineno, j + x);
|
||||
PDC_putc((srcp[j] & A_CHARTEXT),
|
||||
chtype_attr(srcp[j]) >> 8);
|
||||
}
|
||||
|
||||
curscr->_firstch[lineno] = _NO_CHANGE;
|
||||
curscr->_lastch[lineno] = _NO_CHANGE;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
const char *rcsid_PDCscrn =
|
||||
"$Id: pdcscrn.c,v 1.22 2006/03/26 01:48:49 wmcbrine Exp $";
|
||||
"$Id: pdcscrn.c,v 1.23 2006/03/27 04:35:41 wmcbrine Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
@@ -157,7 +157,6 @@ int PDC_scr_open(SCREEN *internal, bool echo)
|
||||
|
||||
PDC_get_cursor_pos(&internal->cursrow, &internal->curscol);
|
||||
|
||||
internal->direct_video = TRUE; /* Assume that we can */
|
||||
internal->autocr = TRUE; /* cr -> lf by default */
|
||||
internal->raw_out = FALSE; /* tty I/O modes */
|
||||
internal->raw_inp = FALSE; /* tty I/O modes */
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
const char *rcsid_termattr =
|
||||
"$Id: termattr.c,v 1.25 2006/03/20 23:49:44 wmcbrine Exp $";
|
||||
"$Id: termattr.c,v 1.26 2006/03/27 04:35:41 wmcbrine Exp $";
|
||||
#endif
|
||||
|
||||
/*man-start**************************************************************
|
||||
@@ -128,7 +128,11 @@ int baudrate(void)
|
||||
{
|
||||
PDC_LOG(("baudrate() - called\n"));
|
||||
|
||||
#ifdef DOS
|
||||
return SP->direct_video ? INT_MAX : 19200;
|
||||
#else
|
||||
return INT_MAX;
|
||||
#endif
|
||||
}
|
||||
|
||||
char erasechar(void)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
const char *rcsid_PDCscrn =
|
||||
"$Id: pdcscrn.c,v 1.31 2006/03/26 01:48:53 wmcbrine Exp $";
|
||||
"$Id: pdcscrn.c,v 1.32 2006/03/27 04:35:41 wmcbrine Exp $";
|
||||
#endif
|
||||
|
||||
#define PDC_RESTORE_NONE 0
|
||||
@@ -302,7 +302,6 @@ int PDC_scr_open(SCREEN *internal, bool echo)
|
||||
|
||||
PDC_get_cursor_pos(&internal->cursrow, &internal->curscol);
|
||||
|
||||
internal->direct_video = TRUE; /* Assume that we can */
|
||||
internal->autocr = TRUE; /* cr -> lf by default */
|
||||
internal->raw_out = FALSE; /* tty I/O modes */
|
||||
internal->raw_inp = FALSE; /* tty I/O modes */
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
const char *rcsid_PDCscrn =
|
||||
"$Id: pdcscrn.c,v 1.20 2006/03/26 01:17:14 wmcbrine Exp $";
|
||||
"$Id: pdcscrn.c,v 1.21 2006/03/27 04:35:41 wmcbrine Exp $";
|
||||
#endif
|
||||
|
||||
bool GLOBAL_sb_on = FALSE;
|
||||
@@ -107,7 +107,6 @@ int PDC_scr_open(SCREEN *internal, bool echo)
|
||||
PDC_LOG(("PDC_scr_open() - called\n"));
|
||||
|
||||
internal->cursrow = internal->curscol = 0;
|
||||
internal->direct_video = FALSE; /* Assume that we can't */
|
||||
internal->autocr = TRUE; /* cr -> lf by default */
|
||||
internal->raw_out = FALSE; /* tty I/O modes */
|
||||
internal->raw_inp = FALSE; /* tty I/O modes */
|
||||
|
||||
Reference in New Issue
Block a user