version 1.23, 2005/11/18 20:56:52 |
version 1.24, 2005/11/20 03:53:45 |
|
|
* process; the editing functions do, however, set some |
* process; the editing functions do, however, set some |
* hints to eliminate a lot of the grinding. There is more |
* hints to eliminate a lot of the grinding. There is more |
* that can be done; the "vtputc" interface is a real |
* that can be done; the "vtputc" interface is a real |
* pig. Two conditional compilation flags; the GOSLING |
* pig. |
* flag enables dynamic programming redisplay, using the |
|
* algorithm published by Jim Gosling in SIGOA. The MEMMAP |
|
* changes things around for memory mapped video. With |
|
* both off, the terminal is a VT52. |
|
*/ |
*/ |
#include "def.h" |
#include "def.h" |
#include "kbd.h" |
#include "kbd.h" |
|
|
* for change the size of a structure that isn't used. |
* for change the size of a structure that isn't used. |
* A bit of a cheat. |
* A bit of a cheat. |
*/ |
*/ |
/* These defines really belong in sysdef.h */ |
|
#ifndef XCHAR |
|
#define XCHAR int |
#define XCHAR int |
#define XSHORT int |
#define XSHORT int |
#endif |
|
|
|
#ifdef STANDOUT_GLITCH |
#ifdef STANDOUT_GLITCH |
#include <term.h> |
#include <term.h> |
|
|
struct video *video; /* Actual screen data. */ |
struct video *video; /* Actual screen data. */ |
struct video blanks; /* Blank line image. */ |
struct video blanks; /* Blank line image. */ |
|
|
#ifdef GOSLING |
|
/* |
/* |
* This matrix is written as an array because |
* This matrix is written as an array because |
* we do funny things in the "setscores" routine, which |
* we do funny things in the "setscores" routine, which |
|
|
* Look at "setscores" to understand what is up. |
* Look at "setscores" to understand what is up. |
*/ |
*/ |
struct score *score; /* [NROW * NROW] */ |
struct score *score; /* [NROW * NROW] */ |
#endif |
|
|
|
/* |
/* |
* Reinit the display data structures, this is called when the terminal |
* Reinit the display data structures, this is called when the terminal |
|
|
} |
} |
} |
} |
|
|
#ifdef GOSLING |
|
TRYREALLOC(score, newrow * newrow * sizeof(struct score)); |
TRYREALLOC(score, newrow * newrow * sizeof(struct score)); |
#endif |
|
TRYREALLOC(vscreen, (newrow - 1) * sizeof(struct video *)); |
TRYREALLOC(vscreen, (newrow - 1) * sizeof(struct video *)); |
TRYREALLOC(pscreen, (newrow - 1) * sizeof(struct video *)); |
TRYREALLOC(pscreen, (newrow - 1) * sizeof(struct video *)); |
TRYREALLOC(video, (2 * (newrow - 1)) * sizeof(struct video)); |
TRYREALLOC(video, (2 * (newrow - 1)) * sizeof(struct video)); |
|
|
ttflush(); |
ttflush(); |
return; |
return; |
} |
} |
#ifdef GOSLING |
|
if (hflag != FALSE) { /* Hard update? */ |
if (hflag != FALSE) { /* Hard update? */ |
for (i = 0; i < nrow - 1; ++i) {/* Compute hash data. */ |
for (i = 0; i < nrow - 1; ++i) {/* Compute hash data. */ |
hash(vscreen[i]); |
hash(vscreen[i]); |
|
|
ttflush(); |
ttflush(); |
return; |
return; |
} |
} |
#endif |
|
for (i = 0; i < nrow - 1; ++i) { /* Easy update. */ |
for (i = 0; i < nrow - 1; ++i) { /* Easy update. */ |
vp1 = vscreen[i]; |
vp1 = vscreen[i]; |
vp2 = pscreen[i]; |
vp2 = pscreen[i]; |
|
|
char *cp5; |
char *cp5; |
int nbflag; |
int nbflag; |
|
|
#ifdef MEMMAP |
|
putline(row + 1, 1, &vvp->v_text[0]); |
|
#else |
|
|
|
if (vvp->v_color != pvp->v_color) { /* Wrong color, do a */ |
if (vvp->v_color != pvp->v_color) { /* Wrong color, do a */ |
ttmove(row, 0); /* full redraw. */ |
ttmove(row, 0); /* full redraw. */ |
#ifdef STANDOUT_GLITCH |
#ifdef STANDOUT_GLITCH |
|
|
* putting the invisible glitch character on the next line. |
* putting the invisible glitch character on the next line. |
* (Hazeltine executive 80 model 30) |
* (Hazeltine executive 80 model 30) |
*/ |
*/ |
cp2 = &vvp->v_text[ncol - (magic_cookie_glitch >= 0 ? (magic_cookie_glitch != 0 ? magic_cookie_glitch : 1) : 0)]; |
cp2 = &vvp->v_text[ncol - (magic_cookie_glitch >= 0 ? |
|
(magic_cookie_glitch != 0 ? magic_cookie_glitch : 1) : 0)]; |
#else |
#else |
cp1 = &vvp->v_text[0]; |
cp1 = &vvp->v_text[0]; |
cp2 = &vvp->v_text[ncol]; |
cp2 = &vvp->v_text[ncol]; |
|
|
} |
} |
if (cp5 != cp3) /* Do erase. */ |
if (cp5 != cp3) /* Do erase. */ |
tteeol(); |
tteeol(); |
#endif |
|
} |
} |
|
|
/* |
/* |
|
|
return (n); |
return (n); |
} |
} |
|
|
#ifdef GOSLING |
|
/* |
/* |
* Compute the hash code for the line pointed to by the "vp". |
* Compute the hash code for the line pointed to by the "vp". |
* Recompute it if necessary. Also set the approximate redisplay |
* Recompute it if necessary. Also set the approximate redisplay |
|
|
k = offs + j - 1; |
k = offs + j - 1; |
uline(k, vscreen[k], pscreen[offs + i - 1]); |
uline(k, vscreen[k], pscreen[offs + i - 1]); |
} |
} |
#endif |
|