ref: 57ad566dfc30b250229852619fc1073d47375dfa
parent: 82a797da707881fa3188cab7424738cd07fe9c92
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Apr 17 18:19:23 EDT 2015
games/doom: fix mips
--- a/sys/src/games/doom/d_net.c
+++ b/sys/src/games/doom/d_net.c
@@ -25,14 +25,15 @@
static const char rcsid[] = "$Id: d_net.c,v 1.3 1997/02/03 22:01:47 b1 Exp $";
+#include "doomdef.h"
+#include "doomstat.h"
#include "m_menu.h"
#include "i_system.h"
#include "i_video.h"
#include "i_net.h"
+#include "r_data.h"
#include "g_game.h"
-#include "doomdef.h"
-#include "doomstat.h"
#define NCMD_EXIT 0x80000000
#define NCMD_RETRANSMIT 0x40000000
@@ -40,7 +41,6 @@
#define NCMD_KILL 0x10000000 // kill game
#define NCMD_CHECKSUM 0x0fffffff
-
doomcom_t* doomcom;
doomdata_t* netbuffer; // points inside doomcom
--- a/sys/src/games/doom/d_net.h
+++ b/sys/src/games/doom/d_net.h
@@ -25,7 +25,6 @@
#include "d_player.h"
-
#ifdef __GNUG__
#pragma interface
#endif
--- a/sys/src/games/doom/m_swap.c
+++ b/sys/src/games/doom/m_swap.c
@@ -31,8 +31,8 @@
#include "m_swap.h"
-// Not needed with big endian.
-#ifndef __BIG_ENDIAN__
+// Not needed with little endian.
+#ifdef __BIG_ENDIAN__
// Swap 16bit, that is, MSB and LSB byte.
unsigned short SwapSHORT(unsigned short x)
--- a/sys/src/games/doom/m_swap.h
+++ b/sys/src/games/doom/m_swap.h
@@ -32,8 +32,8 @@
// Endianess handling.
// WAD files are stored little endian.
#ifdef __BIG_ENDIAN__
-short SwapSHORT(short);
-long SwapLONG(long);
+unsigned short SwapSHORT(unsigned short);
+unsigned long SwapLONG(unsigned long);
#define SHORT(x) ((short)SwapSHORT((unsigned short) (x)))
#define LONG(x) ((long)SwapLONG((unsigned long) (x)))
#else
--- a/sys/src/games/doom/mkfile
+++ b/sys/src/games/doom/mkfile
@@ -136,8 +136,7 @@
$HFILES\
${OFILES:%.$O=%.c}\
-</sys/src/cmd/mkone
+CFLAGS=$CFLAGS `{~ $objtype mips && echo -D__BIG_ENDIAN__}
-d_net.$O : d_net.c
- $CC -FVw d_net.c
+</sys/src/cmd/mkone