Thanks...
John Rosenberg AT&T NS
ihnp4!ihu1m!johnnyr
"Ramming speed, Mr. Sulu!"
try changing the make file to -ltermcap. (It makes mille work.)
By the way, the factory version wouldn't work with a vt102 terminal
on our 4.2 system. I have a patch, if anybody else found the same
bug.
ucbvax!ucdavis!vega!ccrdave
Thank God some one else is having the same problem I
am. I was beginning to think I was just screwed up or
somthing.
If anyone has the time to research this please post it
to the net.
Thanks
Doug Anderson
What -ltermcap?? Try -lcurses. Geez.
where do these def'ns reside? I can't get a successful compile.
Undefined:
_sqrt
_atan2
_tan
_tgetent
_tgetstr
_tgoto
Eric Hestenes
arpanet: hest...@nprdc.ARPA
other: ucbvax!sdcsvax!sdcsla!hestenes or hest...@sdcsla.UUCP
Curses doesn't work either. At least not on my 3B2.
Doug Anderson
I guess this incompatability with the rest of the Unix
community is progress.
Steve Spearman ihnp4!ihopb!spear
There are various problems w/ sys V vtrek.
1) The i/o sets you to RAW! Look in the termio module.
2) The way to make it compile w/o diagnostics (NOT run) is
to change termlib to termcap in the make file. Anybody who
can fix the tty stuff would have my thanks.
3) The afore mentioned term problems. I posted one fix, another
was posted.
ucbvax!ucdavis!vega!ccrdave
The problem is that Visual Trek uses the "termcap" library incorrectly (or,
at least, not in the way it's supposed to be used). The "curses"/"terminfo"
library has routines which emulate the behavior of the "tget..." routines
but only if you use them correctly.
The code in question (in excerpted form):
static char cm[20];
p = cm;
tgetstr("cm", &p);
p = cl;
tgetstr("cl", &p);
...
A more "correct" version would be
static char string[1024]; /* or however big it has to be */
static char *stringp = &string[0];
static char *cm;
cm = tgetstr("cm", &stringp);
cl = tgetstr("cl", &stringp);
The intent was that "tget<whatever>" would return the gotten
boolean/number/string. The pointer for "tgetstr" is merely to a buffer into
which the strings are to be dumped. The reason it works differently in
"curses"/"terminfo" is that "terminfo" reads the entire "terminfo" entry as
one big lump, and you then reference the capability strings directly from
that lump. The "tgetstr" routines merely return pointers into that lump;
they do not use the second argument in any way whatsoever.
Speaking of suspicious code:
gtty(0, &tty);
saveflags = tty.sg_flags;
tty.sg_flags |= RAW;
tty.sg_flags &= ~(ECHO | XTABS);
stty(0, &tty);
Programs should not use RAW mode unless they need an 8-bit data path to/from
the terminal (no parity, just 8 data bits) and no flow control. If the
program just wants to capture each character as it is typed, CBREAK mode is
just fine. You probably want to turn off CRMOD also (RAW mode disables all
output translations). The RAW should be CBREAK and the ECHO | XTABS should
probably include CRMOD (and maybe LCASE).
ioctl(0, TIOCGETP, &tty);
/* I consider "gtty" and "stty" to be deprecated */
saveflags = tty.sg_flags;
tty.sg_flags |= CBREAK;
tty.sg_flags &= ~(ECHO | XTABS | CRMOD | LCASE);
ioctl(0, TIOCSETP, &tty);
None of that will work right in System III or System V. Declare "tty" as a
"struct termio", declare "savetty" as "struct termio" also and throw out
"saveflags", and replace the code with
ioctl(0, TCGETA, &tty);
savetty = tty;
/*
* This assumes you want to turn off all output translations,
* which is very likely to be the case in any full-screen program.
*/
tty.c_oflag &= ~OPOST;
tty.c_lflag &= ~(ICANON | ECHO);
/* turning ICANON off is like turning CBREAK on */
ioctl(0, TCSETAW, &tty);
Note that in both these cases, the user's interrupt character will work
normally. This means that unless you want to disable the interrupt and quit
characters (for information on that, see below), you'll have to catch SIGINT
(and maybe SIGQUIT) and, if you get those signals, restore the modes, clear
the screen, and exit.
To disable the interrupt characters in V7 (and, hence, 4.xBSD):
struct tchars tc, savetc;
ioctl(0, TIOCGETC, &tc);
savetc = tc;
tc.t_intrc = '\377';
tc.t_quitc = '\377';
ioctl(0, TIOCSETC, &tc);
For S3/S5, just turn off the ISIG bit as well as the ICANON bit in
"c_lflags".
If you're running under 4.xBSD, you should also either
1) catch SIGTSTP and, when it is caught, reset the TTY modes, clear
the screen, reset the SIGTSTP handler if you're running under
4.2BSD, and send yourself a SIGTSTP with "kill"
or
2) disable the suspend and delayed-suspend characters as well.
To do this, look up the TIOCGLTC and TIOCSLTC "ioctl" calls in
TTY(4).
Moral - writing full-screen programs is more complicated than you probably
thought.
Guy Harris
The math library ("-lm").
> _tgetent
> _tgetstr
> _tgoto
On a system with the old "termcap" library, in the "termcap library"
("-ltermcap" or "-ltermlib"). On a system with the new "curses"/"terminfo"
library, in that library ("-lcurses") (although note that the code that uses
"tgetstr" uses it in a way that may be "correct", in that the documentation
doesn't explicitly say it's wrong, but won't work with the new library; see
earlier posting on this subject).
The Makefile posted with this game gives both "-lm" and "-ltermlib". Did
you use that Makefile or did you try compiling it on your own?
Guy Harris
Actually, it is. Termcap has severe problems that have been
fixed in terminfo. The (very few) primitive termlib routines
were closely tied to the termcap database structure, so they
do not all have a direct replacement in terminfo-based curses.
Looks like you
1) aren't getting to the curses library, the tgetent, tgetstr,
and tgoto error
2) aren't getting to math library.
What sort of sys V system. There are zillions. Here's a generic
fix for the little UNISOFT port machines. It may work for you...
1) change the make file to -ltermcap. -lcurses may work on some
machines.
2) Use one of the posted terminal fixes.
3) If you get the program to compile and it acts incredibly freaky,
try replacing the direct setting of your tty, in the termio.c file,
with calls to the curses equivalents, noecho and crmode. That
worked. You will have some more butchering to do, but the rest is
obvious. I will post a running UNISOFT port version, if I get
requests.
Anyone have hack running on unisoft? Other games? I'd be interested...
Perhaps mutually benificial swaps can be arranged.
ucbvax!ucdavis!vega!ccrdave
Thanks in advance,
C.J. Opperman
ihu1h!jomibase
IH 4H303 x5014
uucp: ihnp4!ihu1h!jomibase
--
C.J. Opperman
ihu1h!jomibase
IH 4H303 x5014
uucp: ihnp4!ihu1h!jomibase
Say what? There are routines in the curses/terminfo library for emulating
the old termcap routines. The S5R2 documentation says they may go away at a
later date, but I'm not sure that statement is still operative.
Guy Harris
Same here! I don't see the sources anywhere!
David A. Somner
somner@lasspvax
(No thanks in advance, let's see if someone is helpful enough...)
"A curious device. It seems to be a collection of distinct columns
fused together. The type of coins which come out of the bottom
of a particular shaft are all the same, even though a mixture is
inserted in the single slit at the top. Somehow, internally they
are permuted about."
-- A barbarian describes a change maker in a modern
day city.
Sure, what's the problem with a UniPlus+ SysV port?, I think it's great and I
have hack and other games running on my machine.
I haven't heard that it should be any major difference between UniPlus+ and
UniPlus+, so what's the problem?.
Lars Hammarstrand.
Datorisering AB, Stockholm, SWEDEN.
UUCP: {seismo,decvax,philabs}!{mcvax,ukc,unido}!enea!daab!lasse
ARPA: decvax!mcvax!enea!daab!la...@berkley.ARPA
decvax!mcvax!enea!daab!la...@seismo.ARPA
Ps...
If you have a 1/2" tape station, I can send you a 1600 BPI tar tape with hack
and some other stuff.
me too, me too!!! perhaps another posting is in order....
--
god bless Lily St. Cyr
-Rocky Horror Picture Show
Name: James Turner
Mail: Imagen Corp. 2650 San Tomas Expressway, P.O. Box 58101
Santa Clara, CA 95052-9400
AT&T: (408) 986-9400
UUCP: ...{decvax,ucbvax}!decwrl!imagen!negami!turner