Browse Source

Remove a bunch of ancient PS2 defines.

Darryl Pogue 13 years ago
parent
commit
51443d2243
  1. 17
      Sources/Plasma/CoreLib/hsConfig.h
  2. 107
      Sources/Plasma/CoreLib/hsGeometry3.h
  3. 2
      Sources/Plasma/CoreLib/hsMatrix44.h
  4. 6
      Sources/Plasma/CoreLib/hsStream.h

17
Sources/Plasma/CoreLib/hsConfig.h

@ -34,16 +34,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#ifdef BUILDPS2
#define HS_BUILD_FOR_PS2 1
#define PLASMA_NO_NETWORK 1
#define PLASMA_NO_KEYBOARD 1
#define PLASMA_NO_GLIDE 1
#define PLASMA_NO_DDRAW 1
#define HS_BUILD_PLASMA 1
#define NEXUS_NO_2D 1
#endif
//////////////////// Change the 1s and 0s //////////////////////
#define HS_CAN_USE_FLOAT 1
@ -143,13 +133,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#if HS_BUILD_FOR_PS2
#define ATTRIBUTE_FOR_PS2 __attribute__((aligned (16))) /* SUNSOFT */
#else
#define ATTRIBUTE_FOR_PS2
#endif
/////////////////////Myst3D Defines /////////////////////////////////////
#ifdef M3DRELEASE

107
Sources/Plasma/CoreLib/hsGeometry3.h

@ -32,84 +32,6 @@ struct hsPoint3;
struct hsScalarTriple;
class hsStream;
#if HS_BUILD_FOR_PS2
#include <eekernel.h>
#include <stdlib.h>
#include <stdio.h>
#include <eeregs.h>
#include <libgraph.h>
#include <libdma.h>
#include <libpkt.h>
#include <sifdev.h>
#include <libdev.h>
/**** vu0 inline ****/
#if 1
#define inline_asm inline /* inline */
#else
#define inline_asm /* not inline */
#endif
/******* HeadSpin *******/
typedef float hsScalar;
/* -------------------------------------------------------------------------------- */
/* return(sqrt(x)) */
inline_asm hsScalar SqrtVU0(hsScalar x)
{
register hsScalar ret;
asm volatile(" \
mfc1 $8,%1 \
qmtc2 $8,vf4 \
vsqrt Q,vf4x \
vwaitq \
cfc2 $2,$vi22 \
mtc1 $2,%0 \
" :"=f" (ret) : "f" (x), "0" (ret) : "$2", "$8", "memory");
return ret;
}
/* -------------------------------------------------------------------------------- */
/* return(1 / a) */
inline_asm hsScalar ScalarInvertVU0(hsScalar a)
{
register hsScalar ret;
asm volatile(" \
mfc1 $8,%1 \
qmtc2 $8,vf2 \
vdiv Q,vf0w,vf2x \
vwaitq \
cfc2 $2,$vi22 \
mtc1 $2,%0 \
" :"=f" (ret) : "f" (a), "0" (ret) : "$2", "$8", "memory");
return ret;
}
/* -------------------------------------------------------------------------------- */
/* return(a * b) */
inline_asm hsScalar ScalarMulVU0(hsScalar a, hsScalar b)
{
register hsScalar ret;
asm volatile(" \
mfc1 $8,%1 \
qmtc2 $8,vf2 \
mfc1 $9,%2 \
qmtc2 $9,vf3 \
vmul.x vf3,vf2,vf3 \
qmfc2 $2 ,vf3 \
mtc1 $2,%0 \
" :"=f" (ret) : "f" (a), "f" (b), "0" (ret) : "$2", "$8", "$9", "memory");
return ret;
}
#endif // PS2
/*
If value is already close to hsScalar1, then this is a good approx. of 1/sqrt(value)
*/
@ -166,12 +88,7 @@ public:
hsScalar Magnitude() const;
hsScalar MagnitudeSquared() const;
#else
#if HS_BUILD_FOR_PS2
hsScalar Magnitude() const;
#else
hsScalar Magnitude() const { return hsSquareRoot(MagnitudeSquared()); }
#endif
hsScalar MagnitudeSquared() const { return (fX * fX + fY * fY + fZ * fZ); }
#endif
@ -183,19 +100,7 @@ public:
void Read(hsStream *stream);
void Write(hsStream *stream) const;
} ATTRIBUTE_FOR_PS2; /* SUNSOFT */
#if HS_BUILD_FOR_PS2
inline hsScalar hsScalarTriple::Magnitude() const
{
MATRIX4 m;
m[0] = fX;
m[1] = fY;
m[2] = fZ;
return MagnitudeVU0(m);
}
#endif
};
///////////////////////////////////////////////////////////////////////////
@ -256,7 +161,7 @@ struct hsPoint3 : public hsScalarTriple {
hsBool operator!=(const hsPoint3& ss) const { return !(*this == ss); }
hsPoint3 &operator+=(const hsScalarTriple &s) { fX += s.fX; fY += s.fY; fZ += s.fZ; return *this; }
hsPoint3 &operator*=(const hsScalar s) { fX *= s; fY *= s; fZ *= s; return *this; }
} ATTRIBUTE_FOR_PS2; /* SUNSOFT */
};
/////////////////////////////////////////////////////////////////////////////////////////////
@ -332,7 +237,7 @@ struct hsVector3 : public hsScalarTriple {
hsVector3 &operator-=(const hsScalarTriple &s) { fX -= s.fX; fY -= s.fY; fZ -= s.fZ; return *this; }
hsVector3 &operator*=(const hsScalar s) { fX *= s; fY *= s; fZ *= s; return *this; }
hsVector3 &operator/=(const hsScalar s) { fX /= s; fY /= s; fZ /= s; return *this; }
} ATTRIBUTE_FOR_PS2; /* SUNSOFT */
};
struct hsPoint4 {
hsScalar fX, fY, fZ, fW;
@ -345,7 +250,7 @@ struct hsPoint4 {
hsPoint4* Set(hsScalar x, hsScalar y, hsScalar z, hsScalar w)
{ fX = x; fY = y; fZ = z; fW = w; return this; }
} ATTRIBUTE_FOR_PS2; /* SUNSOFT */
};
inline hsVector3 operator+(const hsVector3& s, const hsVector3& t)
@ -471,7 +376,7 @@ struct hsPointNorm {
void Read(hsStream* s) { fPos.Read(s); fNorm.Read(s); }
void Write(hsStream* s) const { fPos.Write(s); fNorm.Write(s); }
} ATTRIBUTE_FOR_PS2; /* SUNSOFT */
};
struct hsPlane3 {
@ -491,6 +396,6 @@ struct hsPlane3 {
void Read(hsStream *stream);
void Write(hsStream *stream) const;
} ATTRIBUTE_FOR_PS2;
};
#endif

2
Sources/Plasma/CoreLib/hsMatrix44.h

@ -157,7 +157,7 @@ struct hsMatrix44 {
void Read(hsStream *stream);
void Write(hsStream *stream);
} ATTRIBUTE_FOR_PS2; /* SUNSOFT */
};
#if 0 // Havok reeks
inline int operator!=(const hsMatrix44& s, const hsMatrix44& t)

6
Sources/Plasma/CoreLib/hsStream.h

@ -338,9 +338,6 @@ public:
virtual void SetFileRef(UInt32 refNum);
};
#if !HS_BUILD_FOR_PS2
#if !(HS_BUILD_FOR_REFERENCE)
class hsUNIXStream: public hsStream
{
FILE* fRef;
@ -399,9 +396,6 @@ public:
virtual UInt32 GetEOF();
};
#endif
#endif
class hsRAMStream : public hsStream {
hsAppender fAppender;
hsAppenderIterator fIter;

Loading…
Cancel
Save