mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Fixed conflicts
This commit is contained in:
commit
2de22f0321
@ -10,21 +10,29 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
|
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(-DGL_GLEXT_PROTOTYPES)
|
||||||
add_definitions(-DGLX_GLXEXT_PROTOTYPES)
|
add_definitions(-DGLX_GLXEXT_PROTOTYPES)
|
||||||
|
|
||||||
find_package(wxWidgets COMPONENTS core base net aui gl REQUIRED)
|
find_package(wxWidgets COMPONENTS core base net aui gl REQUIRED)
|
||||||
|
find_package(GLEW REQUIRED)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
find_package(FFMPEG REQUIRED)
|
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
|
find_package(OpenAL REQUIRED)
|
||||||
|
|
||||||
include("${wxWidgets_USE_FILE}")
|
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(
|
include_directories(
|
||||||
${wxWidgets_INCLUDE_DIRS}
|
${wxWidgets_INCLUDE_DIRS}
|
||||||
${FFMPEG_INCLUDE_DIR}
|
${OPENAL_INCLUDE_DIR}
|
||||||
|
${CMAKE_SOURCE_DIR}/../ffmpeg/${PLATFORM_ARCH}/include
|
||||||
${CMAKE_SOURCE_DIR}
|
${CMAKE_SOURCE_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/Emu
|
${CMAKE_SOURCE_DIR}/Emu
|
||||||
${CMAKE_SOURCE_DIR}/Gui
|
${CMAKE_SOURCE_DIR}/Gui
|
||||||
@ -33,6 +41,8 @@ ${CMAKE_SOURCE_DIR}/Crypto
|
|||||||
${CMAKE_SOURCE_DIR}/..
|
${CMAKE_SOURCE_DIR}/..
|
||||||
)
|
)
|
||||||
|
|
||||||
|
link_directories(${CMAKE_SOURCE_DIR}/../ffmpeg/${PLATFORM_ARCH}/lib)
|
||||||
|
|
||||||
file(
|
file(
|
||||||
GLOB_RECURSE
|
GLOB_RECURSE
|
||||||
RPCS3_SRC
|
RPCS3_SRC
|
||||||
@ -48,5 +58,5 @@ ${CMAKE_SOURCE_DIR}/../Utilities/*
|
|||||||
|
|
||||||
add_executable(rpcs3 ${RPCS3_SRC})
|
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})
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
ALenum g_last_al_error = AL_NO_ERROR;
|
ALenum g_last_al_error = AL_NO_ERROR;
|
||||||
ALCenum g_last_alc_error = ALC_NO_ERROR;
|
ALCenum g_last_alc_error = ALC_NO_ERROR;
|
||||||
|
|
||||||
ALCdevice* pDevice;
|
#define checkForAlError(sit) if((g_last_al_error = alGetError()) != AL_NO_ERROR) printAlError(g_last_al_error, sit)
|
||||||
ALCcontext* pContext;
|
#define checkForAlcError(sit) if((g_last_alc_error = alcGetError(m_device)) != ALC_NO_ERROR) printAlcError(g_last_alc_error, sit)
|
||||||
|
|
||||||
void printAlError(ALenum err, const char* situation)
|
void printAlError(ALenum err, const char* situation)
|
||||||
{
|
{
|
||||||
@ -25,120 +25,124 @@ void printAlcError(ALCenum err, const char* situation)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OpenALThread::~OpenALThread()
|
||||||
|
{
|
||||||
|
Quit();
|
||||||
|
}
|
||||||
|
|
||||||
void OpenALThread::Init()
|
void OpenALThread::Init()
|
||||||
{
|
{
|
||||||
pDevice = alcOpenDevice(NULL);
|
m_device = alcOpenDevice(nullptr);
|
||||||
checkForAlcError("alcOpenDevice");
|
checkForAlcError("alcOpenDevice");
|
||||||
|
|
||||||
pContext = alcCreateContext(pDevice, NULL);
|
m_context = alcCreateContext(m_device, nullptr);
|
||||||
checkForAlcError("alcCreateContext");
|
checkForAlcError("alcCreateContext");
|
||||||
|
|
||||||
alcMakeContextCurrent(pContext);
|
alcMakeContextCurrent(m_context);
|
||||||
checkForAlcError("alcMakeContextCurrent");
|
checkForAlcError("alcMakeContextCurrent");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALThread::Quit()
|
void OpenALThread::Quit()
|
||||||
{
|
{
|
||||||
for (SampleBuffer::iterator i = mBuffers.begin(); i != mBuffers.end(); i++)
|
alcMakeContextCurrent(nullptr);
|
||||||
alDeleteBuffers(1, &i->second.mBufferID);
|
alcDestroyContext(m_context);
|
||||||
|
alcCloseDevice(m_device);
|
||||||
alcMakeContextCurrent(NULL);
|
|
||||||
alcDestroyContext(pContext);
|
|
||||||
alcCloseDevice(pDevice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALThread::Play()
|
void OpenALThread::Play()
|
||||||
{
|
{
|
||||||
alSourcePlay(mSource);
|
ALint state;
|
||||||
checkForAlError("alSourcePlay");
|
alGetSourcei(m_source, AL_SOURCE_STATE, &state);
|
||||||
|
checkForAlError("alGetSourcei");
|
||||||
|
|
||||||
|
if(state != AL_PLAYING)
|
||||||
|
{
|
||||||
|
alSourcePlay(m_source);
|
||||||
|
checkForAlError("alSourcePlay");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALThread::Close()
|
void OpenALThread::Close()
|
||||||
{
|
{
|
||||||
alSourceStop(mSource);
|
alSourceStop(m_source);
|
||||||
checkForAlError("alSourceStop");
|
checkForAlError("alSourceStop");
|
||||||
if (alIsSource(mSource))
|
if (alIsSource(m_source))
|
||||||
alDeleteSources(1, &mSource);
|
alDeleteSources(1, &m_source);
|
||||||
|
|
||||||
|
alDeleteBuffers(g_al_buffers_count, m_buffers);
|
||||||
|
checkForAlError("alDeleteBuffers");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALThread::Stop()
|
void OpenALThread::Stop()
|
||||||
{
|
{
|
||||||
alSourceStop(mSource);
|
alSourceStop(m_source);
|
||||||
checkForAlError("alSourceStop");
|
checkForAlError("alSourceStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALThread::Open(const void* src, ALsizei size)
|
void OpenALThread::Open(const void* src, ALsizei size)
|
||||||
{
|
{
|
||||||
alGenSources(1, &mSource); // WARNING: Memory leaks!
|
alGenSources(1, &m_source);
|
||||||
checkForAlError("alGenSources");
|
checkForAlError("alGenSources");
|
||||||
|
|
||||||
alSourcei(mSource, AL_LOOPING, AL_FALSE);
|
alGenBuffers(g_al_buffers_count, m_buffers);
|
||||||
|
checkForAlError("alGenBuffers");
|
||||||
|
|
||||||
|
alSourcei(m_source, AL_LOOPING, AL_FALSE);
|
||||||
checkForAlError("alSourcei");
|
checkForAlError("alSourcei");
|
||||||
|
|
||||||
mProcessed = 0;
|
m_buffer_size = size;
|
||||||
mBuffer.mFreq = 48000;
|
|
||||||
mBuffer.mFormat = AL_FORMAT_STEREO16;
|
|
||||||
|
|
||||||
for (int i = 0; i < NUM_OF_BUFFERS; i++)
|
for(uint i=0; i<g_al_buffers_count; ++i)
|
||||||
{
|
{
|
||||||
AddData(src, size);
|
AddBlock(m_buffers[i], m_buffer_size, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alSourceQueueBuffers(m_source, g_al_buffers_count, m_buffers);
|
||||||
|
checkForAlError("alSourceQueueBuffers");
|
||||||
|
Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALThread::AddData(const void* src, ALsizei size)
|
void OpenALThread::AddData(const void* src, ALsizei size)
|
||||||
{
|
{
|
||||||
alGenBuffers(1, &mBuffer.mBufferID);
|
const char* bsrc = (const char*)src;
|
||||||
checkForAlError("alGenBuffers");
|
ALuint buffer;
|
||||||
|
ALint buffers_count;
|
||||||
mBuffers[mBuffer.mBufferID] = mBuffer;
|
alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &buffers_count);
|
||||||
|
checkForAlError("alGetSourcei");
|
||||||
AddBlock(mBuffer.mBufferID, size, src);
|
|
||||||
|
|
||||||
alSourceQueueBuffers(mSource, 1, &mBuffer.mBufferID);
|
while(size)
|
||||||
checkForAlError("alSourceQueueBuffers");
|
|
||||||
|
|
||||||
alGetSourcei(mSource, AL_BUFFERS_PROCESSED, &mProcessed);
|
|
||||||
|
|
||||||
while (mProcessed--)
|
|
||||||
{
|
{
|
||||||
alSourceUnqueueBuffers(mSource, 1, &mBuffer.mBufferID);
|
if(buffers_count-- <= 0)
|
||||||
|
{
|
||||||
|
Play();
|
||||||
|
|
||||||
|
alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &buffers_count);
|
||||||
|
checkForAlError("alGetSourcei");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
alSourceUnqueueBuffers(m_source, 1, &buffer);
|
||||||
checkForAlError("alSourceUnqueueBuffers");
|
checkForAlError("alSourceUnqueueBuffers");
|
||||||
|
|
||||||
alDeleteBuffers(1, &mBuffer.mBufferID);
|
int bsize = size < m_buffer_size ? size : m_buffer_size;
|
||||||
checkForAlError("alDeleteBuffers");
|
AddBlock(buffer, bsize, bsrc);
|
||||||
|
|
||||||
|
alSourceQueueBuffers(m_source, 1, &buffer);
|
||||||
|
checkForAlError("alSourceQueueBuffers");
|
||||||
|
|
||||||
|
size -= bsize;
|
||||||
|
bsrc += bsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenALThread::AddBlock(ALuint bufferID, ALsizei size, const void* src)
|
bool OpenALThread::AddBlock(const ALuint buffer_id, ALsizei size, const void* src)
|
||||||
{
|
{
|
||||||
memset(&mTempBuffer, 0, sizeof(mTempBuffer));
|
|
||||||
memcpy(mTempBuffer, src, size);
|
|
||||||
|
|
||||||
long TotalRet = 0, ret;
|
|
||||||
|
|
||||||
if (size < 1) return false;
|
if (size < 1) return false;
|
||||||
|
|
||||||
while (TotalRet < size)
|
alBufferData(buffer_id, AL_FORMAT_STEREO16, src, size, 48000);
|
||||||
{
|
|
||||||
ret = size;
|
|
||||||
|
|
||||||
// if buffer is empty
|
|
||||||
if (ret == 0) break;
|
|
||||||
else if (ret < 0)
|
|
||||||
{
|
|
||||||
ConLog.Error("Error in bitstream!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TotalRet += ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (TotalRet > 0)
|
|
||||||
{
|
|
||||||
alBufferData(bufferID, mBuffers[bufferID].mFormat, mTempBuffer,
|
|
||||||
TotalRet, mBuffers[bufferID].mFreq);
|
|
||||||
checkForAlError("alBufferData");
|
checkForAlError("alBufferData");
|
||||||
}
|
|
||||||
|
|
||||||
return (ret > 0);
|
return true;
|
||||||
}
|
}
|
@ -2,49 +2,28 @@
|
|||||||
|
|
||||||
#include "OpenAL/include/al.h"
|
#include "OpenAL/include/al.h"
|
||||||
#include "OpenAL/include/alc.h"
|
#include "OpenAL/include/alc.h"
|
||||||
#include <map>
|
|
||||||
|
|
||||||
extern ALenum g_last_al_error;
|
|
||||||
extern ALCenum g_last_alc_error;
|
|
||||||
|
|
||||||
void printAlError(ALenum err, const char* situation);
|
|
||||||
void printAlcError(ALCenum err, const char* situation);
|
|
||||||
|
|
||||||
#define checkForAlError(sit) if((g_last_al_error = alGetError()) != AL_NO_ERROR) printAlError(g_last_al_error, sit)
|
|
||||||
#define checkForAlcError(sit) if((g_last_alc_error = alcGetError(pDevice)) != ALC_NO_ERROR) printAlcError(g_last_alc_error, sit)
|
|
||||||
|
|
||||||
struct SampleInfo
|
|
||||||
{
|
|
||||||
uint mBufferID;
|
|
||||||
uint mFreq;
|
|
||||||
uint mFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::map<ALuint, SampleInfo> SampleBuffer;
|
|
||||||
|
|
||||||
#define NUM_OF_BUFFERS 16
|
|
||||||
|
|
||||||
|
|
||||||
extern ALCdevice* pDevice;
|
|
||||||
extern ALCcontext* pContext;
|
|
||||||
|
|
||||||
class OpenALThread
|
class OpenALThread
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
ALuint mSource;
|
static const uint g_al_buffers_count = 16;
|
||||||
SampleBuffer mBuffers;
|
|
||||||
SampleInfo mBuffer;
|
ALuint m_source;
|
||||||
ALint mProcessed;
|
ALuint m_buffers[g_al_buffers_count];
|
||||||
u16 mTempBuffer[512];
|
ALCdevice* m_device;
|
||||||
|
ALCcontext* m_context;
|
||||||
|
u32 m_buffer_size;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
~OpenALThread();
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
void Quit();
|
void Quit();
|
||||||
void Play();
|
void Play();
|
||||||
void Open(const void* src, ALsizei size);
|
void Open(const void* src, ALsizei size);
|
||||||
void Close();
|
void Close();
|
||||||
void Stop();
|
void Stop();
|
||||||
bool AddBlock(ALuint bufferID, ALsizei size, const void* src);
|
bool AddBlock(const ALuint buffer_id, ALsizei size, const void* src);
|
||||||
void AddData(const void* src, ALsizei size);
|
void AddData(const void* src, ALsizei size);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@ void AudioDumper::WriteHeader()
|
|||||||
size_t AudioDumper::WriteData(const void* buffer, size_t size)
|
size_t AudioDumper::WriteData(const void* buffer, size_t size)
|
||||||
{
|
{
|
||||||
size_t ret = m_output.Write(buffer, size);
|
size_t ret = m_output.Write(buffer, size);
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1613,6 +1613,10 @@ private:
|
|||||||
{
|
{
|
||||||
DisAsm_V1_R2("lvlx", vd, ra, rb);
|
DisAsm_V1_R2("lvlx", vd, ra, rb);
|
||||||
}
|
}
|
||||||
|
void LDBRX(u32 rd, u32 ra, u32 rb)
|
||||||
|
{
|
||||||
|
DisAsm_R3("ldbrx", rd, ra, rb);
|
||||||
|
}
|
||||||
void LWBRX(u32 rd, u32 ra, u32 rb)
|
void LWBRX(u32 rd, u32 ra, u32 rb)
|
||||||
{
|
{
|
||||||
DisAsm_R3("lwbrx", rd, ra, rb);
|
DisAsm_R3("lwbrx", rd, ra, rb);
|
||||||
|
@ -528,6 +528,7 @@ namespace PPU_instr
|
|||||||
/*0x1e9*/bind_instr(g1f_list, DIVD, RD, RA, RB, OE, RC);
|
/*0x1e9*/bind_instr(g1f_list, DIVD, RD, RA, RB, OE, RC);
|
||||||
/*0x1eb*/bind_instr(g1f_list, DIVW, RD, RA, RB, OE, RC);
|
/*0x1eb*/bind_instr(g1f_list, DIVW, RD, RA, RB, OE, RC);
|
||||||
/*0x207*/bind_instr(g1f_list, LVLX, VD, RA, RB);
|
/*0x207*/bind_instr(g1f_list, LVLX, VD, RA, RB);
|
||||||
|
/*0x214*/bind_instr(g1f_list, LDBRX, RD, RA, RB);
|
||||||
/*0x216*/bind_instr(g1f_list, LWBRX, RD, RA, RB);
|
/*0x216*/bind_instr(g1f_list, LWBRX, RD, RA, RB);
|
||||||
/*0x217*/bind_instr(g1f_list, LFSX, FRD, RA, RB);
|
/*0x217*/bind_instr(g1f_list, LFSX, FRD, RA, RB);
|
||||||
/*0x218*/bind_instr(g1f_list, SRW, RA, RS, RB, RC);
|
/*0x218*/bind_instr(g1f_list, SRW, RA, RS, RB, RC);
|
||||||
|
@ -2324,8 +2324,7 @@ private:
|
|||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
CPU.GPR[rd] = __umulh(CPU.GPR[ra], CPU.GPR[rb]);
|
CPU.GPR[rd] = __umulh(CPU.GPR[ra], CPU.GPR[rb]);
|
||||||
#else
|
#else
|
||||||
ConLog.Warning("MULHDU");
|
//ConLog.Warning("MULHDU");
|
||||||
|
|
||||||
const u64 RA = CPU.GPR[ra];
|
const u64 RA = CPU.GPR[ra];
|
||||||
const u64 RB = CPU.GPR[rb];
|
const u64 RB = CPU.GPR[rb];
|
||||||
|
|
||||||
@ -2531,7 +2530,7 @@ private:
|
|||||||
#ifdef _M_X64
|
#ifdef _M_X64
|
||||||
CPU.GPR[rd] = __mulh(CPU.GPR[ra], CPU.GPR[rb]);
|
CPU.GPR[rd] = __mulh(CPU.GPR[ra], CPU.GPR[rb]);
|
||||||
#else
|
#else
|
||||||
ConLog.Warning("MULHD");
|
//ConLog.Warning("MULHD");
|
||||||
const s64 RA = CPU.GPR[ra];
|
const s64 RA = CPU.GPR[ra];
|
||||||
const s64 RB = CPU.GPR[rb];
|
const s64 RB = CPU.GPR[rb];
|
||||||
|
|
||||||
@ -2993,6 +2992,10 @@ private:
|
|||||||
|
|
||||||
Memory.ReadLeft(CPU.VPR[vd]._u8 + eb, addr, 16 - eb);
|
Memory.ReadLeft(CPU.VPR[vd]._u8 + eb, addr, 16 - eb);
|
||||||
}
|
}
|
||||||
|
void LDBRX(u32 rd, u32 ra, u32 rb)
|
||||||
|
{
|
||||||
|
CPU.GPR[rd] = (u64&)Memory[ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb]];
|
||||||
|
}
|
||||||
void LWBRX(u32 rd, u32 ra, u32 rb)
|
void LWBRX(u32 rd, u32 ra, u32 rb)
|
||||||
{
|
{
|
||||||
CPU.GPR[rd] = (u32&)Memory[ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb]];
|
CPU.GPR[rd] = (u32&)Memory[ra ? CPU.GPR[ra] + CPU.GPR[rb] : CPU.GPR[rb]];
|
||||||
@ -3787,8 +3790,7 @@ private:
|
|||||||
}
|
}
|
||||||
void FRSQRTE(u32 frd, u32 frb, bool rc)
|
void FRSQRTE(u32 frd, u32 frb, bool rc)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED();
|
CPU.FPR[frd] = 1.0f / (float)sqrt(CPU.FPR[frb]);
|
||||||
//CPU.FPR[frd] = 1.0f / (float)sqrt(CPU.FPR[frb]);
|
|
||||||
}
|
}
|
||||||
void FMSUB(u32 frd, u32 fra, u32 frc, u32 frb, bool rc)
|
void FMSUB(u32 frd, u32 fra, u32 frc, u32 frb, bool rc)
|
||||||
{
|
{
|
||||||
|
@ -341,6 +341,7 @@ namespace PPU_opcodes
|
|||||||
DIVD = 0x1e9,
|
DIVD = 0x1e9,
|
||||||
DIVW = 0x1eb,
|
DIVW = 0x1eb,
|
||||||
LVLX = 0x207, //Load Vector Left Indexed
|
LVLX = 0x207, //Load Vector Left Indexed
|
||||||
|
LDBRX = 0x214,
|
||||||
LWBRX = 0x216,
|
LWBRX = 0x216,
|
||||||
LFSX = 0x217,
|
LFSX = 0x217,
|
||||||
SRW = 0x218,
|
SRW = 0x218,
|
||||||
@ -731,6 +732,7 @@ public:
|
|||||||
virtual void DIVD(u32 rd, u32 ra, u32 rb, u32 oe, bool rc) = 0;
|
virtual void DIVD(u32 rd, u32 ra, u32 rb, u32 oe, bool rc) = 0;
|
||||||
virtual void DIVW(u32 rd, u32 ra, u32 rb, u32 oe, bool rc) = 0;
|
virtual void DIVW(u32 rd, u32 ra, u32 rb, u32 oe, bool rc) = 0;
|
||||||
virtual void LVLX(u32 vd, u32 ra, u32 rb) = 0;
|
virtual void LVLX(u32 vd, u32 ra, u32 rb) = 0;
|
||||||
|
virtual void LDBRX(u32 rd, u32 ra, u32 rb) = 0;
|
||||||
virtual void LWBRX(u32 rd, u32 ra, u32 rb) = 0;
|
virtual void LWBRX(u32 rd, u32 ra, u32 rb) = 0;
|
||||||
virtual void LFSX(u32 frd, u32 ra, u32 rb) = 0;
|
virtual void LFSX(u32 frd, u32 ra, u32 rb) = 0;
|
||||||
virtual void SRW(u32 ra, u32 rs, u32 rb, bool rc) = 0;
|
virtual void SRW(u32 ra, u32 rs, u32 rb, bool rc) = 0;
|
||||||
|
@ -5,7 +5,7 @@ void GLFragmentDecompilerThread::AddCode(std::string code, bool append_mask)
|
|||||||
{
|
{
|
||||||
if(!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt) return;
|
if(!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt) return;
|
||||||
|
|
||||||
const std::string mask = GetMask().c_str();
|
const std::string mask = GetMask();
|
||||||
std::string cond;
|
std::string cond;
|
||||||
|
|
||||||
if(!src0.exec_if_gr || !src0.exec_if_lt || !src0.exec_if_eq)
|
if(!src0.exec_if_gr || !src0.exec_if_lt || !src0.exec_if_eq)
|
||||||
@ -227,7 +227,7 @@ std::string GLFragmentDecompilerThread::BuildCode()
|
|||||||
main += "\t" + m_parr.AddParam(PARAM_OUT, "vec4", "ocol", 0) + " = " + (m_ctrl & 0x40 ? "r0" : "h0") + ";\n";
|
main += "\t" + m_parr.AddParam(PARAM_OUT, "vec4", "ocol", 0) + " = " + (m_ctrl & 0x40 ? "r0" : "h0") + ";\n";
|
||||||
if(m_ctrl & 0xe) main += "\tgl_FragDepth = r1.z;\n";
|
if(m_ctrl & 0xe) main += "\tgl_FragDepth = r1.z;\n";
|
||||||
|
|
||||||
std::string p = "";
|
std::string p;
|
||||||
|
|
||||||
for(u32 i=0; i<m_parr.params.GetCount(); ++i)
|
for(u32 i=0; i<m_parr.params.GetCount(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include "GLGSRender.h"
|
#include "GLGSRender.h"
|
||||||
#include "Emu/Cell/PPCInstrTable.h"
|
#include "Emu/Cell/PPCInstrTable.h"
|
||||||
#include "Gui/RSXDebugger.h"
|
#include "Gui/RSXDebugger.h"
|
||||||
#include "OpenGL.h"
|
|
||||||
|
|
||||||
#define CMD_DEBUG 0
|
#define CMD_DEBUG 0
|
||||||
#define DUMP_VERTEX_DATA 0
|
#define DUMP_VERTEX_DATA 0
|
||||||
@ -650,10 +649,11 @@ void GLGSRender::OnInitThread()
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0);
|
glSwapInterval(Ini.GSVSyncEnable.GetValue() ? 1 : 0);
|
||||||
#else
|
// Undefined reference: glXSwapIntervalEXT
|
||||||
|
/*#else
|
||||||
if (GLXDrawable drawable = glXGetCurrentDrawable()){
|
if (GLXDrawable drawable = glXGetCurrentDrawable()){
|
||||||
glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0);
|
glXSwapIntervalEXT(glXGetCurrentDisplay(), drawable, Ini.GSVSyncEnable.GetValue() ? 1 : 0);
|
||||||
}
|
}*/
|
||||||
#endif
|
#endif
|
||||||
glGenTextures(1, &g_depth_tex);
|
glGenTextures(1, &g_depth_tex);
|
||||||
glGenTextures(1, &g_flip_tex);
|
glGenTextures(1, &g_flip_tex);
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Emu/GS/GSRender.h"
|
#include "Emu/GS/GSRender.h"
|
||||||
#include "Emu/GS/RSXThread.h"
|
#include "Emu/GS/RSXThread.h"
|
||||||
#include <wx/glcanvas.h>
|
|
||||||
#include "GLBuffers.h"
|
#include "GLBuffers.h"
|
||||||
#include "GLProgram.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "GLProgramBuffer.h"
|
#include "GLProgramBuffer.h"
|
||||||
|
#include <wx/glcanvas.h>
|
||||||
|
|
||||||
#pragma comment(lib, "opengl32.lib")
|
#pragma comment(lib, "opengl32.lib")
|
||||||
|
|
||||||
|
@ -319,7 +319,8 @@ wxString GLVertexDecompilerThread::BuildCode()
|
|||||||
|
|
||||||
wxString f = wxEmptyString;
|
wxString f = wxEmptyString;
|
||||||
|
|
||||||
f += wxString::Format("void %s()\n{\n\tgl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n%s\tgl_Position = gl_Position * scaleOffsetMat;\n}\n", m_funcs[0].name.wx_str(), BuildFuncBody(m_funcs[0]).wx_str());
|
f += wxString::Format("void %s()\n{\n\tgl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n\t%s();\n\tgl_Position = gl_Position * scaleOffsetMat;\n}\n",
|
||||||
|
m_funcs[0].name.wx_str(), m_funcs[1].name.wx_str());
|
||||||
|
|
||||||
for(uint i=1; i<m_funcs.GetCount(); ++i)
|
for(uint i=1; i<m_funcs.GetCount(); ++i)
|
||||||
{
|
{
|
||||||
@ -354,6 +355,11 @@ void GLVertexDecompilerThread::Task()
|
|||||||
src[2].src2l = d3.src2l;
|
src[2].src2l = d3.src2l;
|
||||||
src[2].src2h = d2.src2h;
|
src[2].src2h = d2.src2h;
|
||||||
|
|
||||||
|
if(!d1.sca_opcode && !d1.vec_opcode)
|
||||||
|
{
|
||||||
|
m_body.Add("//nop");
|
||||||
|
}
|
||||||
|
|
||||||
switch(d1.sca_opcode)
|
switch(d1.sca_opcode)
|
||||||
{
|
{
|
||||||
case 0x00: break; // NOP
|
case 0x00: break; // NOP
|
||||||
@ -364,11 +370,11 @@ void GLVertexDecompilerThread::Task()
|
|||||||
case 0x05: AddScaCode("exp(" + GetSRC(2, true) + ")"); break; // EXP
|
case 0x05: AddScaCode("exp(" + GetSRC(2, true) + ")"); break; // EXP
|
||||||
case 0x06: AddScaCode("log(" + GetSRC(2, true) + ")"); break; // LOG
|
case 0x06: AddScaCode("log(" + GetSRC(2, true) + ")"); break; // LOG
|
||||||
//case 0x07: break; // LIT
|
//case 0x07: break; // LIT
|
||||||
case 0x08: AddScaCode("{ /*BRA*/ " + GetFunc() + "; " + wxString(m_funcs.GetCount() == 1 || m_funcs[1].offset > intsCount ? "gl_Position = gl_Position * scaleOffsetMat;" : "") + " return; }", false, true); break; // BRA
|
case 0x08: AddScaCode("{ /*BRA*/ " + GetFunc() + "; return; }", false, true); break; // BRA
|
||||||
case 0x09: AddScaCode("{ " + GetFunc() + "; " + wxString(m_funcs.GetCount() == 1 || m_funcs[1].offset > intsCount ? "gl_Position = gl_Position * scaleOffsetMat;" : "") + " return; }", false, true); break; // BRI : works differently (BRI o[1].x(TR) L0;)
|
case 0x09: AddScaCode("{ " + GetFunc() + "; return; }", false, true); break; // BRI : works differently (BRI o[1].x(TR) L0;)
|
||||||
case 0x0a: AddScaCode("/*CAL*/ " + GetFunc(), false, true); break; // CAL : works same as BRI
|
case 0x0a: AddScaCode("/*CAL*/ " + GetFunc(), false, true); break; // CAL : works same as BRI
|
||||||
case 0x0b: AddScaCode("/*CLI*/ " + GetFunc(), false, true); break; // CLI : works same as BRI
|
case 0x0b: AddScaCode("/*CLI*/ " + GetFunc(), false, true); break; // CLI : works same as BRI
|
||||||
case 0x0c: AddScaCode("{ " + wxString(m_funcs.GetCount() == 1 || m_funcs[1].offset > intsCount ? "gl_Position = gl_Position * scaleOffsetMat;" : "") + "return; }", false, true); break; // RET : works like BRI but shorter (RET o[1].x(TR);)
|
case 0x0c: AddScaCode("return", false, true); break; // RET : works like BRI but shorter (RET o[1].x(TR);)
|
||||||
case 0x0d: AddScaCode("log2(" + GetSRC(2, true) + ")"); break; // LG2
|
case 0x0d: AddScaCode("log2(" + GetSRC(2, true) + ")"); break; // LG2
|
||||||
case 0x0e: AddScaCode("exp2(" + GetSRC(2, true) + ")"); break; // EX2
|
case 0x0e: AddScaCode("exp2(" + GetSRC(2, true) + ")"); break; // EX2
|
||||||
case 0x0f: AddScaCode("sin(" + GetSRC(2, true) + ")"); break; // SIN
|
case 0x0f: AddScaCode("sin(" + GetSRC(2, true) + ")"); break; // SIN
|
||||||
@ -429,7 +435,7 @@ void GLVertexDecompilerThread::Task()
|
|||||||
m_shader = BuildCode();
|
m_shader = BuildCode();
|
||||||
|
|
||||||
m_body.Clear();
|
m_body.Clear();
|
||||||
m_funcs.RemoveAt(1, m_funcs.GetCount() - 1);
|
m_funcs.RemoveAt(2, m_funcs.GetCount() - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLVertexProgram::GLVertexProgram()
|
GLVertexProgram::GLVertexProgram()
|
||||||
|
@ -151,6 +151,9 @@ struct GLVertexDecompilerThread : public ThreadBase
|
|||||||
m_funcs.Add(new FuncInfo());
|
m_funcs.Add(new FuncInfo());
|
||||||
m_funcs[0].offset = 0;
|
m_funcs[0].offset = 0;
|
||||||
m_funcs[0].name = "main";
|
m_funcs[0].name = "main";
|
||||||
|
m_funcs.Add(new FuncInfo());
|
||||||
|
m_funcs[1].offset = 0;
|
||||||
|
m_funcs[1].name = "func0";
|
||||||
//m_cur_func->body = "\tgl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n";
|
//m_cur_func->body = "\tgl_Position = vec4(0.0f, 0.0f, 0.0f, 1.0f);\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <GL/glew.h>
|
||||||
|
#endif
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include "GL/glext.h"
|
#include "GL/glext.h"
|
||||||
|
|
||||||
|
@ -513,6 +513,8 @@ public:
|
|||||||
|
|
||||||
__forceinline AT GetAddr() const { return m_addr; }
|
__forceinline AT GetAddr() const { return m_addr; }
|
||||||
|
|
||||||
|
__forceinline void SetAddr(AT addr) { m_addr = addr; }
|
||||||
|
|
||||||
__forceinline bool IsGood() const
|
__forceinline bool IsGood() const
|
||||||
{
|
{
|
||||||
return Memory.IsGoodAddr(m_addr, sizeof(T));
|
return Memory.IsGoodAddr(m_addr, sizeof(T));
|
||||||
|
@ -63,7 +63,7 @@ static const g_module_list[] =
|
|||||||
{0x002e, "cellLv2dbg"},
|
{0x002e, "cellLv2dbg"},
|
||||||
{0x0030, "cellUsbpspcm"},
|
{0x0030, "cellUsbpspcm"},
|
||||||
{0x0031, "cellAvconfExt"},
|
{0x0031, "cellAvconfExt"},
|
||||||
{0x0032, "cellSysutilUserinfo"},
|
{0x0032, "cellUserInfo"},
|
||||||
{0x0033, "cellSysutilSavedata"},
|
{0x0033, "cellSysutilSavedata"},
|
||||||
{0x0034, "cellSubdisplay"},
|
{0x0034, "cellSubdisplay"},
|
||||||
{0x0035, "cellSysutilRec"},
|
{0x0035, "cellSysutilRec"},
|
||||||
|
@ -17,9 +17,6 @@ int cellAudioInit()
|
|||||||
{
|
{
|
||||||
cellAudio.Warning("cellAudioInit()");
|
cellAudio.Warning("cellAudioInit()");
|
||||||
|
|
||||||
if(Ini.AudioOutMode.GetValue() == 1)
|
|
||||||
m_audio_out->Init();
|
|
||||||
|
|
||||||
if (m_config.m_is_audio_initialized)
|
if (m_config.m_is_audio_initialized)
|
||||||
{
|
{
|
||||||
return CELL_AUDIO_ERROR_ALREADY_INIT;
|
return CELL_AUDIO_ERROR_ALREADY_INIT;
|
||||||
@ -53,14 +50,21 @@ int cellAudioInit()
|
|||||||
|
|
||||||
float buffer[2*256]; // buffer for 2 channels
|
float buffer[2*256]; // buffer for 2 channels
|
||||||
be_t<float> buffer2[8*256]; // buffer for 8 channels (max count)
|
be_t<float> buffer2[8*256]; // buffer for 8 channels (max count)
|
||||||
u16 oal_buffer[2*256]; // buffer for OpenAL
|
//u16 oal_buffer[2*256]; // buffer for OpenAL
|
||||||
|
|
||||||
memset(&buffer, 0, sizeof(buffer));
|
uint oal_buffer_offset = 0;
|
||||||
memset(&buffer2, 0, sizeof(buffer2));
|
uint oal_buffer_size = 2 * 256;
|
||||||
memset(&oal_buffer, 0, sizeof(oal_buffer));
|
std::unique_ptr<u16[]> oal_buffer(new u16[oal_buffer_size]);
|
||||||
|
|
||||||
|
memset(buffer, 0, sizeof(buffer));
|
||||||
|
memset(buffer2, 0, sizeof(buffer2));
|
||||||
|
memset(oal_buffer.get(), 0, oal_buffer_size * sizeof(u16));
|
||||||
|
|
||||||
if(Ini.AudioOutMode.GetValue() == 1)
|
if(Ini.AudioOutMode.GetValue() == 1)
|
||||||
m_audio_out->Open(oal_buffer, sizeof(oal_buffer));
|
{
|
||||||
|
m_audio_out->Init();
|
||||||
|
m_audio_out->Open(oal_buffer.get(), oal_buffer_size*sizeof(u16));
|
||||||
|
}
|
||||||
|
|
||||||
while (m_config.m_is_audio_initialized)
|
while (m_config.m_is_audio_initialized)
|
||||||
{
|
{
|
||||||
@ -120,8 +124,10 @@ int cellAudioInit()
|
|||||||
buffer[i] = buffer2[i];
|
buffer[i] = buffer2[i];
|
||||||
|
|
||||||
// convert the data from float to u16
|
// convert the data from float to u16
|
||||||
oal_buffer[i] = (u16)((float)buffer[i] * (1 << 16));
|
assert(buffer[i] >= -4.0f && buffer[i] <= 4.0f);
|
||||||
|
oal_buffer[oal_buffer_offset + i] = (u16)(buffer[i] * ((1 << 13) - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
first_mix = false;
|
first_mix = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -131,7 +137,8 @@ int cellAudioInit()
|
|||||||
buffer[i] = (buffer[i] + buffer2[i]) * 0.5; // TODO: valid mixing
|
buffer[i] = (buffer[i] + buffer2[i]) * 0.5; // TODO: valid mixing
|
||||||
|
|
||||||
// convert the data from float to u16
|
// convert the data from float to u16
|
||||||
oal_buffer[i] = (u16)((float)buffer[i] * (1 << 16));
|
assert(buffer[i] >= -4.0f && buffer[i] <= 4.0f);
|
||||||
|
oal_buffer[oal_buffer_offset + i] = (u16)(buffer[i] * ((1 << 13) - 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,8 +147,14 @@ int cellAudioInit()
|
|||||||
// TODO: check event source
|
// TODO: check event source
|
||||||
Emu.GetEventManager().SendEvent(m_config.event_key, 0x10103000e010e07, 0, 0, 0);
|
Emu.GetEventManager().SendEvent(m_config.event_key, 0x10103000e010e07, 0, 0, 0);
|
||||||
|
|
||||||
if(Ini.AudioOutMode.GetValue() == 1)
|
oal_buffer_offset += sizeof(buffer) / sizeof(float);
|
||||||
m_audio_out->AddData(oal_buffer, sizeof(oal_buffer));
|
|
||||||
|
if(oal_buffer_offset >= oal_buffer_size)
|
||||||
|
{
|
||||||
|
m_audio_out->AddData(oal_buffer.get(), oal_buffer_offset * sizeof(u16));
|
||||||
|
|
||||||
|
oal_buffer_offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(Ini.AudioDumpToFile.GetValue())
|
if(Ini.AudioDumpToFile.GetValue())
|
||||||
{
|
{
|
||||||
@ -160,8 +173,6 @@ abort:
|
|||||||
m_dump.Finalize();
|
m_dump.Finalize();
|
||||||
|
|
||||||
m_config.m_is_audio_finalized = true;
|
m_config.m_is_audio_finalized = true;
|
||||||
if(Ini.AudioOutMode.GetValue() == 1)
|
|
||||||
m_audio_out->Quit();
|
|
||||||
});
|
});
|
||||||
t.detach();
|
t.detach();
|
||||||
|
|
||||||
@ -191,8 +202,6 @@ int cellAudioQuit()
|
|||||||
|
|
||||||
Memory.Free(m_config.m_buffer);
|
Memory.Free(m_config.m_buffer);
|
||||||
Memory.Free(m_config.m_indexes);
|
Memory.Free(m_config.m_indexes);
|
||||||
if(Ini.AudioOutMode.GetValue() == 1)
|
|
||||||
m_audio_out->Quit();
|
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
@ -301,9 +310,6 @@ int cellAudioPortStart(u32 portNum)
|
|||||||
|
|
||||||
m_config.m_ports[portNum].m_is_audio_port_started = true;
|
m_config.m_ports[portNum].m_is_audio_port_started = true;
|
||||||
|
|
||||||
if(Ini.AudioOutMode.GetValue() == 1)
|
|
||||||
m_audio_out->Play();
|
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,9 +118,15 @@ int cellGameBootCheck(mem32_t type, mem32_t attributes, mem_ptr_t<CellGameConten
|
|||||||
if (!type.IsGood() || !attributes.IsGood() || !size.IsGood() || !dirName.IsGood())
|
if (!type.IsGood() || !attributes.IsGood() || !size.IsGood() || !dirName.IsGood())
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
|
|
||||||
wxString dir = wxEmptyString;
|
// TODO: Locate the PARAM.SFO. The following path may be wrong.
|
||||||
|
vfsFile f("/app_home/PARAM.SFO");
|
||||||
|
PSFLoader psf(f);
|
||||||
|
if(!psf.Load(false))
|
||||||
|
return CELL_GAME_ERROR_FAILURE;
|
||||||
|
wxString dir = psf.m_info.serial(0,4) + psf.m_info.serial(5,5);
|
||||||
|
|
||||||
type = CELL_GAME_GAMETYPE_DISC;
|
// TODO: Only works for HDD games
|
||||||
|
type = CELL_GAME_GAMETYPE_HDD;
|
||||||
attributes = 0;
|
attributes = 0;
|
||||||
size->hddFreeSizeKB = 40000000; //40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
size->hddFreeSizeKB = 40000000; //40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run.
|
||||||
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
size->sizeKB = CELL_GAME_SIZEKB_NOTCALC;
|
||||||
@ -150,6 +156,16 @@ int cellGameContentPermit(mem_list_ptr_t<u8> contentInfoPath, mem_list_ptr_t<u8
|
|||||||
if (!contentInfoPath.IsGood() || !usrdirPath.IsGood())
|
if (!contentInfoPath.IsGood() || !usrdirPath.IsGood())
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
|
|
||||||
|
// TODO: Locate the PARAM.SFO. The following path may be wrong.
|
||||||
|
vfsFile f("/app_home/PARAM.SFO");
|
||||||
|
PSFLoader psf(f);
|
||||||
|
if(!psf.Load(false))
|
||||||
|
return CELL_GAME_ERROR_FAILURE;
|
||||||
|
wxString title_id = psf.m_info.serial(0,4) + psf.m_info.serial(5,5);
|
||||||
|
|
||||||
|
// TODO: Only works for HDD games
|
||||||
|
Memory.WriteString(contentInfoPath.GetAddr(), "/dev_hdd0/game/"+title_id);
|
||||||
|
Memory.WriteString(usrdirPath.GetAddr(), "/dev_hdd0/game/"+title_id+"/USRDIR");
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +188,7 @@ int cellGameGetParamInt(u32 id, mem32_t value)
|
|||||||
if(!value.IsGood())
|
if(!value.IsGood())
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
|
|
||||||
// TODO: Locate the PARAM.SFO. The following path is in most cases wrong.
|
// TODO: Locate the PARAM.SFO. The following path may be wrong.
|
||||||
vfsFile f("/app_home/PARAM.SFO");
|
vfsFile f("/app_home/PARAM.SFO");
|
||||||
PSFLoader psf(f);
|
PSFLoader psf(f);
|
||||||
if(!psf.Load(false))
|
if(!psf.Load(false))
|
||||||
@ -198,7 +214,7 @@ int cellGameGetParamString(u32 id, mem_list_ptr_t<u8> buf, u32 bufsize)
|
|||||||
if(!buf.IsGood())
|
if(!buf.IsGood())
|
||||||
return CELL_GAME_ERROR_PARAM;
|
return CELL_GAME_ERROR_PARAM;
|
||||||
|
|
||||||
// TODO: Locate the PARAM.SFO. The following path is in most cases wrong.
|
// TODO: Locate the PARAM.SFO. The following path may be wrong.
|
||||||
vfsFile f("/app_home/PARAM.SFO");
|
vfsFile f("/app_home/PARAM.SFO");
|
||||||
PSFLoader psf(f);
|
PSFLoader psf(f);
|
||||||
if(!psf.Load(false))
|
if(!psf.Load(false))
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
#include "Emu/SysCalls/SysCalls.h"
|
#include "Emu/SysCalls/SysCalls.h"
|
||||||
#include "Emu/SysCalls/SC_FUNC.h"
|
#include "Emu/SysCalls/SC_FUNC.h"
|
||||||
|
|
||||||
|
// Requires GCC 4.10 apparently..
|
||||||
|
#ifdef _MSC_VER
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
|
#endif
|
||||||
|
|
||||||
void cellL10n_init();
|
void cellL10n_init();
|
||||||
Module cellL10n(0x001e, 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);
|
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?
|
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::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
|
||||||
std::string str = convert.to_bytes(wstr);
|
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();
|
utf8_len = str.size();
|
||||||
Memory.WriteString(utf8, str.c_str());
|
Memory.WriteString(utf8, str.c_str());
|
||||||
|
#endif
|
||||||
return ConversionOK;
|
return ConversionOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,4 +212,4 @@ void cellL10n_init()
|
|||||||
// cellL10n.AddFunc(0xf9b1896d, SJISstoUCS2s);
|
// cellL10n.AddFunc(0xf9b1896d, SJISstoUCS2s);
|
||||||
// cellL10n.AddFunc(0xfa4a675a, BIG5stoUCS2s);
|
// cellL10n.AddFunc(0xfa4a675a, BIG5stoUCS2s);
|
||||||
// cellL10n.AddFunc(0xfdbf6ac5, UTF8stoUCS2s);
|
// cellL10n.AddFunc(0xfdbf6ac5, UTF8stoUCS2s);
|
||||||
}
|
}
|
||||||
|
75
rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp
Normal file
75
rpcs3/Emu/SysCalls/Modules/cellUserInfo.cpp
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "Emu/SysCalls/SysCalls.h"
|
||||||
|
#include "Emu/SysCalls/SC_FUNC.h"
|
||||||
|
|
||||||
|
#include "cellUserInfo.h"
|
||||||
|
|
||||||
|
void cellUserInfo_init();
|
||||||
|
Module cellUserInfo(0x0032, cellUserInfo_init);
|
||||||
|
|
||||||
|
int cellUserInfoGetStat(u32 id, mem_ptr_t<CellUserInfoUserStat> stat)
|
||||||
|
{
|
||||||
|
cellUserInfo.Warning("cellUserInfoGetStat(id=%d, stat_addr=0x%x)", id, stat.GetAddr());
|
||||||
|
|
||||||
|
if (!stat.IsGood())
|
||||||
|
return CELL_USERINFO_ERROR_PARAM;
|
||||||
|
if (id > CELL_USERINFO_USER_MAX)
|
||||||
|
return CELL_USERINFO_ERROR_NOUSER;
|
||||||
|
|
||||||
|
char path [256];
|
||||||
|
sprintf(path, "/dev_hdd0/home/%08d", id);
|
||||||
|
if (!Emu.GetVFS().ExistsDir(path))
|
||||||
|
return CELL_USERINFO_ERROR_NOUSER;
|
||||||
|
|
||||||
|
sprintf(path, "/dev_hdd0/home/%08d/localusername", id);
|
||||||
|
vfsStream* stream = Emu.GetVFS().OpenFile(path, vfsRead);
|
||||||
|
if (!stream || !(stream->IsOpened()))
|
||||||
|
return CELL_USERINFO_ERROR_INTERNAL;
|
||||||
|
|
||||||
|
char name [CELL_USERINFO_USERNAME_SIZE];
|
||||||
|
memset(name, 0, CELL_USERINFO_USERNAME_SIZE);
|
||||||
|
stream->Read(name, CELL_USERINFO_USERNAME_SIZE);
|
||||||
|
stream->Close();
|
||||||
|
|
||||||
|
stat->id = id;
|
||||||
|
memcpy(stat->name, name, CELL_USERINFO_USERNAME_SIZE);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellUserInfoSelectUser_ListType()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellUserInfo);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellUserInfoSelectUser_SetList()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellUserInfo);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellUserInfoEnableOverlay()
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED_FUNC(cellUserInfo);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellUserInfoGetList(mem32_t listNum, mem_ptr_t<CellUserInfoUserList> listBuf, mem32_t currentUserId)
|
||||||
|
{
|
||||||
|
cellUserInfo.Warning("cellUserInfoGetList(listNum_addr=0x%x, listBuf_addr=0x%x, currentUserId_addr=0x%x)",
|
||||||
|
listNum.GetAddr(), listBuf.GetAddr(), currentUserId.GetAddr());
|
||||||
|
|
||||||
|
listNum = 1;
|
||||||
|
listBuf->userId[0] = 1;
|
||||||
|
currentUserId = 1;
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cellUserInfo_init()
|
||||||
|
{
|
||||||
|
cellUserInfo.AddFunc(0x2b761140, cellUserInfoGetStat);
|
||||||
|
cellUserInfo.AddFunc(0x3097cc1c, cellUserInfoSelectUser_ListType);
|
||||||
|
cellUserInfo.AddFunc(0x55123a25, cellUserInfoSelectUser_SetList);
|
||||||
|
cellUserInfo.AddFunc(0xb3516536, cellUserInfoEnableOverlay);
|
||||||
|
cellUserInfo.AddFunc(0xc55e338b, cellUserInfoGetList);
|
||||||
|
}
|
55
rpcs3/Emu/SysCalls/Modules/cellUserInfo.h
Normal file
55
rpcs3/Emu/SysCalls/Modules/cellUserInfo.h
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Return Codes
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CELL_USERINFO_RET_OK = 0,
|
||||||
|
CELL_USERINFO_RET_CANCEL = 1,
|
||||||
|
CELL_USERINFO_ERROR_BUSY = 0x8002c301,
|
||||||
|
CELL_USERINFO_ERROR_INTERNAL = 0x8002c302,
|
||||||
|
CELL_USERINFO_ERROR_PARAM = 0x8002c303,
|
||||||
|
CELL_USERINFO_ERROR_NOUSER = 0x8002c304,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Enums
|
||||||
|
enum CellUserInfoParamSize
|
||||||
|
{
|
||||||
|
CELL_USERINFO_USER_MAX = 16,
|
||||||
|
CELL_USERINFO_TITLE_SIZE = 256,
|
||||||
|
CELL_USERINFO_USERNAME_SIZE = 64,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum CellUserInfoListType
|
||||||
|
{
|
||||||
|
CELL_USERINFO_LISTTYPE_ALL = 0,
|
||||||
|
CELL_USERINFO_LISTTYPE_NOCURRENT = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Structs
|
||||||
|
struct CellUserInfoUserStat
|
||||||
|
{
|
||||||
|
u32 id;
|
||||||
|
u8 name[CELL_USERINFO_USERNAME_SIZE];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellUserInfoUserList
|
||||||
|
{
|
||||||
|
u32 userId[CELL_USERINFO_USER_MAX];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellUserInfoListSet
|
||||||
|
{
|
||||||
|
u32 title_addr; // (char*)
|
||||||
|
u32 focus;
|
||||||
|
u32 fixedListNum;
|
||||||
|
mem_ptr_t<CellUserInfoUserList> fixedList;
|
||||||
|
u32 reserved_addr; // (void*)
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellUserInfoTypeSet
|
||||||
|
{
|
||||||
|
u32 title_addr; // (char*)
|
||||||
|
u32 focus;
|
||||||
|
CellUserInfoListType type;
|
||||||
|
u32 reserved_addr; // (void*)
|
||||||
|
};
|
@ -270,6 +270,25 @@ int cellFsAioFinish(mem8_ptr_t mount_point)
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cellFsReadWithOffset(u32 fd, u64 offset, u32 buf_addr, u64 buffer_size, mem64_t nread)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsReadWithOffset(fd=%d, offset=0x%llx, buf_addr=0x%x, buffer_size=%lld nread=0x%llx)",
|
||||||
|
fd, offset, buf_addr, buffer_size, nread.GetAddr());
|
||||||
|
|
||||||
|
int ret;
|
||||||
|
MemoryAllocator<be_t<u64>> oldPos, newPos;
|
||||||
|
ret = cellFsLseek(fd, 0, CELL_SEEK_CUR, oldPos.GetAddr()); // Save the current position
|
||||||
|
if (ret) return ret;
|
||||||
|
ret = cellFsLseek(fd, offset, CELL_SEEK_SET, newPos.GetAddr()); // Move to the specified offset
|
||||||
|
if (ret) return ret;
|
||||||
|
ret = cellFsRead(fd, buf_addr, buffer_size, nread.GetAddr()); // Read the file
|
||||||
|
if (ret) return ret;
|
||||||
|
ret = cellFsLseek(fd, Memory.Read64(oldPos.GetAddr()), CELL_SEEK_SET, newPos.GetAddr()); // Return to the old position
|
||||||
|
if (ret) return ret;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void sys_fs_init()
|
void sys_fs_init()
|
||||||
{
|
{
|
||||||
sys_fs.AddFunc(0x718bf5f8, cellFsOpen);
|
sys_fs.AddFunc(0x718bf5f8, cellFsOpen);
|
||||||
@ -295,5 +314,20 @@ void sys_fs_init()
|
|||||||
sys_fs.AddFunc(0x9f951810, cellFsAioFinish);
|
sys_fs.AddFunc(0x9f951810, cellFsAioFinish);
|
||||||
sys_fs.AddFunc(0x1a108ab7, cellFsGetBlockSize);
|
sys_fs.AddFunc(0x1a108ab7, cellFsGetBlockSize);
|
||||||
sys_fs.AddFunc(0xaa3b4bcd, cellFsGetFreeSize);
|
sys_fs.AddFunc(0xaa3b4bcd, cellFsGetFreeSize);
|
||||||
|
sys_fs.AddFunc(0x0d5b4a14, cellFsReadWithOffset);
|
||||||
|
sys_fs.AddFunc(0x9b882495, cellFsGetDirectoryEntries);
|
||||||
|
sys_fs.AddFunc(0x2664c8ae, cellFsStReadInit);
|
||||||
|
sys_fs.AddFunc(0xd73938df, cellFsStReadFinish);
|
||||||
|
sys_fs.AddFunc(0xb3afee8b, cellFsStReadGetRingBuf);
|
||||||
|
sys_fs.AddFunc(0xcf34969c, cellFsStReadGetStatus);
|
||||||
|
sys_fs.AddFunc(0xbd273a88, cellFsStReadGetRegid);
|
||||||
|
sys_fs.AddFunc(0x8df28ff9, cellFsStReadStart);
|
||||||
|
sys_fs.AddFunc(0xf8e5d9a0, cellFsStReadStop);
|
||||||
|
sys_fs.AddFunc(0x27800c6b, cellFsStRead);
|
||||||
|
sys_fs.AddFunc(0x190912f6, cellFsStReadGetCurrentAddr);
|
||||||
|
sys_fs.AddFunc(0x81f33783, cellFsStReadPutCurrentAddr);
|
||||||
|
sys_fs.AddFunc(0x8f71c5b2, cellFsStReadWait);
|
||||||
|
sys_fs.AddFunc(0x866f6aec, cellFsStReadWaitCallback);
|
||||||
|
|
||||||
aio_init = false;
|
aio_init = false;
|
||||||
}
|
}
|
||||||
|
@ -2,25 +2,119 @@
|
|||||||
#include "Emu/SysCalls/SysCalls.h"
|
#include "Emu/SysCalls/SysCalls.h"
|
||||||
#include "Emu/SysCalls/SC_FUNC.h"
|
#include "Emu/SysCalls/SC_FUNC.h"
|
||||||
|
|
||||||
|
#include "sys_net.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <winsock.h>
|
||||||
|
#elif
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void sys_net_init();
|
void sys_net_init();
|
||||||
Module sys_net((u16)0x0000, sys_net_init);
|
Module sys_net((u16)0x0000, sys_net_init);
|
||||||
|
|
||||||
int accept()
|
mem32_t g_lastError(NULL);
|
||||||
|
|
||||||
|
|
||||||
|
// Auxiliary Functions
|
||||||
|
int inet_pton4(const char *src, char *dst)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
const char digits[] = "0123456789";
|
||||||
return CELL_OK;
|
int saw_digit, octets, ch;
|
||||||
|
unsigned char tmp[4], *tp;
|
||||||
|
|
||||||
|
saw_digit = 0;
|
||||||
|
octets = 0;
|
||||||
|
*(tp = tmp) = 0;
|
||||||
|
while ((ch = *src++) != '\0') {
|
||||||
|
const char *pch;
|
||||||
|
|
||||||
|
if ((pch = strchr(digits, ch)) != NULL) {
|
||||||
|
unsigned int n = *tp * 10 + (pch - digits);
|
||||||
|
|
||||||
|
if (n > 255)
|
||||||
|
return (0);
|
||||||
|
*tp = n;
|
||||||
|
if (! saw_digit) {
|
||||||
|
if (++octets > 4)
|
||||||
|
return (0);
|
||||||
|
saw_digit = 1;
|
||||||
|
}
|
||||||
|
} else if (ch == '.' && saw_digit) {
|
||||||
|
if (octets == 4)
|
||||||
|
return 0;
|
||||||
|
*++tp = 0;
|
||||||
|
saw_digit = 0;
|
||||||
|
} else
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
if (octets < 4)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
memcpy(dst, tmp, 4);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bind()
|
int inet_pton(int af, const char *src, char *dst)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
switch (af) {
|
||||||
return CELL_OK;
|
case AF_INET:
|
||||||
|
return (inet_pton4(src, dst));
|
||||||
|
|
||||||
|
default:
|
||||||
|
errno = EAFNOSUPPORT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int connect()
|
s32 getLastError()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
#ifdef _WIN32
|
||||||
return CELL_OK;
|
s32 ret = WSAGetLastError();
|
||||||
|
if (ret > 10000 && ret < 11000)
|
||||||
|
return ret % 10000;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
#else
|
||||||
|
return errno;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
int sys_net_accept(s32 s, mem_ptr_t<sys_net_sockaddr> addr, mem32_t paddrlen)
|
||||||
|
{
|
||||||
|
sys_net.Warning("accept(s=%d, family_addr=0x%x, paddrlen=0x%x)", s, addr.GetAddr(), paddrlen.GetAddr());
|
||||||
|
sockaddr _addr;
|
||||||
|
memcpy(&_addr, Memory.VirtualToRealAddr(addr.GetAddr()), sizeof(sockaddr));
|
||||||
|
_addr.sa_family = addr->sa_family;
|
||||||
|
s32 *_paddrlen = (s32 *)Memory.VirtualToRealAddr(paddrlen.GetAddr());
|
||||||
|
int ret = accept(s, &_addr, _paddrlen);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sys_net_bind(s32 s, mem_ptr_t<sys_net_sockaddr> family, u32 addrlen)
|
||||||
|
{
|
||||||
|
sys_net.Warning("bind(s=%d, family_addr=0x%x, addrlen=%u)", s, family.GetAddr(), addrlen);
|
||||||
|
sockaddr _family;
|
||||||
|
memcpy(&_family, Memory.VirtualToRealAddr(family.GetAddr()), sizeof(sockaddr));
|
||||||
|
_family.sa_family = family->sa_family;
|
||||||
|
int ret = bind(s, &_family, addrlen);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sys_net_connect(s32 s, mem_ptr_t<sys_net_sockaddr> family, u32 addrlen)
|
||||||
|
{
|
||||||
|
sys_net.Warning("connect(s=%d, family_addr=0x%x, addrlen=%u)", s, family.GetAddr(), addrlen);
|
||||||
|
sockaddr _family;
|
||||||
|
memcpy(&_family, Memory.VirtualToRealAddr(family.GetAddr()), sizeof(sockaddr));
|
||||||
|
_family.sa_family = family->sa_family;
|
||||||
|
int ret = connect(s, &_family, addrlen);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gethostbyaddr()
|
int gethostbyaddr()
|
||||||
@ -101,10 +195,12 @@ int inet_ntop()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int inet_pton()
|
int sys_net_inet_pton(s32 af, u32 src_addr, u32 dst_addr)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("inet_pton(af=%d, src_addr=0x%x, dst_addr=0x%x)", af, src_addr, dst_addr);
|
||||||
return CELL_OK;
|
char *src = (char *)Memory.VirtualToRealAddr(src_addr);
|
||||||
|
char *dst = (char *)Memory.VirtualToRealAddr(dst_addr);
|
||||||
|
return inet_pton(af, src, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
int listen()
|
int listen()
|
||||||
@ -113,16 +209,28 @@ int listen()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int recv()
|
int sys_net_recv(s32 s, u32 buf_addr, u32 len, s32 flags)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("recv(s=%d, buf_addr=0x%x, len=%d, flags=0x%x)", s, buf_addr, len, flags);
|
||||||
return CELL_OK;
|
char *buf = (char *)Memory.VirtualToRealAddr(buf_addr);
|
||||||
|
int ret = recv(s, buf, len, flags);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int recvfrom()
|
int sys_net_recvfrom(s32 s, u32 buf_addr, u32 len, s32 flags, mem_ptr_t<sys_net_sockaddr> addr, mem32_t paddrlen)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("recvfrom(s=%d, buf_addr=0x%x, len=%u, flags=0x%x, addr_addr=0x%x, paddrlen=0x%x)",
|
||||||
return CELL_OK;
|
s, buf_addr, len, flags, addr.GetAddr(), paddrlen.GetAddr());
|
||||||
|
|
||||||
|
char *_buf_addr = (char *)Memory.VirtualToRealAddr(buf_addr);
|
||||||
|
sockaddr _addr;
|
||||||
|
memcpy(&_addr, Memory.VirtualToRealAddr(addr.GetAddr()), sizeof(sockaddr));
|
||||||
|
_addr.sa_family = addr->sa_family;
|
||||||
|
s32 *_paddrlen = (s32 *)Memory.VirtualToRealAddr(paddrlen.GetAddr());
|
||||||
|
int ret = recvfrom(s, _buf_addr, len, flags, &_addr, _paddrlen);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int recvmsg()
|
int recvmsg()
|
||||||
@ -131,10 +239,13 @@ int recvmsg()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int send()
|
int sys_net_send(s32 s, u32 buf_addr, u32 len, s32 flags)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("send(s=%d, buf_addr=0x%x, len=%d, flags=0x%x)", s, buf_addr, len, flags);
|
||||||
return CELL_OK;
|
char *buf = (char *)Memory.VirtualToRealAddr(buf_addr);
|
||||||
|
int ret = send(s, buf, len, flags);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sendmsg()
|
int sendmsg()
|
||||||
@ -143,34 +254,51 @@ int sendmsg()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sendto()
|
int sys_net_sendto(s32 s, u32 buf_addr, u32 len, s32 flags, mem_ptr_t<sys_net_sockaddr> addr, u32 addrlen)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("sendto(s=%d, buf_addr=0x%x, len=%u, flags=0x%x, addr=0x%x, addrlen=%u)",
|
||||||
return CELL_OK;
|
s, buf_addr, len, flags, addr.GetAddr(), addrlen);
|
||||||
|
|
||||||
|
char *_buf_addr = (char *)Memory.VirtualToRealAddr(buf_addr);
|
||||||
|
sockaddr _addr;
|
||||||
|
memcpy(&_addr, Memory.VirtualToRealAddr(addr.GetAddr()), sizeof(sockaddr));
|
||||||
|
_addr.sa_family = addr->sa_family;
|
||||||
|
int ret = sendto(s, _buf_addr, len, flags, &_addr, addrlen);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int setsockopt()
|
int sys_net_setsockopt(s32 s, s32 level, s32 optname, u32 optval_addr, u32 optlen)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("socket(s=%d, level=%d, optname=%d, optval_addr=0x%x, optlen=%u)", s, level, optname, optval_addr, optlen);
|
||||||
return CELL_OK;
|
char *_optval_addr = (char *)Memory.VirtualToRealAddr(optval_addr);
|
||||||
|
int ret = setsockopt(s, level, optname, _optval_addr, optlen);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int shutdown()
|
int sys_net_shutdown(s32 s, s32 how)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("shutdown(s=%d, how=%d)", s, how);
|
||||||
return CELL_OK;
|
int ret = shutdown(s, how);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int socket()
|
int sys_net_socket(s32 family, s32 type, s32 protocol)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("socket(family=%d, type=%d, protocol=%d", family, type, protocol);
|
||||||
return CELL_OK;
|
int ret = socket(family, type, protocol);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int socketclose()
|
int sys_net_socketclose(s32 s)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("socket(s=%d)", s);
|
||||||
return CELL_OK;
|
int ret = closesocket(s);
|
||||||
|
g_lastError = getLastError();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int socketpoll()
|
int socketpoll()
|
||||||
@ -185,9 +313,17 @@ int socketselect()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sys_net_initialize_network_ex()
|
int sys_net_initialize_network_ex(mem_ptr_t<sys_net_initialize_parameter> param)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("sys_net_initialize_network_ex(param_addr=0x%x)", param.GetAddr());
|
||||||
|
g_lastError.SetAddr(Memory.Alloc(4, 1));
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSADATA wsaData;
|
||||||
|
WORD wVersionRequested = MAKEWORD(1,1);
|
||||||
|
WSAStartup(wVersionRequested, &wsaData);
|
||||||
|
#elif
|
||||||
|
// TODO ?
|
||||||
|
#endif
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,10 +381,10 @@ int sys_net_show_nameserver()
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _sys_net_errno_loc()
|
s32 _sys_net_errno_loc()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("_sys_net_errno_loc()");
|
||||||
return CELL_OK;
|
return g_lastError.GetAddr();
|
||||||
}
|
}
|
||||||
|
|
||||||
int sys_net_set_resolver_configurations()
|
int sys_net_set_resolver_configurations()
|
||||||
@ -313,7 +449,14 @@ int sys_net_show_ifconfig()
|
|||||||
|
|
||||||
int sys_net_finalize_network()
|
int sys_net_finalize_network()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED_FUNC(sys_net);
|
sys_net.Warning("sys_net_initialize_network_ex()");
|
||||||
|
Memory.Free(g_lastError.GetAddr());
|
||||||
|
g_lastError.SetAddr(NULL);
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSACleanup();
|
||||||
|
#else
|
||||||
|
// TODO ?
|
||||||
|
#endif
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,40 +480,39 @@ int sys_net_free_thread_context()
|
|||||||
|
|
||||||
void sys_net_init()
|
void sys_net_init()
|
||||||
{
|
{
|
||||||
// (TODO: Fix function overloading problem due to winsock.h and find addresses for ntohl and ntohs)
|
// The names of the following functions are modified to avoid overloading problems
|
||||||
|
sys_net.AddFunc(0xc94f6939, sys_net_accept);
|
||||||
//sys_net.AddFunc(0xc94f6939, accept);
|
sys_net.AddFunc(0xb0a59804, sys_net_bind);
|
||||||
//sys_net.AddFunc(0xb0a59804, bind);
|
sys_net.AddFunc(0x64f66d35, sys_net_connect);
|
||||||
//sys_net.AddFunc(0x64f66d35, connect);
|
//sys_net.AddFunc(0xf7ac8941, sys_net_gethostbyaddr);
|
||||||
//sys_net.AddFunc(0xf7ac8941, gethostbyaddr);
|
//sys_net.AddFunc(0x71f4c717, sys_net_gethostbyname);
|
||||||
//sys_net.AddFunc(0x71f4c717, gethostbyname);
|
//sys_net.AddFunc(0xf9ec2db6, sys_net_getpeername);
|
||||||
//sys_net.AddFunc(0xf9ec2db6, getpeername);
|
//sys_net.AddFunc(0x13efe7f5, sys_net_getsockname);
|
||||||
//sys_net.AddFunc(0x13efe7f5, getsockname);
|
//sys_net.AddFunc(0x5a045bd1, sys_net_getsockopt);
|
||||||
//sys_net.AddFunc(0x5a045bd1, getsockopt);
|
//sys_net.AddFunc(0xdabbc2c0, sys_net_inet_addr);
|
||||||
//sys_net.AddFunc(0xdabbc2c0, inet_addr);
|
//sys_net.AddFunc(0xa9a079e0, sys_net_inet_aton);
|
||||||
sys_net.AddFunc(0xa9a079e0, inet_aton);
|
//sys_net.AddFunc(0x566893ce, sys_net_inet_lnaof);
|
||||||
sys_net.AddFunc(0x566893ce, inet_lnaof);
|
//sys_net.AddFunc(0xb4152c74, sys_net_inet_makeaddr);
|
||||||
sys_net.AddFunc(0xb4152c74, inet_makeaddr);
|
//sys_net.AddFunc(0xe39a62a7, sys_net_inet_netof);
|
||||||
sys_net.AddFunc(0xe39a62a7, inet_netof);
|
//sys_net.AddFunc(0x506ad863, sys_net_inet_network);
|
||||||
sys_net.AddFunc(0x506ad863, inet_network);
|
//sys_net.AddFunc(0x858a930b, sys_net_inet_ntoa);
|
||||||
//sys_net.AddFunc(0x858a930b, inet_ntoa);
|
//sys_net.AddFunc(0xc98a3146, sys_net_inet_ntop);
|
||||||
sys_net.AddFunc(0xc98a3146, inet_ntop);
|
sys_net.AddFunc(0x8af3825e, sys_net_inet_pton);
|
||||||
sys_net.AddFunc(0x8af3825e, inet_pton);
|
//sys_net.AddFunc(0x28e208bb, sys_net_listen);
|
||||||
//sys_net.AddFunc(0x28e208bb, listen);
|
//sys_net.AddFunc(, sys_net_ntohl);
|
||||||
//sys_net.AddFunc(, ntohl);
|
//sys_net.AddFunc(, sys_net_ntohs);
|
||||||
//sys_net.AddFunc(, ntohs);
|
sys_net.AddFunc(0xfba04f37, sys_net_recv);
|
||||||
//sys_net.AddFunc(0xfba04f37, recv);
|
sys_net.AddFunc(0x1f953b9f, sys_net_recvfrom);
|
||||||
//sys_net.AddFunc(0x1f953b9f, recvfrom);
|
//sys_net.AddFunc(0xc9d09c34, sys_net_recvmsg);
|
||||||
sys_net.AddFunc(0xc9d09c34, recvmsg);
|
sys_net.AddFunc(0xdc751b40, sys_net_send);
|
||||||
//sys_net.AddFunc(0xdc751b40, send);
|
//sys_net.AddFunc(0xad09481b, sys_net_sendmsg);
|
||||||
sys_net.AddFunc(0xad09481b, sendmsg);
|
sys_net.AddFunc(0x9647570b, sys_net_sendto);
|
||||||
//sys_net.AddFunc(0x9647570b, sendto);
|
sys_net.AddFunc(0x88f03575, sys_net_setsockopt);
|
||||||
//sys_net.AddFunc(0x88f03575, setsockopt);
|
sys_net.AddFunc(0xa50777c6, sys_net_shutdown);
|
||||||
//sys_net.AddFunc(0xa50777c6, shutdown);
|
sys_net.AddFunc(0x9c056962, sys_net_socket);
|
||||||
//sys_net.AddFunc(0x9c056962, socket);
|
sys_net.AddFunc(0x6db6e8cd, sys_net_socketclose);
|
||||||
sys_net.AddFunc(0x6db6e8cd, socketclose);
|
//sys_net.AddFunc(0x051ee3ee, sys_net_socketpoll);
|
||||||
sys_net.AddFunc(0x051ee3ee, socketpoll);
|
//sys_net.AddFunc(0x3f09e20a, sys_net_socketselect);
|
||||||
sys_net.AddFunc(0x3f09e20a, socketselect);
|
|
||||||
|
|
||||||
sys_net.AddFunc(0x139a9e9b, sys_net_initialize_network_ex);
|
sys_net.AddFunc(0x139a9e9b, sys_net_initialize_network_ex);
|
||||||
sys_net.AddFunc(0x05bd4438, sys_net_get_udpp2p_test_param);
|
sys_net.AddFunc(0x05bd4438, sys_net_get_udpp2p_test_param);
|
||||||
|
16
rpcs3/Emu/SysCalls/Modules/sys_net.h
Normal file
16
rpcs3/Emu/SysCalls/Modules/sys_net.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct sys_net_initialize_parameter
|
||||||
|
{
|
||||||
|
u32 memory_addr;
|
||||||
|
int memory_size;
|
||||||
|
int flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
// The names of the following structs are modified to avoid overloading problems
|
||||||
|
struct sys_net_sockaddr
|
||||||
|
{
|
||||||
|
u8 sa_len;
|
||||||
|
u8 sa_family; // sa_family_t
|
||||||
|
u8 sa_data[14];
|
||||||
|
};
|
@ -262,6 +262,19 @@ extern int cellFsTruncate(u32 path_addr, u64 size);
|
|||||||
extern int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size);
|
extern int cellFsFGetBlockSize(u32 fd, mem64_t sector_size, mem64_t block_size);
|
||||||
extern int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size);
|
extern int cellFsGetBlockSize(u32 path_addr, mem64_t sector_size, mem64_t block_size);
|
||||||
extern int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count);
|
extern int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count);
|
||||||
|
extern int cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u32 entries_size, mem32_t data_count);
|
||||||
|
extern int cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf);
|
||||||
|
extern int cellFsStReadFinish(u32 fd);
|
||||||
|
extern int cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf);
|
||||||
|
extern int cellFsStReadGetStatus(u32 fd, mem64_t status);
|
||||||
|
extern int cellFsStReadGetRegid(u32 fd, mem64_t regid);
|
||||||
|
extern int cellFsStReadStart(u32 fd, u64 offset, u64 size);
|
||||||
|
extern int cellFsStReadStop(u32 fd);
|
||||||
|
extern int cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize);
|
||||||
|
extern int cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size);
|
||||||
|
extern int cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size);
|
||||||
|
extern int cellFsStReadWait(u32 fd, u64 size);
|
||||||
|
extern int cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd, u64 xsize)> func);
|
||||||
|
|
||||||
//cellVideo
|
//cellVideo
|
||||||
extern int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr);
|
extern int cellVideoOutGetState(u32 videoOut, u32 deviceIndex, u32 state_addr);
|
||||||
|
@ -10,6 +10,39 @@ enum
|
|||||||
IDFlag_Dir = 2,
|
IDFlag_Dir = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FsRingBuffer
|
||||||
|
{
|
||||||
|
u64 m_ringbuf_size;
|
||||||
|
u64 m_block_size;
|
||||||
|
u64 m_transfer_rate;
|
||||||
|
u32 m_copy;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FsRingBufferConfig
|
||||||
|
{
|
||||||
|
FsRingBuffer m_ring_buffer;
|
||||||
|
u32 m_buffer;
|
||||||
|
u64 m_fs_status;
|
||||||
|
u64 m_regid;
|
||||||
|
u32 m_alloc_mem_size;
|
||||||
|
u32 m_current_addr;
|
||||||
|
|
||||||
|
FsRingBufferConfig()
|
||||||
|
: m_fs_status(CELL_FS_ST_NOT_INITIALIZED)
|
||||||
|
, m_regid(0)
|
||||||
|
, m_alloc_mem_size(0)
|
||||||
|
, m_current_addr(0)
|
||||||
|
{
|
||||||
|
memset(&m_ring_buffer, 0, sizeof(FsRingBufferConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
~FsRingBufferConfig()
|
||||||
|
{
|
||||||
|
memset(&m_ring_buffer, 0, sizeof(FsRingBufferConfig));
|
||||||
|
}
|
||||||
|
} m_fs_config;
|
||||||
|
|
||||||
|
|
||||||
int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
|
int cellFsOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
|
||||||
{
|
{
|
||||||
const wxString& path = Memory.ReadString(path_addr);
|
const wxString& path = Memory.ReadString(path_addr);
|
||||||
@ -290,7 +323,7 @@ int cellFsMkdir(u32 path_addr, u32 mode)
|
|||||||
{
|
{
|
||||||
const wxString& ps3_path = Memory.ReadString(path_addr);
|
const wxString& ps3_path = Memory.ReadString(path_addr);
|
||||||
sys_fs.Log("cellFsMkdir(path=\"%s\", mode=0x%x)", ps3_path.wx_str(), mode);
|
sys_fs.Log("cellFsMkdir(path=\"%s\", mode=0x%x)", ps3_path.wx_str(), mode);
|
||||||
|
|
||||||
vfsDir dir;
|
vfsDir dir;
|
||||||
if(dir.IsExists(ps3_path))
|
if(dir.IsExists(ps3_path))
|
||||||
return CELL_EEXIST;
|
return CELL_EEXIST;
|
||||||
@ -484,3 +517,217 @@ int cellFsGetFreeSize(u32 path_addr, mem32_t block_size, mem64_t block_count)
|
|||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cellFsGetDirectoryEntries(u32 fd, mem_ptr_t<CellFsDirectoryEntry> entries, u32 entries_size, mem32_t data_count)
|
||||||
|
{
|
||||||
|
sys_fs.Log("cellFsGetDirectoryEntries(fd=%d, entries_addr=0x%x, entries_size = 0x%x, data_count_addr=0x%x)", fd, entries.GetAddr(), entries_size, data_count.GetAddr());
|
||||||
|
|
||||||
|
vfsDirBase* directory;
|
||||||
|
if(!sys_fs.CheckId(fd, directory))
|
||||||
|
return CELL_ESRCH;
|
||||||
|
if(!entries.IsGood() || !data_count.IsGood())
|
||||||
|
return CELL_EFAULT;
|
||||||
|
|
||||||
|
const DirEntryInfo* info = directory->Read();
|
||||||
|
if(info)
|
||||||
|
{
|
||||||
|
data_count = 1;
|
||||||
|
Memory.WriteString(entries.GetAddr()+2, info->name.wx_str());
|
||||||
|
entries->entry_name.d_namlen = info->name.Length();
|
||||||
|
entries->entry_name.d_type = (info->flags & DirEntry_TypeFile) ? CELL_FS_TYPE_REGULAR : CELL_FS_TYPE_DIRECTORY;
|
||||||
|
|
||||||
|
entries->attribute.st_mode =
|
||||||
|
CELL_FS_S_IRUSR | CELL_FS_S_IWUSR | CELL_FS_S_IXUSR |
|
||||||
|
CELL_FS_S_IRGRP | CELL_FS_S_IWGRP | CELL_FS_S_IXGRP |
|
||||||
|
CELL_FS_S_IROTH | CELL_FS_S_IWOTH | CELL_FS_S_IXOTH;
|
||||||
|
|
||||||
|
entries->attribute.st_uid = 0;
|
||||||
|
entries->attribute.st_gid = 0;
|
||||||
|
entries->attribute.st_atime_ = 0; //TODO
|
||||||
|
entries->attribute.st_mtime_ = 0; //TODO
|
||||||
|
entries->attribute.st_ctime_ = 0; //TODO
|
||||||
|
entries->attribute.st_blksize = 4096;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadInit(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStReadInit(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.GetAddr());
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
if(!ringbuf.IsGood())
|
||||||
|
return CELL_EFAULT;
|
||||||
|
|
||||||
|
FsRingBuffer& buffer = m_fs_config.m_ring_buffer;
|
||||||
|
|
||||||
|
buffer.m_block_size = ringbuf->block_size;
|
||||||
|
buffer.m_copy = ringbuf->copy;
|
||||||
|
buffer.m_ringbuf_size = ringbuf->ringbuf_size;
|
||||||
|
buffer.m_transfer_rate = ringbuf->transfer_rate;
|
||||||
|
|
||||||
|
if(buffer.m_ringbuf_size < 0x40000000) // If the size is less than 1MB
|
||||||
|
m_fs_config.m_alloc_mem_size = ((ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024);
|
||||||
|
m_fs_config.m_alloc_mem_size = ((ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024);
|
||||||
|
|
||||||
|
// alloc memory
|
||||||
|
m_fs_config.m_buffer = Memory.Alloc(m_fs_config.m_alloc_mem_size, 1024);
|
||||||
|
memset(Memory + m_fs_config.m_buffer, 0, m_fs_config.m_alloc_mem_size);
|
||||||
|
|
||||||
|
m_fs_config.m_fs_status = CELL_FS_ST_INITIALIZED;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadFinish(u32 fd)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStReadFinish(fd=%d)", fd);
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
Memory.Free(m_fs_config.m_buffer);
|
||||||
|
m_fs_config.m_fs_status = CELL_FS_ST_NOT_INITIALIZED;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadGetRingBuf(u32 fd, mem_ptr_t<CellFsRingBuffer> ringbuf)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStReadGetRingBuf(fd=%d, ringbuf_addr=0x%x)", fd, ringbuf.GetAddr());
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
if(!ringbuf.IsGood())
|
||||||
|
return CELL_EFAULT;
|
||||||
|
|
||||||
|
FsRingBuffer& buffer = m_fs_config.m_ring_buffer;
|
||||||
|
|
||||||
|
ringbuf->block_size = buffer.m_block_size;
|
||||||
|
ringbuf->copy = buffer.m_copy;
|
||||||
|
ringbuf->ringbuf_size = buffer.m_ringbuf_size;
|
||||||
|
ringbuf->transfer_rate = buffer.m_transfer_rate;
|
||||||
|
|
||||||
|
sys_fs.Warning("*** fs stream config: block_size=0x%llx, copy=%d, ringbuf_size = 0x%llx, transfer_rate = 0x%llx", ringbuf->block_size, ringbuf->copy,
|
||||||
|
ringbuf->ringbuf_size, ringbuf->transfer_rate);
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadGetStatus(u32 fd, mem64_t status)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStReadGetRingBuf(fd=%d, status_addr=0x%x)", fd, status.GetAddr());
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
status = m_fs_config.m_fs_status;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadGetRegid(u32 fd, mem64_t regid)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStReadGetRingBuf(fd=%d, regid_addr=0x%x)", fd, regid.GetAddr());
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
regid = m_fs_config.m_regid;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("TODO: cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size);
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
m_fs_config.m_current_addr = m_fs_config.m_buffer + (u32)offset;
|
||||||
|
m_fs_config.m_fs_status = CELL_FS_ST_PROGRESS;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadStop(u32 fd)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("cellFsStReadStop(fd=%d)", fd);
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
m_fs_config.m_fs_status = CELL_FS_ST_STOP;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStRead(u32 fd, u32 buf_addr, u64 size, mem64_t rsize)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("TODO: cellFsStRead(fd=%d, buf_addr=0x%x, size=0x%llx, rsize_addr = 0x%x)", fd, buf_addr, size, rsize.GetAddr());
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
if (rsize.GetAddr() && !rsize.IsGood()) return CELL_EFAULT;
|
||||||
|
|
||||||
|
m_fs_config.m_regid += size;
|
||||||
|
rsize = m_fs_config.m_regid;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadGetCurrentAddr(u32 fd, mem32_t addr_addr, mem64_t size)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("TODO: cellFsStReadGetCurrentAddr(fd=%d, addr_addr=0x%x, size_addr = 0x%x)", fd, addr_addr.GetAddr(), size.GetAddr());
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
if (!addr_addr.IsGood() && !size.IsGood()) return CELL_EFAULT;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadPutCurrentAddr(u32 fd, u32 addr_addr, u64 size)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("TODO: cellFsStReadPutCurrentAddr(fd=%d, addr_addr=0x%x, size = 0x%llx)", fd, addr_addr, size);
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
if (!Memory.IsGoodAddr(addr_addr)) return CELL_EFAULT;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadWait(u32 fd, u64 size)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("TODO: cellFsStReadWait(fd=%d, size = 0x%llx)", fd, size);
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cellFsStReadWaitCallback(u32 fd, u64 size, mem_func_ptr_t<void (*)(int xfd, u64 xsize)> func)
|
||||||
|
{
|
||||||
|
sys_fs.Warning("TODO: cellFsStReadWaitCallback(fd=%d, size = 0x%llx, func_addr = 0x%x)", fd, size, func.GetAddr());
|
||||||
|
|
||||||
|
if (!func.IsGood())
|
||||||
|
return CELL_EFAULT;
|
||||||
|
|
||||||
|
vfsStream* file;
|
||||||
|
if(!sys_fs.CheckId(fd, file)) return CELL_ESRCH;
|
||||||
|
|
||||||
|
return CELL_OK;
|
||||||
|
}
|
@ -56,6 +56,21 @@ enum FsDirentType
|
|||||||
CELL_FS_TYPE_SYMLINK = 3,
|
CELL_FS_TYPE_SYMLINK = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum CellFsRingBufferCopy
|
||||||
|
{
|
||||||
|
CELL_FS_ST_COPY = 0,
|
||||||
|
CELL_FS_ST_COPYLESS = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum cellFsStStatus
|
||||||
|
{
|
||||||
|
CELL_FS_ST_INITIALIZED = 0x0001,
|
||||||
|
CELL_FS_ST_NOT_INITIALIZED = 0x0002,
|
||||||
|
CELL_FS_ST_STOP = 0x0100,
|
||||||
|
CELL_FS_ST_PROGRESS = 0x0200,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#pragma pack(4)
|
#pragma pack(4)
|
||||||
|
|
||||||
struct CellFsStat
|
struct CellFsStat
|
||||||
@ -92,4 +107,18 @@ struct CellFsAio
|
|||||||
be_t<u32> buf_addr;
|
be_t<u32> buf_addr;
|
||||||
be_t<u64> size;
|
be_t<u64> size;
|
||||||
be_t<u64> user_data;
|
be_t<u64> user_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CellFsDirectoryEntry
|
||||||
|
{
|
||||||
|
CellFsStat attribute;
|
||||||
|
CellFsDirent entry_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellFsRingBuffer
|
||||||
|
{
|
||||||
|
be_t<u64> ringbuf_size;
|
||||||
|
be_t<u64> block_size;
|
||||||
|
be_t<u64> transfer_rate;
|
||||||
|
be_t<u32> copy;
|
||||||
|
};
|
||||||
|
@ -93,12 +93,12 @@ bool Emulator::BootGame(const std::string& path)
|
|||||||
{
|
{
|
||||||
static const char* elf_path[6] =
|
static const char* elf_path[6] =
|
||||||
{
|
{
|
||||||
"\\PS3_GAME\\USRDIR\\BOOT.BIN",
|
"/PS3_GAME/USRDIR/BOOT.BIN",
|
||||||
"\\USRDIR\\BOOT.BIN",
|
"/USRDIR/BOOT.BIN",
|
||||||
"\\BOOT.BIN",
|
"/BOOT.BIN",
|
||||||
"\\PS3_GAME\\USRDIR\\EBOOT.BIN",
|
"/PS3_GAME/USRDIR/EBOOT.BIN",
|
||||||
"\\USRDIR\\EBOOT.BIN",
|
"/USRDIR/EBOOT.BIN",
|
||||||
"\\EBOOT.BIN",
|
"/EBOOT.BIN",
|
||||||
};
|
};
|
||||||
|
|
||||||
for(int i=0; i<sizeof(elf_path) / sizeof(*elf_path);i++)
|
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)
|
if(wxFileName(m_path).GetFullName().CmpNoCase("EBOOT.BIN") == 0)
|
||||||
{
|
{
|
||||||
elf_path += "\\BOOT.BIN";
|
elf_path += "/BOOT.BIN";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elf_path += "\\" + wxFileName(m_path).GetName() + ".elf";
|
elf_path += "/" + wxFileName(m_path).GetName() + ".elf";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!DecryptSelf(elf_path, self_path))
|
if(!DecryptSelf(elf_path, self_path))
|
||||||
|
@ -45,8 +45,8 @@ AboutDialog::AboutDialog(wxWindow *parent)
|
|||||||
|
|
||||||
//Credits
|
//Credits
|
||||||
wxBoxSizer* s_panel_credits(new wxBoxSizer(wxHORIZONTAL));
|
wxBoxSizer* s_panel_credits(new wxBoxSizer(wxHORIZONTAL));
|
||||||
wxStaticText* t_section1 = new wxStaticText(this, wxID_ANY, "\nDevelopers:\n\nDH\nAlexAltea\nHykem\nOil", wxDefaultPosition, wxSize(156,160));
|
wxStaticText* t_section1 = new wxStaticText(this, wxID_ANY, "\nDevelopers:\n\nDH\nAlexAltea\nHykem\nOil\nNekotekina\nelisha464\nBigpet", wxDefaultPosition, wxSize(156,160));
|
||||||
wxStaticText* t_section2 = new wxStaticText(this, wxID_ANY, "\nThanks:\n\nBlackDaemon", wxDefaultPosition, wxSize(156,160));
|
wxStaticText* t_section2 = new wxStaticText(this, wxID_ANY, "\nThanks:\n\nBlackDaemon\nAishou\nkrofna\nxsacha", wxDefaultPosition, wxSize(156,160));
|
||||||
|
|
||||||
s_panel_credits->AddSpacer(12);
|
s_panel_credits->AddSpacer(12);
|
||||||
s_panel_credits->Add(t_section1);
|
s_panel_credits->Add(t_section1);
|
||||||
|
@ -14,6 +14,11 @@ std::mutex g_cs_conlog;
|
|||||||
static const uint max_item_count = 500;
|
static const uint max_item_count = 500;
|
||||||
static const uint buffer_size = 1024 * 64;
|
static const uint buffer_size = 1024 * 64;
|
||||||
|
|
||||||
|
static const std::string g_log_colors[] =
|
||||||
|
{
|
||||||
|
"Black", "Green", "White", "Yellow", "Red",
|
||||||
|
};
|
||||||
|
|
||||||
struct LogPacket
|
struct LogPacket
|
||||||
{
|
{
|
||||||
std::string m_prefix;
|
std::string m_prefix;
|
||||||
@ -112,7 +117,7 @@ LogWriter::LogWriter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWriter::WriteToLog(std::string prefix, std::string value, std::string colour/*, wxColour bgcolour*/)
|
void LogWriter::WriteToLog(std::string prefix, std::string value, u8 lvl/*, wxColour bgcolour*/)
|
||||||
{
|
{
|
||||||
if(!prefix.empty())
|
if(!prefix.empty())
|
||||||
{
|
{
|
||||||
@ -125,7 +130,8 @@ void LogWriter::WriteToLog(std::string prefix, std::string value, std::string co
|
|||||||
if(m_logfile.IsOpened())
|
if(m_logfile.IsOpened())
|
||||||
m_logfile.Write(wxString(prefix.empty() ? "" : std::string("[" + prefix + "]: ") + value + "\n").wx_str());
|
m_logfile.Write(wxString(prefix.empty() ? "" : std::string("[" + prefix + "]: ") + value + "\n").wx_str());
|
||||||
|
|
||||||
if(!ConLogFrame) return;
|
if(!ConLogFrame || Ini.HLELogLvl.GetValue() == 4 || (lvl != 0 && lvl <= Ini.HLELogLvl.GetValue()))
|
||||||
|
return;
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(g_cs_conlog);
|
std::lock_guard<std::mutex> lock(g_cs_conlog);
|
||||||
|
|
||||||
@ -156,7 +162,7 @@ void LogWriter::WriteToLog(std::string prefix, std::string value, std::string co
|
|||||||
|
|
||||||
//if(LogBuffer.put == LogBuffer.get) LogBuffer.Flush();
|
//if(LogBuffer.put == LogBuffer.get) LogBuffer.Flush();
|
||||||
|
|
||||||
LogBuffer.Push(LogPacket(prefix, value, colour));
|
LogBuffer.Push(LogPacket(prefix, value, g_log_colors[lvl]));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWriter::Write(const wxString fmt, ...)
|
void LogWriter::Write(const wxString fmt, ...)
|
||||||
@ -169,7 +175,7 @@ void LogWriter::Write(const wxString fmt, ...)
|
|||||||
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
WriteToLog("!", (const char *)frmt.ToAscii(), "White");
|
WriteToLog("!", (const char *)frmt.ToAscii(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWriter::Error(const wxString fmt, ...)
|
void LogWriter::Error(const wxString fmt, ...)
|
||||||
@ -182,7 +188,7 @@ void LogWriter::Error(const wxString fmt, ...)
|
|||||||
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
WriteToLog("E", static_cast<const char *>(frmt), "Red");
|
WriteToLog("E", static_cast<const char *>(frmt), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWriter::Warning(const wxString fmt, ...)
|
void LogWriter::Warning(const wxString fmt, ...)
|
||||||
@ -195,7 +201,7 @@ void LogWriter::Warning(const wxString fmt, ...)
|
|||||||
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
WriteToLog("W", static_cast<const char *>(frmt), "Yellow");
|
WriteToLog("W", static_cast<const char *>(frmt), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWriter::Success(const wxString fmt, ...)
|
void LogWriter::Success(const wxString fmt, ...)
|
||||||
@ -208,12 +214,12 @@ void LogWriter::Success(const wxString fmt, ...)
|
|||||||
|
|
||||||
va_end(list);
|
va_end(list);
|
||||||
|
|
||||||
WriteToLog("S", static_cast<const char *>(frmt), "Green");
|
WriteToLog("S", static_cast<const char *>(frmt), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWriter::SkipLn()
|
void LogWriter::SkipLn()
|
||||||
{
|
{
|
||||||
WriteToLog("", "", "Black");
|
WriteToLog("", "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(LogFrame, wxPanel)
|
BEGIN_EVENT_TABLE(LogFrame, wxPanel)
|
||||||
|
@ -11,7 +11,7 @@ class LogWriter
|
|||||||
std::string m_prefix;
|
std::string m_prefix;
|
||||||
std::string m_value;
|
std::string m_value;
|
||||||
|
|
||||||
virtual void WriteToLog(std::string prefix, std::string value, std::string colour);
|
virtual void WriteToLog(std::string prefix, std::string value, u8 lvl);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LogWriter();
|
LogWriter();
|
||||||
|
@ -346,6 +346,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxStaticBoxSizer* s_round_audio_out( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Audio Out") ) );
|
wxStaticBoxSizer* s_round_audio_out( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Audio Out") ) );
|
||||||
|
|
||||||
wxStaticBoxSizer* s_round_hle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("HLE / Misc.") ) );
|
wxStaticBoxSizer* s_round_hle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("HLE / Misc.") ) );
|
||||||
|
wxStaticBoxSizer* s_round_hle_log_lvl( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Log lvl") ) );
|
||||||
|
|
||||||
wxComboBox* cbox_cpu_decoder = new wxComboBox(&diag, wxID_ANY);
|
wxComboBox* cbox_cpu_decoder = new wxComboBox(&diag, wxID_ANY);
|
||||||
wxComboBox* cbox_gs_render = new wxComboBox(&diag, wxID_ANY);
|
wxComboBox* cbox_gs_render = new wxComboBox(&diag, wxID_ANY);
|
||||||
@ -355,6 +356,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxComboBox* cbox_keyboard_handler = new wxComboBox(&diag, wxID_ANY);
|
wxComboBox* cbox_keyboard_handler = new wxComboBox(&diag, wxID_ANY);
|
||||||
wxComboBox* cbox_mouse_handler = new wxComboBox(&diag, wxID_ANY);
|
wxComboBox* cbox_mouse_handler = new wxComboBox(&diag, wxID_ANY);
|
||||||
wxComboBox* cbox_audio_out = new wxComboBox(&diag, wxID_ANY);
|
wxComboBox* cbox_audio_out = new wxComboBox(&diag, wxID_ANY);
|
||||||
|
wxComboBox* cbox_hle_loglvl = new wxComboBox(&diag, wxID_ANY);
|
||||||
|
|
||||||
wxCheckBox* chbox_cpu_ignore_rwerrors = new wxCheckBox(&diag, wxID_ANY, "Ignore Read/Write errors");
|
wxCheckBox* chbox_cpu_ignore_rwerrors = new wxCheckBox(&diag, wxID_ANY, "Ignore Read/Write errors");
|
||||||
wxCheckBox* chbox_gs_log_prog = new wxCheckBox(&diag, wxID_ANY, "Log vertex/fragment programs");
|
wxCheckBox* chbox_gs_log_prog = new wxCheckBox(&diag, wxID_ANY, "Log vertex/fragment programs");
|
||||||
@ -397,6 +399,12 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
cbox_audio_out->Append("Null");
|
cbox_audio_out->Append("Null");
|
||||||
cbox_audio_out->Append("OpenAL");
|
cbox_audio_out->Append("OpenAL");
|
||||||
|
|
||||||
|
cbox_hle_loglvl->Append("All");
|
||||||
|
cbox_hle_loglvl->Append("Success");
|
||||||
|
cbox_hle_loglvl->Append("Warnings");
|
||||||
|
cbox_hle_loglvl->Append("Errors");
|
||||||
|
cbox_hle_loglvl->Append("Nothing");
|
||||||
|
|
||||||
chbox_cpu_ignore_rwerrors->SetValue(Ini.CPUIgnoreRWErrors.GetValue());
|
chbox_cpu_ignore_rwerrors->SetValue(Ini.CPUIgnoreRWErrors.GetValue());
|
||||||
chbox_gs_log_prog->SetValue(Ini.GSLogPrograms.GetValue());
|
chbox_gs_log_prog->SetValue(Ini.GSLogPrograms.GetValue());
|
||||||
chbox_gs_dump_depth->SetValue(Ini.GSDumpDepthBuffer.GetValue());
|
chbox_gs_dump_depth->SetValue(Ini.GSDumpDepthBuffer.GetValue());
|
||||||
@ -408,6 +416,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue());
|
chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue());
|
||||||
|
|
||||||
chbox_audio_dump->Enable(Emu.IsStopped());
|
chbox_audio_dump->Enable(Emu.IsStopped());
|
||||||
|
cbox_audio_out->Enable(Emu.IsStopped());
|
||||||
chbox_hle_logging->Enable(Emu.IsStopped());
|
chbox_hle_logging->Enable(Emu.IsStopped());
|
||||||
|
|
||||||
cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0);
|
cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0);
|
||||||
@ -418,6 +427,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue());
|
cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue());
|
||||||
cbox_mouse_handler->SetSelection(Ini.MouseHandlerMode.GetValue());
|
cbox_mouse_handler->SetSelection(Ini.MouseHandlerMode.GetValue());
|
||||||
cbox_audio_out->SetSelection(Ini.AudioOutMode.GetValue());
|
cbox_audio_out->SetSelection(Ini.AudioOutMode.GetValue());
|
||||||
|
cbox_hle_loglvl->SetSelection(Ini.HLELogLvl.GetValue());
|
||||||
|
|
||||||
s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_round_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
@ -445,6 +455,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
s_round_audio_out->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_audio_out->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_round_audio->Add(s_round_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_audio->Add(s_round_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
|
||||||
|
s_round_hle_log_lvl->Add(cbox_hle_loglvl, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
|
s_round_hle->Add(s_round_hle_log_lvl, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_round_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_round_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
s_round_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
|
s_round_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||||
@ -487,6 +499,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
|||||||
Ini.HLELogging.SetValue(chbox_hle_logging->GetValue());
|
Ini.HLELogging.SetValue(chbox_hle_logging->GetValue());
|
||||||
Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue());
|
Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue());
|
||||||
Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue());
|
Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue());
|
||||||
|
Ini.HLELogLvl.SetValue(cbox_hle_loglvl->GetSelection());
|
||||||
|
|
||||||
Ini.Save();
|
Ini.Save();
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ Ini::Ini()
|
|||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
m_Config = new wxIniConfig( wxEmptyString, wxEmptyString,
|
m_Config = new wxIniConfig( wxEmptyString, wxEmptyString,
|
||||||
wxGetCwd() + "\\rpcs3.ini",
|
wxGetCwd() + "/rpcs3.ini",
|
||||||
wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
|
wxEmptyString, wxCONFIG_USE_LOCAL_FILE );
|
||||||
#else
|
#else
|
||||||
m_Config = new wxConfig("rpcs3");
|
m_Config = new wxConfig("rpcs3");
|
||||||
|
16
rpcs3/Ini.h
16
rpcs3/Ini.h
@ -109,6 +109,7 @@ public:
|
|||||||
IniEntry<bool> HLELogging;
|
IniEntry<bool> HLELogging;
|
||||||
IniEntry<bool> HLESaveTTY;
|
IniEntry<bool> HLESaveTTY;
|
||||||
IniEntry<bool> HLEExitOnStop;
|
IniEntry<bool> HLEExitOnStop;
|
||||||
|
IniEntry<u8> HLELogLvl;
|
||||||
|
|
||||||
IniEntry<int> PadHandlerLeft;
|
IniEntry<int> PadHandlerLeft;
|
||||||
IniEntry<int> PadHandlerDown;
|
IniEntry<int> PadHandlerDown;
|
||||||
@ -132,11 +133,11 @@ public:
|
|||||||
{
|
{
|
||||||
wxString path;
|
wxString path;
|
||||||
|
|
||||||
path = DefPath + "\\" + "CPU";
|
path = DefPath + "/" + "CPU";
|
||||||
CPUDecoderMode.Init("DecoderMode", path);
|
CPUDecoderMode.Init("DecoderMode", path);
|
||||||
CPUIgnoreRWErrors.Init("IgnoreRWErrors", path);
|
CPUIgnoreRWErrors.Init("IgnoreRWErrors", path);
|
||||||
|
|
||||||
path = DefPath + "\\" + "GS";
|
path = DefPath + "/" + "GS";
|
||||||
GSRenderMode.Init("RenderMode", path);
|
GSRenderMode.Init("RenderMode", path);
|
||||||
GSResolution.Init("Resolution", path);
|
GSResolution.Init("Resolution", path);
|
||||||
GSAspectRatio.Init("AspectRatio", path);
|
GSAspectRatio.Init("AspectRatio", path);
|
||||||
@ -145,12 +146,12 @@ public:
|
|||||||
GSDumpColorBuffers.Init("DumpColorBuffers", path);
|
GSDumpColorBuffers.Init("DumpColorBuffers", path);
|
||||||
GSDumpDepthBuffer.Init("DumpDepthBuffer", path);
|
GSDumpDepthBuffer.Init("DumpDepthBuffer", path);
|
||||||
|
|
||||||
path = DefPath + "\\" + "IO";
|
path = DefPath + "/" + "IO";
|
||||||
PadHandlerMode.Init("PadHandlerMode", path);
|
PadHandlerMode.Init("PadHandlerMode", path);
|
||||||
KeyboardHandlerMode.Init("KeyboardHandlerMode", path);
|
KeyboardHandlerMode.Init("KeyboardHandlerMode", path);
|
||||||
MouseHandlerMode.Init("MouseHandlerMode", path);
|
MouseHandlerMode.Init("MouseHandlerMode", path);
|
||||||
|
|
||||||
path = DefPath + "\\" + "ControlSetings";
|
path = DefPath + "/" + "ControlSetings";
|
||||||
PadHandlerLeft.Init("PadHandlerLeft", path);
|
PadHandlerLeft.Init("PadHandlerLeft", path);
|
||||||
PadHandlerDown.Init("PadHandlerDown", path);
|
PadHandlerDown.Init("PadHandlerDown", path);
|
||||||
PadHandlerRight.Init("PadHandlerRight", path);
|
PadHandlerRight.Init("PadHandlerRight", path);
|
||||||
@ -168,14 +169,15 @@ public:
|
|||||||
PadHandlerR2.Init("PadHandlerR2", path);
|
PadHandlerR2.Init("PadHandlerR2", path);
|
||||||
PadHandlerL2.Init("PadHandlerL2", path);
|
PadHandlerL2.Init("PadHandlerL2", path);
|
||||||
|
|
||||||
path = DefPath + "\\" + "Audio";
|
path = DefPath + "/" + "Audio";
|
||||||
AudioOutMode.Init("AudioOutMode", path);
|
AudioOutMode.Init("AudioOutMode", path);
|
||||||
AudioDumpToFile.Init("AudioDumpToFile", path);
|
AudioDumpToFile.Init("AudioDumpToFile", path);
|
||||||
|
|
||||||
path = DefPath + "\\" + "HLE";
|
path = DefPath + "/" + "HLE";
|
||||||
HLELogging.Init("HLELogging", path);
|
HLELogging.Init("HLELogging", path);
|
||||||
HLESaveTTY.Init("HLESaveTTY", path);
|
HLESaveTTY.Init("HLESaveTTY", path);
|
||||||
HLEExitOnStop.Init("HLEExitOnStop", path);
|
HLEExitOnStop.Init("HLEExitOnStop", path);
|
||||||
|
HLELogLvl.Init("HLELogLvl", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Load()
|
void Load()
|
||||||
@ -197,6 +199,7 @@ public:
|
|||||||
HLELogging.Load(false);
|
HLELogging.Load(false);
|
||||||
HLESaveTTY.Load(false);
|
HLESaveTTY.Load(false);
|
||||||
HLEExitOnStop.Load(false);
|
HLEExitOnStop.Load(false);
|
||||||
|
HLELogLvl.Load(0);
|
||||||
|
|
||||||
PadHandlerLeft.Load(static_cast<int>('A'));
|
PadHandlerLeft.Load(static_cast<int>('A'));
|
||||||
PadHandlerDown.Load(static_cast<int>('S'));
|
PadHandlerDown.Load(static_cast<int>('S'));
|
||||||
@ -235,6 +238,7 @@ public:
|
|||||||
HLELogging.Save();
|
HLELogging.Save();
|
||||||
HLESaveTTY.Save();
|
HLESaveTTY.Save();
|
||||||
HLEExitOnStop.Save();
|
HLEExitOnStop.Save();
|
||||||
|
HLELogLvl.Save();
|
||||||
|
|
||||||
PadHandlerLeft.Save();
|
PadHandlerLeft.Save();
|
||||||
PadHandlerDown.Save();
|
PadHandlerDown.Save();
|
||||||
|
@ -165,7 +165,7 @@ bool Loader::Load()
|
|||||||
/*
|
/*
|
||||||
const wxString& root = wxFileName(wxFileName(m_stream->GetPath()).GetPath()).GetPath();
|
const wxString& root = wxFileName(wxFileName(m_stream->GetPath()).GetPath()).GetPath();
|
||||||
wxString ps3_path;
|
wxString ps3_path;
|
||||||
const wxString& psf_path = root + "\\" + "PARAM.SFO";
|
const wxString& psf_path = root + "/" + "PARAM.SFO";
|
||||||
vfsFile f(psf_path);
|
vfsFile f(psf_path);
|
||||||
if(f.IsOpened())
|
if(f.IsOpened())
|
||||||
{
|
{
|
||||||
|
@ -304,6 +304,7 @@
|
|||||||
<ClCompile Include="Emu\SysCalls\Modules\cellSysmodule.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellSysmodule.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellSysutil.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellSysutil.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellSysutilAp.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellSysutilAp.cpp" />
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\cellUserInfo.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellVdec.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellVdec.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\cellVpost.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\cellVpost.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\libmixer.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\libmixer.cpp" />
|
||||||
@ -312,6 +313,7 @@
|
|||||||
<ClCompile Include="Emu\SysCalls\Modules\sysPrxForUser.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\sysPrxForUser.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\sys_fs.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\sys_fs.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Modules\sys_io.cpp" />
|
<ClCompile Include="Emu\SysCalls\Modules\sys_io.cpp" />
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\sys_net.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\Static.cpp" />
|
<ClCompile Include="Emu\SysCalls\Static.cpp" />
|
||||||
<ClCompile Include="Emu\SysCalls\SysCalls.cpp" />
|
<ClCompile Include="Emu\SysCalls\SysCalls.cpp" />
|
||||||
<ClCompile Include="Emu\System.cpp" />
|
<ClCompile Include="Emu\System.cpp" />
|
||||||
|
@ -460,6 +460,12 @@
|
|||||||
<ClCompile Include="Emu\Audio\AL\OpenALThread.cpp">
|
<ClCompile Include="Emu\Audio\AL\OpenALThread.cpp">
|
||||||
<Filter>Emu\Audio\AL</Filter>
|
<Filter>Emu\Audio\AL</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\sys_net.cpp">
|
||||||
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Emu\SysCalls\Modules\cellUserInfo.cpp">
|
||||||
|
<Filter>Emu\SysCalls\Modules</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="rpcs3.rc" />
|
<ResourceCompile Include="rpcs3.rc" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user