Let's see: Fix Linux build so it compiles, both under normal and devbuilds. Add the ZeroGS patch for SSE2, and preliminary work on the configuration issue. Get build.sh postix compliant. And let's not feed C++ strings to WriteLn.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@468 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-02-10 12:42:26 +00:00
parent c433291c67
commit 5249b67a56
9 changed files with 50 additions and 28 deletions

View File

@ -20,6 +20,7 @@
#define __LNXSYSEXEC_H__
#include "Linux.h"
#include "GS.h"
#include <sys/mman.h>
extern void StartGui();

View File

@ -3,10 +3,10 @@ INCLUDES = -I@srcdir@/x86/ -I@srcdir@/common/
noinst_LIBRARIES = libpcsx2.a
libpcsx2_a_SOURCES = \
CDVD.cpp CDVDiso.cpp CDVDisodrv.cpp COP0.cpp COP2.cpp Cache.cpp CdRom.cpp Console.cpp \
CDVD.cpp CDVDiso.cpp CDVDisodrv.cpp COP0.cpp COP2.cpp Cache.cpp CdRom.cpp Console.cpp HwRead.cpp HwWrite.cpp \
Counters.cpp Decode_XA.cpp Elfheader.cpp FPU.cpp FPU2.cpp FiFo.cpp Gif.cpp GS.cpp Hw.cpp Interpreter.cpp \
IopBios.cpp IopCounters.cpp IopDma.cpp IopHw.cpp IopMem.cpp IopSio2.cpp MMI.cpp MTGS.cpp \
Memory.cpp Misc.cpp Patch.cpp PathUtils.cpp Plugins.cpp PrecompiledHeader.cpp R3000A.cpp \
Memory.cpp MemoryCard.cpp Misc.cpp Patch.cpp PathUtils.cpp Plugins.cpp PrecompiledHeader.cpp R3000A.cpp \
R3000AInterpreter.cpp R3000AOpcodeTables.cpp R5900.cpp R5900OpcodeImpl.cpp R5900OpcodeTables.cpp \
SPR.cpp SaveState.cpp Sif.cpp Sio.cpp SourceLog.cpp Stats.cpp System.cpp ThreadTools.cpp \
VU0.cpp VU0micro.cpp VU0microInterp.cpp VU1micro.cpp VU1microInterp.cpp VUflags.cpp VUmicroMem.cpp VUops.cpp \
@ -16,7 +16,7 @@ Vif.cpp VifDma.cpp vssprintf.cpp vtlb.cpp xmlpatchloader.cpp AlignedMalloc.cpp
libpcsx2_a_SOURCES += \
CDVD.h CDVDiso.h CDVDisodrv.h CDVDlib.h COP0.h Cache.h CdRom.h Common.h Counters.h Decode_XA.h EEregs.h \
Elfheader.h Exceptions.h GS.h Hw.h IopBios.h IopBios2.h IopCounters.h IopDma.h IopHw.h IopMem.h IopSio2.h Memcpyfast.h \
Memory.h Misc.h Patch.h Paths.h Plugins.h PrecompiledHeader.h PsxCommon.h R3000A.h R5900.h R5900OpcodeTables.h \
Memory.h MemoryCard.h Misc.h Patch.h Paths.h Plugins.h PrecompiledHeader.h PsxCommon.h R3000A.h R5900.h R5900OpcodeTables.h \
SPR.h SamplProf.h SaveState.h Sif.h Sifcmd.h Sio.h SafeArray.h Stats.h StringUtils.h System.h Threading.h \
VU.h VUflags.h VUmicro.h VUops.h Vif.h VifDma.h cheatscpp.h vtlb.h

View File

@ -386,7 +386,7 @@ void SaveGSState(const string& file)
if( g_SaveGSStream ) return;
Console::WriteLn( _("Saving GS State...") );
Console::WriteLn( "\t%hs", params file );
Console::WriteLn( "\t%hs", params file.c_str() );
g_fGSSave = new gzSavingState( file );

View File

@ -2,7 +2,7 @@
curdir=`pwd`
function buildplugin {
buildplugin() {
cd ${curdir}/$1
sh build.sh $2

View File

@ -39,12 +39,12 @@ void SaveConfig()
return;
}
fprintf(f, "interlace = %x\n", conf.interlace);
fprintf(f, "mrtdepth = %x\n", conf.mrtdepth);
fprintf(f, "options = %x\n", conf.options);
fprintf(f, "bilinear = %x\n", conf.bilinear);
fprintf(f, "aliasing = %x\n", conf.aa);
fprintf(f, "gamesettings = %x\n", conf.gamesettings);
fprintf(f, "interlace = %hhx\n", conf.interlace);
fprintf(f, "mrtdepth = %hhx\n", conf.mrtdepth);
fprintf(f, "options = %x\n", conf.options); //u32
fprintf(f, "bilinear = %hhx\n", conf.bilinear);
fprintf(f, "aliasing = %hhx\n", conf.aa);
fprintf(f, "gamesettings = %x\n", conf.gamesettings); //u32
fclose(f);
}
@ -70,12 +70,12 @@ void LoadConfig()
SaveConfig();//save and return
return;
}
fscanf(f, "interlace = %x\n", &conf.interlace);
fscanf(f, "mrtdepth = %x\n", &conf.mrtdepth);
fscanf(f, "options = %x\n", &conf.options);
fscanf(f, "bilinear = %x\n", &conf.bilinear);
fscanf(f, "aliasing = %x\n", &conf.aa);
fscanf(f, "gamesettings = %x\n", &conf.gamesettings);
fscanf(f, "interlace = %hhx\n", &conf.interlace);
fscanf(f, "mrtdepth = %hhx\n", &conf.mrtdepth);
fscanf(f, "options = %x\n", &conf.options);//u32
fscanf(f, "bilinear = %hhx\n", &conf.bilinear);
fscanf(f, "aliasing = %hhx\n", &conf.aa);
fscanf(f, "gamesettings = %x\n", &conf.gamesettings);//u32
fclose(f);
// filter bad files

View File

@ -112,6 +112,7 @@ void OnConf_Ok(GtkButton *button, gpointer user_data)
char *str;
int i;
// fixme; This doesn't look right; conf.interlace is a u8.
u32 newinterlace = is_checked(Conf, "checkInterlace");
if (!conf.interlace )
@ -198,13 +199,14 @@ void CALLBACK GSconfigure()
if (!(conf.options & GSOPTION_LOADED)) LoadConfig();
Conf = create_Config();
// fixme; Need to check "checkInterlace" as well.
set_checked(Conf, "checkBilinear", !!conf.bilinear);
//set_checked(Conf, "checkbutton6", conf.mrtdepth);
set_checked(Conf, "radioAANone", conf.aa==0);
set_checked(Conf, "radioAA2X", conf.aa==1);
set_checked(Conf, "radioAA4X", conf.aa==2);
set_checked(Conf, "radioAA8X", conf.aa==3);
set_checked(Conf, "radioAA16X", conf.aa==4);
set_checked(Conf, "radioAANone", (conf.aa==0));
set_checked(Conf, "radioAA2X", (conf.aa==1));
set_checked(Conf, "radioAA4X", (conf.aa==2));
set_checked(Conf, "radioAA8X", (conf.aa==3));
set_checked(Conf, "radioAA16X", (conf.aa==4));
set_checked(Conf, "checkWireframe", (conf.options&GSOPTION_WIREFRAME)?1:0);
set_checked(Conf, "checkAVI", (conf.options&GSOPTION_CAPTUREAVI)?1:0);
set_checked(Conf, "checkfullscreen", (conf.options&GSOPTION_FULLSCREEN)?1:0);

View File

@ -5361,6 +5361,8 @@ fi
$as_echo "$ac_cv_lib_Xxf86vm_main" >&6; }
if test "x$ac_cv_lib_Xxf86vm_main" = x""yes; then
LIBS="$LIBS -lXxf86vm"
else
echo "Error! You need to have libXxf86vm-dev." ; exit -1
fi

View File

@ -131,7 +131,7 @@ AC_CHECK_LIB(pthread,main,[LIBS="$LIBS -lpthread"])
AC_CHECK_LIB(stdc++,main,[LIBS="$LIBS -lstdc++"])
AC_CHECK_LIB(z,main,[LIBS="$LIBS -lz"])
AC_CHECK_LIB(dl,main,[LIBS="$LIBS -ldl"])
AC_CHECK_LIB(Xxf86vm,main,[LIBS="$LIBS -lXxf86vm"])
AC_CHECK_LIB(Xxf86vm,main,[LIBS="$LIBS -lXxf86vm"],[echo "Error! You need to have libXxf86vm-dev." ; exit -1])
dnl AC_CHECK_LIB(Cg,cgCreateContext,[LIBS="$LIBS -lCg"])
dnl AC_CHECK_LIB(CgGL,cgGLEnableProfile,[LIBS="$LIBS -lCgGL"])

View File

@ -1883,16 +1883,33 @@ ZeroGS::CMemoryTarget* ZeroGS::CMemoryTargetMngr::GetMemoryTarget(const tex0Info
}
else {
if( tex0.psm == PSMT16Z || tex0.psm == PSMT16SZ ) {
texdata.resize(4*GPU_TEXWIDTH*channels*widthmult*(targ->realheight+widthmult-1)/widthmult);
#if defined(ZEROGS_SSE2)
// reserve additional elements for alignment if SSE2 used.
texdata.resize(4 * GPU_TEXWIDTH * channels * widthmult * (targ->realheight + widthmult - 1) / widthmult + 15);
#else
texdata.resize(4 * GPU_TEXWIDTH * channels * widthmult * (targ->realheight + widthmult - 1) / widthmult);
#endif
ptexdata = &texdata[0];
// needs to be 8 bit, use xmm for unpacking
u16* dst = (u16*)ptexdata;
u16* src = (u16*)(g_pbyGSMemory + 4 * GPU_TEXWIDTH * targ->realy);
assert( ((u32)(uptr)dst)%16 == 0 );
#if defined(ZEROGS_SSE2)
if (((u32)(uptr)dst) % 16 != 0) {
// This is not an unusual situation, when vector<u8> does not align 16bit, it is destructive for SSE2
// instruction movdqa [%eax], xmm0
// The idea would be resize vector to 15 elements, and set ptxedata to an aligned position.
// Later we would move eax by 16, so we should only verify that the first element is aligned
// FIXME. As I see, texdata used only once here, it does not have any impact on other code.
// Probably, usage of _aligned_maloc() would be preferable.
// -- Zeydlitz
int disalignment = 16 - ((u32)(uptr)dst)%16 ; // This is value of shift. It could be 0 < disalignment <= 15
ptexdata = &texdata[disalignment]; // Set pointer to aligned element
dst = (u16*)ptexdata;
GS_LOG("Made alignment for texdata, 0x%x\n", dst );
assert( ((u32)(uptr)dst)%16 == 0 ); // Assert, because at future could be vectors with uncontigious spaces
}
int iters = targ->height*GPU_TEXWIDTH/16;
#if defined(_MSC_VER)