[comp.sys.3b1] Those bottom four lines on the screen.

kirkaas@oahu.cs.ucla.edu (paul kirkaas) (04/29/91)

Has anyone ever figured out how to get those bottom four lines that are
dedicated to the function key labels to be part of the regular display
screen?  I managed to get the top display line into the regular
display, but the same technique doesn't seem to work on the bottom.  I would
like to use vi with every line I can.

Thanks

Paul

-- 
Paul Kirkaas
kirkaas@cs.ucla.edu

kirkaas@oahu.cs.ucla.edu (paul kirkaas) (04/29/91)

In article <1991Apr29.023819.24783@cs.ucla.edu> I write:

>Has anyone ever figured out how to get those bottom four lines that are
>dedicated to the function key labels to be part of the regular display
>screen?  I managed to get the top display line into the regular
>display, but the same technique doesn't seem to work on the bottom.  I would
>like to use vi with every line I can.

No one was able to help me yet, but several mail notes asked me how I got
access to to top line.  I include below an old program I wrote to do that.
It is not cleaned up at all because I never found it useful --- I was never
able to get the bottom four lines out of it --- just the top one.

It is invoked as "fullscreen -hH -tT", where H is the height of the desired
screen in pixela, and T tells how many pixels down from the top to start the
screen.  The standard screen starts 12 pixels from the top and is 288
pixels high.  (12 pixels to a line).  In theory you should be able to
invoke this program with fullscreen -t0 -h348 to get a 29 line display 
screen.  In practice, the largest it will work with is 
fullscreen -t0 -h300, which gives you 25 lines, no top status line.  If
I call it with fullscreen -t0 -h301, it doesn't work.

I am including this program here rather than in sources.3b1 because
this is not a practical tool until someone figures out why we can't
get access to those bottom four lines.

Paul

---------------- CUT ------------------
/* fullscreen.c --- Paul Kirkaas --- 12 October 1987

     This program creates a new screen window running ksh.

     In the standard full screen mode of the Unix PC, there are 
24 lines of 12 vertical pixels each; or 288 total pixels.  In addition, 
there is one text line at the top of the screen, and four reserved at the 
bottom for various system status information.  The virtual terminal
borederless window usually starts at 12 pixels down, leaving the top
status line (Phone, date, "W" icon) undisturbed.  

     The "fullscreen [-tT] [-hH]" command starts the borderless window of
Height H, T pixels down from the top of the screen. T = 0 eliminates the
top status line completely; T = 12 is where the standard virtual terminal
usually begins.  

     If termcap is used, screen dependent functions
like more and vi will work on the little windows.  If this is done, more
will work even for very small screen sizes; for some reason, vi does
not work properly on screen sizes of less that ~ 9 lines.

-- pxk  12 Oct 87
*/
   
#include <sys/wd.h>
#include <fcntl.h>
#include <stdio.h>

extern char ** environ;
main(argc, argv)
int argc;
char ** argv;
{ 
  int w_id;
  int screentop = 12; /* Standard default */
  int screenheight = 12 * 24; /* Standard default */
  int hgt, topP;
  struct uwdata wndcntl;
  argc--;
  while(argc)
  {
/* printf("argc = %d; argv = %s\n", argc, argv[argc]); */
  if (! strncmp("-t",argv[argc],2)) screentop = atoi(&argv[argc][2]);
  else if (! strncmp("-h",argv[argc],2)) screenheight = atoi(&argv[argc][2]);
  else { printf("Usage: \"screen -hH -tT\";  T=Top of window, H=Height of\
    window (in pixels).\n\n");
       exit(1); }
  argc--;
  }
    close( 0 );
    close( 1 );
    close( 2 );
    w_id = open( "/dev/window", O_RDWR );
    dup( 0 );
    dup( 0 );
    winit();
    system("stty 526:5:48bd:3b:7f:1c:8:15:4:0:0:0");

   ioctl(0,WIOCGETD,&wndcntl);
/*   hgt *= 12; */
   hgt = screenheight;
   wndcntl.uw_height = (short) hgt;
   wndcntl.uw_width = (short) 720;
   wndcntl.uw_x = (short) 0; 
   wndcntl.uw_y = (short) screentop; 
   wndcntl.uw_uflags |= NBORDER;
   ioctl(0,WIOCSETD,&wndcntl);
   newenviron(hgt);
   printf(
"Setting new screen; top at pixel %d (line %d), %d pixels (%d lines) high\n",
	screentop, screentop/12, screenheight, screenheight/12);
   execlp("ksh","ksh",0);
   
}

seterm(str,no)
int no;
char * str;
{
sprintf(str,"%s%02d'","TERMCAP=':md=[1m:me=[0m:\
al=[1L:am:bs:\
cd=[0J:ce=[0K:cl=[2J[H:cm=[%i%2;%2H:co#80:\
dc=[1P:dl=[1M:do=[B:ei=:ho=[H:\
ic=[1@:im=:kb=\10:kd=[B:kl=[D:kr=[C:ku=[A:\
k1=Oc:k2=Od:k3=Oe:k4=Of:k5=Og:k6=Oh:k7=Oi:k8=Oj:\
nd=[C:se=[m:so=[7m:ue=[m:up=[A:us=[4m:\
EE=[m:BO=[1m:DS=[2m:XS=[9m:OR=[1m:CV=[=C:CI=[=1C:\
KM=/usr/lib/ua/kmap.s4:li#",no);
}

newenviron(hgt) int hgt;
{ int i=0;
  int j=0;
  int k=0;

  char * exportstr = (char *) calloc(1,999);
  char ** newenv;
  while (environ[i++]);
  i += 9;
  newenv = (char * *) calloc (i,sizeof(char *));
  while (j<i && environ[k] )
    {  if (( strncmp (environ[k],"TERMCAP",7)) &&
           ( strncmp (environ[k],"WNWIDTH",7)) &&
           ( strncmp (environ[k],"WNHEIGHT",8)))
      { newenv[j] = (char *) strcpy(malloc(strlen(environ[k]) + 8),
					environ[k]);
	    j++;
	  }
       k++;
    }
   seterm(exportstr,hgt/12); /* Call function that loads exportstr w. TERMCAP */
   newenv[j]=exportstr;
   environ=newenv;
}
-- 
Paul Kirkaas
kirkaas@cs.ucla.edu

yarvin-norman@cs.yale.edu (Norman Yarvin) (05/02/91)

kirkaas@oahu.cs.ucla.edu (paul kirkaas) writes:
>Has anyone ever figured out how to get those bottom four lines that are
>dedicated to the function key labels to be part of the regular display
>screen?

There are two ways to do this.

1.  Run MGR.

2.  Use adb on /etc/lddrv/wind.o.  (if you're feeling especially skilled)
But in this case your time would probably be better spent on writing
assembler bit-blit routines to speed up MGR.

--
Norman Yarvin					yarvin-norman@cs.yale.edu