mirror of https://github.com/PCSX2/pcsx2.git
GSdx: gcc build runs, and judging by the frame rate it may even draw something.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4321 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
052cd4d45e
commit
d4b300a8ac
|
@ -44,7 +44,7 @@ EXPORT_C_(uint32) PSEgetLibType()
|
|||
return PSE_LT_GPU;
|
||||
}
|
||||
|
||||
EXPORT_C_(char*) PSEgetLibName()
|
||||
EXPORT_C_(const char*) PSEgetLibName()
|
||||
{
|
||||
return GSUtil::GetLibName();
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ EXPORT_C_(uint32) PS2EgetLibType()
|
|||
return PS2E_LT_GS;
|
||||
}
|
||||
|
||||
EXPORT_C_(char*) PS2EgetLibName()
|
||||
EXPORT_C_(const char*) PS2EgetLibName()
|
||||
{
|
||||
return GSUtil::GetLibName();
|
||||
}
|
||||
|
@ -194,12 +194,12 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
|
|||
case 0: case 1: case 2: dev = new GSDevice9(); break;
|
||||
case 3: case 4: case 5: dev = new GSDevice11(); break;
|
||||
#endif
|
||||
case 12: case 13: new GSDeviceNull(); break;
|
||||
case 12: case 13: dev = new GSDeviceNull(); break;
|
||||
}
|
||||
|
||||
if(dev == NULL)
|
||||
{
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(s_gs == NULL)
|
||||
|
@ -214,10 +214,10 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
|
|||
case 3:
|
||||
s_gs = new GSRendererDX11();
|
||||
break;
|
||||
#endif
|
||||
case 1: case 4: case 7: case 10: case 12:
|
||||
s_gs = new GSRendererSW(threads);
|
||||
break;
|
||||
#endif
|
||||
case 2: case 5: case 8: case 11: case 13:
|
||||
s_gs = new GSRendererNull();
|
||||
break;
|
||||
|
@ -290,7 +290,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags)
|
|||
if(flags & 4)
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
renderer = s_isdx11avail ? 4 : 1; // dx11 / dx9 sw
|
||||
renderer = s_isdx11avail ? 4 : 1; // dx11 / dx9 sw
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -542,6 +542,8 @@ EXPORT_C GSgetTitleInfo2(char* dest, size_t length)
|
|||
{
|
||||
string s = "GSdx";
|
||||
|
||||
if(s_gs != NULL) // TODO: this gets called from a different thread concurrently with GSOpen (on linux)
|
||||
|
||||
if(s_gs->m_GStitleInfoBuffer[0])
|
||||
{
|
||||
GSAutoLock lock(&s_gs->m_pGSsetTitle_Crit);
|
||||
|
|
|
@ -386,13 +386,13 @@ void GSRenderer::VSync(int field)
|
|||
|
||||
if(!m_snapshot.empty())
|
||||
{
|
||||
bool shift = false;
|
||||
bool shift = false;
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#ifdef _WINDOWS
|
||||
|
||||
shift = !!(::GetAsyncKeyState(VK_SHIFT) & 0x8000);
|
||||
shift = !!(::GetAsyncKeyState(VK_SHIFT) & 0x8000);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if(!m_dump && shift)
|
||||
{
|
||||
|
|
|
@ -22,56 +22,69 @@
|
|||
#include "stdafx.h"
|
||||
#include "GS.h"
|
||||
#include "GSUtil.h"
|
||||
//#include "svnrev.h"
|
||||
#include "xbyak/xbyak_util.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "svnrev.h"
|
||||
#else
|
||||
#define SVN_REV 0
|
||||
#define SVN_MODS 0
|
||||
#endif
|
||||
|
||||
char* GSUtil::GetLibName()
|
||||
const char* GSUtil::GetLibName()
|
||||
{
|
||||
// TODO: critsec
|
||||
|
||||
static string str;
|
||||
|
||||
str = format("GSdx %d", SVN_REV);
|
||||
|
||||
if(SVN_MODS) str += "m";
|
||||
|
||||
#if _M_AMD64
|
||||
str += " 64-bit";
|
||||
#endif
|
||||
|
||||
list<string> sl;
|
||||
|
||||
// TODO: linux (gcc)
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
sl.push_back(format("Intel C++ %d.%02d", __INTEL_COMPILER / 100, __INTEL_COMPILER % 100));
|
||||
#elif _MSC_VER
|
||||
sl.push_back(format("MSVC %d.%02d", _MSC_VER / 100, _MSC_VER % 100));
|
||||
#endif
|
||||
|
||||
#if _M_SSE >= 0x500
|
||||
sl.push_back("AVX");
|
||||
#elif _M_SSE >= 0x402
|
||||
sl.push_back("SSE42");
|
||||
#elif _M_SSE >= 0x401
|
||||
sl.push_back("SSE41");
|
||||
#elif _M_SSE >= 0x301
|
||||
sl.push_back("SSSE3");
|
||||
#elif _M_SSE >= 0x200
|
||||
sl.push_back("SSE2");
|
||||
#elif _M_SSE >= 0x100
|
||||
sl.push_back("SSE");
|
||||
#endif
|
||||
|
||||
for(list<string>::iterator i = sl.begin(); i != sl.end(); )
|
||||
if(str.empty())
|
||||
{
|
||||
if(i == sl.begin()) str += " (";
|
||||
str += *i;
|
||||
str += ++i != sl.end() ? ", " : ")";
|
||||
str = "GSdx";
|
||||
|
||||
#ifdef _WINDOWS
|
||||
str += format(" %d", SVN_REV);
|
||||
if(SVN_MODS) str += "m";
|
||||
#endif
|
||||
|
||||
#if _M_AMD64
|
||||
str += " 64-bit";
|
||||
#endif
|
||||
|
||||
list<string> sl;
|
||||
|
||||
// TODO: linux (gcc)
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
sl.push_back(format("Intel C++ %d.%02d", __INTEL_COMPILER / 100, __INTEL_COMPILER % 100));
|
||||
#elif _MSC_VER
|
||||
sl.push_back(format("MSVC %d.%02d", _MSC_VER / 100, _MSC_VER % 100));
|
||||
#elif __GNUC__
|
||||
sl.push_back(format("GCC %d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__));
|
||||
#endif
|
||||
|
||||
#if _M_SSE >= 0x500
|
||||
sl.push_back("AVX");
|
||||
#elif _M_SSE >= 0x402
|
||||
sl.push_back("SSE42");
|
||||
#elif _M_SSE >= 0x401
|
||||
sl.push_back("SSE41");
|
||||
#elif _M_SSE >= 0x301
|
||||
sl.push_back("SSSE3");
|
||||
#elif _M_SSE >= 0x200
|
||||
sl.push_back("SSE2");
|
||||
#elif _M_SSE >= 0x100
|
||||
sl.push_back("SSE");
|
||||
#endif
|
||||
|
||||
for(list<string>::iterator i = sl.begin(); i != sl.end(); )
|
||||
{
|
||||
if(i == sl.begin()) str += " (";
|
||||
str += *i;
|
||||
str += ++i != sl.end() ? ", " : ")";
|
||||
}
|
||||
}
|
||||
|
||||
return (char*)str.c_str();
|
||||
return str.c_str();
|
||||
}
|
||||
|
||||
static class GSUtilMaps
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
class GSUtil
|
||||
{
|
||||
public:
|
||||
static char* GetLibName();
|
||||
static const char* GetLibName();
|
||||
|
||||
static GS_PRIM_CLASS GetPrimClass(uint32 prim);
|
||||
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/libGSdx" prefix_auto="1" extension_auto="1" />
|
||||
<Option output="../../bin/plugins/libGSdx" prefix_auto="1" extension_auto="1" />
|
||||
<Option working_dir="../../bin" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option host_application="../../pcsx2/bin/pcsx2" />
|
||||
<Option createDefFile="1" />
|
||||
<Option createStaticLib="1" />
|
||||
<Compiler>
|
||||
|
@ -18,10 +20,12 @@
|
|||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/libGSdx" prefix_auto="1" extension_auto="1" />
|
||||
<Option output="../../bin/plugins/libGSdx" prefix_auto="1" extension_auto="1" />
|
||||
<Option working_dir="../../bin" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="3" />
|
||||
<Option compiler="gcc" />
|
||||
<Option host_application="../../pcsx2/bin/pcsx2" />
|
||||
<Option createDefFile="1" />
|
||||
<Option createStaticLib="1" />
|
||||
<Compiler>
|
||||
|
@ -30,10 +34,15 @@
|
|||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-march=pentium4" />
|
||||
<Add option="-fno-operator-names" />
|
||||
<Add option="-msse2" />
|
||||
<Add option="-m32" />
|
||||
<Add option="-mpreferred-stack-boundary=2" />
|
||||
<Add option="-D_LINUX" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-lpthread" />
|
||||
</Linker>
|
||||
<Unit filename="GPU.cpp" />
|
||||
<Unit filename="GPU.h" />
|
||||
<Unit filename="GPUDrawScanline.cpp" />
|
||||
|
@ -139,7 +148,11 @@
|
|||
<envvars />
|
||||
<code_completion />
|
||||
<lib_finder disable_auto="1" />
|
||||
<debugger />
|
||||
<debugger>
|
||||
<remote_debugging>
|
||||
<options conn_type="0" serial_baud="115200" additional_cmds_before="handle SIGSEGV nostop" />
|
||||
</remote_debugging>
|
||||
</debugger>
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
|
|
|
@ -104,8 +104,8 @@ using namespace stdext;
|
|||
|
||||
#ifdef __GNUC__
|
||||
|
||||
// #define __forceinline __attribute__((always_inline,unused))
|
||||
#define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#define __forceinline __inline__ __attribute__((always_inline,unused))
|
||||
// #define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#define __assume(c) ((void)0)
|
||||
|
||||
#endif
|
||||
|
@ -156,7 +156,7 @@ typedef signed long long int64;
|
|||
|
||||
#endif
|
||||
|
||||
#if defined(_DEBUG) && defined(_MSC_VER)
|
||||
#if defined(_DEBUG) //&& defined(_MSC_VER)
|
||||
|
||||
#include <assert.h>
|
||||
#define ASSERT assert
|
||||
|
|
Loading…
Reference in New Issue