Article View: net.sources.games
Article #10patch for vtrek/4.2 BSD use of vt1XX terminals.
From: Lord Kahless
Date: Mon, 16 Sep 1985 19:32
Date: Mon, 16 Sep 1985 19:32
94 lines
2966 bytes
2966 bytes
/* Hail Victory.
* The vtrek game doesn't work with many vt100 termcap entries on
* the local 4.2 BSD systems. The following modifications make it work
* on our 4.2 systems. I suspect it will not work on all versions
* of UNIX, but it works perfectly on a Wyse 75, vt220, and a Microterm
* Ergo 320, all used in the 1200 to 2400 baud range at 4.2 BSD Davis.
*
* I asked if anybody was interested in a fix, and got several requests.
* Here it is.
*
* If you have found your version doesn't work, try replacing the code
* in the original game with the code below. If it still doesn't work,
* consider the amount of padding in your termcap for cursor movement
* and try adding the use of tputs, documented in termcap (3).
*/
/* the following replaces main.c. Basically, I define several variables
* to hold necessary information for the termcap routines.
*/
/*
* main.c
*
* visual star trek
*
* BASIC version written by Tom Goerz and debugged by Dug Patrick
* 22-Dec-79, 13-Nov-80
* C version written by Dug Patrick
* 05-Aug-84, 11-Mar-85
*
* Minor hack to make work on some vt10X emulators, Lord Kahless,
* 850911.0200
*
*/
#include "vtrek.h"
char playership[] = " ? ";
int rolines = 0;
main()
{
int cmd, ch;
char str[44];
#ifdef AZTEC
int errortrap();
Sysvec[FLT_FAULT] = errortrap;
#endif
#ifndef AZTEC /* if it isn't an AZTEC, define the termcap variables */
char c;
char PC;
char *BP;
char bp [1024], *name;
char *TERM;
char *tgetstr ();
char *tgetent ();
char *getenv ();
char *tgoto ();
char *x;
extern char *nCM;
extern char cmbuf [30];
x = cmbuf;
/* get name of term */
name = getenv ("TERM");
/* get the termcap of the terminal */
tgetent (bp,name);
/* get the cursor positioning string */
nCM = tgetstr("cm", &x);
#endif
/* this is the move cursor routine from termio.c */
/* move cursor */
moveyx(ypos,xpos)
int ypos,xpos;
{
#ifdef AZTEC
printf("%s%c%c", cm, ypos+31, xpos+31);
#else /* UNIX 4.2 */
extern char *nCM;
extern char cmbuf [30];
char cmbuf2 [30];
char *ca;
char *tgoto ();
int i;
/* Higher baud rates will probably require use of padding. */
ca = cmbuf2;
ca = tgoto (nCM,xpos-1,ypos-1);
printf ("%s",ca);
# endif
}
Technical Details
Message-ID:
<74@ucdavis.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!ucdavis!ccrdaveShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucdavis.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!ucdavis!ccrdave From: ccrdave@ucdavis.UUCP (Lord Kahless) Newsgroups: net.sources.games Subject: patch for vtrek/4.2 BSD use of vt1XX terminals. Message-ID: <74@ucdavis.UUCP> Date: Mon, 16-Sep-85 15:32:02 EDT Article-I.D.: ucdavis.74 Posted: Mon Sep 16 15:32:02 1985 Date-Received: Wed, 18-Sep-85 03:04:18 EDT Distribution: net Organization: University of California, Davis Lines: 94