From 567e3567cfbbfd9940e7ac02313f241710d726c7 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sat, 29 Apr 1995 00:06:37 +0000 Subject: Use POSIX tty semantics. --- snake/snake/move.c | 53 +++++++++++++---------------------------------------- snake/snake/snake.c | 9 ++++----- snake/snake/snake.h | 10 ++++------ 3 files changed, 21 insertions(+), 51 deletions(-) (limited to 'snake') diff --git a/snake/snake/move.c b/snake/snake/move.c index 5e72dac2..993c1636 100644 --- a/snake/snake/move.c +++ b/snake/snake/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.9 1995/04/22 10:16:04 cgd Exp $ */ +/* $NetBSD: move.c,v 1.10 1995/04/29 00:06:37 mycroft Exp $ */ /* * Copyright (c) 1980, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 7/19/93"; #else -static char rcsid[] = "$NetBSD: move.c,v 1.9 1995/04/22 10:16:04 cgd Exp $"; +static char rcsid[] = "$NetBSD: move.c,v 1.10 1995/04/29 00:06:37 mycroft Exp $"; #endif #endif /* not lint */ @@ -90,7 +90,6 @@ static char rcsid[] = "$NetBSD: move.c,v 1.9 1995/04/22 10:16:04 cgd Exp $"; * * point(&p,x,y) return point set to x,y. * - * baudrate(x) returns the baudrate of the terminal. * delay(t) causes an approximately constant delay * independent of baudrate. * Duration is ~ t/20 seconds. @@ -511,28 +510,12 @@ char *str; if (str) tputs(str, 1, outch); } -baudrate() -{ - - switch (orig.sg_ospeed){ - case B300: - return(300); - case B1200: - return(1200); - case B4800: - return(4800); - case B9600: - return(9600); - default: - return(0); - } -} delay(t) int t; { int k,j; - k = baudrate() * t / 300; + k = ospeed * t / 300; for(j=0;j # include # include -# include # include +# include # include #define ESC '\033' @@ -62,6 +62,7 @@ char tbuf[1024], tcapbuf[128]; char *tgetstr(), *tgoto(); int Klength; /* length of KX strings */ int chunk; /* amount of money given at a time */ +short ospeed; #ifdef debug #define cashvalue (loot-penalty)/25 #else @@ -72,10 +73,7 @@ struct point { int col, line; }; struct point cursor; -struct sgttyb orig, new; -#ifdef TIOCLGET -struct ltchars olttyc, nlttyc; -#endif +struct termios orig, new; struct point *point(); #if __STDC__ void apr(struct point *, const char *, ...); -- cgit v1.2.3-56-ge451