Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site motel6.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!tektronix!reed!motel6!keith
From: keith@motel6.UUCP (Keith Packard)
Newsgroups: net.games.rogue
Subject: Re: problem with rogue7 strings
Message-ID: <175@motel6.UUCP>
Date: Sun, 30-Jun-85 18:04:42 EDT
Article-I.D.: motel6.175
Posted: Sun Jun 30 18:04:42 1985
Date-Received: Fri, 5-Jul-85 02:38:44 EDT
References: <174@motel6.UUCP>
Distribution: net
Organization: 5440 SE 41st, Portland, OR
Lines: 52

> I have a set of rogue7 sources (the one with multiple character classes)
> that do run fine on the vax.  But, when I ported them to a
> Sequent Balance-8000 machine (32016), I got strange
> errors in the messages printed at the top of the screen.  For example,
> I am fighting a bat:
> 
> You miss the bat --More--
> 
> When I hit space, the message changes to:
> 
> Tou miss the bat --More--
> 
> Yes, this is correct.  I check the sources and find that it
> *really* wanted to print:
> 
> The bat misses you.
> 
> but only the first character was printed correctly.
> 
> keith packard
> ...!tektronix!reed!motel6!keith

Well, I found the problem, when I unset the "flush typeahead" flag
everything worked correctly!  It turns out that, on my 11/73 and
obviously on the Balance calling ioctl:
ioctl (foo, TIOCFLUSH, 0)
causes *both* input and *output* to be flushed, and of course I
was only seeing this problem when I was in battle - flush was
being called all the time.  So, looking at my kernel sources
(Praise Unix for Sourced Systems) I found out that if you call
ioctl:

# include	
int	flags = FREAD;
ioctl (foo, TIOCFLUSH, &flags)

then only the input queue is flushed!
I wish things like this made it into the documentation. (grr)
Oh, you can use FWRITE in the ioctl call as well.

So, I made an enormous hack and did:

# define flushout()	ioctl (_tty_ch, TCFLSH, "\001\000\000\000")

in rogue.h

(well actually "\001\000" as I was fixing the 11/73 version...)

I know, ugly but it was quick.  I'll fix it later... (sure)

Keith Packard
...!tektronix!motel6!keith