FAST_VIDEO was used inconsistently -- some direct memory references were

made without it. To Do: The checks (including the missing ones) could be
performed at runtime instead, based on SP->direct_video. This might make
BIOS mode more portable.
This commit is contained in:
William McBrine
2006-01-15 18:36:58 +00:00
parent 17d33eb901
commit dd2e359043
7 changed files with 15 additions and 43 deletions

View File

@@ -18,7 +18,7 @@
***************************************************************************
*/
/*
$Id: curses.h,v 1.79 2006/01/15 17:53:20 wmcbrine Exp $
$Id: curses.h,v 1.80 2006/01/15 18:36:53 wmcbrine Exp $
*/
/*
*----------------------------------------------------------------------
@@ -140,8 +140,6 @@ rely on #if, rather than a complicated set of #if defined() or
PDCurses definitions list: (Only define those needed)
REGISTERWINDOWS True for auto window update registery.
FAST_VIDEO True if display is memory mapped, or
we can utilize the fast video update routines.
DOS True if compiling for DOS.
OS2 True if compiling for OS/2.
WIN32 True if compiling for Windoze 95 or Windoze NT

View File

@@ -18,7 +18,7 @@
***************************************************************************
*/
/*
$Id: curspriv.h,v 1.16 2006/01/04 13:14:46 wmcbrine Exp $
$Id: curspriv.h,v 1.17 2006/01/15 18:36:53 wmcbrine Exp $
*/
/*
*
@@ -108,7 +108,6 @@ $Id: curspriv.h,v 1.16 2006/01/04 13:14:46 wmcbrine Exp $
/*----------------------------------------*/
#ifdef DOS
# define FAST_VIDEO 1 /* We can write directly to the screen. */
# ifdef NDP
typedef union REGS16 Regs;
# else

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
#ifdef PDCDEBUG
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.8 2006/01/12 06:45:43 wmcbrine Exp $";
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.9 2006/01/15 18:36:58 wmcbrine Exp $";
#endif
/*man-start*********************************************************************
@@ -290,14 +290,7 @@ int PDC_get_cursor_mode()
PDCurses Description:
This is a private PDCurses routine.
This function returns the current font size. This function only
works if the #define FAST_VIDEO is true.
PDCurses Return Value:
This function returns OK on success and ERR on error.
PDCurses Errors:
An ERR will be returned if FAST_VIDEO is not true.
This function returns the current font size.
Portability:
PDCurses int PDC_get_font(void);
@@ -312,12 +305,10 @@ int PDC_get_font()
#endif
/***********************************************************************/
{
#if defined(FAST_VIDEO)
int retval;
#endif
PDC_LOG(("PDC_get_font() - called\n"));
#if defined(FAST_VIDEO)
retval = getdosmemword(0x485);
/* Assume the MDS Genius is in 66 line mode. */
@@ -348,7 +339,6 @@ int PDC_get_font()
}
return retval;
#endif
}
/*man-start*********************************************************************

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
#ifdef PDCDEBUG
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.9 2006/01/12 06:45:43 wmcbrine Exp $";
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.10 2006/01/15 18:36:58 wmcbrine Exp $";
#endif
/*man-start*********************************************************************
@@ -298,14 +298,7 @@ int PDC_get_cursor_mode(void)
PDCurses Description:
This is a private PDCurses routine.
This function returns the current font size. This function only
works if the #define FAST_VIDEO is true.
PDCurses Return Value:
This function returns OK on success and ERR on error.
PDCurses Errors:
An ERR will be returned if FAST_VIDEO is not true.
This function returns the current font size.
Portability:
PDCurses int PDC_get_font(void);

View File

@@ -43,7 +43,7 @@
#endif
#ifdef PDCDEBUG
char *rcsid_util = "$Id: util.c,v 1.16 2006/01/13 01:17:59 wmcbrine Exp $";
char *rcsid_util = "$Id: util.c,v 1.17 2006/01/15 18:36:58 wmcbrine Exp $";
#endif
/*man-start*********************************************************************
@@ -85,11 +85,9 @@ char *rcsid_util = "$Id: util.c,v 1.16 2006/01/13 01:17:59 wmcbrine Exp $";
in this curses version such application will link with an
error message complaining about undefined symbols.
If the PDCurses library is compiled under DOS with the FAST_VIDEO
define true, then we will poke the BIOS keyboard buffer head and
tail pointers, resetting the typeahead to implement flushinp().
If this is not true, then we will be unable to reliably flush
the typeahead.
If the PDCurses library is compiled under DOS, then we will poke
the BIOS keyboard buffer head and tail pointers, resetting the
typeahead to implement flushinp().
filter() and use_env() are no-ops on PDCurses. getwin() and
putwin() also do nothing yet.
@@ -328,11 +326,11 @@ int PDC_CDECL flushinp()
PDC_LOG(("flushinp() - called\n"));
#if defined(DOS) && defined(FAST_VIDEO)
#ifdef DOS
/* Force the BIOS kbd buf head/tail pointers to be the
same... Real nasty trick... */
setdosmemword (0x41a, getdosmemword (0x41c));
setdosmemword(0x41a, getdosmemword (0x41c));
#endif
#ifdef OS2

View File

@@ -22,7 +22,7 @@
#include <curses.h>
#ifdef PDCDEBUG
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.6 2006/01/15 18:20:24 wmcbrine Exp $";
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.7 2006/01/15 18:36:58 wmcbrine Exp $";
#endif
extern HANDLE hConOut, hConIn;
@@ -194,9 +194,6 @@ int PDC_get_cursor_mode(void)
This function returns the current font size.
PDCurses Return Value:
This function returns OK on success and ERR on error.
Portability:
PDCurses int PDC_get_font(void);

View File

@@ -24,7 +24,7 @@
#include <curses.h>
#ifdef PDCDEBUG
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.4 2006/01/15 18:20:24 wmcbrine Exp $";
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.5 2006/01/15 18:36:58 wmcbrine Exp $";
#endif
/*man-start*********************************************************************
@@ -104,9 +104,6 @@ int PDC_get_rows()
This function returns the current font size.
PDCurses Return Value:
This function returns OK on success and ERR on error.
Portability:
PDCurses int PDC_get_font(void);