\begindata{text822, 0}
Return-path: <manson@ewf.eng.ohio-state.edu>
X-Andrew-Authenticated-as: 0;andrew.cmu.edu;Network-Mail
Received: from po2.andrew.cmu.edu via trymail
          ID </afs/andrew.cmu.edu/usr12/dl2n/Mailbox/0a8bFI200jZdI=w05r>;
          Tue, 10 Apr 90 20:03:35 -0400 (EDT)
Received: from tut.cis.ohio-state.edu by po2.andrew.cmu.edu (5.54/3.15) id <AA03051> for dl2n+; Tue, 10 Apr 90 20:02:56 EDT
Received: from riker.eng.ohio-state.edu by tut.cis.ohio-state.edu (5.61-kk/5.900402)
	id AA11337; Tue, 10 Apr 90 18:12:20 -0400
Received: by riker.eng.ohio-state.edu (5.61/5.900327)
	id AA12937; Tue, 10 Apr 90 17:12:09 -0500
Date: Tue, 10 Apr 90 17:12:09 -0500
From: Bob Manson <manson@ewf.eng.ohio-state.edu>
Message-Id: <9004102212.AA12937@riker.eng.ohio-state.edu>
To: dl2n+@andrew.cmu.edu
In-Reply-To: Daniel Edward Lovinger's message of Tue, 10 Apr 90 16:38:11 -0400 (EDT) <sa8YEn600W0K4HFld7@andrew.cmu.edu>
Subject: xtrek version 5.4 alpha under HP-UX 6.5
Reply-To: bob_manson@cis.ohio-state.edu

Here are the diffs; the ../ files are the ones that have been fixed for HPsUX.
Of course, the makefile changes are gonna be different for your environment, but
the -Wc,-Nd5000 is the most important change. Unfortunately, I didn't #ifdef
the changes in the floating-point computations, but they might be needed
for other machines that don't handle divide-by-zero and overflow the same way
as Suns do.

*** Makefile	Mon Nov 20 11:39:23 1989
--- ../Makefile	Thu Mar  1 18:12:09 1990
***************
*** 66,75 ****
  
          DESTDIR =
        USRLIBDIR = $(DESTDIR)/usr/lib
!          BINDIR = $(DESTDIR)/usr/X11/bin
           INCDIR = $(DESTDIR)/usr/include/X11
           ADMDIR = $(DESTDIR)/usr/adm
!          LIBDIR = $(DESTDIR)/usr/X11/lib
       LINTLIBDIR = $(USRLIBDIR)/lint
          FONTDIR = $(LIBDIR)/fonts
         XINITDIR = $(LIBDIR)/xinit
--- 66,75 ----
  
          DESTDIR =
        USRLIBDIR = $(DESTDIR)/usr/lib
!          BINDIR = $(DESTDIR)/usr/games/
           INCDIR = $(DESTDIR)/usr/include/X11
           ADMDIR = $(DESTDIR)/usr/adm
!          LIBDIR = $(DESTDIR)/usr/games/lib
       LINTLIBDIR = $(USRLIBDIR)/lint
          FONTDIR = $(LIBDIR)/fonts
         XINITDIR = $(LIBDIR)/xinit
***************
*** 77,83 ****
           UWMDIR = $(LIBDIR)/uwm
           AWMDIR = $(LIBDIR)/awm
           TWMDIR = $(LIBDIR)/twm
!         MANPATH = $(DESTDIR)/usr/X11/man
    MANSOURCEPATH = $(MANPATH)/man
           MANDIR = $(MANSOURCEPATH)1
        LIBMANDIR = $(MANSOURCEPATH)3
--- 77,83 ----
           UWMDIR = $(LIBDIR)/uwm
           AWMDIR = $(LIBDIR)/awm
           TWMDIR = $(LIBDIR)/twm
!         MANPATH = $(DESTDIR)/usr/local/man
    MANSOURCEPATH = $(MANPATH)/man
           MANDIR = $(MANSOURCEPATH)1
        LIBMANDIR = $(MANSOURCEPATH)3
***************
*** 91,97 ****
     INSTAPPFLAGS = -m 0444
    INSTKMEMFLAGS = -m 4755
          FCFLAGS = -t
!     CDEBUGFLAGS = -O
  
          PATHSEP = /
           DEPEND = $(DEPENDSRC)/makedepend
--- 91,97 ----
     INSTAPPFLAGS = -m 0444
    INSTKMEMFLAGS = -m 4755
          FCFLAGS = -t
!     CDEBUGFLAGS = -g
  
          PATHSEP = /
           DEPEND = $(DEPENDSRC)/makedepend
***************
*** 164,175 ****
  # by several orders of magnitude.
  
  XTOPTIONS	= -DTURBO_OPTION -DTELEPORT_OPTION
! CFLAGS 		= -O -DX11_R3_ENV $(XTOPTIONS)
  YACC		= yacc
  LEX		= lex
  
! PREFIX		= /afs/andrew.cmu.edu/usr0/games
! #PREFIX		= /usr/X11
  XTREKBINDIR	= $(PREFIX)/bin
  XTREKLIBDIR	= $(PREFIX)/lib/xtrek
  FONTDIR		= $(PREFIX)/fonts/x11
--- 164,175 ----
  # by several orders of magnitude.
  
  XTOPTIONS	= -DTURBO_OPTION -DTELEPORT_OPTION
! CFLAGS 		= -g -Wc,-Np5000 -DX11_R3_ENV $(XTOPTIONS)
  YACC		= yacc
  LEX		= lex
  
! #PREFIX		= /afs/andrew.cmu.edu/usr0/games
! PREFIX		= /n/shape/1/xtrek
  XTREKBINDIR	= $(PREFIX)/bin
  XTREKLIBDIR	= $(PREFIX)/lib/xtrek
  FONTDIR		= $(PREFIX)/fonts/x11
*** input.c	Fri Nov 17 14:39:10 1989
--- ../input.c	Thu Mar  1 17:44:15 1990
***************
*** 60,65 ****
--- 60,68 ----
  
  LOCAL void      setRedrawFlag()
  {
+ #ifdef hpux
+   signal(SIGALRM, setRedrawFlag);
+ #endif
    if (skipUpdates)
      do_the_redraw = 1;
    else
*** rmove.c	Tue Oct 31 23:23:42 1989
--- ../rmove.c	Wed Mar 21 11:36:32 1990
***************
*** 157,166 ****
    double          asin_input;
    double          rint();
    double          asin();
!   int             impact_dist;
!   int             impact_time;
!   int             impact_x;
!   int             impact_y;
    int             impact_dir;
    int             difang;
  
--- 157,166 ----
    double          asin_input;
    double          rint();
    double          asin();
!   double             impact_dist; /***/
!   double             impact_time;
!   double             impact_x;
!   double             impact_y;
    int             impact_dir;
    int             difang;
  
***************
*** 178,183 ****
--- 178,184 ----
    /* Choose the more acute of the solution angles (quicker hit) */
    ACUTE(alpha);
    delta = 128 - alpha - beta;
+   if(delta==128) delta=127;
    alpha = alpha ? alpha : 1;
    delta = delta ? delta : 1;
    /* calculate the time to the impact */
***************
*** 184,190 ****
    impact_dist = POLAR_DISTANCE(enemy_x - me_x, enemy_y - me_y);
    impact_time = (POLAR_SINE(alpha) * impact_dist) /
      (POLAR_SINE(delta) * (enemy_speed + 0.01));
- 
    /* calculate the location of the impact */
    impact_x = POLAR_X(enemy_speed * impact_time, enemy_dir) + enemy_x;
    impact_y = POLAR_Y(enemy_speed * impact_time, enemy_dir) + enemy_y;
--- 185,190 ----
***************
*** 295,306 ****
--- 295,316 ----
         p->p_speed * WARP1, p->p_dir, p->p_x, p->p_y,
         &tcourse, &impact_time, &impact_dist,
         &impact_x, &impact_y);
+     if(fmod((double)impact_time,(double)2000000.0)!=2000000.0) {
+       impact_time=2000000.0;
+     }
+     if((((long)(impact_time)<-20000000)) || (((long)impact_time)>(20000000))) {
+       impact_time=20000000;
+     }
      future_x = POLAR_X(p->p_speed * impact_time, p->p_dir) + p->p_x;
      future_y = POLAR_Y(p->p_speed * impact_time, p->p_dir) + p->p_y;
      if ((ABS(impact_x - future_x) < t->t_range) &&
  	(ABS(impact_y - future_y) < t->t_range)) {
        thits++;
+ #if 0
        ldir = POLAR_DIRECTION(t->t_x - p->p_x, t->t_x - p->p_y);
+ #else
+       ldir = POLAR_DIRECTION(t->t_x - p->p_x, t->t_y - p->p_y);
+ #endif
      }
    }
  
***************
*** 452,458 ****
    double          dx, dy, impact_time;
    int             tdist;
    int             p_nonhostile = !ISRHOSTILE(p);
!   int             tmpx, tmpy, tmpdir, tmpspeed, tmpimptime = 10, tmpdist;
    int             impact_dist;
    int             impact_x, impact_y;
    int             tcourse, cdist, angadd;
--- 462,469 ----
    double          dx, dy, impact_time;
    int             tdist;
    int             p_nonhostile = !ISRHOSTILE(p);
!   int             tmpx, tmpy, tmpdir, tmpspeed, tmpimptime = 10;
!   double tmpdist;
    int             impact_dist;
    int             impact_x, impact_y;
    int             tcourse, cdist, angadd;

						Bob
manson@cis.ohio-state.edu
\enddata{text822, 0}
