<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>61529</bug_id>
          
          <creation_ts>2004-08-24 09:48 0000</creation_ts>
          <short_desc>Duke Nukem 3D crashes on PPC</short_desc>
          <delta_ts>2004-08-26 23:10:45 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Games</component>
          <version>unspecified</version>
          <rep_platform>PPC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>https://bugzilla.icculus.org/show_bug.cgi?id=1914</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mat@esi.com.pl</reporter>
          <assigned_to>games@gentoo.org</assigned_to>
          <cc>ppc@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>mat@esi.com.pl</who>
            <bug_when>2004-08-24 09:48:37 0000</bug_when>
            <thetext>After emerging Duke Nukem 3D (duke3d-20040817.ebuild) I found out that while
it compiles fine it refuses to start with the message &quot;Not enough memory for
file grouping system&quot;.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




After some digging I found that there is an endianness problem - game does 
necessary byte-swapping only on Mac. Below is the patch that solved the 
problem for me. 
 
------------------------------ duke3d-20040817-endian_patch  
--- duke3d/source/buildengine/platform.h        2003-08-07 
12:06:17.000000000+0200 
+++ duke3d.new/source/buildengine/platform.h    2004-08-24 
18:35:05.292291088+0200 
@@ -5,6 +5,7 @@ 
 #include &quot;win32_compat.h&quot; 
 #elif (defined PLATFORM_UNIX) 
 #include &quot;unix_compat.h&quot; 
+#include &lt;endian.h&gt; 
 #elif (defined PLATFORM_DOS) 
 #include &quot;doscmpat.h&quot; 
 #else 
@@ -60,9 +61,15 @@ 
 #define BUILDSWAP_INTEL16(x) _swap16(x) 
 #define BUILDSWAP_INTEL32(x) _swap32(x) 
 #else 
+#if __BYTE_ORDER == __LITTLE_ENDIAN 
 #define PLATFORM_LITTLEENDIAN 1 
 #define BUILDSWAP_INTEL16(x) (x) 
 #define BUILDSWAP_INTEL32(x) (x) 
+#else 
+#define PLATFORM_BIGENDIAN 1 
+#define BUILDSWAP_INTEL16(x) _swap16(x) 
+#define BUILDSWAP_INTEL32(x) _swap32(x) 
+#endif 
 #endif 
 
 extern int has_altivec;  /* PowerPC-specific. */ 
-----------------------------------------------------------</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mat@esi.com.pl</who>
            <bug_when>2004-08-24 09:58:59 0000</bug_when>
            <thetext>Created an attachment (id=38105)
duke3d-20040817-endian_patch
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2004-08-24 10:12:28 0000</bug_when>
            <thetext>Just curious, but have you checked to see if this has been fixed upstream?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mat@esi.com.pl</who>
            <bug_when>2004-08-24 10:14:24 0000</bug_when>
            <thetext>Nope. I just wanted to see it running on my machine _now_ ;)
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pylon@gentoo.org</who>
            <bug_when>2004-08-24 21:27:39 0000</bug_when>
            <thetext>Curious, the homepage just describes a Linux/x86 and a Mac OS X/ppc port.  No Linux/ppc port.  So I&apos;m not sure if it will run on Linux/ppc.

dholm, you set the ~ppc keyword.  Tell us more ;-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mat@esi.com.pl</who>
            <bug_when>2004-08-24 23:15:27 0000</bug_when>
            <thetext>Well... Without the change I did it compiled but crashed (wrong byte swapping
due to wrong endianness). After the change it starts fine, plays the intros
etc. Then I started the game - it worked too but not fast enough as for my
liking so I played for maybe two minutes and quited. So for me - now it is
properly marked as ~ppc as it does run to some extent.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2004-08-26 19:44:36 0000</bug_when>
            <thetext>awesome, added to cvs, thanks ... also e-mailed it upstream</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ryan@epicgames.com</who>
            <bug_when>2004-08-26 23:10:45 0000</bug_when>
            <thetext>(This is in the upstream CVS now. Thanks for the patch!)

--ryan.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>38105</attachid>
            <date>2004-08-24 09:58 0000</date>
            <desc>duke3d-20040817-endian_patch</desc>
            <filename>duke3d-20040817-endian_patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGR1a2UzZC9zb3VyY2UvYnVpbGRlbmdpbmUvcGxhdGZvcm0uaAkyMDAzLTA4LTA3IDEyOjA2
OjE3LjAwMDAwMDAwMCArMDIwMAorKysgZHVrZTNkLm5ldy9zb3VyY2UvYnVpbGRlbmdpbmUvcGxh
dGZvcm0uaAkyMDA0LTA4LTI0IDE4OjM1OjA1LjI5MjI5MTA4OCArMDIwMApAQCAtNSw2ICs1LDcg
QEAKICNpbmNsdWRlICJ3aW4zMl9jb21wYXQuaCIKICNlbGlmIChkZWZpbmVkIFBMQVRGT1JNX1VO
SVgpCiAjaW5jbHVkZSAidW5peF9jb21wYXQuaCIKKyNpbmNsdWRlIDxlbmRpYW4uaD4KICNlbGlm
IChkZWZpbmVkIFBMQVRGT1JNX0RPUykKICNpbmNsdWRlICJkb3NjbXBhdC5oIgogI2Vsc2UKQEAg
LTYwLDkgKzYxLDE1IEBACiAjZGVmaW5lIEJVSUxEU1dBUF9JTlRFTDE2KHgpIF9zd2FwMTYoeCkK
ICNkZWZpbmUgQlVJTERTV0FQX0lOVEVMMzIoeCkgX3N3YXAzMih4KQogI2Vsc2U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