summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Holm <dholm@gentoo.org>2004-02-15 14:36:54 +0000
committerDavid Holm <dholm@gentoo.org>2004-02-15 14:36:54 +0000
commit0bcf423a2c2e89b53158553430a8ecc1b3e100de (patch)
tree1f214f79df6fe4da405e8a9716eab5a26f7395cf /games-rpg
parentversion bump (Manifest recommit) (diff)
downloadgentoo-2-0bcf423a2c2e89b53158553430a8ecc1b3e100de.tar.gz
gentoo-2-0bcf423a2c2e89b53158553430a8ecc1b3e100de.tar.bz2
gentoo-2-0bcf423a2c2e89b53158553430a8ecc1b3e100de.zip
Added a patch to make egoboo compile on ppc. Keyworded ~ppc.
Diffstat (limited to 'games-rpg')
-rw-r--r--games-rpg/egoboo/ChangeLog6
-rw-r--r--games-rpg/egoboo/egoboo-2.22.ebuild7
-rw-r--r--games-rpg/egoboo/files/2.22-endian.patch178
3 files changed, 188 insertions, 3 deletions
diff --git a/games-rpg/egoboo/ChangeLog b/games-rpg/egoboo/ChangeLog
index 69714c9fd4ec..e43059f37580 100644
--- a/games-rpg/egoboo/ChangeLog
+++ b/games-rpg/egoboo/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for games-rpg/egoboo
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-rpg/egoboo/ChangeLog,v 1.4 2004/01/08 11:13:13 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-rpg/egoboo/ChangeLog,v 1.5 2004/02/15 14:36:45 dholm Exp $
+
+ 15 Feb 2004; David Holm <dholm@gentoo.org> egoboo-2.22.ebuild,
+ files/2.22-endian.patch:
+ Added a patch to make egoboo compile on ppc. Keyworded ~ppc.
08 Jan 2004; Michael Sterrett <mr_bones_@gentoo.org> egoboo-2.22.ebuild,
files/egoboo-2.22.sh:
diff --git a/games-rpg/egoboo/egoboo-2.22.ebuild b/games-rpg/egoboo/egoboo-2.22.ebuild
index 95a314a18de9..01aa3c289917 100644
--- a/games-rpg/egoboo/egoboo-2.22.ebuild
+++ b/games-rpg/egoboo/egoboo-2.22.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-rpg/egoboo/egoboo-2.22.ebuild,v 1.3 2004/01/08 11:13:13 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-rpg/egoboo/egoboo-2.22.ebuild,v 1.4 2004/02/15 14:36:45 dholm Exp $
inherit flag-o-matic games
@@ -9,7 +9,7 @@ DESCRIPTION="A 3d dungeon crawling adventure in the spirit of NetHack"
HOMEPAGE="http://egoboo.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/ego${PV/./}.tar.gz"
-KEYWORDS="-* x86"
+KEYWORDS="-* x86 ~ppc"
LICENSE="GPL-2"
SLOT="0"
IUSE=""
@@ -34,6 +34,9 @@ src_unpack() {
sed \
-e "s:GENTOODIR:${GAMES_DATADIR}:" "${FILESDIR}/${P}.sh" \
> "${T}/egoboo" || die "sed wrapper failed"
+
+ # Fix endianess using SDL
+ epatch ${FILESDIR}/${PV}-endian.patch
}
src_compile() {
diff --git a/games-rpg/egoboo/files/2.22-endian.patch b/games-rpg/egoboo/files/2.22-endian.patch
new file mode 100644
index 000000000000..02c3d578a69c
--- /dev/null
+++ b/games-rpg/egoboo/files/2.22-endian.patch
@@ -0,0 +1,178 @@
+--- egoboo/code/egobootypedef.h.orig 2004-02-15 15:19:03.000000000 +0100
++++ egoboo/code/egobootypedef.h 2004-02-15 15:23:58.000000000 +0100
+@@ -71,13 +71,49 @@
+ typedef Sint32 LONG;
+ typedef Uint32 DWORD;
+ typedef struct lin_RECT { LONG left; LONG right; LONG top; LONG bottom; } RECT;
++
++#ifdef __powerpc__
++#define _BIG_ENDIAN
++
++/*
++ * __lwbrx - Load Word Byte-Reverse Indexed
++ *
++ * int __lwbrx(void *, int);
++ */
++#define __lwbrx(base, index) \
++ ({ unsigned long lwbrxResult; \
++ __asm__ volatile ("lwbrx %0, %1, %2" : "=r" (lwbrxResult) : "b%" (index), "r" (base) : "memory"); \
++ /*return*/ lwbrxResult; })
++
++static float LoadFloatByteswapped( float *ptr );
++static inline float LoadFloatByteswapped( float *ptr )
++{
++ union {
++ float f;
++ long l;
++ } data;
++
++ /*Load byteswapped and store to the stack*/
++ data.l = __lwbrx( ptr, 0 );
++
++ /*Return the result*/
++ return data.f;
++}
++#elif __i386__
+ #define _LITTLE_ENDIAN
++#else
++#define _BIG_ENDIAN
++#error You have to implement LoadFloatByteswapped on your architecture!
++#endif
++
+ #define LE32bitToHost( pData, pNumByte ) pData
+ #define BE32bitToHost( pData, pNumByte ) pData
+ #define LE16bitToHost( pData, pNumByte ) pData
+ #define BE16bitToHost( pData, pNumByte ) pData
+ #define EndianChange32bit( pData, pNumByte ) pData
+ #define EndianChange16bit( pData, pNumByte ) pData
++
++
+ #endif
+
+
+--- egoboo/code/game.c.orig 2004-02-15 15:19:07.000000000 +0100
++++ egoboo/code/game.c 2004-02-15 15:19:19.000000000 +0100
+@@ -10,6 +10,7 @@
+ #define TITLE "Boo"
+
+ #define RELEASE(x) if (x) {x->Release(); x=NULL;}
++#include <SDL/SDL_endian.h>
+
+ //---------------------------------------------------------------------------------------------
+ char *os_cvrt_filename(char *name, char ch)
+@@ -2203,7 +2204,7 @@
+ #ifdef _LITTLE_ENDIAN
+ iTmp = ipIntPointer[0];
+ #else
+- iTmp = EndianS32_LtoB( ipIntPointer[0] );
++ iTmp = SDL_SwapLE32( ipIntPointer[0] );
+ #endif
+ if(iTmp != MD2START ) return FALSE;
+
+@@ -2284,14 +2285,14 @@
+ #ifdef _LITTLE_ENDIAN
+ int iNumCommands = ipIntPointer[9];
+ #else
+- int iNumCommands = EndianS32_LtoB( ipIntPointer[9] );
++ int iNumCommands = SDL_SwapLE32( ipIntPointer[9] );
+ #endif
+
+ // Offset (in DWORDS) from the start of the file to the gl command list.
+ #ifdef _LITTLE_ENDIAN
+ int iCommandOffset = ipIntPointer[15]>>2;
+ #else
+- int iCommandOffset = EndianS32_LtoB( ipIntPointer[15] )>>2;
++ int iCommandOffset = SDL_SwapLE32( ipIntPointer[15] )>>2;
+ #endif
+
+ // Read in each command
+@@ -2306,7 +2307,7 @@
+ #ifdef _LITTLE_ENDIAN
+ iNumVertices = ipIntPointer[iCommandOffset]; iCommandOffset++; cnt++;
+ #else
+- iNumVertices = EndianS32_LtoB( ipIntPointer[iCommandOffset] ); iCommandOffset++; cnt++;
++ iNumVertices = SDL_SwapLE32( ipIntPointer[iCommandOffset] ); iCommandOffset++; cnt++;
+ #endif
+ if(iNumVertices != 0)
+ {
+@@ -2337,7 +2338,7 @@
+ #else
+ fTmpu = LoadFloatByteswapped( &fpFloatPointer[iCommandOffset] ); iCommandOffset++; cnt++;
+ fTmpv = LoadFloatByteswapped( &fpFloatPointer[iCommandOffset] ); iCommandOffset++; cnt++;
+- iTmp = EndianS32_LtoB( ipIntPointer[iCommandOffset] ); iCommandOffset++; cnt++;
++ iTmp = SDL_SwapLE32( ipIntPointer[iCommandOffset] ); iCommandOffset++; cnt++;
+ #endif
+ madcommandu[modelindex][entry] = fTmpu-(.5/64); // GL doesn't align correctly
+ madcommandv[modelindex][entry] = fTmpv-(.5/64); // with D3D
+@@ -2373,9 +2374,9 @@
+ iNumFrames = ipIntPointer[10];
+ iFrameOffset = ipIntPointer[14]>>2;
+ #else
+- iNumVertices = EndianS32_LtoB( ipIntPointer[6] );
+- iNumFrames = EndianS32_LtoB( ipIntPointer[10] );
+- iFrameOffset = EndianS32_LtoB( ipIntPointer[14] )>>2;
++ iNumVertices = SDL_SwapLE32( ipIntPointer[6] );
++ iNumFrames = SDL_SwapLE32( ipIntPointer[10] );
++ iFrameOffset = SDL_SwapLE32( ipIntPointer[14] )>>2;
+ #endif
+
+
+@@ -2433,9 +2434,9 @@
+ iNumFrames = ipIntPointer[10];
+ iFrameOffset = ipIntPointer[14]>>2;
+ #else
+- iNumVertices = EndianS32_LtoB( ipIntPointer[6] );
+- iNumFrames = EndianS32_LtoB( ipIntPointer[10] );
+- iFrameOffset = EndianS32_LtoB( ipIntPointer[14] )>>2;
++ iNumVertices = SDL_SwapLE32( ipIntPointer[6] );
++ iNumFrames = SDL_SwapLE32( ipIntPointer[10] );
++ iFrameOffset = SDL_SwapLE32( ipIntPointer[14] )>>2;
+ #endif
+
+
+@@ -3270,10 +3271,10 @@
+ fread(&itmp, 4, 1, fileread); meshsizex = itmp;
+ fread(&itmp, 4, 1, fileread); meshsizey = itmp;
+ #else
+- fread(&itmp, 4, 1, fileread); if( ( int )EndianS32_LtoB( itmp ) != MAPID) return FALSE;
+- fread(&itmp, 4, 1, fileread); numvert = ( int )EndianS32_LtoB( itmp );
+- fread(&itmp, 4, 1, fileread); meshsizex = ( int )EndianS32_LtoB( itmp );
+- fread(&itmp, 4, 1, fileread); meshsizey = ( int )EndianS32_LtoB( itmp );
++ fread(&itmp, 4, 1, fileread); if( ( int )SDL_SwapLE32( itmp ) != MAPID) return FALSE;
++ fread(&itmp, 4, 1, fileread); numvert = ( int )SDL_SwapLE32( itmp );
++ fread(&itmp, 4, 1, fileread); meshsizex = ( int )SDL_SwapLE32( itmp );
++ fread(&itmp, 4, 1, fileread); meshsizey = ( int )SDL_SwapLE32( itmp );
+ #endif
+
+ numfan = meshsizex*meshsizey;
+@@ -3299,9 +3300,9 @@
+ meshfx[fan] = itmp>>16;
+ meshtile[fan] = itmp;
+ #else
+- meshtype[fan] = EndianS32_LtoB( itmp )>>24;
+- meshfx[fan] = EndianS32_LtoB( itmp )>>16;
+- meshtile[fan] = EndianS32_LtoB( itmp );
++ meshtype[fan] = SDL_SwapLE32( itmp )>>24;
++ meshfx[fan] = SDL_SwapLE32( itmp )>>16;
++ meshtile[fan] = SDL_SwapLE32( itmp );
+ #endif
+
+ fan++;
+@@ -3315,7 +3316,7 @@
+ #ifdef _LITTLE_ENDIAN
+ meshtwist[fan] = itmp;
+ #else
+- meshtwist[fan] = EndianS32_LtoB( itmp );
++ meshtwist[fan] = SDL_SwapLE32( itmp );
+ #endif
+
+ fan++;
+@@ -3387,7 +3388,7 @@
+ #ifdef _LITTLE_ENDIAN
+ meshvrta[cnt] = itmp;
+ #else
+- meshvrta[cnt] = EndianS32_LtoB( itmp );
++ meshvrta[cnt] = SDL_SwapLE32( itmp );
+ #endif
+ meshvrtl[cnt] = 0;
+