Thanks to a patch by Zeydlitz, the Linux build of pcsx2 works! (The plugins still need fixing from the reorg, but I'll get that later.)

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@689 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2009-02-03 20:48:57 +00:00 committed by Gregory Hainaut
parent cc0053c1e7
commit 1de54165b5
13 changed files with 135 additions and 22 deletions

View File

@ -1,4 +1,4 @@
INCLUDES = -I@srcdir@/../ -I@srcdir@/../../common/ INCLUDES = -I@srcdir@/../ -I@srcdir@/../common/
noinst_LIBRARIES = libDebugTools.a noinst_LIBRARIES = libDebugTools.a
libDebugTools_a_SOURCES = \ libDebugTools_a_SOURCES = \

View File

@ -1,4 +1,4 @@
INCLUDES = -I@srcdir@/../ -I@srcdir@/../x86 -I@srcdir@/../../common/ INCLUDES = -I@srcdir@/../ -I@srcdir@/../x86 -I@srcdir@/../common/
noinst_LIBRARIES = libIPU.a noinst_LIBRARIES = libIPU.a
libIPU_a_SOURCES = IPU.cpp yuv2rgb.cpp coroutine.cpp \ libIPU_a_SOURCES = IPU.cpp yuv2rgb.cpp coroutine.cpp \

View File

@ -1,4 +1,4 @@
INCLUDES = -I@srcdir@/../ -I@srcdir@/../../ -I@srcdir@/../../../common/ INCLUDES = -I@srcdir@/../ -I@srcdir@/../../ -I@srcdir@/../../common/
noinst_LIBRARIES = libmpeg2IPU.a noinst_LIBRARIES = libmpeg2IPU.a
libmpeg2IPU_a_SOURCES = Idct.cpp Mpeg.cpp Mpeg.h Vlc.h libmpeg2IPU_a_SOURCES = Idct.cpp Mpeg.cpp Mpeg.h Vlc.h

View File

@ -20,9 +20,12 @@
#define COLOR_RESET "\033[0m" #define COLOR_RESET "\033[0m"
// Linux Note : The Linux Console is pretty simple. It just dumps to the stdio! // Linux Note : The Linux Console is pretty simple. It just dumps to the stdio!
// (no console open/close/title stuff tho, so those functions are dummies) // (no console open/close/title stuff tho, so those functions are dummies)
// Fixme - A lot of extra \ns are being added in here somewhere. I think it's
// partially in SetColor/ClearColor, as colored lines have more extra \ns then the other
// lines.
namespace Console namespace Console
{ {
static const char* tbl_color_codes[] = static const char* tbl_color_codes[] =

View File

@ -1,5 +1,5 @@
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../ -I@srcdir@/../../common/ INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../ -I@srcdir@/../common/
bin_PROGRAMS = pcsx2 bin_PROGRAMS = pcsx2

View File

@ -67,4 +67,116 @@ static __forceinline void memset16_obj( T& obj )
memset32_obj<data + (data<<16)>( obj ); memset32_obj<data + (data<<16)>( obj );
} }
// An optimized memset for 8 bit destination data.
template< u8 data, size_t bytes >
static __forceinline void memset_8( void *dest )
{
if( bytes == 0 ) return;
if( (bytes & 0x3) != 0 )
{
// unaligned data length. No point in doing an optimized inline version (too complicated!)
// So fall back on the compiler implementation:
memset( dest, data, bytes );
return;
}
// This function only works on 32-bit alignments of data copied.
jASSUME( (bytes & 0x3) == 0 );
enum
{
remdat = bytes>>2,
data32 = data + (data<<8) + (data<<16) + (data<<24)
};
// macro to execute the x86/32 "stosd" copies.
switch( remdat )
{
case 1:
*(u32*)dest = data32;
return;
case 2:
((u32*)dest)[0] = data32;
((u32*)dest)[1] = data32;
return;
case 3:
__asm__
(
".intel_syntax\n"
"cld\n"
// "mov %edi, %0\n"
// "mov %eax, %1\n"
"stosd\n"
"stosd\n"
"stosd\n"
".att_syntax\n"
:
: "D"(dest), "a"(data32)
// D - edi, a -- eax, c ecx
:
);
return;
case 4:
__asm__
(
".intel_syntax\n"
"cld\n"
// "mov %edi, %0\n"
// "mov %eax, %1\n"
"stosd\n"
"stosd\n"
"stosd\n"
"stosd\n"
".att_syntax\n"
:
: "D"(dest), "a"(data32)
:
);
return;
case 5:
__asm__
(
".intel_syntax\n"
"cld\n"
// "mov %edi, %0\n"
// "mov %eax, %1\n"
"stosd\n"
"stosd\n"
"stosd\n"
"stosd\n"
"stosd\n"
".att_syntax\n"
:
: "D"(dest), "a"(data32)
:
);
return;
default:
__asm__
(
".intel_syntax\n"
"cld\n"
// "mov ecx, %0\n"
// "mov edi, %1\n"
// "mov eax, %2\n"
"rep stosd\n"
".att_syntax\n"
:
: "c"(remdat), "D"(dest), "a"(data32)
:
);
return;
}
}
#endif #endif

View File

@ -859,7 +859,7 @@ int SysPageFaultExceptionFilter(EXCEPTION_POINTERS* eps)
#else #else
#include "errno.h" #include "errno.h"
__forceinline void __fastcall InstallLinuxExceptionHandler() void InstallLinuxExceptionHandler()
{ {
struct sigaction sa; struct sigaction sa;
@ -869,13 +869,13 @@ __forceinline void __fastcall InstallLinuxExceptionHandler()
sigaction(SIGSEGV, &sa, NULL); sigaction(SIGSEGV, &sa, NULL);
} }
__forceinline void __fastcall ReleaseLinuxExceptionHandler() void ReleaseLinuxExceptionHandler()
{ {
// Code this later. // Code this later.
} }
// Linux implementation of SIGSEGV handler. Bind it using sigaction(). // Linux implementation of SIGSEGV handler. Bind it using sigaction().
// This is my shot in the dark. Probably needs some work. Good luck! (air) // This is my shot in the dark. Probably needs some work. Good luck! (air)
__forceinline void __fastcall SysPageFaultExceptionFilter( int signal, siginfo_t *info, void * ) void SysPageFaultExceptionFilter( int signal, siginfo_t *info, void * )
{ {
int err; int err;
u32 pagesize = getpagesize(); u32 pagesize = getpagesize();
@ -885,6 +885,8 @@ __forceinline void __fastcall SysPageFaultExceptionFilter( int signal, siginfo_t
u32 offset = (u8*)info->si_addr - psM; u32 offset = (u8*)info->si_addr - psM;
uptr pageoffset = ( offset / pagesize ) * pagesize; uptr pageoffset = ( offset / pagesize ) * pagesize;
DevCon::Status( "Protected memory cleanup. Offset 0x%x", params offset );
if (offset>=Ps2MemSize::Base) if (offset>=Ps2MemSize::Base)
{ {
// Bad mojo! Completly invalid address. // Bad mojo! Completly invalid address.

View File

@ -1,4 +1,4 @@
INCLUDES = -I@srcdir@/../ -I@srcdir@/../../common/ INCLUDES = -I@srcdir@/../ -I@srcdir@/../common/
noinst_LIBRARIES = libRDebug.a noinst_LIBRARIES = libRDebug.a
libRDebug_a_SOURCES = \ libRDebug_a_SOURCES = \

View File

@ -34,9 +34,9 @@
using namespace R5900; using namespace R5900;
FILE *emuLog; FILE *emuLog;
u32 varLog;
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
u32 varLog;
// these used by the depreciated _old_Log only // these used by the depreciated _old_Log only
u16 logProtocol; u16 logProtocol;

View File

@ -1,4 +1,4 @@
INCLUDES = -I@srcdir@/../ -I@srcdir@/../../common/ -I@srcdir@/../IPU/ INCLUDES = -I@srcdir@/../ -I@srcdir@/../common/ -I@srcdir@/../IPU/
noinst_LIBRARIES = libx86recomp.a noinst_LIBRARIES = libx86recomp.a
# have to add the sources instead of making a library since the linking is complicated # have to add the sources instead of making a library since the linking is complicated

View File

@ -113,10 +113,10 @@ static u32 dumplog = 0;
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
// and not sure what these might have once been used for... (air) // and not sure what these might have once been used for... (air)
static const char *txt0 = "EAX = %x : ECX = %x : EDX = %x\n"; //static const char *txt0 = "EAX = %x : ECX = %x : EDX = %x\n";
static const char *txt0RC = "EAX = %x : EBX = %x : ECX = %x : EDX = %x : ESI = %x : EDI = %x\n"; //static const char *txt0RC = "EAX = %x : EBX = %x : ECX = %x : EDX = %x : ESI = %x : EDI = %x\n";
static const char *txt1 = "REG[%d] = %x_%x\n"; //static const char *txt1 = "REG[%d] = %x_%x\n";
static const char *txt2 = "M32 = %x\n"; //static const char *txt2 = "M32 = %x\n";
#endif #endif
static void iBranchTest(u32 newpc, bool noDispatch=false); static void iBranchTest(u32 newpc, bool noDispatch=false);

View File

@ -1,4 +1,4 @@
INCLUDES = -I@srcdir@/.. -I@srcdir@/../../ -I@srcdir@/../../../common/ INCLUDES = -I@srcdir@/.. -I@srcdir@/../../ -I@srcdir@/../../common/
noinst_LIBRARIES = libix86.a noinst_LIBRARIES = libix86.a
libix86_a_SOURCES = ix86_tools.cpp ix86_3dnow.cpp ix86.cpp ix86_cpudetect.cpp ix86_fpu.cpp ix86.h ix86_sse.cpp ix86_mmx.cpp libix86_a_SOURCES = ix86_tools.cpp ix86_3dnow.cpp ix86.cpp ix86_cpudetect.cpp ix86_fpu.cpp ix86.h ix86_sse.cpp ix86_mmx.cpp

View File

@ -1082,12 +1082,10 @@ __forceinline void SSE4_DPPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from, u8
__forceinline void SSE4_DPPS_M128_to_XMM(x86SSERegType to, uptr from, u8 imm8) __forceinline void SSE4_DPPS_M128_to_XMM(x86SSERegType to, uptr from, u8 imm8)
{ {
const int overb = 0; // TODO: x64?
write8(0x66); write8(0x66);
write24(0x403A0F); write24(0x403A0F);
ModRM(0, to, DISP32); ModRM(0, to, DISP32);
write32(MEMADDR(from, 4 + overb)); write32(MEMADDR(from, 4));
write8(imm8); write8(imm8);
} }
@ -1128,13 +1126,11 @@ __forceinline void SSE4_BLENDVPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from
__forceinline void SSE4_BLENDVPS_M128_to_XMM(x86SSERegType to, uptr from) __forceinline void SSE4_BLENDVPS_M128_to_XMM(x86SSERegType to, uptr from)
{ {
const int overb = 0; // TODO: x64?
write8(0x66); write8(0x66);
RexR(0, to); RexR(0, to);
write24(0x14380F); write24(0x14380F);
ModRM(0, to, DISP32); ModRM(0, to, DISP32);
write32(MEMADDR(from, 4 + overb)); write32(MEMADDR(from, 4));
} }
__forceinline void SSE4_PMOVSXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from) __forceinline void SSE4_PMOVSXDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from)