Merge pull request #99 from xsacha/master

Linux build fix
This commit is contained in:
Alexandro Sánchez Bach 2014-03-11 19:29:28 +01:00
commit 5c563d04c7
11 changed files with 58 additions and 36 deletions

View File

@ -10,21 +10,29 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin")
add_definitions(-DGL_GLEXT_PROTOTYPES)
add_definitions(-DGLX_GLXEXT_PROTOTYPES)
find_package(wxWidgets COMPONENTS core base net aui gl REQUIRED)
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)
find_package(FFMPEG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenAL REQUIRED)
include("${wxWidgets_USE_FILE}")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PLATFORM_ARCH "linux/x86_64")
else()
set(PLATFORM_ARCH "linux/x86")
endif()
include_directories(
${wxWidgets_INCLUDE_DIRS}
${FFMPEG_INCLUDE_DIR}
${OPENAL_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/../ffmpeg/${PLATFORM_ARCH}/include
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/Emu
${CMAKE_SOURCE_DIR}/Gui
@ -33,6 +41,8 @@ ${CMAKE_SOURCE_DIR}/Crypto
${CMAKE_SOURCE_DIR}/..
)
link_directories(${CMAKE_SOURCE_DIR}/../ffmpeg/${PLATFORM_ARCH}/lib)
file(
GLOB_RECURSE
RPCS3_SRC
@ -48,5 +58,5 @@ ${CMAKE_SOURCE_DIR}/../Utilities/*
add_executable(rpcs3 ${RPCS3_SRC})
target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES})
target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES} libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a ${ZLIB_LIBRARIES})

View File

@ -526,7 +526,7 @@ static const s32 MAX_INT_VALUE = 0x7fffffff;
class PPUThread : public PPCThread
{
public:
std::atomic<u32> owned_mutexes;
u32 owned_mutexes;
public:
PPCdouble FPR[32]; //Floating Point Register

View File

@ -2,7 +2,6 @@
#include "GLGSRender.h"
#include "Emu/Cell/PPCInstrTable.h"
#include "Gui/RSXDebugger.h"
#include "OpenGL.h"
#define CMD_DEBUG 0
#define DUMP_VERTEX_DATA 0
@ -650,10 +649,11 @@ void GLGSRender::OnInitThread()
#ifdef _WIN32
glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0);
#else
// Undefined reference: glXSwapIntervalEXT
/*#else
if (GLXDrawable drawable = glXGetCurrentDrawable()){
glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0);
}
}*/
#endif
glGenTextures(1, &g_depth_tex);
glGenTextures(1, &g_flip_tex);

View File

@ -1,11 +1,9 @@
#pragma once
#include "Emu/GS/GSRender.h"
#include "Emu/GS/RSXThread.h"
#include <wx/glcanvas.h>
#include "GLBuffers.h"
#include "GLProgram.h"
#include "OpenGL.h"
#include "GLProgramBuffer.h"
#include <wx/glcanvas.h>
#pragma comment(lib, "opengl32.lib")

View File

@ -1,4 +1,7 @@
#pragma once
#ifndef _WIN32
#include <GL/glew.h>
#endif
#include <GL/gl.h>
#include "GL/glext.h"

View File

@ -2,7 +2,10 @@
#include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h"
// Requires GCC 4.10 apparently..
#ifdef _MSC_VER
#include <codecvt>
#endif
void cellL10n_init();
Module cellL10n(0x001e, cellL10n_init);
@ -26,7 +29,7 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t
std::u16string wstr =(char16_t*)Memory.VirtualToRealAddr(utf16);
wstr.resize(utf16_len.GetValue()); // TODO: Is this really the role of utf16_len in this function?
#ifdef _MSC_VER
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
std::string str = convert.to_bytes(wstr);
@ -36,6 +39,7 @@ int UTF16stoUTF8s(mem16_ptr_t utf16, mem64_t utf16_len, mem8_ptr_t utf8, mem64_t
utf8_len = str.size();
Memory.WriteString(utf8, str.c_str());
#endif
return ConversionOK;
}
@ -208,4 +212,4 @@ void cellL10n_init()
// cellL10n.AddFunc(0xf9b1896d, SJISstoUCS2s);
// cellL10n.AddFunc(0xfa4a675a, BIG5stoUCS2s);
// cellL10n.AddFunc(0xfdbf6ac5, UTF8stoUCS2s);
}
}

View File

@ -87,7 +87,8 @@ struct CellSpursTraceInfo
//u8 padding[];
};
__declspec(align(8)) struct CellTraceHeader
//__declspec(align(8))
struct CellTraceHeader
{
u8 tag;
u8 length;
@ -135,17 +136,20 @@ struct CellSpursTracePacket
} data;
};
__declspec(align(128)) struct CellSpurs
//__declspec(align(128))
struct CellSpurs
{
u8 skip[CELL_SPURS_SIZE];
};
__declspec(align(128)) struct CellSpurs2
//__declspec(align(128))
struct CellSpurs2
{
u8 skip[CELL_SPURS_SIZE2 - CELL_SPURS_SIZE];
};
__declspec(align(8)) struct CellSpursAttribute
//__declspec(align(8))
struct CellSpursAttribute
{
u8 skip[CELL_SPURS_ATTRIBUTE_SIZE];
};
@ -184,7 +188,8 @@ enum
};
__declspec(align(128)) struct CellSpursTaskset
//__declspec(align(128))
struct CellSpursTaskset
{
u8 skip[6400];
};
@ -217,7 +222,8 @@ struct CellSpursTasksetInfo
#define CELL_SPURS_TASKSET_SIZE CELL_SPURS_TASKSET_CLASS0_SIZE
*/
__declspec(align(128)) struct CellSpursTaskset2
//__declspec(align(128))
struct CellSpursTaskset2
{
be_t<u8> skip[10496];
};
@ -267,7 +273,8 @@ struct CellSpursTaskAttribute2
//be_t<u32> __reserved__[];
};
__declspec(align(128)) struct CellSpursTaskExitCode
//__declspec(align(128))
struct CellSpursTaskExitCode
{
unsigned char skip[128];
};

View File

@ -93,12 +93,12 @@ bool Emulator::BootGame(const std::string& path)
{
static const char* elf_path[6] =
{
"\\PS3_GAME\\USRDIR\\BOOT.BIN",
"\\USRDIR\\BOOT.BIN",
"\\BOOT.BIN",
"\\PS3_GAME\\USRDIR\\EBOOT.BIN",
"\\USRDIR\\EBOOT.BIN",
"\\EBOOT.BIN",
"/PS3_GAME/USRDIR/BOOT.BIN",
"/USRDIR/BOOT.BIN",
"/BOOT.BIN",
"/PS3_GAME/USRDIR/EBOOT.BIN",
"/USRDIR/EBOOT.BIN",
"/EBOOT.BIN",
};
for(int i=0; i<sizeof(elf_path) / sizeof(*elf_path);i++)
@ -128,11 +128,11 @@ void Emulator::Load()
if(wxFileName(m_path).GetFullName().CmpNoCase("EBOOT.BIN") == 0)
{
elf_path += "\\BOOT.BIN";
elf_path += "/BOOT.BIN";
}
else
{
elf_path += "\\" + wxFileName(m_path).GetName() + ".elf";
elf_path += "/" + wxFileName(m_path).GetName() + ".elf";
}
if(!DecryptSelf(elf_path, self_path))

View File

@ -152,7 +152,7 @@ Ini::Ini()
{
#ifdef _WIN32
m_Config = new wxIniConfig( wxEmptyString, wxEmptyString,
wxGetCwd() + "\\rpcs3.ini",
wxGetCwd() + "/rpcs3.ini",
wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
#else
m_Config = new wxConfig("rpcs3");

View File

@ -132,11 +132,11 @@ public:
{
wxString path;
path = DefPath + "\\" + "CPU";
path = DefPath + "/" + "CPU";
CPUDecoderMode.Init("DecoderMode", path);
CPUIgnoreRWErrors.Init("IgnoreRWErrors", path);
path = DefPath + "\\" + "GS";
path = DefPath + "/" + "GS";
GSRenderMode.Init("RenderMode", path);
GSResolution.Init("Resolution", path);
GSAspectRatio.Init("AspectRatio", path);
@ -145,12 +145,12 @@ public:
GSDumpColorBuffers.Init("DumpColorBuffers", path);
GSDumpDepthBuffer.Init("DumpDepthBuffer", path);
path = DefPath + "\\" + "IO";
path = DefPath + "/" + "IO";
PadHandlerMode.Init("PadHandlerMode", path);
KeyboardHandlerMode.Init("KeyboardHandlerMode", path);
MouseHandlerMode.Init("MouseHandlerMode", path);
path = DefPath + "\\" + "ControlSetings";
path = DefPath + "/" + "ControlSetings";
PadHandlerLeft.Init("PadHandlerLeft", path);
PadHandlerDown.Init("PadHandlerDown", path);
PadHandlerRight.Init("PadHandlerRight", path);
@ -168,11 +168,11 @@ public:
PadHandlerR2.Init("PadHandlerR2", path);
PadHandlerL2.Init("PadHandlerL2", path);
path = DefPath + "\\" + "Audio";
path = DefPath + "/" + "Audio";
AudioOutMode.Init("AudioOutMode", path);
AudioDumpToFile.Init("AudioDumpToFile", path);
path = DefPath + "\\" + "HLE";
path = DefPath + "/" + "HLE";
HLELogging.Init("HLELogging", path);
HLESaveTTY.Init("HLESaveTTY", path);
HLEExitOnStop.Init("HLEExitOnStop", path);

View File

@ -165,7 +165,7 @@ bool Loader::Load()
/*
const wxString& root = wxFileName(wxFileName(m_stream->GetPath()).GetPath()).GetPath();
wxString ps3_path;
const wxString& psf_path = root + "\\" + "PARAM.SFO";
const wxString& psf_path = root + "/" + "PARAM.SFO";
vfsFile f(psf_path);
if(f.IsOpened())
{