[BACK]Return to display.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/display.c between version 1.23 and 1.24

version 1.23, 2005/11/18 20:56:52 version 1.24, 2005/11/20 03:53:45
Line 8 
Line 8 
  * 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"
Line 27 
Line 23 
  * 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>
Line 99 
Line 92 
 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
Line 108 
Line 100 
  * 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
Line 164 
Line 155 
                         }                          }
                 }                  }
   
 #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));
Line 551 
Line 540 
                 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]);
Line 594 
Line 582 
                 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];
Line 677 
Line 664 
         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
Line 695 
Line 678 
                  * 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];
Line 751 
Line 735 
         }          }
         if (cp5 != cp3)                 /* Do erase.             */          if (cp5 != cp3)                 /* Do erase.             */
                 tteeol();                  tteeol();
 #endif  
 }  }
   
 /*  /*
Line 830 
Line 813 
         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
Line 1031 
Line 1013 
         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  

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24