[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/rott/FC-6 rott-1.0-64bit.patch, NONE, 1.1 rott-1.0-compile.patch, NONE, 1.1 rott-1.0-cvs-fixes.patch, NONE, 1.1 rott-1.0-fixes.patch, NONE, 1.1 rott-1.0-more-fixes.patch, NONE, 1.1 rott-1.0-registered.patch, NONE, 1.1 rott-1.0-winrott-fixes.patch, NONE, 1.1 rott-1.0-winrott.patch, NONE, 1.1 rott-registered.desktop, NONE, 1.1 rott-registered.sh, NONE, 1.1 rott-shareware.desktop, NONE, 1.1 rott-shareware.sh, NONE, 1.1 rott.autodlrc, NONE, 1.1 rott.png, NONE, 1.1 rott.spec, NONE, 1.1 rott.spec~, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2



Author: jwrdegoede

Update of /cvs/extras/rpms/rott/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26245

Modified Files:
	.cvsignore sources 
Added Files:
	rott-1.0-64bit.patch rott-1.0-compile.patch 
	rott-1.0-cvs-fixes.patch rott-1.0-fixes.patch 
	rott-1.0-more-fixes.patch rott-1.0-registered.patch 
	rott-1.0-winrott-fixes.patch rott-1.0-winrott.patch 
	rott-registered.desktop rott-registered.sh 
	rott-shareware.desktop rott-shareware.sh rott.autodlrc 
	rott.png rott.spec rott.spec~ 
Log Message:
* Fri May 11 2007 Hans de Goede <j w r degoede hhs nl> 1.0-2
- Add desktop entry and userfriendly launcher script for registered package
- Add a patch fixing crashes with "long" usernames


rott-1.0-64bit.patch:

--- NEW FILE rott-1.0-64bit.patch ---
diff -ur rott-1.0.orig/rott/audiolib/dpmi.h rott-1.0/rott/audiolib/dpmi.h
--- rott-1.0.orig/rott/audiolib/dpmi.h	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/audiolib/dpmi.h	2007-05-06 22:03:17.000000000 +0200
@@ -62,8 +62,8 @@
 unsigned long DPMI_GetRealModeVector( int num );
 void DPMI_SetRealModeVector( int num, unsigned long vector );
 int  DPMI_CallRealModeFunction( dpmi_regs *callregs );
-int  DPMI_GetDOSMemory( void **ptr, int *descriptor, unsigned length );
-int  DPMI_FreeDOSMemory( int descriptor );
+int  DPMI_GetDOSMemory( void **ptr, long *descriptor, unsigned length );
+int  DPMI_FreeDOSMemory( long descriptor );
 int  DPMI_LockMemory( void *address, unsigned length );
 int  DPMI_LockMemoryRegion( void *start, void *end );
 int  DPMI_UnlockMemory( void *address, unsigned length );
diff -ur rott-1.0.orig/rott/audiolib/multivoc.c rott-1.0/rott/audiolib/multivoc.c
--- rott-1.0.orig/rott/audiolib/multivoc.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/audiolib/multivoc.c	2007-05-06 22:03:17.000000000 +0200
@@ -107,7 +107,7 @@
 
 static int MV_TotalMemory;
 
-static int   MV_BufferDescriptor;
+static long   MV_BufferDescriptor;
 static int   MV_BufferEmpty[ NumberOfBuffers ];
 char *MV_MixBuffer[ NumberOfBuffers + 1 ];
 
diff -ur rott-1.0.orig/rott/audiolib/nodpmi.c rott-1.0/rott/audiolib/nodpmi.c
--- rott-1.0.orig/rott/audiolib/nodpmi.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/audiolib/nodpmi.c	2007-05-06 22:03:17.000000000 +0200
@@ -160,18 +160,18 @@
    return( status );
    }
 
-int DPMI_GetDOSMemory( void **ptr, int *descriptor, unsigned length )
+int DPMI_GetDOSMemory( void **ptr, long *descriptor, unsigned length )
 {
 	/* Lovely... */
 	
 	*ptr = (void *)malloc(length);
 	
-	*descriptor = (int) *ptr;
+	*descriptor = (long) *ptr;
 	
 	return (descriptor == 0) ? DPMI_Error : DPMI_Ok;
 }
 
-int DPMI_FreeDOSMemory( int descriptor )
+int DPMI_FreeDOSMemory( long descriptor )
 {
 	free((void *)descriptor);
 	
diff -ur rott-1.0.orig/rott/modexlib.c rott-1.0/rott/modexlib.c
--- rott-1.0.orig/rott/modexlib.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/modexlib.c	2007-05-06 22:03:17.000000000 +0200
@@ -45,12 +45,12 @@
 
 int    linewidth;
 int    ylookup[MAXSCREENHEIGHT];
-int    page1start;
-int    page2start;
-int    page3start;
+byte  *page1start;
+byte  *page2start;
+byte  *page3start;
 int    screensize;
-unsigned bufferofs;
-unsigned displayofs;
+byte  *bufferofs;
+byte  *displayofs;
 boolean graphicsmode=false;
 
 #ifdef DOS
@@ -248,7 +248,7 @@
 =
 =======================
 */
-void VL_CopyBufferToAll ( unsigned buffer )
+void VL_CopyBufferToAll ( byte *buffer )
 {
    int plane;
 
@@ -506,9 +506,9 @@
 
     screensize=MAXSCREENHEIGHT*MAXSCREENWIDTH;
 
-    page1start=(int)sdl_surface->pixels;
-    page2start=(int)sdl_surface->pixels;
-    page3start=(int)sdl_surface->pixels;
+    page1start=sdl_surface->pixels;
+    page2start=sdl_surface->pixels;
+    page3start=sdl_surface->pixels;
     displayofs = page1start;
     bufferofs = page2start;
     XFlipPage ();
@@ -570,7 +570,7 @@
 =
 =======================
 */
-void VL_CopyBufferToAll ( unsigned buffer )
+void VL_CopyBufferToAll ( byte *buffer )
 {
 #ifdef DOS
    int plane;
@@ -611,7 +611,7 @@
 =================
 */
 
-void VL_ClearBuffer (unsigned buf, byte color)
+void VL_ClearBuffer (byte *buf, byte color)
 {
 #ifdef DOS
   VGAMAPMASK(15);
diff -ur rott-1.0.orig/rott/modexlib.h rott-1.0/rott/modexlib.h
--- rott-1.0.orig/rott/modexlib.h	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/modexlib.h	2007-05-06 22:03:17.000000000 +0200
@@ -105,23 +105,23 @@
 
 extern  int      ylookup[MAXSCREENHEIGHT];      // Table of row offsets
 extern  int      linewidth;
-extern  int      page1start;
-extern  int      page2start;
-extern  int      page3start;
+extern  byte    *page1start;
+extern  byte    *page2start;
+extern  byte    *page3start;
 extern  int      screensize;
-extern  unsigned bufferofs;
-extern  unsigned displayofs;
+extern  byte    *bufferofs;
+extern  byte    *displayofs;
 extern  boolean  graphicsmode;
 
 
 void  GraphicsMode ( void );
 void  SetTextMode ( void );
 void  VL_SetVGAPlaneMode ( void );
-void  VL_ClearBuffer (unsigned buf, byte color);
+void  VL_ClearBuffer (byte *buf, byte color);
 void  VL_ClearVideo (byte color);
 void  VL_DePlaneVGA (void);
 void  VL_CopyDisplayToHidden ( void );
-void  VL_CopyBufferToAll ( unsigned buffer );
+void  VL_CopyBufferToAll ( byte *buffer );
 void  VL_CopyPlanarPage ( byte * src, byte * dest );
 void  VL_CopyPlanarPageToMemory ( byte * src, byte * dest );
 void  XFlipPage ( void );
diff -ur rott-1.0.orig/rott/rt_actor.c rott-1.0/rott/rt_actor.c
--- rott-1.0.orig/rott/rt_actor.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_actor.c	2007-05-06 22:03:17.000000000 +0200
@@ -88,7 +88,7 @@
 
 byte              deathshapeoffset[8] = {0,7,7,8,8,9,8,7};
 
-unsigned          MAXFUNCTION,MINFUNCTION,MAXSTATE,MINSTATE;
+unsigned long     MAXFUNCTION,MINFUNCTION,MAXSTATE,MINSTATE;
 
 objtype           *PLAYER0MISSILE;
 objtype           *SCREENEYE;
@@ -992,16 +992,16 @@
 void FindAddresses(void)
 {
  int i;
- unsigned tstate,tfunct;
+ unsigned long tstate,tfunct;
 
- MINFUNCTION = 0xffffffff;
+ MINFUNCTION = -1l;
  MAXFUNCTION = 0x00000000;
- MINSTATE = 0xffffffff;
+ MINSTATE = -1l;
  MAXSTATE = 0x00000000;
 
  for(i=0;i<MAXSTATES;i++)
    {
-   tstate = (unsigned)(statetable[i]);
+   tstate = (unsigned long)(statetable[i]);
    if (tstate < MINSTATE)
       MINSTATE = tstate;
 
@@ -1009,7 +1009,7 @@
       MAXSTATE = tstate;
    if (statetable[i]!=NULL)
       {
-      tfunct = (unsigned)(statetable[i]->think);
+      tfunct = (unsigned long)(statetable[i]->think);
       if (tfunct < MINFUNCTION)
          MINFUNCTION = tfunct;
 
@@ -1021,10 +1021,10 @@
 
 void CheckBounds(objtype*ob)
 {
- unsigned tstate,tfunct;
+ unsigned long tstate,tfunct;
 
-  tstate = (unsigned)(ob->state);
-  tfunct = (unsigned)(ob->state->think);
+  tstate = (unsigned long)(ob->state);
+  tfunct = (unsigned long)(ob->state->think);
 
  if ((tfunct < MINFUNCTION) || (tfunct > MAXFUNCTION) ||
 	  (tstate < MINSTATE) || (tstate > MAXSTATE))
@@ -10077,7 +10077,7 @@
 		 if (ob->hitpoints <= 0)
 			{objtype*column = (objtype*)(ob->whatever);
 
-          EnableObject((int)column);
+          EnableObject((long)column);
 			 ob->whatever = NULL;
 
 			 KillActor(ob);
@@ -10442,7 +10442,7 @@
         {
         objtype*column = (objtype*)(ob->whatever);
 
-        EnableObject((int)column);
+        EnableObject((long)column);
         ob->whatever = NULL;
 
         KillActor(ob);
@@ -10663,7 +10663,7 @@
             {touchplatetype *tplate;
 
              for(tplate=touchplate[tempstat->linked_to];tplate;tplate = tplate->nextaction)
-                if (tplate->whichobj == (int)(tempstat))
+                if (tplate->whichobj == (long)(tempstat))
                    RemoveTouchplateAction(tplate,tempstat->linked_to);
             }
 
@@ -10879,7 +10879,7 @@
        (tempstat->itemnumber == stat_tntcrate)
       )
       {
-      tempstat->linked_to = (int)(LASTSTAT);
+      tempstat->linked_to = (long)(LASTSTAT);
       tempstat->flags |= FL_RESPAWN;
       }
 
@@ -10900,7 +10900,7 @@
 
 
 
-void EnableObject(int object)
+void EnableObject(long object)
    {
    objtype* ob;
    int i,gasicon;
@@ -10951,7 +10951,7 @@
       }
    }
 
-void DisableObject(int object)
+void DisableObject(long object)
 {objtype*ob;
 
  ob = (objtype*)object;
diff -ur rott-1.0.orig/rott/rt_actor.h rott-1.0/rott/rt_actor.h
--- rott-1.0.orig/rott/rt_actor.h	2007-05-06 22:30:12.000000000 +0200
+++ rott-1.0/rott/rt_actor.h	2007-05-06 22:03:17.000000000 +0200
@@ -358,8 +358,8 @@
 void     A_Drain(objtype*ob);
 void     T_Explosion(objtype*ob);
 void     T_MoveColumn(objtype*);
-void     EnableObject(int object);
-void     DisableObject(int);
+void     EnableObject(long object);
+void     DisableObject(long object);
 
 void     T_Collide(objtype*);
 void  Collision(objtype*ob,objtype *attacker,int hitmomentumx,int hitmomentumy);
diff -ur rott-1.0.orig/rott/rt_def.h rott-1.0/rott/rt_def.h
--- rott-1.0.orig/rott/rt_def.h	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_def.h	2007-05-06 22:03:17.000000000 +0200
@@ -300,7 +300,7 @@
 typedef unsigned char           byte;
 typedef unsigned short int      word;
 typedef unsigned long           longword;
-typedef long fixed;
+typedef int fixed;
 
 
 //////////////////////////////////////////////////////////////////////////
diff -ur rott-1.0.orig/rott/rt_door.c rott-1.0/rott/rt_door.c
--- rott-1.0.orig/rott/rt_door.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_door.c	2007-05-06 22:03:17.000000000 +0200
@@ -94,7 +94,7 @@
 
 // Local Variables
 
-static void (*touchactions[NUMTOUCHPLATEACTIONS])(int) =
+static void (*touchactions[NUMTOUCHPLATEACTIONS])(long) =
 						 {ActivatePushWall,
 						  ActivateMoveWall,
 						  LinkedOpenDoor,
@@ -315,7 +315,7 @@
 }
 
 
-int GetIndexForAction(void (*action)(int))
+int GetIndexForAction(void (*action)(long))
 {int i;
 
  for(i=0;i<NUMTOUCHPLATEACTIONS;i++)
@@ -486,10 +486,10 @@
 	temp->complete = dummy.complete;
 
 	if (dummy.whichobj & FL_TACT)
-	  temp->whichobj = (int)(objlist[dummy.whichobj & ~FL_TACT]);
+	  temp->whichobj = (long)(objlist[dummy.whichobj & ~FL_TACT]);
 
 	else if (dummy.whichobj & FL_TSTAT)
-	  temp->whichobj = (int)(GetStatForIndex(dummy.whichobj & ~FL_TSTAT));
+	  temp->whichobj = (long)(GetStatForIndex(dummy.whichobj & ~FL_TSTAT));
 	else
 	  temp->whichobj = dummy.whichobj;
 	if (dummy.actionindex != -1)
@@ -613,7 +613,7 @@
 
 
 
-void  Link_To_Touchplate(word touchlocx, word touchlocy, void (*maction)(int), void (*swapaction)(int), int wobj, int delaytime)
+void  Link_To_Touchplate(word touchlocx, word touchlocy, void (*maction)(long), void (*swapaction)(long), long wobj, int delaytime)
 {touchplatetype *temp;
  int index;
 
@@ -640,7 +640,7 @@
 
 
 
-void ClockLink (void (*saction)(int), void (*eaction)(int), int wobj,int whichclock)
+void ClockLink (void (*saction)(long), void (*eaction)(long), long wobj,int whichclock)
 {touchplatetype*temp;
 
 
@@ -731,7 +731,7 @@
    touchplatetype *temp;
    int i,touchcomplete,j;
    int playeron;
-   void (*tempact)(int);
+   void (*tempact)(long);
    boolean wallmessage,doormessage,columnmessage;
 
    for(i=0;i<lasttouch;i++)
@@ -1789,7 +1789,7 @@
 =====================
 */
 
-void LinkedOpenDoor (int door)
+void LinkedOpenDoor (long door)
 {
    UtilizeDoor(door,OpenDoor);
 }
@@ -1802,7 +1802,7 @@
 =====================
 */
 
-void LinkedCloseDoor (int door)
+void LinkedCloseDoor (long door)
 {
    if (DoorReadyToClose(door)==true)
       UtilizeDoor(door,CloseDoor);
@@ -3477,7 +3477,7 @@
 =====================
 */
 
-void ActivatePushWall (int pwall)
+void ActivatePushWall (long pwall)
 {
    pwallobj_t * pw;
 
@@ -3508,7 +3508,7 @@
 =====================
 */
 
-void ActivateMoveWall (int pwall)
+void ActivateMoveWall (long pwall)
 {
    pwallobj_t * pw;
 
diff -ur rott-1.0.orig/rott/rt_door.h rott-1.0/rott/rt_door.h
--- rott-1.0.orig/rott/rt_door.h	2002-12-20 21:15:28.000000000 +0100
+++ rott-1.0/rott/rt_door.h	2007-05-06 22:03:17.000000000 +0200
@@ -124,11 +124,11 @@
 } pwallobj_t;
 
 typedef struct tplate
-{ void (*action)(int);
-  void (*swapaction)(int);
+{ void (*action)(long);
+  void (*swapaction)(long);
   struct tplate * nextaction;
   struct tplate * prevaction;
-  int whichobj;
+  long whichobj;
   byte tictime;
   byte ticcount;
   byte triggered;
@@ -213,9 +213,9 @@
 
 
 int  PlatformHeight(int,int);
-void Link_To_Touchplate(word, word, void (*)(int), void (*)(int),int, int);
+void Link_To_Touchplate(word, word, void (*)(long), void (*)(long), long, int);
 void TriggerStuff(void);
-void ClockLink(void (*)(int),void(*)(int),int,int);
+void ClockLink(void (*)(long),void(*)(long),long,int);
 void RecursiveConnect(int);
 void ConnectAreas(void);
 void InitAreas(void);
@@ -234,8 +234,8 @@
 void WallPushing (int pwall);
 void PushWall (int pwall, int dir);
 void OperatePushWall (int pwall, int dir, boolean localplayer );
-void ActivatePushWall (int pwall);
-void ActivateMoveWall (int pwall);
+void ActivatePushWall (long pwall);
+void ActivateMoveWall (long pwall);
 int  UpdateMaskedWall (int num);
 
 void FixDoorAreaNumbers ( void );
@@ -262,8 +262,8 @@
 void LoadElevators(byte * buffer,int size);
 
 void MakeWideDoorVisible ( int doornum );
-void LinkedCloseDoor (int door);
-void LinkedOpenDoor (int door);
+void LinkedCloseDoor (long door);
+void LinkedOpenDoor (long door);
 int IsWall (int tilex, int tiley);
 int IsDoor (int tilex, int tiley);
 int IsMaskedWall (int tilex, int tiley);
diff -ur rott-1.0.orig/rott/rt_draw.c rott-1.0/rott/rt_draw.c
--- rott-1.0.orig/rott/rt_draw.c	2003-01-01 10:24:25.000000000 +0100
+++ rott-1.0/rott/rt_draw.c	2007-05-06 22:03:17.000000000 +0200
@@ -100,7 +100,7 @@
 //
 
 short   tantable[FINEANGLES];
-long    sintable[FINEANGLES+FINEANGLEQUAD+1],
+int     sintable[FINEANGLES+FINEANGLEQUAD+1],
 		  *costable = sintable+(FINEANGLES/4);
 
 //
@@ -200,7 +200,7 @@
 {
   byte * table;
   byte * ptr;
-  long  length;
+  int   length;
   int   i;
 
 //
@@ -244,7 +244,7 @@
 //
 // get sin/cos table
 //
-   memcpy(&sintable[0],ptr,length*sizeof(long));
+   memcpy(&sintable[0],ptr,length*sizeof(int));
    SwapIntelLongArray(&sintable[0], length);
    ptr+=(length)*sizeof(int);
 
diff -ur rott-1.0.orig/rott/rt_game.c rott-1.0/rott/rt_game.c
--- rott-1.0.orig/rott/rt_game.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_game.c	2007-05-06 22:13:20.000000000 +0200
@@ -998,7 +998,7 @@
 
 void DrawGameString (int x, int y, const char * str, boolean bufferofsonly)
 {
-   unsigned tempbuf;
+   byte *tempbuf;
 
    px=x;
    py=y;
@@ -1543,8 +1543,8 @@
 
 void DrawMPPic (int xpos, int ypos, int width, int height, int heightmod, byte *src, boolean bufferofsonly)
 {
-   byte *olddest;
-   byte *dest;
+   int olddest;
+   int dest;
    int x;
    int y;
    int planes;
@@ -1554,9 +1554,9 @@
    mask = 1 << (xpos&3);
 
 #ifdef DOS
-   olddest = (byte *)(ylookup[ypos] + (xpos>>2));
+   olddest = ylookup[ypos] + (xpos>>2);
 #else
-   olddest = (byte *)(ylookup[ypos] + xpos);
+   olddest = ylookup[ypos] + xpos;
 #endif
 
    for (planes = 0; planes < 4; planes++)
@@ -1637,8 +1637,8 @@
 
 void DrawColoredMPPic (int xpos, int ypos, int width, int height, int heightmod, byte *src, boolean bufferofsonly, int color)
 {
-   byte *olddest;
-   byte *dest;
+   int olddest;
+   int dest;
    int x;
    int y;
    int planes;
@@ -1651,9 +1651,9 @@
    mask = 1 << (xpos&3);
 
 #ifdef DOS
-   olddest = (byte *)(ylookup[ypos] + (xpos>>2));
+   olddest = ylookup[ypos] + (xpos>>2);
 #else
-   olddest = (byte *)(ylookup[ypos] + xpos);
+   olddest = ylookup[ypos] + xpos;
 #endif
 
    for (planes = 0; planes < 4; planes++)
@@ -1822,8 +1822,8 @@
 
 void DrawPPic (int xpos, int ypos, int width, int height, byte *src, int num, boolean up, boolean bufferofsonly)
 {
-   byte *olddest;
-   byte *dest;
+   int olddest;
+   int dest;
    int x;
    int y;
    int planes;
@@ -1847,9 +1847,9 @@
    mask = 1;
 
 #ifdef DOS
-   olddest = (byte *)(ylookup[ypos] + (xpos>>2));
+   olddest = ylookup[ypos] + (xpos>>2);
 #else
-   olddest = (byte *)(ylookup[ypos] + xpos);
+   olddest = ylookup[ypos] + xpos;
 #endif
 
    for (planes = 0; planes < 4; planes++)
@@ -2254,7 +2254,7 @@
 void DrawPause (void)
 {
    pic_t *p;
-   int bufftemp = bufferofs;
+   byte *bufftemp = bufferofs;
 
    bufferofs -= screenofs;
 
@@ -2610,15 +2610,16 @@
 
 void GM_MemToScreen (byte *source, int width, int height, int x, int y)
 {
-   byte *dest, *dest1, *dest2, *dest3, mask;
+   int dest;
+   byte *dest1, *dest2, *dest3, mask;
    byte *screen1, *screen2, *screen3;
    int  plane;
    int w;
    
 #ifdef DOS
-   dest = (byte *)(ylookup[y]+(x>>2));
+   dest = ylookup[y]+(x>>2);
 #else
-   dest = (byte *)(ylookup[y]+x);
+   dest = ylookup[y]+x;
 #endif
    mask = 1 << (x&3);
 
@@ -4450,7 +4451,7 @@
 {
    if ((SaveTime+1) < GetTicCount())
    {
-      int temp = bufferofs;
+      byte *temp = bufferofs;
 
       bufferofs = displayofs;
       SaveTime = GetTicCount();
diff -ur rott-1.0.orig/rott/rt_main.c rott-1.0/rott/rt_main.c
--- rott-1.0.orig/rott/rt_main.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_main.c	2007-05-06 22:13:55.000000000 +0200
@@ -962,7 +962,7 @@
                while ((!LastScan) && (!IN_GetMouseButtons()))
                   {
                   int i;
-                  unsigned tempbuf;
+                  byte *tempbuf;
                   MenuFadeOut();
                   ClearGraphicsScreen();
                   SetPalette(&dimpal[0]);
diff -ur rott-1.0.orig/rott/rt_stat.c rott-1.0/rott/rt_stat.c
--- rott-1.0.orig/rott/rt_stat.c	2002-12-24 05:34:15.000000000 +0100
+++ rott-1.0/rott/rt_stat.c	2007-05-06 22:03:17.000000000 +0200
@@ -397,7 +397,7 @@
 }
 
 
-void ActivateLight(int light)
+void ActivateLight(long light)
 {statobj_t*tstat;
 
  tstat = (statobj_t*)light;
@@ -409,7 +409,7 @@
 }
 
 
-void DeactivateLight(int light)
+void DeactivateLight(long light)
 {statobj_t*tstat;
 
  tstat = (statobj_t*)light;
diff -ur rott-1.0.orig/rott/rt_stat.h rott-1.0/rott/rt_stat.h
--- rott-1.0.orig/rott/rt_stat.h	2002-12-20 21:15:28.000000000 +0100
+++ rott-1.0/rott/rt_stat.h	2007-05-06 22:03:17.000000000 +0200
@@ -151,7 +151,7 @@
 		  short int         whichstat;
 		  short int         areanumber;
 
-		  int               linked_to;
+		  long              linked_to;
 		  struct statstruct *statnext;
 		  struct statstruct *statprev;
 		  struct statstruct *nextactive;
@@ -167,8 +167,7 @@
 		  int               spawnz;
 		  struct respstruct *next;
 		  struct respstruct *prev;
-        int linked_to;
-
+                  long              linked_to;
 } respawn_t;
 
 
@@ -205,8 +204,8 @@
 void Set_NewZ_to_MapValue(fixed*,int,const char*,int,int);
 void RemoveFromFreeStaticList(statobj_t*);
 void CheckCriticalStatics(void);
-void ActivateLight(int);
-void DeactivateLight(int);
+void ActivateLight(long);
+void DeactivateLight(long);
 void TurnOnLight(int,int);
 void TurnOffLight(int,int);
 void MakeStatActive(statobj_t*);
diff -ur rott-1.0.orig/rott/rt_ted.c rott-1.0/rott/rt_ted.c
--- rott-1.0.orig/rott/rt_ted.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_ted.c	2007-05-06 22:14:56.000000000 +0200
@@ -1139,7 +1139,7 @@
    int lastmem=0;
    int lastcache=0;
    int ticdelay;
-   unsigned tempbuf;
+   byte *tempbuf;
 
 #if defined(PLATFORM_MACOSX) || defined(__sparc__)
 #warning "Precaching is disabled. Fix."
@@ -1329,7 +1329,7 @@
    {
    int  filehandle;
    char RTLSignature[ 4 ];
-   unsigned long RTLVersion;
+   unsigned int RTLVersion;
 
    filehandle = SafeOpenRead( filename );
 
@@ -1395,12 +1395,12 @@
       SEEK_SET );
    SafeRead( filehandle, &RTLMap, sizeof( RTLMap ) );
 
-    SwapIntelLong((long *)&RTLMap.used);
-    SwapIntelLong((long *)&RTLMap.CRC);
-    SwapIntelLong((long *)&RTLMap.RLEWtag);
-    SwapIntelLong((long *)&RTLMap.MapSpecials);
-    SwapIntelLongArray((long *)&RTLMap.planestart, NUMPLANES);
-    SwapIntelLongArray((long *)&RTLMap.planelength, NUMPLANES);
+    SwapIntelLong((int *)&RTLMap.used);
+    SwapIntelLong((int *)&RTLMap.CRC);
+    SwapIntelLong((int *)&RTLMap.RLEWtag);
+    SwapIntelLong((int *)&RTLMap.MapSpecials);
+    SwapIntelLongArray((int *)&RTLMap.planestart, NUMPLANES);
+    SwapIntelLongArray((int *)&RTLMap.planelength, NUMPLANES);
 
    if ( !RTLMap.used )
       {
@@ -3568,7 +3568,7 @@
 
 
 void LinkActor (objtype *ob,int tilex,int tiley,
-                void (*action)(int),void (*swapaction)(int)
+                void (*action)(long),void (*swapaction)(long)
                )
    {
 	word  touchx,touchy;
@@ -3585,7 +3585,7 @@
       if ((clockx == tilex) && (clocky == tiley))
          {
          clocklinked = 1;
-         ClockLink(EnableObject,DisableObject,(int)ob,k);
+         ClockLink(EnableObject,DisableObject,(long)ob,k);
          }
       }
 
@@ -3612,9 +3612,9 @@
 
 
          if (tswitch && (tswitch->flags & FL_ON))
-            Link_To_Touchplate(touchx,touchy,swapaction,action,(int)ob,0);
+            Link_To_Touchplate(touchx,touchy,swapaction,action,(long)ob,0);
          else
-            Link_To_Touchplate(touchx,touchy,action,swapaction,(int)ob,0);
+            Link_To_Touchplate(touchx,touchy,action,swapaction,(long)ob,0);
          if (ob->obclass == gasgrateobj)
             {
             ob->temp1 = touchx;
@@ -3645,7 +3645,7 @@
    {
    int   i,j,linked;
 	word   *map,tile;
-	void (*action)(int),(*swapaction)(int);
+	void (*action)(long),(*swapaction)(long);
 
 
    map = mapplanes[1];
@@ -4051,7 +4051,7 @@
 							 if (!(tswitch->flags & FL_ON))
 								{sprites[i][j]->shapenum --;
 								 if (touchindices[touchx][touchy])
-									 {Link_To_Touchplate(touchx,touchy,ActivateLight,DeactivateLight,(int)(sprites[i][j]),0);
+									 {Link_To_Touchplate(touchx,touchy,ActivateLight,DeactivateLight,(long)(sprites[i][j]),0);
 									  sprites[i][j]->linked_to = touchindices[touchx][touchy]-1;
 									 }
 								 else
@@ -4059,7 +4059,7 @@
 								}
 							 else
 								{if (touchindices[touchx][touchy])
-									 {Link_To_Touchplate(touchx,touchy,DeactivateLight,ActivateLight,(int)(sprites[i][j]),0);
+									 {Link_To_Touchplate(touchx,touchy,DeactivateLight,ActivateLight,(long)(sprites[i][j]),0);
 									  sprites[i][j]->linked_to = touchindices[touchx][touchy]-1;
 									 }
 								 else
@@ -4069,7 +4069,7 @@
 							}
 					  else
 						 {if (touchindices[touchx][touchy])
-							 {Link_To_Touchplate(touchx,touchy,DeactivateLight,ActivateLight,(int)(sprites[i][j]),0);
+							 {Link_To_Touchplate(touchx,touchy,DeactivateLight,ActivateLight,(long)(sprites[i][j]),0);
 							  sprites[i][j]->linked_to = touchindices[touchx][touchy]-1;
 							 }
 						  else
diff -ur rott-1.0.orig/rott/rt_util.c rott-1.0/rott/rt_util.c
--- rott-1.0.orig/rott/rt_util.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/rt_util.c	2007-05-06 22:03:17.000000000 +0200
@@ -1171,7 +1171,7 @@
 }
 
 
-long	SwapLong (long l)
+int	SwapLong (int l)
 {
 	byte	b1,b2,b3,b4;
 
@@ -1180,10 +1180,10 @@
 	b3 = (l>>16)&255;
 	b4 = (l>>24)&255;
 
-	return ((long)b1<<24) + ((long)b2<<16) + ((long)b3<<8) + b4;
+	return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4;
 }
 
-long	KeepLong (long l)
+int	KeepLong (int l)
 {
 	return l;
 }
@@ -1194,7 +1194,7 @@
 #undef SwapShort
 #undef SwapLong
 
-void SwapIntelLong(long *l)
+void SwapIntelLong(int *l)
 {
     *l = IntelLong(*l);
 }
@@ -1204,7 +1204,7 @@
     *s = IntelShort(*s);
 }
 
-void SwapIntelLongArray(long *l, int num)
+void SwapIntelLongArray(int *l, int num)
 {
     while (num--) {
         SwapIntelLong(l);
diff -ur rott-1.0.orig/rott/rt_util.h rott-1.0/rott/rt_util.h
--- rott-1.0.orig/rott/rt_util.h	2002-12-25 09:00:13.000000000 +0100
+++ rott-1.0/rott/rt_util.h	2007-05-06 22:03:17.000000000 +0200
@@ -67,11 +67,11 @@
 long  ParseNum (char *str);
 short MotoShort (short l);
 short IntelShort (short l);
-long  MotoLong (long l);
-long  IntelLong (long l);
-void  SwapIntelLong (long *l);
+int   MotoLong (int l);
+int   IntelLong (int l);
+void  SwapIntelLong (int *l);
 void  SwapIntelShort(short *s);
-void  SwapIntelLongArray (long *l, int num);
+void  SwapIntelLongArray (int *l, int num);
 void  SwapIntelShortArray (short *s, int num);
 int   US_CheckParm (char *parm, char **strings);
 byte  BestColor (int r, int g, int b, byte *palette);
diff -ur rott-1.0.orig/rott/rt_vid.c rott-1.0/rott/rt_vid.c
--- rott-1.0.orig/rott/rt_vid.c	2002-12-24 08:29:52.000000000 +0100
+++ rott-1.0/rott/rt_vid.c	2007-05-06 22:15:21.000000000 +0200
@@ -968,7 +968,7 @@
 
 void SwitchPalette (byte * newpal, int steps)
 {
-   int temp;
+   byte *temp;
 
    VL_FadeOut(0,255,0,0,0,steps>>1);
 
diff -ur rott-1.0.orig/rott/rt_view.c rott-1.0/rott/rt_view.c
--- rott-1.0.orig/rott/rt_view.c	2003-01-01 10:24:39.000000000 +0100
+++ rott-1.0/rott/rt_view.c	2007-05-06 22:03:17.000000000 +0200
@@ -220,7 +220,7 @@
 {
     int   i;
     int   frac;
-    long  intang;
+    int   intang;
     byte * table;
     byte * ptr;
     int   length;
@@ -246,7 +246,7 @@
 //
 
    memcpy(&length,ptr,sizeof(int));
-   SwapIntelLong((long *)&length);
+   SwapIntelLong(&length);
    ptr+=sizeof(int);
    pangle=SafeMalloc(length*sizeof(int));
    memcpy(pangle,ptr,length*sizeof(int));
@@ -447,7 +447,7 @@
 	lump = W_GetNumForName("colormap");
 	length = W_LumpLength (lump) + 255;
 	colormap = SafeMalloc (length);
-	colormap = (byte *)( ((int)colormap + 255)&~0xff);
+	colormap = (byte *)( ((long)colormap + 255)&~0xff);
 	W_ReadLump (lump,colormap);
 
 // Fix fire colors in colormap
@@ -461,7 +461,7 @@
 	lump = W_GetNumForName("specmaps");
 	length = W_LumpLength (lump+1) + 255;
 	redmap = SafeMalloc (length);
-	redmap = (byte *)( ((int)redmap + 255)&~0xff);
+	redmap = (byte *)( ((long)redmap + 255)&~0xff);
 	W_ReadLump (lump+1,redmap);
    greenmap = redmap+(16*256);
 
@@ -474,7 +474,7 @@
          {
 	      length = W_LumpLength (lump+i) + 255;
 	      playermaps[i] = SafeMalloc (length);
-	      playermaps[i] = (byte *)( ((int)playermaps[i] + 255)&~0xff);
+	      playermaps[i] = (byte *)( ((long)playermaps[i] + 255)&~0xff);
 	      W_ReadLump (lump+i,playermaps[i]);
          }
       }
diff -ur rott-1.0.orig/rott/watcom.c rott-1.0/rott/watcom.c
--- rott-1.0.orig/rott/watcom.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/watcom.c	2007-05-06 22:03:17.000000000 +0200
@@ -24,8 +24,8 @@
 
 fixed FixedDiv2(fixed a, fixed b)
 {
-	__int64 x = (signed long)a;
-	__int64 y = (signed long)b;
+	__int64 x = (signed int)a;
+	__int64 y = (signed int)b;
 	__int64 z = x * 65536 / y;
 	
 	return (z) & 0xffffffff;
diff -ur rott-1.0.orig/rott/rt_main.h rott-1.0/rott/rt_main.h
--- rott-1.0.orig/rott/rt_main.h	2002-12-20 22:18:39.000000000 +0100
+++ rott-1.0/rott/rt_main.h	2007-05-10 11:49:11.000000000 +0200
@@ -76,8 +76,8 @@
    // Variable for which version of the game can be played
    version_type Product;
 
-   long    TimeCount;
-   long    frame;
+   int     TimeCount;
+   int     frame;
    int     secrettotal,treasuretotal,killtotal;
    int     secretcount,treasurecount,killcount;
    int     supertotal,healthtotal,missiletotal;
@@ -88,7 +88,7 @@
    int     difficulty;
    int     violence;
 	int     mapon;
-	long    score;
+	int     score;
 	int     episode;
 	int     battlemode;
 	int     battleoption;

rott-1.0-compile.patch:

--- NEW FILE rott-1.0-compile.patch ---
diff -ur rott-1.0/rott/Makefile trunk/rott/Makefile
--- rott-1.0/rott/Makefile	2007-05-05 20:44:31.000000000 +0200
+++ trunk/rott/Makefile	2007-05-05 15:47:26.000000000 +0200
@@ -47,7 +47,7 @@
 
 
 CC = gcc
-CFLAGS = -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -W -Wall -Wno-unused $(EXTRACFLAGS)
+CFLAGS = -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -W -Wall -Wno-unused -Wno-pointer-sign $(EXTRACFLAGS)
 LDLIBS = $(SDL_LDFLAGS) -lSDL -lSDL_mixer $(EXTRALDFLAGS) -Wl,-E
 
 all: rott
diff -ur rott-1.0/rott/rt_actor.h trunk/rott/rt_actor.h
--- rott-1.0/rott/rt_actor.h	2007-05-05 20:44:31.000000000 +0200
+++ trunk/rott/rt_actor.h	2007-05-05 15:46:36.000000000 +0200
@@ -315,7 +315,7 @@
 extern  void             *actorat[MAPSIZE][MAPSIZE];
 extern  int              angletodir[ANGLES];
 extern _2Dpoint          SNAKEPATH[512];
-extern  int              STOPSPEED;
+/* extern  int              STOPSPEED; */
 extern  int              FRICTION;
 
 extern  int              objcount;
diff -ur rott-1.0/rott/rt_in.h trunk/rott/rt_in.h
--- rott-1.0/rott/rt_in.h	2007-05-05 20:44:31.000000000 +0200
+++ trunk/rott/rt_in.h	2007-05-05 15:20:49.000000000 +0200
@@ -147,9 +147,9 @@
 
 extern boolean  Paused;
 extern volatile int LastScan;
-extern KeyboardDef KbdDefs;
+/* extern KeyboardDef KbdDefs;
 extern JoystickDef JoyDefs[];
-extern ControlType Controls[MAXPLAYERS];
+extern ControlType Controls[MAXPLAYERS]; */
 
 extern boolean  SpaceBallPresent;
 extern boolean  CybermanPresent;

rott-1.0-cvs-fixes.patch:

--- NEW FILE rott-1.0-cvs-fixes.patch ---
diff -urN rott-1.0/rott/Makefile trunk/rott/Makefile
--- rott-1.0/rott/Makefile	2003-01-01 10:23:03.000000000 +0100
+++ trunk/rott/Makefile	2007-05-05 20:44:31.000000000 +0200
@@ -52,6 +52,9 @@
 
 all: rott
 
+audiolib/audiolib.a:
+	$(MAKE) -C audiolib CC="$(CC)" CFLAGS="$(CFLAGS)" LDLIBS="$(LDLIBS)"
+
 rott: 	\
 	cin_actr.o \
 	cin_efct.o \
@@ -61,7 +64,6 @@
 	cin_util.o \
 	dosutil.o \
 	engine.o \
-	fx_man.o \
 	isr.o \
 	modexlib.o \
 	rt_actor.o \
@@ -101,11 +103,15 @@
 	w_wad.o \
 	watcom.o \
 	z_zone.o \
-	byteordr.o
+	byteordr.o \
+	dukemusc.o \
+	audiolib/audiolib.a
 	$(CC) $^ $(LDLIBS) -o $@
 
 clean:
-	rm -rf *.o
+	$(MAKE) -C audiolib clean
+	rm -rf rott *.o
 
 distclean: clean
+	$(MAKE) -C audiolib distclean
 	rm -rf *~
diff -urN rott-1.0/rott/_rt_util.h trunk/rott/_rt_util.h
--- rott-1.0/rott/_rt_util.h	2002-12-24 07:46:41.000000000 +0100
+++ trunk/rott/_rt_util.h	2007-05-05 20:44:31.000000000 +0200
@@ -20,10 +20,12 @@
 #ifndef _rt_util_private
 #define _rt_util_private
 
+#ifdef DOS
 #define PEL_WRITE_ADR   0x3c8
 #define PEL_READ_ADR    0x3c7
 #define PEL_DATA        0x3c9
 #define PEL_MASK        0x3c6
+#endif
 
 #define ERRORROW        2
 #define ERRORCOL        11
Binary files rott-1.0/rott/audio_wf.lib and trunk/rott/audio_wf.lib differ
diff -urN rott-1.0/rott/audiolib/Makefile trunk/rott/audiolib/Makefile
--- rott-1.0/rott/audiolib/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ trunk/rott/audiolib/Makefile	2007-05-05 20:44:28.000000000 +0200
@@ -0,0 +1,22 @@
+CC=gcc
+AR=ar
+RANLIB=ranlib
+CFLAGS=-g -O2
+LDLIBS=
+
+CFLAGS += $(shell sdl-config --cflags)
+LDLIBS += $(shell sdl-config --libs)
+
+OBJ=fx_man.o dsl.o ll_man.o multivoc.o mv_mix.o mvreverb.o nodpmi.o \
+	pitch.o user.o usrhooks.o
+
+audiolib.a: $(OBJ)
+	rm -rf $@
+	$(AR) rc $@ $^
+	$(RANLIB) $@
+
+clean:
+	rm -rf audiolib.a *.o
+
+distclean: clean
+	rm -rf *~
diff -urN rott-1.0/rott/audiolib/_al_midi.h trunk/rott/audiolib/_al_midi.h
--- rott-1.0/rott/audiolib/_al_midi.h	1970-01-01 01:00:00.000000000 +0100
+++ trunk/rott/audiolib/_al_midi.h	2007-05-05 20:44:28.000000000 +0200
@@ -0,0 +1,174 @@
+/*
+Copyright (C) 1994-1995 Apogee Software, Ltd.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+*/
+#ifndef ___AL_MIDI_H
+#define ___AL_MIDI_H
+
+#define NO_ADLIB_DETECTION    "NOAL"
+
+#define STEREO_DETUNE 5
+
+#define lobyte( num )   ( ( unsigned )*( ( char * )&( num ) ) )
+#define hibyte( num )   ( ( unsigned )*( ( ( char * )&( num ) ) + 1 ) )
+
+#define AL_VoiceNotFound -1
+
+#define  alFreqH     0xb0
+#define  alEffects   0xbd
+
+/* Number of slots for the voices on the chip */
+#define NumChipSlots 18
+
+#define NUM_VOICES      9
+#define NUM_CHANNELS    16
+
+#define NOTE_ON         0x2000  /* Used to turn note on or toggle note */
+#define NOTE_OFF        0x0000
+
+#define MAX_VELOCITY   0x7f
+#define MAX_OCTAVE     7
+#define MAX_NOTE       ( MAX_OCTAVE * 12 + 11 )
+#define FINETUNE_MAX   31
+#define FINETUNE_RANGE ( FINETUNE_MAX + 1 )
+
+#define PITCHBEND_CENTER 1638400
+
+#define note_off             0x80
+#define note_on              0x90
+#define poly_aftertouch      0xa0
+#define control_change       0xb0
+#define program_chng         0xc0
+#define channel_aftertouch   0xd0
+#define pitch_wheel          0xe0
+
+#define MIDI_VOLUME          7
+#define MIDI_PAN             10
+#define MIDI_DETUNE          94
+#define MIDI_ALL_NOTES_OFF   0x7B
+#define MIDI_RESET_ALL_CONTROLLERS 0x79
+#define MIDI_RPN_MSB               100
+#define MIDI_RPN_LSB               101
+#define MIDI_DATAENTRY_MSB         6
+#define MIDI_DATAENTRY_LSB         38
+#define MIDI_PITCHBEND_RPN         0
+
+enum cromatic_scale
+   {
+   C       = 0x157,
+   C_SHARP = 0x16B,
+   D_FLAT  = 0x16B,
+   D       = 0x181,
+   D_SHARP = 0x198,
+   E_FLAT  = 0x198,
+   E       = 0x1B0,
+   F_FLAT  = 0x1B0,
+   E_SHARP = 0x1CA,
+   F       = 0x1CA,
+   F_SHARP = 0x1E5,
+   G_FLAT  = 0x1E5,
+   G       = 0x202,
+   G_SHARP = 0x220,
+   A_FLAT  = 0x220,
+   A       = 0x241,
+   A_SHARP = 0x263,
+   B_FLAT  = 0x263,
+   B       = 0x287,
+   C_FLAT  = 0x287,
+   B_SHARP = 0x2AE,
+   };
+
+/* Definition of octave information to be ORed onto F-Number */
+
+enum octaves
+   {
+   OCTAVE_0 = 0x0000,
+   OCTAVE_1 = 0x0400,
+   OCTAVE_2 = 0x0800,
+   OCTAVE_3 = 0x0C00,
+   OCTAVE_4 = 0x1000,
+   OCTAVE_5 = 0x1400,
+   OCTAVE_6 = 0x1800,
+   OCTAVE_7 = 0x1C00
+   };
+
+typedef struct VOICE
+   {
+   struct VOICE *next;
+   struct VOICE *prev;
[...31725 lines suppressed...]
    unsigned tempbuf;
 
@@ -1777,7 +1777,7 @@
       GiveLives(1);
       if (ob==player)
          {
-         AddMessage("100 Life Item Points!  Extra Life!\n",MSG_BONUS);
+         AddMessage("100 Life Item Points!  Extra Life!",MSG_BONUS);
          SD_PlaySoundRTP (SD_GET1UPSND, player->x, player->y);
          }
       pstate->triads -= 100;
@@ -4183,7 +4183,7 @@
       killangle=startangle+(TOTALDEATHROT>>1);
       if (dopefish==true)
          {
-         AddMessage("Dopefish Death Cam\n",MSG_SYSTEM);
+         AddMessage("Dopefish Death Cam",MSG_SYSTEM);
          }
       for (iangle=startangle;;)
          {
diff -urN rott-1.0/rott/rt_game.h trunk/rott/rt_game.h
--- rott-1.0/rott/rt_game.h	2002-12-21 01:36:20.000000000 +0100
+++ trunk/rott/rt_game.h	2007-05-05 20:44:31.000000000 +0200
@@ -93,7 +93,7 @@
 
 void DrawKills (boolean bufferofsonly);
 void DrawPlayers ( void );
-void DrawGameString (int x, int y, char * str, boolean bufferofsonly);
+void DrawGameString (int x, int y, const char * str, boolean bufferofsonly);
 void DrawNumber (int x, int y, int width, int which, boolean bufferofsonly);
 void TakeDamage (int points, objtype *attacker);
 void HealPlayer (int points, objtype * ob);
diff -urN rott-1.0/rott/rt_main.c trunk/rott/rt_main.c
--- rott-1.0/rott/rt_main.c	2003-01-07 07:34:09.000000000 +0100
+++ trunk/rott/rt_main.c	2007-05-05 20:44:31.000000000 +0200
@@ -1291,8 +1291,7 @@
 
                WaitKeyUp();
                LastScan = 0;
-               while (!LastScan)
-                  ;
+               while (!LastScan) IN_UpdateKeyboard();	// Thanks again DrLex
                LastScan=0;
                }
 #endif
diff -urN rott-1.0/rott/rt_menu.c trunk/rott/rt_menu.c
--- rott-1.0/rott/rt_menu.c	2002-12-29 05:54:44.000000000 +0100
+++ trunk/rott/rt_menu.c	2007-05-05 20:44:31.000000000 +0200
@@ -2948,10 +2948,10 @@
       LastScan=0;
       while (LastScan == 0)
          {
+         IN_UpdateKeyboard();
          RefreshMenuBuf( 0 );
          }
       LastScan = 0;
-      IN_UpdateKeyboard();
    }
    IN_ClearKeysDown();
    return( retval );
diff -urN rott-1.0/rott/rt_sound.c trunk/rott/rt_sound.c
--- rott-1.0/rott/rt_sound.c	2002-12-31 11:33:00.000000000 +0100
+++ trunk/rott/rt_sound.c	2007-05-05 20:44:31.000000000 +0200
@@ -375,7 +375,6 @@
 
    snd=W_CacheLumpNum(SoundNumber(sndnum),PU_STATIC, CvtNull, 1);
 
-#ifdef DOS
    if ( *snd == 'C' )
       {
       voice = FX_PlayVOC3D( snd, pitch, angle, distance,
@@ -386,24 +385,6 @@
       voice = FX_PlayWAV3D( snd, pitch, angle, distance,
          sounds[sndnum].priority, (unsigned long) sndnum );
       }
-#else
-/* 
-   Oh boy.  The library used to implement these functions may need a 
-   file size.  So, let's just hack these in!
- */
-   if ( *snd == 'C' )
-      {
-      voice = FX_PlayVOC3D_ROTT( snd, W_LumpLength(SoundNumber(sndnum)),
-         pitch, angle, distance,
-         sounds[sndnum].priority, (unsigned long) sndnum );
-      }
-   else
-      {
-      voice = FX_PlayWAV3D_ROTT( snd, W_LumpLength(SoundNumber(sndnum)),
-         pitch, angle, distance,
-         sounds[sndnum].priority, (unsigned long) sndnum );
-      }
-#endif
 
    if ( voice < FX_Ok )
       {
diff -urN rott-1.0/rott/rt_str.c trunk/rott/rt_str.c
--- rott-1.0/rott/rt_str.c	2002-12-25 05:40:40.000000000 +0100
+++ trunk/rott/rt_str.c	2007-05-05 20:44:31.000000000 +0200
@@ -1109,6 +1109,8 @@
 //      if (GameEscaped == true)
 //         PauseLoop ();
 
+      IN_PumpEvents();
+      
       if (cursorvis)
          USL_XORICursor (x, y, xx, cursor, color);
 
diff -urN rott-1.0/rott/rt_ted.c trunk/rott/rt_ted.c
--- rott-1.0/rott/rt_ted.c	2003-01-07 07:35:24.000000000 +0100
+++ trunk/rott/rt_ted.c	2007-05-05 20:44:31.000000000 +0200
@@ -1141,7 +1141,7 @@
    int ticdelay;
    unsigned tempbuf;
 
-#if defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_MACOSX) || defined(__sparc__)
 #warning "Precaching is disabled. Fix."
 // Precaching confuses the byteswapping code, since we have
 // no simple way of knowing the type of each resource.
diff -urN rott-1.0/rott/rt_util.c trunk/rott/rt_util.c
--- rott-1.0/rott/rt_util.c	2003-01-07 07:31:51.000000000 +0100
+++ trunk/rott/rt_util.c	2007-05-05 20:44:31.000000000 +0200
@@ -927,7 +927,7 @@
     {
         *ptr = '\0';
         f->dir = opendir(f->pattern);
-        memmove(f->pattern, ptr + 1, strlen(ptr) + 1);
+        memmove(f->pattern, ptr + 1, strlen(ptr + 1) + 1);
     }
 
     return(_dos_findnext(f));
@@ -1850,9 +1850,15 @@
 
    return (true);
 #else
-	STUB_FUNCTION;
+	if (!*path) {
+		return true;
+	}
 	
-	return false;
+	if (chdir (path) == -1) {
+	         return (false);
+	}
+	
+	return true;
 #endif
 }
 
Binary files rott-1.0/rott/spball.lib and trunk/rott/spball.lib differ
diff -urN rott-1.0/rott/version.h trunk/rott/version.h
--- rott-1.0/rott/version.h	2002-12-20 21:15:28.000000000 +0100
+++ trunk/rott/version.h	2007-05-05 20:44:31.000000000 +0200
@@ -17,6 +17,12 @@
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
+
+#ifndef VERSION_H
+#define VERSION_H
+
 #define ROTTMAJORVERSION 1
 #define ROTTMINORVERSION 4
 #define ROTTVERSION ((ROTTMAJORVERSION*10)+(ROTTMINORVERSION))
+
+#endif
diff -urN rott-1.0/rott/watcom.c trunk/rott/watcom.c
--- rott-1.0/rott/watcom.c	2002-12-25 09:00:13.000000000 +0100
+++ trunk/rott/watcom.c	2007-05-05 20:44:31.000000000 +0200
@@ -9,11 +9,8 @@
 
 fixed FixedMul(fixed a, fixed b)
 {
-	__int64 x = a;
-	__int64 y = b;
-	__int64 z = x * y + 0x8000;
-	
-	return (z >> 16) & 0xffffffff;
+	__int64 scratch1 = (__int64) a * (__int64) b + (__int64) 0x8000;
+	return (scratch1 >> 16) & 0xffffffff;
 }
 
 fixed FixedMulShift(fixed a, fixed b, fixed shift)
diff -urN rott-1.0/rott/z_zone.c trunk/rott/z_zone.c
--- rott-1.0/rott/z_zone.c	2002-12-24 05:34:44.000000000 +0100
+++ trunk/rott/z_zone.c	2007-05-05 20:44:31.000000000 +0200
@@ -289,6 +289,12 @@
 //
         size += sizeof(memblock_t);     // account for size of block header
 
+#if defined(__sparc__)
+        /* ensure word alignment */
+        if (size % 4) {
+           size = size + (4 - size % 4);
+        }
+#endif
 
 //
 // if there is a free block behind the rover, back up over them

rott-1.0-fixes.patch:

--- NEW FILE rott-1.0-fixes.patch ---
diff -urN rott-1.0.orig/rott/rt_ted.c rott-1.0/rott/rt_ted.c
--- rott-1.0.orig/rott/rt_ted.c	2007-05-06 23:57:48.000000000 +0200
+++ rott-1.0/rott/rt_ted.c	2007-05-06 23:45:11.000000000 +0200
@@ -5959,6 +6020,7 @@
 		  ambush = (GameRandomNumber("rand actor",0) < 128);
 		  i = randloc[locindex].x;
 		  j = randloc[locindex].y;
+		  tile = mapplanes[1][j*mapwidth + i];
 		  SpawnStand(randomtype,i,j,tile-122,ambush);
 		  used[locindex] = 1;
         PreCacheActor(randomtype,0);

rott-1.0-more-fixes.patch:

--- NEW FILE rott-1.0-more-fixes.patch ---
--- rott-1.0/rott/scriplib.c~	2007-05-16 16:57:34.000000000 +0200
+++ rott-1.0/rott/scriplib.c	2007-05-16 16:57:34.000000000 +0200
@@ -43,7 +43,7 @@
 
 char    token[MAXTOKEN];
 char    name[MAXTOKEN*2];
-char    scriptfilename[30];
+char    scriptfilename[512];
 char    *scriptbuffer,*script_p,*scriptend_p;
 int     scriptline;
 boolean endofscript;
@@ -63,7 +63,7 @@
 
 	size = LoadFile (filename, (void **)&scriptbuffer);
 
-   strcpy(&scriptfilename[0],filename);
+	snprintf(scriptfilename, sizeof(scriptfilename), "%s", filename);
 	script_p = scriptbuffer;
 	scriptend_p = script_p + size;
 	scriptline = 1;

rott-1.0-registered.patch:

--- NEW FILE rott-1.0-registered.patch ---
--- rott-1.0/rott/develop.h~	2007-05-11 10:24:32.000000000 +0200
+++ rott-1.0/rott/develop.h	2007-05-11 10:24:32.000000000 +0200
@@ -41,8 +41,8 @@
 
 #define BNACRASHPREVENT  1 //bna added 
 // Make sure only one of the following are on at one time
-#define SHAREWARE   1
-#define SUPERROTT   0
+#define SHAREWARE   0
+#define SUPERROTT   1
 #define SITELICENSE 0
 
 // cute little dopefish thing, only works with special patch?

rott-1.0-winrott-fixes.patch:

--- NEW FILE rott-1.0-winrott-fixes.patch ---
diff -ur rott-1.0.orig/README rott-1.0/README
--- rott-1.0.orig/README	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/README	2007-05-10 13:55:24.000000000 +0200
@@ -55,8 +55,6 @@
 ------------
 
 - Demos go out of sync.
-- DOS border coloring not implemented.
-- Screen shake from DOS version not implemented.
 - No netplay support.
 
 
diff -ur rott-1.0.orig/rott/WinRott.h rott-1.0/rott/WinRott.h
--- rott-1.0.orig/rott/WinRott.h	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/WinRott.h	2007-05-10 13:55:24.000000000 +0200
@@ -17,6 +17,10 @@
 
 extern int iGLOBAL_FOCALWIDTH;
 extern double dGLOBAL_FPFOCALWIDTH;
+
+void EnableScreenStretch(void);
+void DisableScreenStretch(void);
+
 /*
 double dYZANGLELIMIT;
 
diff -ur rott-1.0.orig/rott/cin_efct.c rott-1.0/rott/cin_efct.c
--- rott-1.0.orig/rott/cin_efct.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/cin_efct.c	2007-05-10 13:55:24.000000000 +0200
@@ -308,7 +308,9 @@
 
    DrawBlankScreen ( );
 
+#ifdef DOS
    VL_SetVGAPlaneMode ();
+#endif
 
    CinematicSetPalette (curpal);
 
@@ -885,6 +887,7 @@
    int i;
    int plane;
    byte src[200];
+   int width = StretchScreen? 320:iGLOBAL_SCREENWIDTH;
 
    DrawClearBuffer ();
 
@@ -898,9 +901,9 @@
       VGAWRITEMAP(plane);
 
 #ifdef DOS
-      for (i=plane;i<iGLOBAL_SCREENWIDTH;i+=4,buf++)
+      for (i=plane;i<width;i+=4,buf++)
 #else
-      for (i=0;i<iGLOBAL_SCREENWIDTH;i++,buf++)
+      for (i=0;i<width;i++,buf++)
 #endif
          {
          DrawFilmPost(buf,&src[0],200);
@@ -924,6 +927,7 @@
    int i;
    int plane;
    int height;
+   int width = StretchScreen? 320:iGLOBAL_SCREENWIDTH;
 
    pic=(lpic_t *)W_CacheLumpNum(lumpnum,PU_CACHE, Cvt_lpic_t, 1);
 
@@ -942,9 +946,9 @@
       VGAWRITEMAP(plane);
 
 #ifdef DOS
-      for (i=plane;i<iGLOBAL_SCREENWIDTH;i+=4,src+=(pic->height<<2),buf++)
+      for (i=plane;i<width;i+=4,src+=(pic->height<<2),buf++)
 #else
-      for (i=0;i<iGLOBAL_SCREENWIDTH;i++,src+=pic->height,buf++)
+      for (i=0;i<width;i++,src+=pic->height,buf++)
 #endif
          {
          DrawFilmPost(buf,src,height);
diff -ur rott-1.0.orig/rott/isr.c rott-1.0/rott/isr.c
--- rott-1.0.orig/rott/isr.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/isr.c	2007-05-10 13:55:24.000000000 +0200
@@ -801,7 +801,7 @@
    delay=(VBLCOUNTER*delay)/10;
    IN_ClearKeysDown();
    time=GetTicCount();
-   while (!LastScan && GetTicCount()<time+delay)
+   while (!LastScan && !IN_GetMouseButtons() && GetTicCount()<time+delay)
       {
       	IN_UpdateKeyboard();
       }
diff -ur rott-1.0.orig/rott/modexlib.c rott-1.0/rott/modexlib.c
--- rott-1.0.orig/rott/modexlib.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/modexlib.c	2007-05-10 13:55:24.000000000 +0200
@@ -38,16 +38,14 @@
 //MED
 #include "memcheck.h"
 #include "rt_util.h"
+#include "rt_net.h" // for GamePaused
 
-void    SchrinkMemPicture();
-void StrechMemPicture ();
-void StrechFlipMemPicture ();
+static void StretchMemPicture ();
 // GLOBAL VARIABLES
 
-boolean StrechScreen=true;//bná++
-extern char *tmpPICbuf;
-char *sdl_surfacePTR;
-extern int iG_aimCross;
+boolean StretchScreen=0;//bná++
+extern boolean iG_aimCross;
+extern boolean sdl_fullscreen;
 extern int iG_X_center;
 extern int iG_Y_center;
 char 	   *iG_buf_center;
@@ -421,7 +419,7 @@
 ====================
 */
 static SDL_Surface *sdl_surface = NULL;
-static SDL_Surface *sdl_backbuf = NULL;
+static SDL_Surface *unstretch_sdl_surface = NULL;
 
 void GraphicsMode ( void )
 {
@@ -441,6 +439,8 @@
     SDL_WM_SetCaption ("Rise of the Triad", "ROTT");
     SDL_ShowCursor (0);
 //    sdl_surface = SDL_SetVideoMode (320, 200, 8, flags);
+    if (sdl_fullscreen)
+        flags = SDL_FULLSCREEN;
     sdl_surface = SDL_SetVideoMode (iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT, 8, flags);    
 	if (sdl_surface == NULL)
 	{
@@ -538,6 +538,8 @@
 	bufofsTopLimit =  bufferofs + screensize - iGLOBAL_SCREENWIDTH;
 	bufofsBottomLimit = bufferofs + iGLOBAL_SCREENWIDTH;
 
+    // start stretched
+    EnableScreenStretch();
     XFlipPage ();
 }
 
@@ -686,8 +688,8 @@
 void VH_UpdateScreen (void)
 { 	
 
-	if ((StrechScreen==true)&&(iGLOBAL_SCREENWIDTH > 320)){//bna++
-		StrechMemPicture ();
+	if (StretchScreen){//bna++
+		StretchMemPicture ();
 	}else{
 		DrawCenterAim ();
 	}
@@ -719,8 +721,8 @@
    if (bufferofs > page3start)
       bufferofs = page1start;
 #else
- 	if ((StrechScreen==true)&&(iGLOBAL_SCREENWIDTH > 320)){//bna++
-		StrechMemPicture ();
+ 	if (StretchScreen){//bna++
+		StretchMemPicture ();
 	}else{
 		DrawCenterAim ();
 	}
@@ -732,154 +734,59 @@
 #endif
 
 
-
-
-
-
-// bna section -------------------------------------------
-void StrechMemPicture ()
+void EnableScreenStretch(void)
 {
-
-		//strech mem //	   SetTextMode (  );
-   		byte *source,*target,*tmp,*tmp2;
-		int x,y,x1,y1;
-		int cnt,NbOfLines;
-		float Yratio,Xratio,old;
-
-		//strech pixels in X direction
-		source = ( byte * )( sdl_surface->pixels);//store screen in tmp pic mem
-		sdl_surfacePTR = source;
-		memcpy( tmpPICbuf, source, (200*iGLOBAL_SCREENWIDTH) );
-
-		source = tmpPICbuf;
-		target = ( byte * )( sdl_surface->pixels);//screen buffer
-
-	    Xratio = iGLOBAL_SCREENWIDTH * 10/ 320;
-		Xratio = (Xratio/10);
-		cnt = (int)Xratio; 
-		Xratio = (Xratio - cnt)/2; 
-		old = 0;
-
-		for (y=0;y<200;y++){
-			tmp = source;
-			tmp2 = target;
-			//write pixel x and x-1 in line 1
-			for (x=0;x<320;x++){
-				for (x1=0;x1<cnt;x1++){
-					//copy one pixel ----------------------
-					*(target++) = *(source) ;
-					old += Xratio;
-					//-----------------------------------
-					if (old > 1) {
-						//copy extra pixel
-						*(target++) = *(source) ;				
-						old -= 1;
-					}
-				}
-				source++;
-			}
-			source = tmp + iGLOBAL_SCREENWIDTH;
-			target = tmp2 + iGLOBAL_SCREENWIDTH;
-		}
-
-		//strech lines in Y direction
-		source = ( byte * )( sdl_surface->pixels);//store screen in tmp pic mem
-		memcpy( tmpPICbuf, source, (200*iGLOBAL_SCREENWIDTH) );
-
-		source = tmpPICbuf;
-		target = ( byte * )( sdl_surface->pixels);//screen buffer
-
-		Yratio = iGLOBAL_SCREENHEIGHT * 10/ 200;//we shall strech 200 lines to 480/600
-		Yratio = (Yratio/10);
-		cnt = (int)Yratio; //2
-		Yratio = (Yratio - cnt)/2; //.2
-		NbOfLines=0;//make sure we dont exeed iGLOBAL_SCREENHEIGHT or we get a crash
-		old = 0;
-
-		for (y=0;y<200;y++){
-			for (y1=0;y1<cnt;y1++){
-				//copy one line ----------------------
-				memcpy(target, source,iGLOBAL_SCREENWIDTH);
-				if (NbOfLines++ >= iGLOBAL_SCREENHEIGHT-1){goto stopx;}
-				target += (iGLOBAL_SCREENWIDTH);
-				old += Yratio;
-				//-----------------------------------
-				if (old > 1) {
-					//copy extra line
-					memcpy(target, source,iGLOBAL_SCREENWIDTH);				
-					if (NbOfLines++ >= iGLOBAL_SCREENHEIGHT-1){goto stopx;}
-					target += (iGLOBAL_SCREENWIDTH);
-					old -= 1;
-				}
-			}
-			source += iGLOBAL_SCREENWIDTH;
-		}
-stopx:;
-
-
-
-
+   int i,offset;
+   
+   if (iGLOBAL_SCREENWIDTH <= 320 || StretchScreen) return;
+   
+   if (unstretch_sdl_surface == NULL)
+   {
+      /* should really be just 320x200, but there is code all over the
+         places which crashes then */
+      unstretch_sdl_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+         iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT, 8, 0, 0, 0, 0);
+   }
+	
+   displayofs = unstretch_sdl_surface->pixels +
+	(displayofs - (byte *)sdl_surface->pixels);
+   bufferofs  = unstretch_sdl_surface->pixels;
+   page1start = unstretch_sdl_surface->pixels;
+   page2start = unstretch_sdl_surface->pixels;
+   page3start = unstretch_sdl_surface->pixels;
+   StretchScreen = 1;	
 }
 
+void DisableScreenStretch(void)
+{
+   if (iGLOBAL_SCREENWIDTH <= 320 || !StretchScreen) return;
+	
+   displayofs = sdl_surface->pixels +
+	(displayofs - (byte *)unstretch_sdl_surface->pixels);
+   bufferofs  = sdl_surface->pixels;
+   page1start = sdl_surface->pixels;
+   page2start = sdl_surface->pixels;
+   page3start = sdl_surface->pixels;
+   StretchScreen = 0;
+}
 
-void SchrinkMemPicture( byte * source)
-{ 
-	//schrink mem picure and plce it in tmpPICbuf
-   	byte *target,*tmp,*tmp2;
-	int x,y;
-	int cnt,NbOfLines;
-	float Yratio,Xratio,old;
-
-	target = tmpPICbuf;
-
-    Xratio = iGLOBAL_SCREENWIDTH * 10/ 320;
-	Xratio = (Xratio/10);
-	cnt = (int)Xratio; //2
-	Xratio = (Xratio - cnt)/2; //.2
-	old = 0;	
 
-	// delte redunted pixels
-	for (y=0;y<iGLOBAL_SCREENHEIGHT;y++){
-		tmp = source;
-		tmp2 = target;
-		for (x=0;x<iGLOBAL_SCREENWIDTH;x++){
-			//copy 1 pixel
-			*(target++) = *(source) ;
-			source += cnt;
-			old += Xratio;
-			if (old >= 1) {
-				source++;
-				old -= 1;
-			}
-		}
-		source = tmp + iGLOBAL_SCREENWIDTH;
-		target = tmp2 + iGLOBAL_SCREENWIDTH;
-	}
-	//delete every redunted lines
-	source = tmpPICbuf;//+(1* iGLOBAL_SCREENWIDTH);
-	target = tmpPICbuf;
-
-	Yratio = iGLOBAL_SCREENHEIGHT * 10 / 200;//we shall schrink 480/600 lines to 200  
-	Yratio = (Yratio/10);
-	cnt = (int)Yratio; //2
-	Yratio = (Yratio - cnt); //.2
-	NbOfLines=0;//make sure we dont exeed iGLOBAL_SCREENHEIGHT or we get a crash
-	old = 0;
-//SetTextMode (  );
-	for (y=0;y<200;y++){
-		//if (source > (tmpPICbuf+(iGLOBAL_SCREENWIDTH*iGLOBAL_SCREENHEIGHT))){goto stopy;}
-		memcpy(target, source, iGLOBAL_SCREENWIDTH);	
-		source += (cnt * iGLOBAL_SCREENWIDTH);
-		old += Yratio;
-		if (old > 1) {
-			//delte extra line
-			source += iGLOBAL_SCREENWIDTH;
-			old -= 1;
-		}
-		target += iGLOBAL_SCREENWIDTH;
-	}
-
-//stopy:;	
+// bna section -------------------------------------------
+static void StretchMemPicture ()
+{
+  SDL_Rect src;
+  SDL_Rect dest;
+	
+  src.x = 0;
+  src.y = 0;
+  src.w = 320;
+  src.h = 200;
+  
+  dest.x = 0;
+  dest.y = 0;
+  dest.w = iGLOBAL_SCREENWIDTH;
+  dest.h = iGLOBAL_SCREENHEIGHT;
+  SDL_SoftStretch(unstretch_sdl_surface, &src, sdl_surface, &dest);
 }
 
 // bna function added start
@@ -889,7 +796,7 @@
 void DrawCenterAim ()
 {
 	int x;
-	if (iG_aimCross > 0){
+	if (iG_aimCross && !GamePaused){
 		if (( ingame == true )&&(iGLOBAL_SCREENWIDTH>320)){
 			  if ((iG_playerTilt <0 )||(iG_playerTilt >iGLOBAL_SCREENHEIGHT/2)){
 					iG_playerTilt = -(2048 - iG_playerTilt);
@@ -913,7 +820,7 @@
 				  }
 			  }
 			  for (x=4;x<=10;x++){
-				  if (((iG_buf_center-(x*iGLOBAL_SCREENWIDTH)+iG_X_center) < bufofsTopLimit)&&((iG_buf_center-(x*iGLOBAL_SCREENWIDTH)+iG_X_center) > bufofsBottomLimit)){
+				  if (((iG_buf_center+(x*iGLOBAL_SCREENWIDTH)+iG_X_center) < bufofsTopLimit)&&((iG_buf_center+(x*iGLOBAL_SCREENWIDTH)+iG_X_center) > bufofsBottomLimit)){
 					 *(iG_buf_center+(x*iGLOBAL_SCREENWIDTH)+iG_X_center) = 75;
 				  }
 			  }
diff -ur rott-1.0.orig/rott/modexlib.h rott-1.0/rott/modexlib.h
--- rott-1.0.orig/rott/modexlib.h	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/modexlib.h	2007-05-10 13:55:24.000000000 +0200
@@ -108,7 +108,7 @@
 #define PEL_DATA                0x3c9
 #endif
 
-extern  boolean StrechScreen;//bná++
+extern  boolean StretchScreen;//bná++
 
 //extern  int      ylookup[MAXSCREENHEIGHT];      // Table of row offsets
 extern  int      ylookup[600];      // just set to max res
diff -ur rott-1.0.orig/rott/rt_cfg.c rott-1.0/rott/rt_cfg.c
--- rott-1.0.orig/rott/rt_cfg.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_cfg.c	2007-05-10 13:55:24.000000000 +0200
@@ -91,6 +91,7 @@
 //******************************************************************************
 
 extern int G_weaponscale;
+extern boolean iG_aimCross;
 
 boolean WriteSoundFile   = true;
 
@@ -109,6 +110,7 @@
 boolean usemouselook     = 0;
 int     inverse_mouse    = 1; //set  to -1 to invert mouse
 boolean usejump          = 0;
+boolean sdl_fullscreen   = 1;
 
 boolean joystickenabled  = 0;
 boolean joypadenabled    = 0;
@@ -507,6 +509,9 @@
 	  // Read in UseJump
       ReadBoolean("UseJump",&usejump);
 
+      // Read in CrossHair
+      ReadBoolean("CrossHair",&iG_aimCross);
+
       // Read in JoystickEnabled
       ReadBoolean("JoystickEnabled",&joystickenabled);
 
@@ -516,6 +521,13 @@
       // Read in JoystickPort
 
       ReadInt("JoystickPort",&joystickport);
+      
+      // Read in fullscreen
+      ReadBoolean("FullScreen", &sdl_fullscreen);
+      
+      // Read in resolution
+      ReadInt("ScreenWidth", &iGLOBAL_SCREENWIDTH);
+      ReadInt("ScreenHeight", &iGLOBAL_SCREENHEIGHT);
 
       // Read in ViewSize
 
@@ -1725,6 +1737,12 @@
    SafeWriteString(file,"; 0 - usejump Disabled\n");
    WriteParameter(file,"UseJump          ",usejump);
 
+   // Write out CrossHair
+   SafeWriteString(file,"\n;\n");
+   SafeWriteString(file,"; 1 - CrossHair Enabled\n");
+   SafeWriteString(file,"; 0 - CrossHair Disabled\n");
+   WriteParameter(file,"CrossHair        ", iG_aimCross);
+
    // Write out JoystickEnabled
 
    SafeWriteString(file,"\n;\n");
@@ -1746,6 +1764,19 @@
    SafeWriteString(file,"; 1 - Use Joystick Port 2\n");
    WriteParameter(file,"JoystickPort     ",joystickport);
 
+   // Write out fullscreen
+   SafeWriteString(file,"\n;\n");
+   SafeWriteString(file,"; 0 - Start in windowed mode\n");
+   SafeWriteString(file,"; 1 - Start in fullscreen mode\n");
+   WriteParameter(file,"FullScreen       ",sdl_fullscreen);
+      
+   // Write out resolution
+   SafeWriteString(file,"\n;\n");
+   SafeWriteString(file,"; Screen Resolution, supported resolutions: \n");
+   SafeWriteString(file,"; 320x200, 640x480 and 800x600\n");
+   WriteParameter(file,"ScreenWidth      ",iGLOBAL_SCREENWIDTH);
+   WriteParameter(file,"ScreenHeight     ",iGLOBAL_SCREENHEIGHT);
+
    // Write out ViewSize
 
    SafeWriteString(file,"\n;\n");
diff -ur rott-1.0.orig/rott/rt_debug.c rott-1.0/rott/rt_debug.c
--- rott-1.0.orig/rott/rt_debug.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_debug.c	2007-05-10 13:55:24.000000000 +0200
@@ -47,7 +47,7 @@
 #include "w_wad.h"
 
 extern int		iDemoNames;
-extern int iG_aimCross;
+extern boolean iG_aimCross;
 
 
 extern void DisplayMessage   (int num,int position);
@@ -424,7 +424,7 @@
    int level;
 
 
-	StrechScreen=true;//bna++ shut on streech mode
+	EnableScreenStretch();//bna++ shut on streech mode
 
 
    MU_StoreSongPosition();
@@ -445,13 +445,13 @@
 		pic_t *shape;
 		shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
 		DrawTiledRegion( 0, 16, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT - 32, 0, 16, shape );
-		StrechScreen=false;//dont strech when we go BACK TO GAME
+		DisableScreenStretch();//dont strech when we go BACK TO GAME
 		DrawPlayScreen(true);//repaint ammo and life stat
 		VW_UpdateScreen ();//update screen
   }
    //bna section end
 
-	StrechScreen=true;//bna++ shut on streech mode
+	EnableScreenStretch();//bna++ shut on streech mode
    while( Keyboard[ sc_Escape ] )
       {
 		IN_UpdateKeyboard();
@@ -475,7 +475,7 @@
       }
    else
       {
-	   StrechScreen=false;//dont strech when we go BACK TO GAME
+	   DisableScreenStretch();//dont strech when we go BACK TO GAME
       SetupScreen(true);
       }
 
@@ -494,7 +494,7 @@
 
    {
 	if (iGLOBAL_SCREENWIDTH > 320) {
-		StrechScreen=true;//bna++ shut on streech mode
+		EnableScreenStretch();//bna++ shut on streech mode
 	}
    StopWind();
    ShutdownClientControls();
@@ -512,7 +512,7 @@
 		pic_t *shape;
 		shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
 		DrawTiledRegion( 0, 16, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT - 32, 0, 16, shape );
-		StrechScreen=false;//dont strech when we go BACK TO GAME
+		DisableScreenStretch();//dont strech when we go BACK TO GAME
 		DrawPlayScreen(true);//repaint ammo and life stat
 		VW_UpdateScreen ();//update screen
   }
@@ -707,7 +707,7 @@
 
 void RestartNormal (void)
 {
-	StrechScreen=true;//bna
+	EnableScreenStretch();//bna
 	DoNormalThing ();
 
    AddMessage ("Restart to level 1", MSG_CHEAT);
@@ -1037,7 +1037,7 @@
 	IN_ClearKeyboardQueue ();
 
    StartupClientControls();
-   StrechScreen = false;
+   DisableScreenStretch();
 }
 
 
@@ -1082,7 +1082,7 @@
       if ((level > 0) && (level < 9))
 #endif
          {
-			StrechScreen=true;//bna
+			EnableScreenStretch();//bna
 			 gamestate.mapon = level-1;
 			 playstate = ex_demorecord;
          }
@@ -1140,7 +1140,7 @@
 
    StartupClientControls();
 
-   StrechScreen = true;
+   EnableScreenStretch();
 }
 
 /*
diff -ur rott-1.0.orig/rott/rt_draw.c rott-1.0/rott/rt_draw.c
--- rott-1.0.orig/rott/rt_draw.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_draw.c	2007-05-10 13:55:24.000000000 +0200
@@ -80,8 +80,6 @@
 =============================================================================
 */
 
-extern char *tmpPICbuf;
-extern char *sdl_surfacePTR;
 int iG_masked;
 
 int whereami=-1;
@@ -3073,7 +3071,7 @@
    shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
    DrawTiledRegion( 0, 16, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT - 32, 0, 16, shape );//bna++
    DrawPlayScreen(false);
-   StrechScreen = false;
+   DisableScreenStretch();
    SHAKETICS = 0xFFFF;
    //bna section end
 }
@@ -3136,7 +3134,7 @@
       //memset(RotatedImage,0xff,131072*8);
 
       if ((masked == false)&&(iGLOBAL_SCREENWIDTH == 800)) {
-		StrechScreen = false;
+		DisableScreenStretch();
 		// SetTextMode (  );
 
 		k=(28*512);//14336;
@@ -3152,7 +3150,7 @@
 			   //k+=512*2;
 		   }
 	  }else if ((masked == false)&&(iGLOBAL_SCREENWIDTH == 640)) {
-		StrechScreen = false;
+		DisableScreenStretch();
 		k=(28*512);//14336;
 		   for (a=0;a<iGLOBAL_SCREENHEIGHT;a++){
 			   for (b=0;b<iGLOBAL_SCREENWIDTH;b++){
@@ -3216,7 +3214,7 @@
 
    time = time;
 ////zxcv
-	StrechScreen=false;//bna++
+	DisableScreenStretch();//bna++
 
 
    anglestep=((endangle-startangle)<<16)/time;
@@ -3250,7 +3248,7 @@
 	   pic_t *shape;
 	   shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
 	   DrawTiledRegion( 0, 16, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT - 32, 0, 16, shape );//bna++
-	   StrechScreen=false;//dont strech when we go BACK TO GAME
+	   DisableScreenStretch();//dont strech when we go BACK TO GAME
 	   DrawPlayScreen(true);//repaint ammo and life stat
   }
 }
@@ -3675,7 +3673,7 @@
 #define MAXSPEED  8
 void UpdateScreenSaver ( void )
 {
-	//StrechScreen = true;
+	//EnableScreenStretch();
    if (ScreenSaver->time!=-1)
       {
       ScreenSaver->time-=tics;
@@ -4367,7 +4365,7 @@
    int i;
 
    byte pal[768];
-	StrechScreen = true;
+	EnableScreenStretch();
 
    viewwidth = 320;//MAXSCREENWIDTH;
    viewheight = 200;//MAXSCREENHEIGHT;
@@ -5532,7 +5530,7 @@
 
 void DoEndCinematic ( void )
 {
-	StrechScreen = true;
+	EnableScreenStretch();
 
    viewwidth = 320;//MAXSCREENWIDTH;
    viewheight = 200;//MAXSCREENHEIGHT;
@@ -5768,7 +5766,7 @@
    byte * bkgnd;
    font_t * oldfont;
    int i;
-	StrechScreen = true;
+	EnableScreenStretch();
    viewwidth = 320;//MAXSCREENWIDTH;
    viewheight = 200;//MAXSCREENHEIGHT;
 
diff -ur rott-1.0.orig/rott/rt_game.c rott-1.0/rott/rt_game.c
--- rott-1.0.orig/rott/rt_game.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_game.c	2007-05-10 13:55:24.000000000 +0200
@@ -95,7 +95,6 @@
                {"Jim",20000,2,1},
                {"Steve",10000,1,1},
             };
-extern char *tmpPICbuf;
 
 //******************************************************************************
 //
@@ -1109,6 +1108,7 @@
       tempbuf=bufferofs;
       bufferofs=page1start;
       VW_DrawPropString (str);
+#ifdef DOS
       px=x;
       py=y;
       bufferofs=page2start;
@@ -1117,6 +1117,7 @@
       py=y;
       bufferofs=page3start;
       VW_DrawPropString (str);
+#endif
       bufferofs=tempbuf;
       }
 }
@@ -3421,11 +3422,11 @@
    EndBonusSkip       = false;
    EndBonusStartY     = 90;
 
-   StrechScreen=true;
+   EnableScreenStretch();
    tmpPic = ( pic_t * )W_CacheLumpName( "mmbk", PU_CACHE, Cvt_pic_t, 1 );
    VWB_DrawPic( 0, 0, tmpPic );
    VW_UpdateScreen();
-   StrechScreen=false;
+   DisableScreenStretch();
 
    IN_StartAck();
    EndBonusVoice = 0;
@@ -3531,9 +3532,9 @@
    picbuf = (byte *)SafeMalloc (64000);
    memcpy(picbuf ,bufferofs ,64000);
 
-   StrechScreen=true;
+   EnableScreenStretch();
    VW_UpdateScreen();//tmpPICbuf is destroyed here
-   StrechScreen=false;
+   DisableScreenStretch();
    //copy it back
 
    memcpy(bufferofs ,picbuf , 64000);
@@ -3758,9 +3759,9 @@
     
 
 	//bna section 
-    StrechScreen=true;//bna++
+    EnableScreenStretch();//bna++
     VW_UpdateScreen();//bna++
-//    StrechScreen=false;//bna++
+//    DisableScreenStretch();//bna++
 	//bna section end
 
 
@@ -4211,7 +4212,7 @@
    int Player;
    char text[80];
 
-   StrechScreen=true;
+   EnableScreenStretch();
 
    IN_ClearKeysDown ();
 
diff -ur rott-1.0.orig/rott/rt_in.c rott-1.0/rott/rt_in.c
--- rott-1.0.orig/rott/rt_in.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_in.c	2007-05-10 14:00:55.000000000 +0200
@@ -104,6 +104,7 @@
 static word sdl_sticks_joybits = 0;
 static int sdl_mouse_grabbed = 0;
 static unsigned int scancodes[SDLK_LAST];
+extern boolean sdl_fullscreen;
 #endif
 
 
@@ -213,7 +214,7 @@
     } /* if */
     else
     {
-        if (sdl_mouse_grabbed)
+        if (sdl_mouse_grabbed || sdl_fullscreen)
         {
           	mouse_relative_x = event->motion.xrel;
        	    mouse_relative_y = event->motion.yrel;
@@ -459,11 +460,14 @@
          (event->key.state == SDL_PRESSED) &&
          (event->key.keysym.mod & KMOD_CTRL) )
     {
+      if (!sdl_fullscreen)
+      {
         sdl_mouse_grabbed = ((sdl_mouse_grabbed) ? 0 : 1);
         if (sdl_mouse_grabbed)
             grab_mode = SDL_GRAB_ON;
         SDL_WM_GrabInput(grab_mode);
-        return(0);
+      }
+      return(0);
     } /* if */
 
     else if ( ( (event->key.keysym.sym == SDLK_RETURN) ||
@@ -471,15 +475,19 @@
               (event->key.state == SDL_PRESSED) &&
               (event->key.keysym.mod & KMOD_ALT) )
     {
-        SDL_Surface *surface = SDL_GetVideoSurface();
-        if (surface != NULL)
-        {
-            Uint32 sdl_flags = surface->flags;
-            attempt_fullscreen_toggle(&surface, &sdl_flags);
-        } /* if */
+        if (SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()))
+            sdl_fullscreen ^= 1;
         return(0);
     } /* if */
 
+    /* HDG: put this above the scancode lookup otherwise it is never reached */
+    if ( (event->key.keysym.sym == SDLK_PAUSE) &&
+         (event->key.state == SDL_PRESSED))
+    {
+        PausePressed = true;
+        return(0);
+    }
+
     k = handle_keypad_enter_hack(event);
     if (!k)
     {
@@ -487,14 +495,14 @@
         if (!k)   /* No DOS equivalent defined. */
             return(0);
     } /* if */
-
-    if (event->key.state == SDL_RELEASED)
+    
+    /* Fix elweirdo SDL capslock/numlock handling, always treat as press */
+    if ( (event->key.keysym.sym != SDLK_CAPSLOCK) &&
+         (event->key.keysym.sym != SDLK_NUMLOCK)  &&
+         (event->key.state == SDL_RELEASED) )
         k += 128;  /* +128 signifies that the key is released in DOS. */
 
-    if (event->key.keysym.sym == SDLK_PAUSE)
-        PausePressed = true;
-
-    else if (event->key.keysym.sym == SDLK_SCROLLOCK)
+    if (event->key.keysym.sym == SDLK_SCROLLOCK)
         PanicPressed = true;
 
     else
@@ -1120,7 +1128,9 @@
     scancodes[SDLK_HOME]            = sc_Home;
     scancodes[SDLK_UP]              = sc_UpArrow;
     scancodes[SDLK_PAGEUP]          = sc_PgUp;
-    scancodes[SDLK_KP_MINUS]        = 0xE04A;
+    // Make this a normal minus, for viewport changing
+    //scancodes[SDLK_KP_MINUS]        = 0xE04A;
+    scancodes[SDLK_KP_MINUS]        = sc_Minus;
     scancodes[SDLK_KP4]             = sc_LeftArrow;
     scancodes[SDLK_KP5]             = 0x4C;
     scancodes[SDLK_KP6]             = sc_RightArrow;
diff -ur rott-1.0.orig/rott/rt_main.c rott-1.0/rott/rt_main.c
--- rott-1.0.orig/rott/rt_main.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_main.c	2007-05-10 14:33:10.000000000 +0200
@@ -164,7 +164,8 @@
 //extern char G_argv[30][80];
 int G_weaponscale;
 extern int iDropDemo;
-extern int iG_aimCross;
+extern boolean iG_aimCross;
+extern boolean sdl_fullscreen;
 
 extern void ComSetTime ( void );
 extern void VH_UpdateScreen (void);
@@ -220,8 +221,6 @@
    gamestate.Product = ROTT_REGISTERED;
 #endif
 
-   SetRottScreenRes (640, 480);
-
    DrawRottTitle ();
    gamestate.randomseed=-1;
 
@@ -248,6 +247,8 @@
       GetMenuInfo ();
       }
 
+   SetRottScreenRes (iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT);
+   
 //   if (modemgame==true)
 //      {
 //      SCREENSHOTS=true;
@@ -571,6 +572,20 @@
       SetTextMode ();
       printf ("Rise of the Triad  (c) 1995 Apogee Software\n\n");
       printf ("COMMAND LINE PARAMETERS\n");
+      printf ("   AIM        - Give Aim Crosshair.\n");
+      printf ("   FULLSCREEN - Start in fullscreen mode\n");
+      printf ("   WINDOW     - Start in windowed mode\n");
+      printf ("   RESOLUTION - Specify the screen resolution to use\n");
+      printf ("              - next param is <widthxheight>, valid resolutions are:\n");
+      printf ("              - 320x200, 640x480 and 800x600\n");
+#if (SHAREWARE==0)
+      printf ("   FILERTL    - used to load Userlevels (RTL files)\n");
+      printf ("              - next parameter is RTL filename\n");
+      printf ("   FILERTC    - used to load Battlelevels (RTC files)\n");
+      printf ("              - next parameter is RTC filename\n");
+      printf ("   FILE       - used to load Extern WAD files\n");
+      printf ("              - next parameter is WAD filename\n");
+#endif
       printf ("   SPACEBALL  - Enable check for Spaceball.\n");
       printf ("   NOJOYS     - Disable check for joystick.\n");
       printf ("   NOMOUSE    - Disable check for mouse.\n");
@@ -593,6 +608,57 @@
       printf ("   MAXTIMELIMIT - Maximimum time to count down from\n");
       printf ("                next paramater is time in seconds\n");
       printf ("   DOPEFISH   - ?\n");
+      printf (" \n");
+      printf ("CONTROLS\n");
+      printf ("         Arrows           - Move\n");
+      printf ("         Ctrl             - Fire\n");
+      printf ("         Comma/Alt+left   - Sidestep Left\n");
+      printf ("         Period/Alt+right - Sidestep Right\n");
+      printf ("         Shift            - Run/Turn faster\n");
+      printf ("         Space            - Use/Open\n");
+      printf ("         1-4              - Choose Weapon\n");
+      printf ("         5-6              - Scale Weapon Up/Down\n");
+      printf ("         Enter            - Swap Weapon\n");
+      printf ("         Backspace        - Turn 180\n");
+      printf ("         Delete           - Drop Weapon\n");
+      printf ("         +/-              - Change Viewsize\n");
+      printf ("         PgUp/PgDn        - Look Up/Down\n");
+      printf ("         Home/End         - Aim Up/Down\n");
+      printf ("         [ ]              - Sound Volumen\n");
+      printf ("         ( )              - Music Volumen\n");
+      printf ("         Tab              - Enter Automapper\n");
+      printf (" \n");
+      printf ("AUTO-MAPPER\n");
+      printf ("         Arrows           - Scroll around\n");
+      printf ("         PgUp             - Zoom Out\n");
+      printf ("         PgDn             - Zoom In\n");
+      printf ("         Tab              - Exit Auto-Mapper\n");
+      printf (" \n");
+      printf ("HOTKEYS\n");
+      printf ("         F1               - Help\n");
+      printf ("         F2               - Save Game\n");
+      printf ("         F3               - Restore Game\n");
+      printf ("         F4               - Controls/Sound/Music\n");
+      printf ("         F5               - Change Detail Level\n");
+      printf ("         F6               - Quick Save\n");
+      printf ("         F7               - Messages On/Off\n");
+      printf ("         F8               - End Game\n");
+      printf ("         F9               - Quick Load\n");
+      printf ("         F10              - Quit\n");
+      printf ("         F11              - Gamma Correction\n");
+      printf (" \n");
+      printf ("COMM-BAT\n");
+      printf ("         F1 - F10         - RemoteRidicule(tm) sounds\n");
+      printf ("         F12              - Live RemoteRidicule\n");
+      printf ("         T                - Type message to all\n");
+      printf ("         Z                - Type directed message\n");
+      printf ("         Tab              - Toggle KillCount display\n");
+      printf (" \n");
+      printf ("SCREENSHOOT\n");
+#ifdef DOS /* makes no sense under Linux as there are no lbm viewers there */
+      printf ("         Alt+V            - Screenshoot in LBM format\n");
+#endif
+      printf ("         Alt+C            - Screenshoot in PCX format\n");
       exit (0);
       }
 
@@ -738,25 +804,49 @@
 void SetupWads( void )
 {
    char  *newargs[99];
-	int argnum = 0;
-#if (SHAREWARE==0)
-   int arg;
-#endif
+   int i, arg, argnum = 0;
    char tempstr[129];
+   char *PStrings[] = {"AIM", "FULLSCREEN", "WINDOW", "RESOLUTION", NULL };
 
-#if (SHAREWARE==0)
-
-
-   // Check for aimcross
-   arg = CheckParm ("aim");
-   if (arg!=0)
+   // These must be checked here so that they can override the cfg file
+   for (i = 1;i < _argc;i++)
    {
-		iG_aimCross = 1;
-   }else{
-		iG_aimCross = 0;
+      arg = US_CheckParm(_argv[i],PStrings);
+      switch(arg)
+      {
+         case 0:
+            iG_aimCross = 1;
+            break;
+         case 1:
+            sdl_fullscreen = 1;
+            break;
+         case 2:
+            sdl_fullscreen = 0;
+            break;
+         case 3:
+            i++;
+            if (i < _argc)
+            {
+               int width, height;
+               if ( (sscanf(_argv[i], "%dx%d", &width, &height) == 2) &&
+                    ( ( (width == 320) && (height == 200) ) ||
+                      ( (width == 640) && (height == 480) ) ||
+                      ( (width == 800) && (height == 600) ) ) )
+               {
+                 iGLOBAL_SCREENWIDTH  = width;
+                 iGLOBAL_SCREENHEIGHT = height;
+               }
+               else
+                  printf("Invalid resolution parameter: %s\n", _argv[i]);
+            }
+            else
+               printf("Missing resolution parameter\n");
+            break;
+      }
    }
 
 
+#if (SHAREWARE==0)
    // Check for rtl files 	
    arg = CheckParm ("filertl");
    if (arg!=0)
@@ -1049,7 +1139,7 @@
 		 
             BATTLE_Shutdown();
             MU_StartSong(song_title);
-			StrechScreen=true;
+			EnableScreenStretch();
             if ((NoWait==false)&&(!modemgame))
                {
                byte dimpal[768];
@@ -1095,9 +1185,7 @@
                      break;
                      }
 
-                  if (iGLOBAL_SCREENWIDTH > 320) { //need fixing, crashes by 320 ,bna
 					DoCreditScreen ();
-				  }
                   if ((!LastScan) && (!IN_GetMouseButtons()))
                      CheckHighScore (0, 0, false);
 #if (SHAREWARE==0)
@@ -1147,7 +1235,7 @@
          case ex_resetgame:
 
   // SetTextMode (  ); //12345678
-			 StrechScreen=true;//bna++ shut on streech mode 
+	    EnableScreenStretch();//bna++ shut on streech mode 
             InitCharacter();
 
             InitializeMessages();
@@ -1232,7 +1320,7 @@
             MenuFixup ();
             playstate=ex_stillplaying;
 
-			StrechScreen=false;//bna++ shut off streech mode
+	    DisableScreenStretch();//bna++ shut off streech mode
 
          break;
 
@@ -1257,7 +1345,7 @@
 //		   SetTextMode (  ); //12345678
             Died ();
             StopWind();
-			 StrechScreen=false;//bna++ shut off streech mode
+			 DisableScreenStretch();//bna++ shut off streech mode
             while (damagecount>0)
                DoBorderShifts();
 
@@ -1438,6 +1526,11 @@
             demoplayback = false;
 
             Z_FreeTags (PU_LEVELSTRUCT, PU_LEVELEND);       // Free current level
+            if (predemo_violence != -1)
+            {
+               gamestate.violence = predemo_violence;
+               predemo_violence = -1;
+            }
             playstate=ex_titles;
          break;
 
@@ -1486,7 +1579,7 @@
 
    {
 
-   StrechScreen=true;//bna++
+   EnableScreenStretch();//bna++
 
    if ( pickquick )
       {
@@ -1831,7 +1924,7 @@
 				pic_t *shape;
 				shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
 				DrawTiledRegion( 0, 16, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT - 32, 0, 16, shape );
-				StrechScreen=false;//dont strech when we go BACK TO GAME
+				DisableScreenStretch();//dont strech when we go BACK TO GAME
 				DrawPlayScreen(true);//repaint ammo and life stat
 				VW_UpdateScreen ();//update screen
 		  }
@@ -2319,6 +2412,7 @@
       // Shrink screen
       if ( Keyboard[ sc_Minus ] )
          {
+         Keyboard[ sc_Minus ] = false; // HDG debounce
          if ( viewsize > 0 )
             {
             viewsize--;
@@ -2329,6 +2423,7 @@
       // Expand screen
       if ( Keyboard[ sc_Plus ] )
          {
+         Keyboard[ sc_Plus ] = false; // HDG debounce
          if ( viewsize < MAXVIEWSIZES - 1 )
             {
             viewsize++;
@@ -2542,12 +2637,29 @@
             {
             SaveScreen( false );
             }
+#ifdef DOS /* makes no sense under Linux as there are no lbm viewers there */
          else if ( Keyboard[ sc_Alt] && Keyboard[ sc_V ] )
             {
             SaveScreen( true );
             }
+#endif
       #endif
       }
+#ifdef USE_SDL
+      /* SDL doesn't send proper release events for these */
+      if (Keystate[sc_CapsLock])
+      {
+         Keystate[sc_CapsLock]++;
+         if (Keystate[sc_CapsLock] == 3)
+            Keystate[sc_CapsLock] = 0;
+      }
+      if (Keystate[0x45]) /* numlock */ 
+      {
+         Keystate[0x45]++;
+         if (Keystate[0x45] == 3)
+            Keystate[0x45] = 0;
+      }
+#endif
    waminot();
    }
 
@@ -3082,14 +3194,22 @@
 
    if (saveLBM)
    {
-      WriteLBMfile (filename, buffer, 320, 200);
+      WriteLBMfile (filename, buffer, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT);
+#if (DEVELOPMENT == 1)
       while (Keyboard[sc_CapsLock] && Keyboard[sc_C])
+#else
+      while (Keyboard[sc_Alt] && Keyboard[sc_V])
+#endif
            IN_UpdateKeyboard ();
    }
    else
    {
       WritePCX (filename, buffer);
+#if (DEVELOPMENT == 1)
       while (Keyboard[sc_CapsLock] && Keyboard[sc_X])
+#else
+      while (Keyboard[sc_Alt] && Keyboard[sc_C])
+#endif
            IN_UpdateKeyboard ();
    }
 
diff -ur rott-1.0.orig/rott/rt_map.c rott-1.0/rott/rt_map.c
--- rott-1.0.orig/rott/rt_map.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_map.c	2007-05-10 13:55:24.000000000 +0200
@@ -898,7 +898,7 @@
    int quitkey;
    ControlInfo control;
 
-StrechScreen = true;//bna++
+EnableScreenStretch();//bna++
 
    ShutdownClientControls();
 
@@ -1041,7 +1041,7 @@
 	   pic_t *shape;
 	   shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
 	   DrawTiledRegion( 0, 16, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT - 32, 0, 16, shape );//bna++
-	   StrechScreen=false;//dont strech when we go BACK TO GAME
+	   DisableScreenStretch();//dont strech when we go BACK TO GAME
 	   VW_UpdateScreen ();
 	   DrawPlayScreen(true);//repaint ammo and life stat
 
diff -ur rott-1.0.orig/rott/rt_menu.c rott-1.0/rott/rt_menu.c
--- rott-1.0.orig/rott/rt_menu.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_menu.c	2007-05-10 13:55:24.000000000 +0200
@@ -38,6 +38,7 @@
 #include <io.h>
 #elif PLATFORM_UNIX
 #include <unistd.h>
+#include <SDL/SDL.h>
 #endif
 
 #include <sys/types.h>
@@ -132,8 +133,6 @@
 
 int quicksaveslot=-1;
 
-extern char *tmpPICbuf;
-
 //******************************************************************************
 //
 // LOCALS
@@ -753,17 +752,18 @@
    "MOUSELOOK",
    "INVERSE MOUSE",
    "CROSS HAIR",
-   "JUMPING"
-
+   "JUMPING",
+   "FULLSCREEN"
    };
-CP_iteminfo ExtOptionsItems = { 20, MENU_Y, 4, 0, 43, ExtOptionsNames, mn_largefont };
+CP_iteminfo ExtOptionsItems = { 20, MENU_Y, 5, 0, 43, ExtOptionsNames, mn_largefont };
 
 CP_itemtype ExtOptionsMenu[] =
 {
    {1, "", 'M', NULL},
    {1, "", 'I', NULL},
    {1, "", 'C', NULL},
-   {1, "", 'J', NULL}
+   {1, "", 'J', NULL},
+   {1, "", 'F', NULL}
 };
    
 //bna added end
@@ -1757,7 +1757,7 @@
    StartGame = false;
  
    SetUpControlPanel();
-   StrechScreen=true;
+   EnableScreenStretch();
    //
    // F-KEYS FROM WITHIN GAME
    //
@@ -1842,7 +1842,7 @@
    // Main menu loop.  "Exit options" or "New game" exits
    //
    StartGame = false;
-   StrechScreen=true;
+   EnableScreenStretch();
 
    while( !StartGame )
       {
@@ -1861,7 +1861,7 @@
                }
 
             StartGame = true;
-			StrechScreen=false;//bna++ shut off streech mode
+			DisableScreenStretch();//bna++ shut off streech mode
             break;
 
          case -1:
@@ -1894,7 +1894,7 @@
 {    
 
    MenuNum = 1;
-		StrechScreen=true;//bna++ shut off streech mode
+		EnableScreenStretch();//bna++ shut off streech mode
    //
    // CHANGE "GAME" AND "DEMO"
    //
@@ -2632,9 +2632,9 @@
 
    do
       {
-	  StrechScreen=true;//bna++
+	  EnableScreenStretch();//bna++
       DrawOrderInfo( page );
-	  StrechScreen=false;//bna++ turn off or screen will be strected every time it passes VW_UpdateScreen
+	  DisableScreenStretch();//bna++ turn off or screen will be strected every time it passes VW_UpdateScreen
       if ( newpage )
          {
          while( Keyboard[ key ] )
@@ -2699,7 +2699,7 @@
 
    Keyboard[ key ] = 0;
    LastScan = 0;
- StrechScreen=true;//bna++
+ EnableScreenStretch();//bna++
    MN_PlayMenuSnd( SD_ESCPRESSEDSND );
    }
 
@@ -3173,7 +3173,7 @@
 
    gamestate.battlemode = battle_StandAloneGame;
    StartGame = true;
-   StrechScreen=false;
+   DisableScreenStretch();
    playstate = ex_resetgame;
 
 
@@ -3201,7 +3201,7 @@
    action = CP_DisplayMsg( ENDGAMESTR, 12 );
 
    StartGame = false;
-   StrechScreen=true;
+   EnableScreenStretch();
    if ( action )
       {
       EndGameStuff ();
@@ -3307,7 +3307,7 @@
       if (LoadTheGame (which, &game) == true)
       {
          MenuFixup ();
-		 StrechScreen=false;
+		 DisableScreenStretch();
          StartGame = true;
 			exit      = 1;
       }
@@ -5036,7 +5036,7 @@
 
 void DoMainMenu (void)
 {
-		StrechScreen=true;//bna++ shut on streech mode
+		EnableScreenStretch();//bna++ shut on streech mode
    SetAlternateMenuBuf();
    ClearMenuBuf();
    DrawMainMenu();
@@ -5351,6 +5351,7 @@
 extern boolean usemouselook;
 extern int iG_aimCross;
 extern boolean usejump;
+extern boolean sdl_fullscreen;
 
 void CP_ExtOptionsMenu (void)
 {
@@ -5374,6 +5375,13 @@
 				 break;
          case 2: iG_aimCross   ^= 1; DrawExtOptionsButtons (); break;
          case 3: usejump       ^= 1; DrawExtOptionsButtons (); break;
+         case 4:
+            if (SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()))
+            {
+               sdl_fullscreen ^= 1;
+               DrawExtOptionsButtons ();
+            }
+            break;
       }
 
 	} while (which >= 0);
@@ -5405,6 +5413,7 @@
             case 1: if (inverse_mouse == -1)on = 1; break;
             case 2: if (iG_aimCross   == 1) on = 1; break;
             case 3: if (usejump       == 1) on = 1; break;
+            case 4: if (sdl_fullscreen== 1) on = 1; break;
          }
 
          if (on)
@@ -5697,7 +5706,7 @@
             if ( status )
                {
                StartGame   = true;
-			      StrechScreen=false;
+			      DisableScreenStretch();
                handlewhich = -2;
                playstate   = ex_resetgame;
                BATTLEMODE  = true;
@@ -7156,7 +7165,7 @@
 
    {
    int i;
-    StrechScreen=true;
+    EnableScreenStretch();
        // SetTextMode (  );
 
 	SetAlternateMenuBuf();
@@ -7209,7 +7218,7 @@
    FlipMenuBuf();
 	RefreshMenuBuf (0);
 
-	 StrechScreen=false;
+	 DisableScreenStretch();
    }
 
 
diff -ur rott-1.0.orig/rott/rt_net.c rott-1.0/rott/rt_net.c
--- rott-1.0.orig/rott/rt_net.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_net.c	2007-05-10 13:55:24.000000000 +0200
@@ -95,6 +95,7 @@
 			*lastdemoptr,
          *demobuffer=NULL;
 boolean  demodone = false;
+int      predemo_violence = -1;
 int oldmomx;
 int oldmomy;
 int oldspdang;
@@ -3080,6 +3081,7 @@
 
    filename[4] = (char)('0' + (byte)demonumber);
    filename[6] = (char)('0' + (byte)gamestate.violence);
+   FixFilePath(filename);
 }
 //****************************************************************************
 //
@@ -3095,8 +3097,19 @@
    if (access (demo, F_OK) == 0)
       return true;
    else
-      return false;
-
+   {
+      /* Saves the users violence level, only do this once, otherwise
+         we might override the saved level with one already modified by us */
+      if (predemo_violence == -1)
+         predemo_violence = gamestate.violence;
+      /* The demos distributed with rott are all for a violence level of 3 */
+      gamestate.violence = 3;
+      GetDemoFilename (demonumber, &demo[0]);
+      if (access (demo, F_OK) == 0)
+         return true;
+      else
+         return false;
+   }
 }
 
 //****************************************************************************
diff -ur rott-1.0.orig/rott/rt_net.h rott-1.0/rott/rt_net.h
--- rott-1.0.orig/rott/rt_net.h	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_net.h	2007-05-10 13:55:24.000000000 +0200
@@ -263,6 +263,7 @@
 					 *lastdemoptr,
                 *demobuffer;
 extern boolean  demodone;
+extern int      predemo_violence;
 
 void     ControlPlayer (void);
 void     ControlRemote (objtype * ob);
diff -ur rott-1.0.orig/rott/rt_str.c rott-1.0/rott/rt_str.c
--- rott-1.0.orig/rott/rt_str.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_str.c	2007-05-10 14:11:23.000000000 +0200
@@ -1455,7 +1455,8 @@
 
 void US_CenterWindow (int w, int h)
 {
-   US_DrawWindow (((MaxX / 8) - w) / 2,((MaxY / 8) - h) / 2, w, h);
+   //HDG US_DrawWindow (((MaxX / 8) - w) / 2,  ((MaxY / 8) - h) / 2, w, h);
+   US_DrawWindow (((iGLOBAL_SCREENWIDTH / 8) - w) / 2,((iGLOBAL_SCREENHEIGHT / 8) - h) / 2, w, h);
 }
 
 
@@ -1521,7 +1522,7 @@
 
    mask = 1 << ( px & 3 );
 
-   if ((iGLOBAL_SCREENWIDTH <= 320)||(StrechScreen == true)){
+   if ((iGLOBAL_SCREENWIDTH <= 320)||(StretchScreen == true)){
 	   while( width-- )
 	   {
 		  VGAMAPMASK( mask );
diff -ur rott-1.0.orig/rott/rt_ted.c rott-1.0/rott/rt_ted.c
--- rott-1.0.orig/rott/rt_ted.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_ted.c	2007-05-10 13:55:24.000000000 +0200
@@ -74,8 +74,6 @@
 // GLOBAL VARIABLES
 //========================================
 
-extern char *tmpPICbuf;
-extern int  iXmas;
 extern boolean  UseBaseMarker;
 
 teamtype TEAM[MAXPLAYERS];
@@ -1235,7 +1233,7 @@
 				DrawNormalSprite (91+3+(Gs*(lastcache<<2)),573,W_GetNumForName ("led2"));//led2 progressbar
 				DrawNormalSprite (91+3+(Gs*(lastcache<<2)),573+3,W_GetNumForName ("led2"));//led2 progressbar
 			}
-			StrechScreen=false;//bna++
+			DisableScreenStretch();//bna++
 			VW_UpdateScreen ();//bna++
             lastcache++;
             ticdelay--;
@@ -1251,7 +1249,7 @@
                }
             }
          }
-	  StrechScreen=false;//bna++
+	  DisableScreenStretch();//bna++
 	  VW_UpdateScreen ();//bna++
 	  //I_Delay(200);
       bufferofs=tempbuf;
@@ -1265,7 +1263,7 @@
 		WHratio = WHratio/100;
 ///	iGLOBAL_SCREENWIDTH = 640;
 //	iGLOBAL_SCREENHEIGHT = 480;
-StrechScreen=false;
+DisableScreenStretch();
 
 	// Cache in fonts
 //	shape = W_CacheLumpNum (W_GetNumForName ("newfnt1"), PU_STATIC, Cvt_font_t, 1);
@@ -1285,7 +1283,7 @@
          while (!IN_CheckAck ())
             ;
          }
- //  StrechScreen=true;
+ //  EnableScreenStretch();
 #if (DEVELOPMENT == 1)
       tempbuf=bufferofs;
       bufferofs=displayofs;
@@ -5749,6 +5747,10 @@
 	SNAKELEVEL = 0;
 	whichpath = 0;
 
+	// som of the code / calls below need bufferofs & friends to point
+	// to to the real screen, not the stretch buffer
+	DisableScreenStretch();//bna++ shut off streech mode
+
 	InitializePlayerstates();
 
 	ResetCheatCodes();
@@ -5898,6 +5900,8 @@
 	insetupgame=false;
 
 	tedlevel = false;   // turn it off once we have done any ted stuff
+	
+	EnableScreenStretch();
 }
 
 
diff -ur rott-1.0.orig/rott/rt_vid.c rott-1.0/rott/rt_vid.c
--- rott-1.0.orig/rott/rt_vid.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/rt_vid.c	2007-05-10 14:13:33.000000000 +0200
@@ -321,7 +321,8 @@
 
 void VWB_DrawPic (int x, int y, pic_t *pic)
 {
-   if (VW_MarkUpdateBlock (x, y, x+(pic->width<<2)-1, y+(pic->height)-1))
+   if (((iGLOBAL_SCREENWIDTH > 320) && !StretchScreen) ||
+       VW_MarkUpdateBlock (x, y, x+(pic->width<<2)-1, y+(pic->height)-1))
       VL_MemToScreen ((byte *)&pic->data, pic->width, pic->height, x, y);
 }
 
@@ -397,7 +398,8 @@
 
 void VWB_Bar (int x, int y, int width, int height, int color)
 {
-   if (VW_MarkUpdateBlock (x,y,x+width,y+height-1) )
+   if (((iGLOBAL_SCREENWIDTH > 320) && !StretchScreen) ||
+       VW_MarkUpdateBlock (x,y,x+width,y+height-1) )
       VL_Bar (x, y, width, height, color);
 }
 
@@ -1190,7 +1192,7 @@
    }
 
    SafeFree(origbuf);
-   StrechScreen=true;//bna++ shut on streech mode
+   EnableScreenStretch();//bna++ shut on streech mode
    if (flip==true)
       VW_UpdateScreen ();
 
diff -ur rott-1.0.orig/rott/winrott.c rott-1.0/rott/winrott.c
--- rott-1.0.orig/rott/winrott.c	2007-05-10 14:38:57.000000000 +0200
+++ rott-1.0/rott/winrott.c	2007-05-10 13:55:24.000000000 +0200
@@ -6,8 +6,8 @@
 
 //typedef unsigned char byte;
 
-int iGLOBAL_SCREENWIDTH;//bna val 800
-int iGLOBAL_SCREENHEIGHT;//bna val 600
+int iGLOBAL_SCREENWIDTH  = 640;//bna val 800
+int iGLOBAL_SCREENHEIGHT = 480;//bna val 600
 int iGLOBAL_SCREENBWIDE ;
 int iG_SCREENWIDTH;// default screen width in bytes
 
@@ -24,9 +24,7 @@
 int iG_X_center;
 int iG_Y_center;
 
-char *tmpPICbuf;//used to strech and schrink mem pictures
-
-int iG_aimCross = 0;
+boolean iG_aimCross = 0;
 
 extern int  viewheight;
 extern int  viewwidth;
@@ -74,8 +72,6 @@
 		dTopYZANGLELIMIT = (90*FINEANGLES/360);;
 	}
 
-	tmpPICbuf =  malloc(iGLOBAL_SCREENHEIGHT*iGLOBAL_SCREENWIDTH);
-
 	//dYZANGLELIMIT = (12*FINEANGLES/360);
 	//#define YZANGLELIMIT  (12*FINEANGLES/360)//bna--(30*FINEANGLES/360)
 

rott-1.0-winrott.patch:

--- NEW FILE rott-1.0-winrott.patch ---
diff -urN rott-1.0.orig/rott/Makefile rott-1.0/rott/Makefile
--- rott-1.0.orig/rott/Makefile	2007-05-06 22:30:12.000000000 +0200
+++ rott-1.0/rott/Makefile	2007-05-06 22:56:40.000000000 +0200
@@ -105,7 +105,8 @@
 	z_zone.o \
 	byteordr.o \
 	dukemusc.o \
-	audiolib/audiolib.a
+	audiolib/audiolib.a \
+	winrott.o
 	$(CC) $^ $(LDLIBS) -o $@
 
 clean:
diff -urN rott-1.0.orig/rott/WinRott.h rott-1.0/rott/WinRott.h
--- rott-1.0.orig/rott/WinRott.h	1970-01-01 01:00:00.000000000 +0100
+++ rott-1.0/rott/WinRott.h	2007-05-06 22:43:18.000000000 +0200
@@ -0,0 +1,51 @@
+
+
+// winrott.h
+
+
+//husk at rette i winrott.c
+
+extern int iGLOBAL_SCREENWIDTH;//bna val 800
+extern int iGLOBAL_SCREENHEIGHT;//bna val 600
+extern int iGLOBAL_SCREENBWIDE ;
+extern int iG_SCREENWIDTH;// default screen width in bytes
+
+extern int iGLOBAL_HEALTH_X;
+extern int iGLOBAL_HEALTH_Y;
+extern int iGLOBAL_AMMO_X;
+extern int iGLOBAL_AMMO_Y;
+
+extern int iGLOBAL_FOCALWIDTH;
+extern double dGLOBAL_FPFOCALWIDTH;
+/*
+double dYZANGLELIMIT;
+
+#define FOCALWIDTH 160//160
+#define FPFOCALWIDTH 160.0//160.0
+
+
+
+#define MAXSCREENHEIGHT    480//600//     200*2
+#define MAXSCREENWIDTH     640//800//     320*2
+#define SCREENBWIDE        640*(96/320)//800*(96/320)//     96*2
+#define MAXVIEWWIDTH       640//     320*2
+#define SCREENWIDTH        640*(96/320)//800*(96/320)//     96*2              // default screen width in bytes
+
+
+#define MAXSCREENHEIGHT    600
+#define MAXSCREENWIDTH     800
+#define SCREENBWIDE        800*(96/320)
+#define MAXVIEWWIDTH       800
+#define SCREENWIDTH        800*(96/320)// default screen width in bytes
+
+*/
+//#define VIEWWIDTH               MAXSCREENWIDTH//320*2             // size of view window
+//#define VIEWHEIGHT              MAXSCREENHEIGHT//200*2
+//#define MAXSCANLINES            MAXSCREENHEIGHT//200*2             // size of ylookup table
+
+
+
+
+
+
+
diff -urN rott-1.0.orig/rott/_rt_floo.h rott-1.0/rott/_rt_floo.h
--- rott-1.0.orig/rott/_rt_floo.h	2002-12-20 21:15:28.000000000 +0100
+++ rott-1.0/rott/_rt_floo.h	2007-05-06 22:34:18.000000000 +0200
@@ -20,9 +20,9 @@
 #ifndef _rt_floor_private
 #define _rt_floor_private
 
-#define	MAXVIEWHEIGHT MAXSCREENHEIGHT	
+//#define	MAXVIEWHEIGHT MAXSCREENHEIGHT	
 #define MAXSKYSEGS    2048
 #define MAXSKYDATA    8
-#define MINSKYHEIGHT  148
+#define MINSKYHEIGHT  0//148 //bna++ sky change here
 
 #endif
diff -urN rott-1.0.orig/rott/_rt_game.h rott-1.0/rott/_rt_game.h
--- rott-1.0.orig/rott/_rt_game.h	2003-01-01 10:23:03.000000000 +0100
+++ rott-1.0/rott/_rt_game.h	2007-05-06 22:34:18.000000000 +0200
@@ -65,16 +65,25 @@
 #define LEADER_NAME_Y ( LEADER_Y + 2 )
 #define LEADER_WIDTH  88
 #define LEADER_HEIGHT 16
-
+/* bna++
 #define HEALTH_X  20
 #define HEALTH_Y  185
 
 #define AMMO_X    300
 #define AMMO_Y    184
+*/
+//--------------------
+#define HEALTH_X  20*2
+#define HEALTH_Y  (185*2)+16
+
+#define AMMO_X    300*2
+#define AMMO_Y    (184*2)+16
+//--------------------
 
 #define SCORE_X   4
 #define SCORE_Y   0
 
+/*
 #define KEY1_X    152
 #define KEY2_X    160
 #define KEY3_X    168
@@ -89,7 +98,23 @@
 
 #define MEN_X     216
 #define MEN_Y     0
+*/
+//--------------------
+#define KEY1_X    152
+#define KEY2_X    160
+#define KEY3_X    168
+#define KEY4_X    176
+#define KEY_Y     0
 
+#define POWER_X   (184)
+#define POWER_Y   0
+
+#define ARMOR_X   200
+#define ARMOR_Y   0
+
+#define MEN_X     216
+#define MEN_Y     0
+//--------------------
 #define HOUR_X    7
 #define MIN_X     26
 #define SEC_X     45
diff -urN rott-1.0.orig/rott/_rt_play.h rott-1.0/rott/_rt_play.h
--- rott-1.0.orig/rott/_rt_play.h	2002-12-20 21:15:28.000000000 +0100
+++ rott-1.0/rott/_rt_play.h	2007-05-06 22:34:18.000000000 +0200
@@ -21,11 +21,20 @@
 #define _rt_playr_private
 
 #include "watcom.h"
+//double dTopYZANGLELIMIT; in winrott.c
+#define TopYZANGLELIMIT  (44*FINEANGLES/360)//bna added
+#define YZANGLELIMIT  (80*FINEANGLES/360)//bna--(30*FINEANGLES/360)
+/*
+//bna++ had to limit this or the sky would fuck up 
+#define TopYZANGLELIMIT  (6*FINEANGLES/360)//bna added
+#define YZANGLELIMIT  (40*FINEANGLES/360)//bna--(30*FINEANGLES/360)
+//partly fixed you can now se up but not down very much see rt_playr.c TopYZANGLELIMIT
+*/
 
-#define YZANGLELIMIT  (30*FINEANGLES/360)
-#define YZTILTSPEED   20
-#define SNAPBACKSPEED 10
-#define YZHORIZONSPEED 4
+
+#define YZTILTSPEED   20*4//*2 = bna added
+#define SNAPBACKSPEED 10*15//*2 = bna added
+#define YZHORIZONSPEED 4*5//*2 = bna added
 #define HORIZONYZOFFSET (FINEANGLES/4)
 #define SetPlayerHorizon(ps,hlevel)    \
     {                                  \
diff -urN rott-1.0.orig/rott/cin_efct.c rott-1.0/rott/cin_efct.c
--- rott-1.0.orig/rott/cin_efct.c	2002-12-24 06:16:25.000000000 +0100
+++ rott-1.0/rott/cin_efct.c	2007-05-06 22:34:18.000000000 +0200
@@ -253,8 +253,8 @@
       bottomscreen = topscreen + (cin_invscale*length);
       cin_yl = (topscreen+FRACTIONUNIT-1)>>FRACTIONBITS;
       cin_yh = (bottomscreen-FRACTIONUNIT)>>FRACTIONBITS;
-      if (cin_yh >= MAXSCREENHEIGHT)
-         cin_yh = MAXSCREENHEIGHT-1;
+      if (cin_yh >= iGLOBAL_SCREENHEIGHT)
+         cin_yh = iGLOBAL_SCREENHEIGHT-1;
       if (cin_yl < 0)
          cin_yl = 0;
       if (cin_yl <= cin_yh)
@@ -354,10 +354,10 @@
    pic=(lpic_t *)W_CacheLumpName(back->name,PU_CACHE, Cvt_lpic_t, 1);
 
    height = pic->height;
-   if (height+back->yoffset>MAXSCREENHEIGHT)
-      height=MAXSCREENHEIGHT-back->yoffset;
+   if (height+back->yoffset>iGLOBAL_SCREENHEIGHT)
+      height=iGLOBAL_SCREENHEIGHT-back->yoffset;
 
-   if (height!=MAXSCREENHEIGHT)
+   if (height!=iGLOBAL_SCREENHEIGHT)
       DrawClearBuffer ();
 
    plane = 0;
@@ -372,9 +372,9 @@
       VGAWRITEMAP(plane);
 
 #ifdef DOS
-      for (i=plane;i<MAXSCREENWIDTH;i+=4,offset+=4,buf++)
+      for (i=plane;i<iGLOBAL_SCREENWIDTH;i+=4,offset+=4,buf++)
[...5112 lines suppressed...]
+	int startX,startY,startoffset;
+    byte  *Ycnt,*b;
+//   SetTextMode (  );
+    b=(byte *)bufferofs;
+
+	b += (((iGLOBAL_SCREENHEIGHT-viewheight)/2)*iGLOBAL_SCREENWIDTH)+((iGLOBAL_SCREENWIDTH-viewwidth)/2);
+	if (viewsize == 8) {b += 8*iGLOBAL_SCREENWIDTH;}
+	startX = 3; //take 3 pixels to the right
+	startY = 3; //take 3 lines down
+	startoffset = (startY*iGLOBAL_SCREENWIDTH);//+startX;
+
+	for (Ycnt=b;Ycnt<b+((viewheight-startY)*iGLOBAL_SCREENWIDTH);Ycnt+=iGLOBAL_SCREENWIDTH){
+		memcpy(Ycnt+startX,Ycnt+startoffset, viewwidth-startX);
+	}
+}
+//----------------------------------------------------------------------
+void MoveScreenDownRight()
+{
+	int startX,startY,startoffset;
+    byte  *Ycnt,*b;
+//   SetTextMode (  );
+    b=(byte *)bufferofs;
+
+	b += (((iGLOBAL_SCREENHEIGHT-viewheight)/2)*iGLOBAL_SCREENWIDTH)+((iGLOBAL_SCREENWIDTH-viewwidth)/2);
+	if (viewsize == 8) {b += 8*iGLOBAL_SCREENWIDTH;}
+	startX = 3; //take 3 pixels to the right
+	startY = 3; //take 3 lines down
+	startoffset = (startY*iGLOBAL_SCREENWIDTH)+startX;
+
+	//Ycnt starts in botton of screen and copys lines upwards
+	for (Ycnt=b+((viewheight-startY-1)*iGLOBAL_SCREENWIDTH);Ycnt>b;Ycnt-=iGLOBAL_SCREENWIDTH){
+		memcpy(Ycnt+startoffset,Ycnt,viewwidth-startX);
+	}
+}
+
+
diff -urN rott-1.0.orig/rott/z_zone.c rott-1.0/rott/z_zone.c
--- rott-1.0.orig/rott/z_zone.c	2007-05-06 22:30:08.000000000 +0200
+++ rott-1.0/rott/z_zone.c	2007-05-06 22:42:39.000000000 +0200
@@ -287,14 +287,9 @@
 // scan through the block list looking for the first free block
 // of sufficient size, throwing out any purgable blocks along the way
 //
-        size += sizeof(memblock_t);     // account for size of block header
+//        size += sizeof(memblock_t);     // account for size of block header
+        size = (size + sizeof(memblock_t) + 3)&~3;     // account for size of block header
 
-#if defined(__sparc__)
-        /* ensure word alignment */
-        if (size % 4) {
-           size = size + (4 - size % 4);
-        }
-#endif
 
 //
 // if there is a free block behind the rover, back up over them
@@ -392,7 +387,8 @@
 // scan through the block list looking for the first free block
 // of sufficient size, throwing out any purgable blocks along the way
 //
-        size += sizeof(memblock_t);     // account for size of block header
+//        size += sizeof(memblock_t);     // account for size of block header
+        size = (size + sizeof(memblock_t) + 3)&~3;     // account for size of block header
 
 
 //
diff -ur rott-1.0/rott/_rt_menu.h winrot-1.26/rott/_rt_menu.h
--- rott-1.0/rott/_rt_menu.h	2002-12-21 01:12:18.000000000 +0100
+++ winrot-1.26/rott/_rt_menu.h	2007-05-05 23:23:29.000000000 +0200
@@ -303,8 +303,11 @@
 void DrawControlMenu (void);
 void CP_ControlMenu (void);
 void DrawOptionsMenu (void);
+void DrawExtOptionsMenu (void);
+void CP_ExtOptionsMenu (void);
 void CP_OptionsMenu (void);
 void DrawOptionsButtons (void);
+void DrawExtOptionsButtons (void);
 void MenuFlipSpeed (void);
 void DrawDetailMenu (void);
 void CP_DetailMenu (void);
diff -ur rott-1.0/rott/rt_build.c winrot-1.26/rott/rt_build.c
--- rott-1.0/rott/rt_build.c	2002-12-25 05:40:39.000000000 +0100
+++ winrot-1.26/rott/rt_build.c	2007-05-05 23:23:29.000000000 +0200
@@ -575,7 +578,8 @@
 
    for (i=0;i<=time;i+=tics)
       {
-      PositionMenuBuf (0,NORMALVIEW,false);
+      //PositionMenuBuf (0,NORMALVIEW,false);
+      PositionMenuBuf (0,NORMALVIEW,true);//bna++ in not true bg in menu is no redrawn
       }
 }
 
diff -ur rott-1.0/rott/develop.h winrot-1.26/rott/develop.h
--- rott-1.0/rott/develop.h	2003-01-07 07:31:51.000000000 +0100
+++ winrot-1.26/rott/develop.h	2007-05-05 23:23:29.000000000 +0200
@@ -39,6 +39,7 @@
 #define DELUXE   0
 #define LOWCOST  0
 
+#define BNACRASHPREVENT  1 //bna added 
 // Make sure only one of the following are on at one time
 #define SHAREWARE   1
 #define SUPERROTT   0
diff -ur rott-1.0/rott/rt_actor.c winrot-1.26/rott/rt_actor.c
--- rott-1.0/rott/rt_actor.c	2003-01-07 07:31:51.000000000 +0100
+++ winrot-1.26/rott/rt_actor.c	2007-05-05 23:23:29.000000000 +0200
@@ -1066,7 +1072,9 @@
 //  for(i=0;i<tics;i++)
 //	{
 
-
+#if (BNACRASHPREVENT == 1)//
+		if (ob->state == 0){return;}
+#endif
     ApplyGravity(ob);
 	 M_CheckDoor(ob);
 	 M_CheckBossSounds(ob);
@@ -1185,10 +1193,17 @@
        )
       )
       ob->state = &s_altexplosion1;
-   else
+   else{
+#if (BNACRASHPREVENT == 1)//crashed here when oscuro and larves were all killed
+		if (ob == 0){return;}
+#endif
       ob->state = newstate;
-
+   }
    SetVisiblePosition(ob,ob->x,ob->y);
+#if (BNACRASHPREVENT == 1)
+		if (ob->state == 0){return;}
+#endif
+
 	ob->ticcount = (ob->state->tictime>>1);
 	ob->shapenum = ob->state->shapenum + ob->shapeoffset;
 
@@ -10898,6 +11092,11 @@
    doorobj_t*tdoor;
 
    ob = (objtype*)object;
+
+#if (BNACRASHPREVENT == 1)//
+		if (ob == 0){return;}
+#endif
+
    ob->flags |= FL_ACTIVE;
    if (ob->obclass == bladeobj)
       {
diff -ur rott-1.0/rott/rt_door.c winrot-1.26/rott/rt_door.c
--- rott-1.0/rott/rt_door.c	2002-12-24 06:16:27.000000000 +0100
+++ winrot-1.26/rott/rt_door.c	2007-05-05 23:23:29.000000000 +0200
@@ -745,7 +745,12 @@
             break;
             }
          }
-
+#if (BNACRASHPREVENT == 1)
+	  //SetTextMode (  ); qwert
+	  //	CRASH IN SHAREWARE 'ride em cowboy' BNA FIX
+      // DONT ALLOW BAD touchplate ( == 0 ) see rt_playr.c
+	  if (touchplate[i] == 0) {continue;}
+#endif
 
       if (!TRIGGER[i])
          continue;
diff -ur rott-1.0/rott/w_wad.c winrot-1.26/rott/w_wad.c
--- rott-1.0/rott/w_wad.c	2002-12-29 05:30:29.000000000 +0100
+++ winrot-1.26/rott/w_wad.c	2007-05-05 23:23:29.000000000 +0200
@@ -84,14 +86,26 @@
         wadinfo_t               header;
         lumpinfo_t              *lump_p;
         unsigned                i;
-        int                             handle, length;
-        int                             startlump;
+        int                     handle, length;
+        int                     startlump;
         filelump_t              *fileinfo, singleinfo;
 
         char filename[MAX_PATH];
+        char buf[MAX_PATH+100];//bna++
+
         strncpy(filename, _filename, sizeof (filename));
         filename[sizeof (filename) - 1] = '\0';
         FixFilePath(filename);
+
+		//bna section start
+		if (access (filename, 0) != 0) {
+			strcpy (buf,"Error, Could not find User file '");
+			strcat (buf,filename);
+			strcat (buf,"', ignoring file");
+			printf(buf);
+		}
+		//bna section end
+
 //
 // read the entire file in
 //      FIXME: shared opens


--- NEW FILE rott-registered.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=Rise of the Triad (Registered)
Comment=RotT Registered launch script, this requires the registered data files
Exec=rott-registered
StartupNotify=false
Terminal=false
Type=Application
Icon=rott.png
Categories=Game;ActionGame;


--- NEW FILE rott-registered.sh ---
#!/bin/bash

set -e

if [ ! -f ~/.rott/registered/*.WAD -a ! -f ~/.rott/registered/*.wad ]; then
	zenity --info --text='In order to play the registered version of Rise of the Triad (ROTT), An Apogee Game, the original registered ROTT datafiles are needed.

If you posess the registered version, copy all the datafiles of this version to [home folder]/.rott/registered and start ROTT Registered again.'
	exit 1
fi

cd ~/.rott/registered
exec rott-registered.bin "$@"


--- NEW FILE rott-shareware.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=Rise of the Triad
Comment=RotT Shareware launcher, will automatically download the needed data-files
Exec=rott-shareware
StartupNotify=false
Terminal=false
Type=Application
Icon=rott.png
Categories=Game;ActionGame;


--- NEW FILE rott-shareware.sh ---
#!/bin/bash

set -e

mkdir -p $HOME/.rott
cd $HOME/.rott

if [ ! -f REMOTE1.RTS ]; then
  set +e
  /usr/share/autodl/AutoDL.py /usr/share/rott/rott.autodlrc
  STATUS=$?
  set -e
  # status 2 means download was ok, but the user choice not to start the game
  if [ "$STATUS" = "0" -o  "$STATUS" = "2" ]; then
    unzip -u 1rott13.zip ROTTSW13.SHR
    unzip -u ROTTSW13.SHR VENDOR.DOC 'HUNTBGIN.*' REMOTE1.RTS 'DEMO*.DMO'
    rm 1rott13.zip ROTTSW13.SHR
  fi
  if [ "$STATUS" != "0" ]; then
    exit $STATUS
  fi
fi

exec /usr/bin/rott-shareware.bin "$@"


--- NEW FILE rott.autodlrc ---
[MESSAGELIST]
[MESSAGE]
	[TITLE]Please click 'Accept' to allow internet access.[/TITLE]
	[TEXT]In order to play Rise of the Triad (ROTT), An Apogee Game, the original ROTT datafiles are needed.

Click Accept, to download the shareware version of the ROTT datafiles, which can be freely downloaded from the internet.

If you posess the full version you can use that instead: Make sure you've installed the rott-registered package, put all the datafiles of the full version in a directory, and then run rott-registered from this directory.

Please click Accept to allow ROTT to access the internet to download the necessary datafiles.[/TEXT]
[/MESSAGE]
[MESSAGE]
	[TITLE]License Information[/TITLE]
	[TEXT]"Rise of the Triad: The HUNT Begins" Copyright 1994, 1995 Apogee Software, Ltd. P.O. Box 496389, Garland, TX 75049, TEL: 972-271-1765 ("Apogee")

BY COPYING, USING OR DISTRIBUTING THIS SHAREWARE PROGRAM, YOU INDICATE YOUR AGREEMENT TO THE TERMS OF THIS vendor.doc.

=====================
KEY POINTS
=====================

[*] If you want to distribute it in a retail location (such as on a rack), or as part of a hardware or software bundle, or on CD-ROM you must get PRIOR signed written permission from Apogee.  Apogee reserves its right to withhold permission.

[*] Everyone can -- and is encouraged! -- to copy, upload and generally pass around this Program without charging for it.

[*] If you want to distribute it as provided in this Vendor.doc by catalog, advertisement, BBS, on-line service, or direct mail, no written permission is needed.  Apogee highly recommends, however, that distribution be made from a copy from Apogee or from one of its authorized sources, such as our home BBS (Software Creations BBS: 508-365-2359) to prevent the sale of older versions.

[*] All advertising of the Program must include "Apogee" in the description.

[*] The Program is marked "Shareware" and contains "episode #1". No right is given by this Vendor.Doc to copy, use or distribute any other version, including any version that is registered, or not marked shareware, or that contains any episode other than #1.

======================
LICENSE
======================

[1] DEFINITIONS:  "Program" means Rise of the Triad and its related files, including this one.  The "Trademarks" consists of "Apogee", the Apogee "comet logo", "Rise of the Triad", and "The HUNT Begins.

[2] OWNERSHIP: Except to the extent expressly licensed, Apogee owns and reserves the exclusive right to distribute the Program, and to use the Trademarks in connection with it.  Its content, layout and format are the property of Apogee to the extent permitted by law.

[3] GRANT AND CONDITIONS:  Apogee grants a non-exclusive license to distribute the Program on IBM compatible media under the Trademarks subject to the following conditions:

 [A] CONDITIONS FOR ALL DISTRIBUTION

  [1] All of the Program's files, including this one, as released by us must be included without modification. The following files must always be included to constitute a legal version for shareware distribution:

      * demo1_3	dmo	08-01-95   1:30p
      * demo2_3	dmo	08-01-95   1:30p
      * huntbgin	rtc		08-01-95   1:30p
      * huntbgin	rtl		08-01-95   1:30p
      * huntbgin	wad		08-01-95   1:30p
      * modem		pck		08-01-95   1:30p
      * readme		exe		08-01-95   1:30p
      * remote1	rts		08-01-95   1:30p
      * rott		exe		08-01-95   1:30p
      * rotthelp		exe		08-01-95   1:30p
      * rottipx		exe		08-01-95   1:30p
      * rottser		exe		08-01-95   1:30p
      * setup		exe		08-01-95   1:30p
      * sndsetup	exe		08-01-95   1:30p

  [2] No copyright or trademark information may be removed.

  [3] You must not [a] distribute any version of the Program with unauthorized changes, such as additional or different levels, or changed characters or mazes; or [b] characterize such versions as an "add-on" or "extension" of any Apogee product; or [c] distribute any unauthorized third party utility designed to alter any Apogee game, game level, game episode or saved game.

 [B] ADDITIONAL CONDITIONS IF YOU CHARGE:  If your distribution involves a disk or other physical medium, you must also:

  [1] Clearly market the Program as shareware, which requires (among other things) using "try before you buy" or similar words on packaging for the Programs.

  [2] Include "Apogee" and the "comet" logo (we encourage use of the 4 color version) on the front cover of the package.

  [3] Include the your name, address and phone number on the packaging and in any added documentation.  This can be imprinted on the package or may be in the form of a label affixed to the box, carton or folder.

  [4] Any description of the Program included in a re-sellers catalog, sales brochure, on special packaging or handouts, must include "An Apogee Game", "Released by Apogee" or "Published by Apogee" if the word count of the description is more than 14 words in length.

  [5] Distribute copies only after the programs on newly created master diskettes have been thoroughly tested.  Always use high quality media and duplication technology.

  [6] Try to sell only the most current version of the Program.

  [7] Although Apogee discourages the practice, you may add an installation routine if it does not interfere with the proper operation or installation of the Program.

  [8] Program updates, recommended descriptions and "screenshots" will be provided upon request, and are available in the re-seller / dealer conference of Apogee's main BBS.

 [C] ADDITIONAL CONDITIONS FOR BUNDLES, CD-ROMS, AND RACKS:
If you wish to distribute in a retail location (such as on a rack), or as part of a hardware or software bundle, or on CD-ROM, you must get PRIOR signed written permission from Apogee, which is in Apogee's discretion and may be subject to royalty or other conditions.

[4] TERM:  Unless terminated for cause, your grants under this VENDOR.DOC terminate 30 days after you receive written notice, or such longer period as the notice may provide.  Following such termination, you may distribute the Program only until the earlier of 60 days after the termination date in the notice, or distribution of the copies you have in stock.  Sections [2], [5], and [6] survive termination.

[5] LIMITED WARRANTY AND LIMITATION OF REMEDIES: If Apogee provides a physically defective copy of the Program, Apogee will replace it upon submission of the defective one.  Aside from this, the Program IS PROVIDED "AS-IS", AND NO WARRANTIES OF ANY KIND (INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE), EXPRESS OR IMPLIED, ARE MADE AS TO IT OR ANY MEDIUM IT MAY BE ON.  OUR ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY IS SUCH REPLACEMENT, AND UNDER NO CIRCUMSTANCES WILL WE PROVIDE ANY OTHER REMEDY FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, PUNITIVE, INCIDENTAL OR OTHER DAMAGES ARISING FROM IT, INCLUDING SUCH FROM NEGLIGENCE, STRICT LIABILITY, OR BREACH OF WARRANTY OR CONTRACT, EVEN AFTER NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.

[6] MISCELLANY

 [A] Since we would be irreparably damaged if Section [3], [4] or [6][D] were not specifically enforced, we will be entitled without bond, other security or proof of damages, to appropriate equitable remedies with respect to breaches of such sections, in addition to such other remedies as we may have.

 [B] You will hold us, our partners, contractors, employees and agents harmless from damage, loss and expense arising directly or indirectly from your acts and omissions in copying and distributing the Program, including from any installation routine that you may add.

 [C] With respect to every matter arising under this, you consent to the exclusive jurisdiction and venue of the state and federal courts sitting in Dallas, Texas, and to service by certified mail, return receipt requested, or as otherwise permitted by law.

 [D] You will not modify, reverse compile, disassemble, or reverse engineer the Program, or use or disclose any confidential information that it contains.

[V.07.15.94][/TEXT]
[/MESSAGE]
[/MESSAGELIST]

[FILELIST]
[FILE]
	[FILENAME]1rott13.zip[/FILENAME]
	[MD5]0fafd6b629eab80278fc726e31f9cf41[/MD5]
	[PATH]$HOME/.rott[/PATH]
	[MIRRORS]
		[URL]ftp://ftp.3drealms.com/share/1rott13.zip[/URL]
		[URL]http://www.dosgamesarchive.com/download/download2.php?id=14[/URL]
	[/MIRRORS]
[/FILE]
[/FILELIST]


--- NEW FILE rott.spec ---
Name:           rott
Version:        1.0
Release:        2%{?dist}
Summary:        Rise of the Triad
Group:          Amusements/Games
License:        GPL
URL:            http://icculus.org/rott/
Source0:        http://icculus.org/rott/releases/rott-1.0.tar.gz
Source1:        rott-shareware.sh
Source2:        rott-registered.sh
Source3:        rott.autodlrc
Source4:        rott-shareware.desktop
Source5:        rott-registered.desktop
# Notice this is made from an edited screenshot and thus derived from the non-
# free datafiles. I believe this constitues fair-use. If anyone disagrees let
# me know and I'll remove it
Source6:        rott.png
Patch0:         rott-1.0-cvs-fixes.patch
Patch1:         rott-1.0-compile.patch
Patch2:         rott-1.0-fixes.patch
Patch3:         rott-1.0-64bit.patch
Patch4:         rott-1.0-winrott.patch
Patch5:         rott-1.0-winrott-fixes.patch
Patch6:         rott-1.0-more-fixes.patch
# Note: this gets applied during build, not during prep!
Patch99:        rott-1.0-registered.patch 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  SDL_mixer-devel desktop-file-utils

%description
This is the icculus.org Linux port of Apogee's classic 3d shooter Rise of the
Triad, which has been released under the GPL by Apogee. This version is
enhanced with the "high" resolution rendering from the winrott port.


%package        shareware
Summary:        Rise of the Triad shareware version
Group:          Amusements/Games
Requires:       hicolor-icon-theme

%description    shareware
This is the icculus.org Linux port of Apogee's classic 3d shooter Rise of the
Triad (RotT), which has been released under the GPL by Apogee. This version is
enhanced with the "high" resolution rendering from the winrott port.

This package contains the engine for the shareware version of RotT. In order to
play the shareware version, you will need the shareware datafiles. Which can
be freely downloaded from Apogee/3DRealms, but cannot be distributed as a part
of Fedora. When you start RotT for the first time it will offer to download
the datafiles for you.


%package        registered
Summary:        Rise of the Triad registered version
Group:          Amusements/Games
Requires:       hicolor-icon-theme zenity

%description    registered
This is the icculus.org Linux port of Apogee's classic 3d shooter Rise of the
Triad (RotT), which has been released under the GPL by Apogee. This version is
enhanced with the "high" resolution rendering from the winrott port.

This package contains the engine for the registered version of RotT. If you own
the registered version, this allows you to play the registered version under
Linux. Place the registered RotT datafiles in a dir and start rott-registered
from this dir.


%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1


%build
pushd rott
make %{?_smp_mflags} EXTRACFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-pointer-sign"
mv rott rott-shareware.bin

patch -p2 < %{PATCH99}
make clean
make %{?_smp_mflags} EXTRACFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-pointer-sign"
mv rott rott-registered.bin
popd


%install
rm -rf $RPM_BUILD_ROOT
#no make install target, DIY
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 755 rott/rott-* $RPM_BUILD_ROOT%{_bindir}
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}-shareware
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}-registered
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/%{name}

# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE4}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE5}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
install -p -m 644 %{SOURCE6} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/


%clean
rm -rf $RPM_BUILD_ROOT


%post shareware
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun shareware
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%post registered
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun registered
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%files shareware
%defattr(-,root,root,-)
%doc README gpl.txt readme.txt
%{_bindir}/rott-shareware*
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}-shareware.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png


%files registered
%defattr(-,root,root,-)
%doc README gpl.txt readme.txt
%{_bindir}/rott-registered*
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}-registered.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png


%changelog
* Fri May 11 2007 Hans de Goede <j w r degoede hhs nl> 1.0-2
- Add desktop entry and userfriendly launcher script for registered package
- Add a patch fixing crashes with "long" usernames

* Fri May 11 2007 Hans de Goede <j w r degoede hhs nl> 1.0-1
- Initial Fedora Extras package


--- NEW FILE rott.spec~ ---
Name:           rott
Version:        1.0
Release:        2%{?dist}
Summary:        Rise of the Triad
Group:          Amusements/Games
License:        GPL
URL:            http://icculus.org/rott/
Source0:        http://icculus.org/rott/releases/rott-1.0.tar.gz
Source1:        rott-shareware.sh
Source2:        rott-registered.sh
Source3:        rott.autodlrc
Source4:        rott-shareware.desktop
Source5:        rott-registered.desktop
# Notice this is made from an edited screenshot and thus derived from the non-
# free datafiles. I believe this constitues fair-use. If anyone disagrees let
# me know and I'll remove it
Source6:        rott.png
Patch0:         rott-1.0-cvs-fixes.patch
Patch1:         rott-1.0-compile.patch
Patch2:         rott-1.0-fixes.patch
Patch3:         rott-1.0-64bit.patch
Patch4:         rott-1.0-winrott.patch
Patch5:         rott-1.0-winrott-fixes.patch
Patch6:         rott-1.0-more-fixes.patch
# Note: this gets applied during build, not during prep!
Patch99:        rott-1.0-registered.patch 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  SDL_mixer-devel desktop-file-utils

%description
This is the icculus.org Linux port of Apogee's classic 3d shooter Rise of the
Triad, which has been released under the GPL by Apogee. This version is
enhanced with the "high" resolution rendering from the winrott port.


%package        shareware
Summary:        Rise of the Triad shareware version
Group:          Amusements/Games
Requires:       hicolor-icon-theme

%description    shareware
This is the icculus.org Linux port of Apogee's classic 3d shooter Rise of the
Triad (RotT), which has been released under the GPL by Apogee. This version is
enhanced with the "high" resolution rendering from the winrott port.

This package contains the engine for the shareware version of RotT. In order to
play the shareware version, you will need the shareware datafiles. Which can
be freely downloaded from Apogee/3DRealms, but cannot be distributed as a part
of Fedora. When you start RotT for the first time it will offer to download
the datafiles for you.


%package        registered
Summary:        Rise of the Triad registered version
Group:          Amusements/Games
Requires:       hicolor-icon-theme zenity

%description    registered
This is the icculus.org Linux port of Apogee's classic 3d shooter Rise of the
Triad (RotT), which has been released under the GPL by Apogee. This version is
enhanced with the "high" resolution rendering from the winrott port.

This package contains the engine for the registered version of RotT. If you own
the registered version, this allows you to play the registered version under
Linux. Place the registered RotT datafiles in a dir and start rott-registered
from this dir.


%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1


%build
pushd rott
make %{?_smp_mflags} EXTRACFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-pointer-sign"
mv rott rott-shareware.bin

patch -p2 < %{PATCH99}
make clean
make %{?_smp_mflags} EXTRACFLAGS="$RPM_OPT_FLAGS -Wno-unused -Wno-pointer-sign"
mv rott rott-registered.bin
popd


%install
rm -rf $RPM_BUILD_ROOT
#no make install target, DIY
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 755 rott/rott-* $RPM_BUILD_ROOT%{_bindir}
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}-shareware
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}-registered
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/%{name}

# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE4}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE5}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
install -p -m 644 %{SOURCE6} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/


%clean
rm -rf $RPM_BUILD_ROOT


%post shareware
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun shareware
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%post registered
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun registered
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%files shareware
%defattr(-,root,root,-)
%doc README gpl.txt readme.txt
%{_bindir}/rott-shareware*
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}-shareware.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png


%files registered
%defattr(-,root,root,-)
%doc README gpl.txt readme.txt
%{_bindir}/rott-registered*
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}-registered.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png


%changelog
* Fri May 11 2007 Hans de Goede <j w r degoede hhs nl> 1.0-2
- Add desktop entry and userfriendly launcher script for registered package
- Add a patch fixing crashes with "long" usernames

* Fri May 11 2007 Hans de Goede <j w r degoede hhs nl> 1.0-1
- Initial Fedora Extras package


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/rott/FC-6/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	17 May 2007 20:57:17 -0000	1.1
+++ .cvsignore	21 May 2007 21:42:41 -0000	1.2
@@ -0,0 +1 @@
+rott-1.0.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/rott/FC-6/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	17 May 2007 20:57:17 -0000	1.1
+++ sources	21 May 2007 21:42:41 -0000	1.2
@@ -0,0 +1 @@
+c1c6cbecf00f2229cf2e0053334dcfc1  rott-1.0.tar.gz


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]