Fix Linux plugin breakages from r540, and make build.sh call fetch.sh so that I am sure to notice the breakages earlier in the future.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@548 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2009-01-04 12:05:10 +00:00 committed by Gregory Hainaut
parent 4524fd919e
commit ffc90048d7
19 changed files with 1594 additions and 1194 deletions

View File

@ -15,6 +15,9 @@ export PCSX2OPTIONS="--enable-sse3 --enable-sse4 --prefix `pwd`"
#Debug / Devbuild version
#export PCSX2OPTIONS="--enable-debug --enable-devbuild --enable-sse3 --prefix `pwd`"
# Make sure we have plugins, and bring the normal plugins in.
sh fetch.sh
option=$@
export PCSX2PLUGINS="`pwd`/bin/plugins"
curdir=`pwd`

View File

@ -87,7 +87,7 @@ typedef unsigned int uint;
#define PCSX2_ALIGNED16(x) __declspec(align(16)) x
#define PCSX2_ALIGNED16_DECL(x) __declspec(align(16)) x
#else
#else // _MSC_VER
#ifdef __LINUX__
@ -107,7 +107,7 @@ typedef uint64_t u64;
typedef uintptr_t uptr;
typedef intptr_t sptr;
#else
#else // __LINUX__
typedef char s8;
typedef short s16;
@ -119,7 +119,7 @@ typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
#endif
#endif // __LINUX__
typedef unsigned int uint;
@ -145,12 +145,16 @@ typedef union _LARGE_INTEGER
#define PCSX2_ALIGNED16_DECL(x) x
// Define some handy equivalents of MSVC++ specific functions.
// (I'm assuming this sort of template use works in GCC -Air
// The various plugins react to C++ in a header that is supposed to be C
// in much the same way a vampire reacts to the sign of a cross.
// Even if the file calling it is a C++ file.
//
// And removing the extern "C"'s makes it even worse. --Arcum42
#if defined(SECURE_SPRINTF)
// Yes, if you add the right includes. --arcum42
// Define some handy equivalents of MSVC++ specific functions.
#ifdef __cplusplus
#ifndef _MSC_VER
#include <stdio.h>
#include <stdarg.h>
#include <cstring>
@ -167,17 +171,16 @@ template <size_t Size>
__forceinline int sprintf_s(char (&dest)[Size], const char* fmt, ... )
{
va_list list;
va_start( list, dest );
int retval = vsprintf_s( dest, fmt, list );
int retval = vsprintf_s( dest, fmt, list );
va_end( list );
return retval;
}
#endif
#endif
#endif // __cplusplus
#endif // SECURE_SPRINTF
#endif // _MSC_VER
#if !defined(__LINUX__) || !defined(HAVE_STDINT_H)

View File

@ -472,15 +472,29 @@ void FindPlugins() {
Handle = dlopen(plugin, RTLD_NOW);
if (Handle == NULL)
{
Console::Error("%s\n", dlerror());
Console::Error("Can't open %s: %s\n", ent->d_name, dlerror());
continue;
}
PS2EgetLibType = (_PS2EgetLibType) dlsym(Handle, "PS2EgetLibType");
PS2EgetLibName = (_PS2EgetLibName) dlsym(Handle, "PS2EgetLibName");
PS2EgetLibVersion2 = (_PS2EgetLibVersion2) dlsym(Handle, "PS2EgetLibVersion2");
if ((PS2EgetLibType == NULL) || (PS2EgetLibName == NULL) || (PS2EgetLibVersion2 == NULL))
if (PS2EgetLibType == NULL)
{
Console::Error("PS2EgetLibType==NULL for %s", ent->d_name);
continue;
}
if (PS2EgetLibName == NULL)
{
Console::Error("PS2EgetLibName==NULL for %s", ent->d_name);
continue;
}
if (PS2EgetLibVersion2 == NULL)
{
Console::Error("PS2EgetLibVersion2==NULL for %s", ent->d_name);
continue;
}
type = PS2EgetLibType();

View File

@ -21,7 +21,7 @@
#pragma warning(disable:4018)
#endif
#include "PS2Edefs.h"
#include "../../common/PS2Edefs.h"
#include "libiso.h"
#ifdef __cplusplus

View File

@ -15,7 +15,7 @@
#include "zlib/zlib.h"
#include "bzip2/bzlib.h"
#include "PS2Etypes.h"
#include "../../common/PS2Etypes.h"
#include "CDVDiso.h"
#include "libiso.h"

View File

@ -27,15 +27,22 @@ cd "temp"
svn checkout http://pcsx2.googlecode.com/svn/trunk/plugins ./
echo "Copying..."
for i in $PLUGINDIRS; do
mv $i ../
for i in $PLUGINDIRS; do
mv $i ../
done
cd ..
rm -rf ./temp/
fi
fi
# Copy the common directory in each individual subfolder so that
# you can compile the plugins both individually *and* from the
# normal subdirectories.
for i in $PLUGINDIRS; do
rm -rf $i/common
cp -r common/ $i/
done
if [ -d zerogs ]
then
echo "Importing local copy of zerogs..."

View File

@ -26,7 +26,7 @@
// need C definitions
extern "C" {
#define GSdefs
#include "PS2Edefs.h"
#include "../../common/PS2Edefs.h"
}
#ifdef _WIN32
@ -36,6 +36,10 @@ extern "C" {
extern HWND GShwnd;
extern "C" u32 CALLBACK PS2EgetLibType(void);
extern "C" u32 CALLBACK PS2EgetLibVersion2(u32 type);
extern "C" char* CALLBACK PS2EgetLibName(void);
#else // linux basic definitions
#include <GL/glew.h>
@ -49,15 +53,22 @@ extern HWND GShwnd;
#include <sys/stat.h>
#include <sys/types.h>
#include <assert.h>
#include <math.h>
#include <vector>
#include <string>
using namespace std;
#include "zerogsmath.h"
extern u32 THR_KeyEvent; // value for passing out key events beetwen threads
extern bool THR_bShift;
#define __inline inline
#if !defined(_MSC_VER) && !defined(HAVE_ALIGNED_MALLOC)
// declare linux equivalents
extern __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
static __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
{
assert( align < 0x10000 );
char* p = (char*)malloc(size+align);
@ -69,7 +80,7 @@ extern __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
return p;
}
extern __forceinline void pcsx2_aligned_free(void* pmem)
static __forceinline void pcsx2_aligned_free(void* pmem)
{
if( pmem != NULL ) {
char* p = (char*)pmem;
@ -124,15 +135,6 @@ extern GLWindow GLWin;
#endif // linux basic definitions
#include <assert.h>
#include <math.h>
#include <vector>
#include <string>
using namespace std;
#include "zerogsmath.h"
#if defined(_MSC_VER)
#define FASTCALL(fn) __fastcall fn
#else
@ -767,7 +769,7 @@ private:
// converts float16 [0,1] to BYTE [0,255] (assumes value is in range, otherwise will take lower 8bits)
// f is a u16
__forceinline u16 Float16ToBYTE(u16 f) {
static __forceinline u16 Float16ToBYTE(u16 f) {
//assert( !(f & 0x8000) );
if( f & 0x8000 ) return 0;
@ -775,7 +777,7 @@ __forceinline u16 Float16ToBYTE(u16 f) {
return d > 255 ? 255 : d;
}
__forceinline u16 Float16ToALPHA(u16 f) {
static __forceinline u16 Float16ToALPHA(u16 f) {
//assert( !(f & 0x8000) );
if( f & 0x8000 ) return 0;
@ -837,8 +839,8 @@ class DVProfileFunc
{
public:
u32 dwUserData;
__forceinline DVProfileFunc(char* pname) {}
__forceinline DVProfileFunc(char* pname, u32 dwUserData) { }
static __forceinline DVProfileFunc(char* pname) {}
static __forceinline DVProfileFunc(char* pname, u32 dwUserData) { }
~DVProfileFunc() {}
};

View File

@ -52,7 +52,7 @@ void CALLBACK GSkeyEvent(keyEvent *ev)
//static bool bShift = false;
static bool bAlt = false;
switch(ev->event) {
switch(ev->evt) {
case KEYPRESS:
switch(ev->key) {
case XK_F5:

View File

@ -84,7 +84,7 @@ extern u32 g_pageTable16SZ[64][64];
extern u32 g_pageTable8[64][128];
extern u32 g_pageTable4[128][128];
__forceinline u32 getPixelAddress32(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress32(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
u32 word = bp * 64 + basepage * 2048 + g_pageTable32[y&31][x&63];
//assert (word < 0x100000);
@ -92,7 +92,7 @@ __forceinline u32 getPixelAddress32(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress32_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress32_0(int x, int y, u32 bw) {
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
u32 word = basepage * 2048 + g_pageTable32[y&31][x&63];
//assert (word < 0x100000);
@ -109,7 +109,7 @@ __forceinline u32 getPixelAddress32_0(int x, int y, u32 bw) {
#define getPixelAddress4HH getPixelAddress32
#define getPixelAddress4HH_0 getPixelAddress32_0
__forceinline u32 getPixelAddress16(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress16(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = bp * 128 + basepage * 4096 + g_pageTable16[y&63][x&63];
//assert (word < 0x200000);
@ -117,7 +117,7 @@ __forceinline u32 getPixelAddress16(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress16_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress16_0(int x, int y, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = basepage * 4096 + g_pageTable16[y&63][x&63];
//assert (word < 0x200000);
@ -125,7 +125,7 @@ __forceinline u32 getPixelAddress16_0(int x, int y, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress16S(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress16S(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = bp * 128 + basepage * 4096 + g_pageTable16S[y&63][x&63];
//assert (word < 0x200000);
@ -133,7 +133,7 @@ __forceinline u32 getPixelAddress16S(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress16S_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress16S_0(int x, int y, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = basepage * 4096 + g_pageTable16S[y&63][x&63];
//assert (word < 0x200000);
@ -141,7 +141,7 @@ __forceinline u32 getPixelAddress16S_0(int x, int y, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress8(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress8(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>6) * ((bw+127)>>7)) + (x>>7);
u32 word = bp * 256 + basepage * 8192 + g_pageTable8[y&63][x&127];
//assert (word < 0x400000);
@ -149,7 +149,7 @@ __forceinline u32 getPixelAddress8(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress8_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress8_0(int x, int y, u32 bw) {
u32 basepage = ((y>>6) * ((bw+127)>>7)) + (x>>7);
u32 word = basepage * 8192 + g_pageTable8[y&63][x&127];
//assert (word < 0x400000);
@ -157,7 +157,7 @@ __forceinline u32 getPixelAddress8_0(int x, int y, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress4(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress4(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>7) * ((bw+127)>>7)) + (x>>7);
u32 word = bp * 512 + basepage * 16384 + g_pageTable4[y&127][x&127];
//assert (word < 0x800000);
@ -165,7 +165,7 @@ __forceinline u32 getPixelAddress4(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress4_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress4_0(int x, int y, u32 bw) {
u32 basepage = ((y>>7) * ((bw+127)>>7)) + (x>>7);
u32 word = basepage * 16384 + g_pageTable4[y&127][x&127];
//assert (word < 0x800000);
@ -173,7 +173,7 @@ __forceinline u32 getPixelAddress4_0(int x, int y, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress32Z(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress32Z(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
u32 word = bp * 64 + basepage * 2048 + g_pageTable32Z[y&31][x&63];
//assert (word < 0x100000);
@ -181,7 +181,7 @@ __forceinline u32 getPixelAddress32Z(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress32Z_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress32Z_0(int x, int y, u32 bw) {
u32 basepage = ((y>>5) * (bw>>6)) + (x>>6);
u32 word = basepage * 2048 + g_pageTable32Z[y&31][x&63];
//assert (word < 0x100000);
@ -192,7 +192,7 @@ __forceinline u32 getPixelAddress32Z_0(int x, int y, u32 bw) {
#define getPixelAddress24Z getPixelAddress32Z
#define getPixelAddress24Z_0 getPixelAddress32Z_0
__forceinline u32 getPixelAddress16Z(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress16Z(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = bp * 128 + basepage * 4096 + g_pageTable16Z[y&63][x&63];
//assert (word < 0x200000);
@ -200,7 +200,7 @@ __forceinline u32 getPixelAddress16Z(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress16Z_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress16Z_0(int x, int y, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = basepage * 4096 + g_pageTable16Z[y&63][x&63];
//assert (word < 0x200000);
@ -208,7 +208,7 @@ __forceinline u32 getPixelAddress16Z_0(int x, int y, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress16SZ(int x, int y, u32 bp, u32 bw) {
static __forceinline u32 getPixelAddress16SZ(int x, int y, u32 bp, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = bp * 128 + basepage * 4096 + g_pageTable16SZ[y&63][x&63];
//assert (word < 0x200000);
@ -216,7 +216,7 @@ __forceinline u32 getPixelAddress16SZ(int x, int y, u32 bp, u32 bw) {
return word;
}
__forceinline u32 getPixelAddress16SZ_0(int x, int y, u32 bw) {
static __forceinline u32 getPixelAddress16SZ_0(int x, int y, u32 bw) {
u32 basepage = ((y>>6) * (bw>>6)) + (x>>6);
u32 word = basepage * 4096 + g_pageTable16SZ[y&63][x&63];
//assert (word < 0x200000);
@ -224,95 +224,95 @@ __forceinline u32 getPixelAddress16SZ_0(int x, int y, u32 bw) {
return word;
}
__forceinline void writePixel32(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel32(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u32*)pmem)[getPixelAddress32(x, y, bp, bw)] = pixel;
}
__forceinline void writePixel24(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel24(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
u8 *buf = (u8*)&((u32*)pmem)[getPixelAddress32(x, y, bp, bw)];
u8 *pix = (u8*)&pixel;
buf[0] = pix[0]; buf[1] = pix[1]; buf[2] = pix[2];
}
__forceinline void writePixel16(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel16(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u16*)pmem)[getPixelAddress16(x, y, bp, bw)] = pixel;
}
__forceinline void writePixel16S(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel16S(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u16*)pmem)[getPixelAddress16S(x, y, bp, bw)] = pixel;
}
__forceinline void writePixel8(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel8(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u8*)pmem)[getPixelAddress8(x, y, bp, bw)] = pixel;
}
__forceinline void writePixel8H(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel8H(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u8*)pmem)[4*getPixelAddress32(x, y, bp, bw)+3] = pixel;
}
__forceinline void writePixel4(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel4(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
u32 addr = getPixelAddress4(x, y, bp, bw);
u8 pix = ((u8*)pmem)[addr/2];
if (addr & 0x1) ((u8*)pmem)[addr/2] = (pix & 0x0f) | (pixel << 4);
else ((u8*)pmem)[addr/2] = (pix & 0xf0) | (pixel);
}
__forceinline void writePixel4HL(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel4HL(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
u8 *p = (u8*)pmem + 4*getPixelAddress4HL(x, y, bp, bw)+3;
*p = (*p & 0xf0) | pixel;
}
__forceinline void writePixel4HH(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel4HH(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
u8 *p = (u8*)pmem + 4*getPixelAddress4HH(x, y, bp, bw)+3;
*p = (*p & 0x0f) | (pixel<<4);
}
__forceinline void writePixel32Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel32Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u32*)pmem)[getPixelAddress32Z(x, y, bp, bw)] = pixel;
}
__forceinline void writePixel24Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel24Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
u8 *buf = (u8*)pmem + 4*getPixelAddress32Z(x, y, bp, bw);
u8 *pix = (u8*)&pixel;
buf[0] = pix[0]; buf[1] = pix[1]; buf[2] = pix[2];
}
__forceinline void writePixel16Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel16Z(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u16*)pmem)[getPixelAddress16Z(x, y, bp, bw)] = pixel;
}
__forceinline void writePixel16SZ(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
static __forceinline void writePixel16SZ(void* pmem, int x, int y, u32 pixel, u32 bp, u32 bw) {
((u16*)pmem)[getPixelAddress16SZ(x, y, bp, bw)] = pixel;
}
///////////////
__forceinline u32 readPixel32(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel32(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32(x, y, bp, bw)];
}
__forceinline u32 readPixel24(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel24(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32(x, y, bp, bw)] & 0xffffff;
}
__forceinline u32 readPixel16(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel16(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16(x, y, bp, bw)];
}
__forceinline u32 readPixel16S(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel16S(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16S(x, y, bp, bw)];
}
__forceinline u32 readPixel8(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel8(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u8*)pmem)[getPixelAddress8(x, y, bp, bw)];
}
__forceinline u32 readPixel8H(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel8H(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u8*)pmem)[4*getPixelAddress32(x, y, bp, bw) + 3];
}
__forceinline u32 readPixel4(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel4(const void* pmem, int x, int y, u32 bp, u32 bw) {
u32 addr = getPixelAddress4(x, y, bp, bw);
u8 pix = ((const u8*)pmem)[addr/2];
if (addr & 0x1)
@ -320,31 +320,31 @@ __forceinline u32 readPixel4(const void* pmem, int x, int y, u32 bp, u32 bw) {
else return pix & 0xf;
}
__forceinline u32 readPixel4HL(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel4HL(const void* pmem, int x, int y, u32 bp, u32 bw) {
const u8 *p = (const u8*)pmem+4*getPixelAddress4HL(x, y, bp, bw)+3;
return *p & 0x0f;
}
__forceinline u32 readPixel4HH(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel4HH(const void* pmem, int x, int y, u32 bp, u32 bw) {
const u8 *p = (const u8*)pmem+4*getPixelAddress4HH(x, y, bp, bw) + 3;
return *p >> 4;
}
///////////////
__forceinline u32 readPixel32Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel32Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32Z(x, y, bp, bw)];
}
__forceinline u32 readPixel24Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel24Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32Z(x, y, bp, bw)] & 0xffffff;
}
__forceinline u32 readPixel16Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel16Z(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16Z(x, y, bp, bw)];
}
__forceinline u32 readPixel16SZ(const void* pmem, int x, int y, u32 bp, u32 bw) {
static __forceinline u32 readPixel16SZ(const void* pmem, int x, int y, u32 bp, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16SZ(x, y, bp, bw)];
}
@ -352,11 +352,11 @@ __forceinline u32 readPixel16SZ(const void* pmem, int x, int y, u32 bp, u32 bw)
// Functions that take 0 bps //
///////////////////////////////
__forceinline void writePixel32_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel32_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u32*)pmem)[getPixelAddress32_0(x, y, bw)] = pixel;
}
__forceinline void writePixel24_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel24_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
u8 *buf = (u8*)&((u32*)pmem)[getPixelAddress32_0(x, y, bw)];
u8 *pix = (u8*)&pixel;
#if defined(_MSC_VER) && defined(__x86_64__)
@ -366,44 +366,44 @@ __forceinline void writePixel24_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
#endif
}
__forceinline void writePixel16_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel16_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u16*)pmem)[getPixelAddress16_0(x, y, bw)] = pixel;
}
__forceinline void writePixel16S_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel16S_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u16*)pmem)[getPixelAddress16S_0(x, y, bw)] = pixel;
}
__forceinline void writePixel8_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel8_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u8*)pmem)[getPixelAddress8_0(x, y, bw)] = pixel;
}
__forceinline void writePixel8H_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel8H_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u8*)pmem)[4*getPixelAddress32_0(x, y, bw)+3] = pixel;
}
__forceinline void writePixel4_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel4_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
u32 addr = getPixelAddress4_0(x, y, bw);
u8 pix = ((u8*)pmem)[addr/2];
if (addr & 0x1) ((u8*)pmem)[addr/2] = (pix & 0x0f) | (pixel << 4);
else ((u8*)pmem)[addr/2] = (pix & 0xf0) | (pixel);
}
__forceinline void writePixel4HL_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel4HL_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
u8 *p = (u8*)pmem + 4*getPixelAddress4HL_0(x, y, bw)+3;
*p = (*p & 0xf0) | pixel;
}
__forceinline void writePixel4HH_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel4HH_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
u8 *p = (u8*)pmem + 4*getPixelAddress4HH_0(x, y, bw)+3;
*p = (*p & 0x0f) | (pixel<<4);
}
__forceinline void writePixel32Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel32Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u32*)pmem)[getPixelAddress32Z_0(x, y, bw)] = pixel;
}
__forceinline void writePixel24Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel24Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
u8 *buf = (u8*)pmem + 4*getPixelAddress32Z_0(x, y, bw);
u8 *pix = (u8*)&pixel;
#if defined(_MSC_VER) && defined(__x86_64__)
@ -413,42 +413,42 @@ __forceinline void writePixel24Z_0(void* pmem, int x, int y, u32 pixel, u32 bw)
#endif
}
__forceinline void writePixel16Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel16Z_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u16*)pmem)[getPixelAddress16Z_0(x, y, bw)] = pixel;
}
__forceinline void writePixel16SZ_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
static __forceinline void writePixel16SZ_0(void* pmem, int x, int y, u32 pixel, u32 bw) {
((u16*)pmem)[getPixelAddress16SZ_0(x, y, bw)] = pixel;
}
///////////////
__forceinline u32 readPixel32_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel32_0(const void* pmem, int x, int y, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32_0(x, y, bw)];
}
__forceinline u32 readPixel24_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel24_0(const void* pmem, int x, int y, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32_0(x, y, bw)] & 0xffffff;
}
__forceinline u32 readPixel16_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel16_0(const void* pmem, int x, int y, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16_0(x, y, bw)];
}
__forceinline u32 readPixel16S_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel16S_0(const void* pmem, int x, int y, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16S_0(x, y, bw)];
}
__forceinline u32 readPixel8_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel8_0(const void* pmem, int x, int y, u32 bw) {
return ((const u8*)pmem)[getPixelAddress8_0(x, y, bw)];
}
__forceinline u32 readPixel8H_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel8H_0(const void* pmem, int x, int y, u32 bw) {
return ((const u8*)pmem)[4*getPixelAddress32_0(x, y, bw) + 3];
}
__forceinline u32 readPixel4_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel4_0(const void* pmem, int x, int y, u32 bw) {
u32 addr = getPixelAddress4_0(x, y, bw);
u8 pix = ((const u8*)pmem)[addr/2];
if (addr & 0x1)
@ -456,31 +456,31 @@ __forceinline u32 readPixel4_0(const void* pmem, int x, int y, u32 bw) {
else return pix & 0xf;
}
__forceinline u32 readPixel4HL_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel4HL_0(const void* pmem, int x, int y, u32 bw) {
const u8 *p = (const u8*)pmem+4*getPixelAddress4HL_0(x, y, bw)+3;
return *p & 0x0f;
}
__forceinline u32 readPixel4HH_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel4HH_0(const void* pmem, int x, int y, u32 bw) {
const u8 *p = (const u8*)pmem+4*getPixelAddress4HH_0(x, y, bw) + 3;
return *p >> 4;
}
///////////////
__forceinline u32 readPixel32Z_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel32Z_0(const void* pmem, int x, int y, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32Z_0(x, y, bw)];
}
__forceinline u32 readPixel24Z_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel24Z_0(const void* pmem, int x, int y, u32 bw) {
return ((const u32*)pmem)[getPixelAddress32Z_0(x, y, bw)] & 0xffffff;
}
__forceinline u32 readPixel16Z_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel16Z_0(const void* pmem, int x, int y, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16Z_0(x, y, bw)];
}
__forceinline u32 readPixel16SZ_0(const void* pmem, int x, int y, u32 bw) {
static __forceinline u32 readPixel16SZ_0(const void* pmem, int x, int y, u32 bw) {
return ((const u16*)pmem)[getPixelAddress16SZ_0(x, y, bw)];
}

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@ AM_INIT_AUTOMAKE(ZeroGSogl,0.96.2)
AC_PROG_CC([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CXX([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AC_PROG_CPP([gcc g++ cl KCC CC cxx cc++ xlC aCC c++])
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_RANLIB
@ -36,13 +37,13 @@ if test "x$debug" == xyes
then
AC_DEFINE(_DEBUG,1,[_DEBUG])
CFLAGS+="-g "
CPPFLAGS+="-g "
CXXFLAGS+="-g "
CPPFLAGS+="-g -fpermissive "
CXXFLAGS+="-g- fpermissive "
else
AC_DEFINE(NDEBUG,1,[NDEBUG])
CFLAGS+="-O3 -fomit-frame-pointer "
CPPFLAGS+="-O3 -fomit-frame-pointer "
CXXFLAGS+="-O3 -fomit-frame-pointer "
CPPFLAGS+="-O3 -fomit-frame-pointer -fpermissive "
CXXFLAGS+="-O3 -fomit-frame-pointer -fpermissive "
fi
AC_MSG_RESULT($debug)

View File

@ -76,8 +76,7 @@ MEMCPY_AMD.CPP
#endif
extern "C" {
#include "PS2Etypes.h"
#include "../../common/PS2Etypes.h"
#if defined(_MSC_VER) && !defined(__x86_64__)

View File

@ -285,7 +285,7 @@ void CALLBACK PADupdate(int pad)
}
}
event.event = KEYPRESS;
event.evt = KEYPRESS;
event.key = key;
break;
case KeyRelease:
@ -299,7 +299,7 @@ void CALLBACK PADupdate(int pad)
}
}
event.event = KEYRELEASE;
event.evt = KEYRELEASE;
event.key = key;
break;

View File

@ -20,16 +20,17 @@
#include <stdarg.h>
#include "zeropad.h"
#include "svnrev.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#ifndef _WIN32
#include <unistd.h>
#else
#include "svnrev.h"
#endif
static char libraryName[256];
char libraryName[256];
PADAnalog g_lanalog[2], g_ranalog[2];
PADconf conf;
@ -115,7 +116,7 @@ void _KeyPress(int pad, u32 key)
}
}
event.event = KEYPRESS;
event.evt = KEYPRESS;
event.key = key;
}
@ -130,12 +131,13 @@ void _KeyRelease(int pad, u32 key)
}
}
event.event = KEYRELEASE;
event.evt = KEYRELEASE;
event.key = key;
}
static void InitLibraryName()
{
#ifdef _WIN32
#ifdef PUBLIC
// Public Release!
@ -169,7 +171,15 @@ static void InitLibraryName()
SVN_MODS ? "m" : ""
);
#endif
#else
// I'll fix up SVN support later. --arcum42
strcpy( libraryName, "ZeroPAD Playground"
# ifdef _DEBUG
"-Debug"
# endif
);
#endif
}
u32 CALLBACK PS2EgetLibType() {
@ -513,6 +523,6 @@ static keyEvent s_event;
keyEvent* CALLBACK PADkeyEvent()
{
s_event = event;
event.event = 0;
event.evt = 0;
return &s_event;
}

View File

@ -42,10 +42,10 @@ using namespace std;
#define PADdefs
extern "C" {
#include "PS2Edefs.h"
#include "../common/PS2Edefs.h"
}
extern char *libraryName;
extern char libraryName[256];
#define FORIT(it, v) for(it = (v).begin(); it != (v).end(); (it)++)

View File

@ -26,6 +26,7 @@ extern "C" {
#include "callbacks.h"
}
#include "zerospu2.h"
#include "Linux.h"
// This is a bit ugly. I'll see if I can work out a better way to do this later.
@ -150,7 +151,7 @@ void on_Conf_Cancel (GtkButton *button, gpointer user_data)
}
extern char* libraryName;
extern char *libraryName;
extern string s_strIniPath;
void CALLBACK SPU2about() {

View File

@ -18,6 +18,9 @@
// Modified by arcum42@gmail.com
#ifndef __LINUX_H__
#define __LINUX_H__
#include <assert.h>
#include <stdlib.h>
@ -26,8 +29,6 @@
#include <sys/soundcard.h>
#include <unistd.h>
#include "zerospu2.h"
// Make it easier to check and set checkmarks in the gui
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
@ -69,3 +70,4 @@ extern void RemoveSound();
extern int SoundGetBytesBuffered();
extern void SoundFeedVoiceData(unsigned char* pSound,long lBytes);
#endif // __LINUX_H__

View File

@ -21,7 +21,9 @@
#include <assert.h>
#include <stdlib.h>
#ifdef _WIN32
#include "svnrev.h"
#endif
#include "SoundTouch/SoundTouch.h"
#include "SoundTouch/WavFile.h"
@ -39,7 +41,7 @@
#define NSFRAMES 16 // gather at least NSFRAMES of NSSIZE before submitting
#define NSPACKETS 24
static char libraryName[256];
char libraryName[256];
FILE *spu2Log;
Config conf;
@ -135,6 +137,7 @@ VOICE_PROCESSED voices[SPU_NUMBER_VOICES+1]; // +1 for modulation
static void InitLibraryName()
{
#ifdef _WIN32
#ifdef PUBLIC
// Public Release!
@ -168,6 +171,15 @@ static void InitLibraryName()
SVN_MODS ? "m" : ""
);
#endif
#else
// I'll hook in svn version code later. --arcum42
strcpy( libraryName, "ZeroSPU2 Playground"
# ifdef _DEBUG
"-Debug"
# endif
);
# endif
}

View File

@ -27,7 +27,7 @@
extern "C" {
#define SPU2defs
#include "PS2Edefs.h"
#include "../common/PS2Edefs.h"
}
#ifdef __LINUX__
@ -79,7 +79,6 @@ inline u64 GetMicroTime()
using namespace std;
extern FILE *spu2Log;
#ifdef _DEBUG
#define SPU2_LOG __Log //debug mode
#else
@ -123,7 +122,7 @@ void SoundFeedVoiceData(unsigned char* pSound,long lBytes);
#include <assert.h>
// declare linux equivalents
extern __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
static __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
{
assert( align < 0x10000 );
char* p = (char*)malloc(size+align);
@ -135,7 +134,7 @@ extern __forceinline void* pcsx2_aligned_malloc(size_t size, size_t align)
return p;
}
extern __forceinline void pcsx2_aligned_free(void* pmem)
static __forceinline void pcsx2_aligned_free(void* pmem)
{
if( pmem != NULL ) {
char* p = (char*)pmem;
@ -145,7 +144,6 @@ extern __forceinline void pcsx2_aligned_free(void* pmem)
#define _aligned_malloc pcsx2_aligned_malloc
#define _aligned_free pcsx2_aligned_free
#endif
// Atomic Operations
@ -162,7 +160,7 @@ extern "C" LONG __cdecl _InterlockedExchangeAdd(LPLONG volatile Addend, LONG Va
typedef void* PVOID;
__forceinline long InterlockedExchangeAdd(long volatile* Addend, long Value)
static __forceinline long InterlockedExchangeAdd(long volatile* Addend, long Value)
{
__asm__ __volatile__(".intel_syntax\n"
"lock xadd [%0], %%eax\n"