From dd2e3590436a0056b16fc3de03c3db827a899f2e Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 15 Jan 2006 18:36:58 +0000 Subject: [PATCH] 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. --- curses.h | 4 +--- curspriv.h | 3 +-- dos/pdcgetsc.c | 16 +++------------- os2/pdcgetsc.c | 11 ++--------- pdcurses/util.c | 14 ++++++-------- win32/pdcgetsc.c | 5 +---- x11/pdcgetsc.c | 5 +---- 7 files changed, 15 insertions(+), 43 deletions(-) diff --git a/curses.h b/curses.h index d51b267c..7cb5e53d 100644 --- a/curses.h +++ b/curses.h @@ -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 diff --git a/curspriv.h b/curspriv.h index 61a832b7..13b432c3 100644 --- a/curspriv.h +++ b/curspriv.h @@ -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 diff --git a/dos/pdcgetsc.c b/dos/pdcgetsc.c index c9eafa59..661594c8 100644 --- a/dos/pdcgetsc.c +++ b/dos/pdcgetsc.c @@ -25,7 +25,7 @@ #include #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********************************************************************* diff --git a/os2/pdcgetsc.c b/os2/pdcgetsc.c index 1f10baac..4b1f0766 100644 --- a/os2/pdcgetsc.c +++ b/os2/pdcgetsc.c @@ -25,7 +25,7 @@ #include #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); diff --git a/pdcurses/util.c b/pdcurses/util.c index d9ed9e1c..f08c246e 100644 --- a/pdcurses/util.c +++ b/pdcurses/util.c @@ -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 diff --git a/win32/pdcgetsc.c b/win32/pdcgetsc.c index c4808856..60a08415 100644 --- a/win32/pdcgetsc.c +++ b/win32/pdcgetsc.c @@ -22,7 +22,7 @@ #include #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); diff --git a/x11/pdcgetsc.c b/x11/pdcgetsc.c index 3fae3a6d..7d6c237a 100644 --- a/x11/pdcgetsc.c +++ b/x11/pdcgetsc.c @@ -24,7 +24,7 @@ #include #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);