Fixed conflicts

This commit is contained in:
Nekotekina 2014-07-11 10:09:38 +04:00
commit 259b57c64a
53 changed files with 366 additions and 331 deletions

View File

@ -19,13 +19,12 @@ before_install:
- sudo apt-get install libwxgtk3.0-dev libopenal-dev freeglut3-dev libglew-dev
- sudo apt-get install aria2 -qq
- download_extract() { aria2c -x 16 $1 -o $2 && tar -xf $2; }
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else sudo apt-get install libstdc++-4.8-dev; fi
# Travis uses CMake 2.8.7. We require 2.8.8. Grab latest
- sudo apt-get install -qq g++-4.8
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
- sudo apt-get install lib32stdc++6 -qq &&
aria2c -x 16 http://www.cmake.org/files/v2.8/cmake-2.8.12.1-Linux-i386.sh &&
chmod a+x cmake-2.8.12.1-Linux-i386.sh &&
sudo ./cmake-2.8.12.1-Linux-i386.sh --skip-license --prefix=/usr;
aria2c -x 16 http://www.cmake.org/files/v3.0/cmake-3.0.0-Linux-i386.sh &&
chmod a+x cmake-3.0.0-Linux-i386.sh &&
sudo ./cmake-3.0.0-Linux-i386.sh --skip-license --prefix=/usr;
before_script:
- git submodule update --init asmjit ffmpeg

View File

@ -2,5 +2,14 @@ cmake_minimum_required(VERSION 2.8)
set(ASMJIT_STATIC TRUE)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
add_subdirectory( asmjit )
add_subdirectory( rpcs3 )

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include "rPlatform.h"
#include "Log.h"
#include <iostream>
#include <string>
@ -98,7 +99,7 @@ struct FileListener : LogListener
bool mPrependChannelName;
FileListener(const std::string& name = _PRGNAME_, bool prependChannel = true)
: mFile(name + ".log", rFile::write),
: mFile(std::string(rPlatform::getConfigDir() + name + ".log").c_str(), rFile::write),
mPrependChannelName(prependChannel)
{
if (!mFile.IsOpened())

View File

@ -1,5 +1,6 @@
#pragma once
#include "BEType.h"
#include "Emu/System.h"
extern void SM_Sleep();
extern size_t SM_GetCurrentThreadId();

View File

@ -15,6 +15,10 @@
#include "Emu/Io/XInput/XInputPadHandler.h"
#endif
#ifndef _WIN32
#include <dirent.h>
#endif
rCanvas::rCanvas(void *parent)
{
@ -135,6 +139,27 @@ int rPlatform::getMouseHandlerCount()
return 2;
}
std::string rPlatform::getConfigDir()
{
static std::string dir = ".";
if (dir == ".") {
#ifdef _WIN32
dir = "";
//mkdir(dir.c_str());
#else
if (getenv("XDG_CONFIG_HOME") != NULL)
dir = getenv("XDG_CONFIG_HOME");
else if (getenv("HOME") != NULL)
dir = getenv("HOME") + std::string("/.config");
else // Just in case
dir = "./config";
dir = dir + "/rpcs3/";
mkdir(dir.c_str());
#endif
}
return dir;
}
MouseHandlerBase *rPlatform::getMouseHandler(int i)
{

View File

@ -46,6 +46,7 @@ struct rPlatform
static MouseHandlerBase *getMouseHandler(int i);
static int getPadHandlerCount();
static PadHandlerBase *getPadHandler(int i);
static std::string getConfigDir();
};
/**********************************************************************

View File

@ -7,22 +7,27 @@ project(rpcs3)
if (CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
message(FATAL_ERROR "GCC ${CMAKE_CXX_COMPILER_VERSION} is too old.")
endif()
add_definitions(-DwxGUI)
#add_definitions(-D__WXGTK__)
#add_definitions(-Wfatal-errors)
add_definitions(-w) # TODO: remove me
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
add_definitions(-fpermissive) # TODO: remove me
add_definitions(-g) # Debugging!!
add_definitions(-msse2)
# Warnings
add_definitions(-Wno-attributes -Wno-enum-compare)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# TODO: stdlib?
endif()
if (NOT MSVC)
add_definitions(-DwxGUI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fexceptions")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -D_DEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O1 -D_NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O1 -g -D_NDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -D_DEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os -D_NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O1 -D_NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O1 -g -D_NDEBUG")
add_definitions(-msse2)
endif()
If( NOT RPCS3_SRC_DIR)
@ -48,11 +53,6 @@ find_package(OpenAL REQUIRED)
include("${wxWidgets_USE_FILE}")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
if(APPLE)
set(PLATFORM_ARCH "macosx/x86_64")
elseif(WIN32)

View File

@ -1,7 +1,5 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "rpcs3/Ini.h"
#include "OpenALThread.h"

View File

@ -310,7 +310,7 @@ class SPUThread : public PPCThread
public:
SPU_GPR_hdr GPR[128]; //General-Purpose Register
SPU_SPR_hdr SPR[128]; //Special-Purpose Registers
FPSCR FPSCR;
// FPSCR fpscr; //Unused
SPU_SNRConfig_hdr cfg; //Signal Notification Registers Configuration (OR-mode enabled: 0x1 for SNR1, 0x2 for SNR2)
EventPort SPUPs[64]; // SPU Thread Event Ports

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include "rpcs3.h"
void SendDbgCommand(DbgCommand id, CPUThread* thr )
{

View File

@ -1330,10 +1330,8 @@ static const std::string GetMethodName(const u32 id)
{ NV4097_SET_TRANSFORM_BRANCH_BITS, "SetTransformBranchBits" } ,
};
for (u32 i = 0; i < SARRSIZEOF(METHOD_NAME_LIST); ++i)
{
if(METHOD_NAME_LIST[i].id == id) return "cellGcm" + METHOD_NAME_LIST[i].name;
}
for(auto& s: METHOD_NAME_LIST)
if(s.id == id) return "cellGcm" + s.name;
return fmt::Format("unknown/illegal method [0x%08x]", id);
}

View File

@ -67,11 +67,11 @@ void GLBufferObject::SetData(const void* data, u32 size, u32 usage)
SetData(m_type, data, size, usage);
}
void GLBufferObject::SetAttribPointer(int location, int size, int type, int pointer, int stride, bool normalized)
void GLBufferObject::SetAttribPointer(int location, int size, int type, GLvoid* pointer, int stride, bool normalized)
{
if(location < 0) return;
glVertexAttribPointer(location, size, type, normalized ? GL_TRUE : GL_FALSE, stride, (const GLvoid*)pointer);
glVertexAttribPointer(location, size, type, normalized ? GL_TRUE : GL_FALSE, stride, pointer);
glEnableVertexAttribArray(location);
}

View File

@ -21,7 +21,7 @@ public:
void UnBind();
void SetData(u32 type, const void* data, u32 size, u32 usage = GL_DYNAMIC_DRAW);
void SetData(const void* data, u32 size, u32 usage = GL_DYNAMIC_DRAW);
void SetAttribPointer(int location, int size, int type, int pointer, int stride, bool normalized = false);
void SetAttribPointer(int location, int size, int type, GLvoid* pointer, int stride, bool normalized = false);
bool IsCreated() const;
};

View File

@ -54,7 +54,7 @@ GLGSRender::GLGSRender()
GLGSRender::~GLGSRender()
{
m_frame->Close();
delete m_context;
// delete m_context; // This won't do anything (deleting void* instead of wglContext*)
}
void GLGSRender::Enable(bool enable, const u32 cap)
@ -249,7 +249,7 @@ void GLGSRender::EnableVertexData(bool indexed_draw)
glEnableVertexAttribArray(i);
checkForGlError("glEnableVertexAttribArray");
glVertexAttribPointer(i, m_vertex_data[i].size, gltype, normalized, 0, (void*)offset_list[i]);
glVertexAttribPointer(i, m_vertex_data[i].size, gltype, normalized, 0, reinterpret_cast<void*>(offset_list[i]));
checkForGlError("glVertexAttribPointer");
}
}
@ -1016,21 +1016,18 @@ void GLGSRender::ExecCMD()
if(m_set_depth_func)
{
//ConLog.Warning("glDepthFunc(0x%x)", m_depth_func);
glDepthFunc(m_depth_func);
checkForGlError("glDepthFunc");
}
if(m_set_depth_bounds)
{
//ConLog.Warning("glDepthBounds(%f, %f)", m_depth_bounds_min, m_depth_bounds_max);
glDepthBoundsEXT(m_depth_bounds_min, m_depth_bounds_max);
checkForGlError("glDepthBounds");
}
if(m_set_clip)
{
//ConLog.Warning("glDepthRangef(%f, %f)", m_clip_min, m_clip_max);
glDepthRangef(m_clip_min, m_clip_max);
checkForGlError("glDepthRangef");
}
@ -1083,7 +1080,7 @@ void GLGSRender::ExecCMD()
checkForGlError("glFrontFace");
}
if(m_set_alpha_func && m_set_alpha_ref && m_alpha_func)
if(m_set_alpha_func && m_set_alpha_ref)
{
glAlphaFunc(m_alpha_func, m_alpha_ref);
checkForGlError("glAlphaFunc");

View File

@ -1,6 +1,7 @@
#pragma once
#include "Emu/GS/GSRender.h"
#include "Emu/GS/RSXThread.h"
#include "Utilities/rPlatform.h"
#include "GLBuffers.h"
#include "GLProgramBuffer.h"

View File

@ -77,7 +77,7 @@ std::string GLVertexDecompilerThread::GetSRC(const u32 n)
ret += m_parr.AddParam(PARAM_NONE, "vec4", "tmp" + std::to_string(src[n].tmp_src));
break;
case 2: //input
if (d1.input_src < SARRSIZEOF(reg_table))
if (d1.input_src < (sizeof(reg_table)/sizeof(reg_table[0])))
{
ret += m_parr.AddParam(PARAM_IN, "vec4", reg_table[d1.input_src], d1.input_src);
}

View File

@ -1,6 +1,7 @@
#pragma once
#include "sysutil_video.h"
#include "GSRender.h"
#include "rpcs3/Ini.h"
struct GSInfo
{

View File

@ -1284,7 +1284,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32
}
break;
// Point
// Point size
case NV4097_SET_POINT_SIZE:
{
m_set_point_size = true;
@ -1293,10 +1293,11 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32
}
break;
// Point sprite
case NV4097_SET_POINT_PARAMS_ENABLE:
{
if (ARGS(0))
LOG_ERROR(RSX, "NV4097_SET_POINT_PARAMS_ENABLE");
LOG_ERROR(RSX, "NV4097_SET_POINT_PARAMS_ENABLE: %x", ARGS(0));
}
break;
@ -1340,7 +1341,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t args, const u32
}
break;
// Depth/ Color buffer usage
// Depth/Color buffer usage
case NV4097_SET_SURFACE_FORMAT:
{
const u32 a0 = ARGS(0);

View File

@ -4,6 +4,7 @@
#include "RSXVertexProgram.h"
#include "RSXFragmentProgram.h"
#include "Emu/SysCalls/Callback.h"
#include "Emu/Memory/Memory.h"
#include <stack>
#include <set> // For tracking a list of used gcm commands
@ -466,24 +467,39 @@ protected:
m_set_line_stipple = false;
m_set_polygon_stipple = false;
// Default value
// TODO: Check against the default value on PS3
m_clear_color_r = 0;
m_clear_color_g = 0;
m_clear_color_b = 0;
m_clear_color_a = 0;
m_clear_z = 0xffffff;
m_clear_s = 0;
m_poly_offset_scale_factor = 0.0;
m_poly_offset_bias = 0.0;
m_depth_bounds_min = 0.0;
m_depth_bounds_max = 1.0;
m_restart_index = 0xffffffff;
m_front_polygon_mode = 0x1b02; // GL_FILL
m_back_polygon_mode = 0x1b02; // GL_FILL
m_front_face = 0x0901;
m_front_face = 0x0901; // GL_CCW
m_cull_face = 0x0405; // GL_BACK
m_alpha_func = 0x0207; // GL_ALWAYS
m_alpha_ref = 0;
m_logic_op = 0x1503; // GL_COPY
m_shade_mode = 0x1D01; // GL_SMOOTH
m_depth_mask = 1;
m_depth_func = 0x0201; // GL_LESS
m_depth_bounds_min = 0.0;
m_depth_bounds_max = 1.0;
m_clip_min = 0.0;
m_clip_max = 1.0;
m_blend_equation_rgb = 0x8006; // GL_FUNC_ADD
m_blend_equation_alpha = 0x8006; // GL_FUNC_ADD
m_blend_sfactor_rgb = 1; // GL_ONE
m_blend_dfactor_rgb = 0; // GL_ZERO
m_blend_sfactor_alpha = 1; // GL_ONE
m_blend_dfactor_alpha = 0; // GL_ZERO
m_point_x = 0;
m_point_y = 0;
m_point_size = 1.0;
@ -492,7 +508,6 @@ protected:
m_line_stipple_factor = 1;
for (size_t i = 0; i < 32; i++)
{
// TODO: Check if the polygon stipple pattern is really "all ones"
m_polygon_stipple_pattern[i] = 0xFFFFFFFF;
}

View File

@ -3,6 +3,7 @@
#include <algorithm>
#include <vector>
#include "Emu/Io/KeyboardHandler.h"
#include "rpcs3.h"
class WindowsKeyboardHandler final
: public wxWindow

View File

@ -3,8 +3,6 @@
#include "Utilities/Log.h"
#include "Memory.h"
#include "MemoryBlock.h"
#include "Emu/System.h"
MemoryBase Memory;

View File

@ -4,12 +4,14 @@
#include <sys/mman.h>
#endif
#include "Emu/SysCalls/Callback.h"
#include "MemoryBlock.h"
#include <vector>
using std::nullptr_t;
#define safe_delete(x) do {delete (x);(x)=nullptr;} while(0)
#define safe_free(x) do {free(x);(x)=nullptr;} while(0)
enum MemoryType
{
Memory_PS3,

View File

@ -2,6 +2,193 @@
#define PAGE_4K(x) (x + 4095) & ~(4095)
union u128
{
struct
{
u64 hi;
u64 lo;
};
u64 _u64[2];
u32 _u32[4];
u16 _u16[8];
u8 _u8[16];
operator u64() const { return _u64[0]; }
operator u32() const { return _u32[0]; }
operator u16() const { return _u16[0]; }
operator u8() const { return _u8[0]; }
operator bool() const { return _u64[0] != 0 || _u64[1] != 0; }
static u128 From128( u64 hi, u64 lo )
{
u128 ret = {hi, lo};
return ret;
}
static u128 From64( u64 src )
{
u128 ret = {0, src};
return ret;
}
static u128 From32( u32 src )
{
u128 ret;
ret._u32[0] = src;
ret._u32[1] = 0;
ret._u32[2] = 0;
ret._u32[3] = 0;
return ret;
}
static u128 FromBit ( u32 bit )
{
u128 ret;
if (bit < 64)
{
ret.hi = 0;
ret.lo = (u64)1 << bit;
}
else if (bit < 128)
{
ret.hi = (u64)1 << (bit - 64);
ret.lo = 0;
}
else
{
ret.hi = 0;
ret.lo = 0;
}
return ret;
}
bool operator == ( const u128& right ) const
{
return (lo == right.lo) && (hi == right.hi);
}
bool operator != ( const u128& right ) const
{
return (lo != right.lo) || (hi != right.hi);
}
u128 operator | ( const u128& right ) const
{
return From128(hi | right.hi, lo | right.lo);
}
u128 operator & ( const u128& right ) const
{
return From128(hi & right.hi, lo & right.lo);
}
u128 operator ^ ( const u128& right ) const
{
return From128(hi ^ right.hi, lo ^ right.lo);
}
u128 operator ~ () const
{
return From128(~hi, ~lo);
}
};
union s128
{
struct
{
s64 hi;
s64 lo;
};
u64 _i64[2];
u32 _i32[4];
u16 _i16[8];
u8 _i8[16];
operator s64() const { return _i64[0]; }
operator s32() const { return _i32[0]; }
operator s16() const { return _i16[0]; }
operator s8() const { return _i8[0]; }
operator bool() const { return _i64[0] != 0 || _i64[1] != 0; }
static s128 From64( s64 src )
{
s128 ret = {src, 0};
return ret;
}
static s128 From32( s32 src )
{
s128 ret;
ret._i32[0] = src;
ret._i32[1] = 0;
ret.hi = 0;
return ret;
}
bool operator == ( const s128& right ) const
{
return (lo == right.lo) && (hi == right.hi);
}
bool operator != ( const s128& right ) const
{
return (lo != right.lo) || (hi != right.hi);
}
};
#include <memory>
#include <emmintrin.h>
//TODO: SSE style
/*
struct u128
{
__m128 m_val;
u128 GetValue128()
{
u128 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u64 GetValue64()
{
u64 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u32 GetValue32()
{
u32 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u16 GetValue16()
{
u16 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u8 GetValue8()
{
u8 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
};
*/
struct MemInfo
{
u64 addr;

View File

@ -1,5 +1,7 @@
#pragma once
#include "Emu/Memory/Memory.h"
#define declCPU PPUThread& CPU = GetCurrentPPUThread
//TODO

View File

@ -21,7 +21,7 @@ extern "C"
//void cellAdec_init();
//Module cellAdec(0x0006, cellAdec_init);
extern Module *cellAdec=nullptr;
Module *cellAdec = nullptr;
int adecRawRead(void* opaque, u8* buf, int buf_size)
{

View File

@ -7,7 +7,7 @@
#include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h"
extern Module *cellAtrac = nullptr;
Module *cellAtrac = nullptr;
#include "cellAtrac.h"

View File

@ -13,7 +13,7 @@
//void cellAudio_init();
//Module cellAudio(0x0011, cellAudio_init);
extern Module *cellAudio = nullptr;
Module *cellAudio = nullptr;
static std::mutex audioMutex;

View File

@ -12,7 +12,7 @@
//void cellFontFT_load();
//void cellFontFT_unload();
//Module cellFontFT(0x001a, cellFontFT_init, cellFontFT_load, cellFontFT_unload);
extern Module *cellFontFT = nullptr;
Module *cellFontFT = nullptr;
struct CellFontLibraryConfigFT
{

View File

@ -14,7 +14,7 @@
//void cellGame_init();
//Module cellGame(0x003e, cellGame_init);
extern Module *cellGame = nullptr;
Module *cellGame = nullptr;
std::string contentInfo = "";
std::string usrdir = "";

View File

@ -12,7 +12,7 @@
//void cellGcmSys_load();
//void cellGcmSys_unload();
//Module cellGcmSys(0x0010, cellGcmSys_init, cellGcmSys_load, cellGcmSys_unload);
extern Module *cellGcmSys = nullptr;
Module *cellGcmSys = nullptr;
u32 local_size = 0;
u32 local_addr = 0;

View File

@ -13,7 +13,7 @@
//void cellGifDec_init();
//Module cellGifDec(0xf010, cellGifDec_init);
extern Module *cellGifDec = nullptr;
Module *cellGifDec = nullptr;
int cellGifDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
{
@ -174,7 +174,8 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
//Decode GIF file. (TODO: Is there any faster alternative? Can we do it without external libraries?)
int width, height, actual_components;
std::shared_ptr<unsigned char> image(stbi_load_from_memory(gif, fileSize, &width, &height, &actual_components, 4));
if (!image) return CELL_GIFDEC_ERROR_STREAM_FORMAT;
if (!image)
return CELL_GIFDEC_ERROR_STREAM_FORMAT;
uint image_size = width * height * 4;

View File

@ -10,7 +10,7 @@
//void cellJpgDec_init();
//Module cellJpgDec(0x000f, cellJpgDec_init);
extern Module *cellJpgDec = nullptr;
Module *cellJpgDec = nullptr;
int cellJpgDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
{
@ -155,7 +155,8 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
int width, height, actual_components;
std::shared_ptr<unsigned char> image(stbi_load_from_memory(jpg, fileSize, &width, &height, &actual_components, 4));
if (!image) return CELL_JPGDEC_ERROR_STREAM_FORMAT;
if (!image)
return CELL_JPGDEC_ERROR_STREAM_FORMAT;
uint image_size = width * height;
switch((u32)current_outParam.outputColorSpace)

View File

@ -5,6 +5,7 @@
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h"
#include "rpcs3.h"
#include "cellSysutil.h"
#include "cellMsgDialog.h"

View File

@ -11,7 +11,7 @@
//void cellPngDec_init();
//Module cellPngDec(0x0018, cellPngDec_init);
extern Module *cellPngDec = nullptr;
Module *cellPngDec = nullptr;
static std::map<u32, CellPngDecMainHandle *> cellPngDecMap;

View File

@ -456,10 +456,10 @@ void InitMembers()
{
s_rescInternalInstance->m_dstMode = (CellRescBufferMode)0;
s_rescInternalInstance->m_interlaceElement = CELL_RESC_ELEMENT_FLOAT;
s_rescInternalInstance->m_colorBuffersEA = NULL;
s_rescInternalInstance->m_vertexArrayEA = NULL;
s_rescInternalInstance->m_fragmentUcodeEA = NULL;
s_rescInternalInstance->m_interlaceTableEA = NULL;
s_rescInternalInstance->m_colorBuffersEA = 0;
s_rescInternalInstance->m_vertexArrayEA = 0;
s_rescInternalInstance->m_fragmentUcodeEA = 0;
s_rescInternalInstance->m_interlaceTableEA = 0;
s_rescInternalInstance->m_bufIdFront = 0;
s_rescInternalInstance->m_dstWidth = 0;
s_rescInternalInstance->m_dstHeight = 0;
@ -668,7 +668,7 @@ void cellRescExit()
if (IsPalTemporal())
{
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_DISABLE);
cellGcmSetVBlankHandler(NULL);
cellGcmSetVBlankHandler(0);
//GcmSysTypePrefix::cellGcmSetSecondVHandler(NULL);
if (IsPalInterpolate())
@ -756,12 +756,12 @@ void SetVBlankHandler(u32 handler)
if (IsNotPalTemporal())
{
cellGcmSetVBlankHandler(handler);
s_rescInternalInstance->s_applicationVBlankHandler = NULL;
s_rescInternalInstance->s_applicationVBlankHandler = 0;
}
else if (IsPal60Hsync())
{
//cellGcmSetSecondVHandler(handler);
s_rescInternalInstance->s_applicationVBlankHandler = NULL;
s_rescInternalInstance->s_applicationVBlankHandler = 0;
}
else
{
@ -782,7 +782,7 @@ void SetFlipHandler(u32 handler)
if (IsGcmFlip())
{
cellGcmSetFlipHandler(handler);
s_rescInternalInstance->s_applicationFlipHandler = NULL;
s_rescInternalInstance->s_applicationFlipHandler = 0;
}
else
{
@ -857,20 +857,20 @@ int cellRescSetDisplayMode(u32 displayMode)
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
//cellGcmSetVBlankHandler(IntrHandler50);
//cellGcmSetSecondVHandler(IntrHandler60);
cellGcmSetFlipHandler(NULL);
cellGcmSetFlipHandler(0);
}
else if (IsPalDrop())
{
//InitLabels();
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetVBlankHandler(NULL);
cellGcmSetVBlankHandler(0);
//cellGcmSetSecondVHandler(IntrHandler60Drop);
cellGcmSetFlipHandler(NULL);
cellGcmSetFlipHandler(0);
}
else if (IsPal60Hsync())
{
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetVBlankHandler(NULL);
cellGcmSetVBlankHandler(0);
}
if (s_rescInternalInstance->s_applicationVBlankHandler) SetVBlankHandler(s_rescInternalInstance->s_applicationVBlankHandler);
@ -1323,7 +1323,7 @@ int cellRescCreateInterlaceTable(u32 ea_addr, float srcH, CellRescTableElement d
return CELL_RESC_ERROR_NOT_INITIALIZED;
}
if ((ea_addr == NULL) || (srcH <= 0.f) || (!(depth == CELL_RESC_ELEMENT_HALF || depth == CELL_RESC_ELEMENT_FLOAT)) || (length <= 0))
if ((ea_addr == 0) || (srcH <= 0.f) || (!(depth == CELL_RESC_ELEMENT_HALF || depth == CELL_RESC_ELEMENT_FLOAT)) || (length <= 0))
{
cellResc->Error("cellRescCreateInterlaceTable : CELL_RESC_ERROR_NOT_INITIALIZED");
return CELL_RESC_ERROR_BAD_ARGUMENT;

View File

@ -20,7 +20,7 @@ typedef void (*CellHddGameStatCallback)(mem_ptr_t<CellHddGameCBResult> cbResult,
//void cellSysutil_init();
//Module cellSysutil(0x0015, cellSysutil_init);
Module *cellSysutil;
Module *cellSysutil = nullptr;
int cellSysutilGetSystemParamInt(int id, mem32_t value)
{

View File

@ -8,7 +8,7 @@
//void cellSysutilAp_init();
//Module cellSysutilAp(0x0039, cellSysutilAp_init);
extern Module *cellSysutilAp = nullptr;
Module *cellSysutilAp = nullptr;
// Return Codes
enum

View File

@ -10,7 +10,7 @@
//void cellUserInfo_init();
//Module cellUserInfo(0x0032, cellUserInfo_init);
extern Module *cellUserInfo = nullptr;
Module *cellUserInfo = nullptr;
int cellUserInfoGetStat(u32 id, mem_ptr_t<CellUserInfoUserStat> stat)
{

View File

@ -1,5 +1,7 @@
#pragma once
#include "Emu/Memory/Memory.h"
#define RESULT(x) SC_ARGS_1 = (x)
class func_caller

View File

@ -2,6 +2,9 @@
#include "ErrorCodes.h"
#include "Static.h"
#include "Emu/Memory/Memory.h"
// Most of the headers below rely on Memory.h
#include "lv2/lv2Fs.h"
#include "lv2/sys_cond.h"
#include "lv2/sys_event.h"
@ -26,6 +29,8 @@
#include "Emu/Event.h"
#include "rpcs3/Ini.h"
//#define SYSCALLS_DEBUG
#define declCPU PPUThread& CPU = GetCurrentPPUThread

View File

@ -4,6 +4,7 @@
#include "Emu/System.h"
#include "Emu/SysCalls/SysCalls.h"
#include "sys_process.h"
#include "rpcs3.h"
SysCallBase sc_p("Process");

View File

@ -8,9 +8,18 @@
#include "Emu/GS/GSManager.h"
#include "Emu/Audio/AudioManager.h"
#include "Emu/FS/VFS.h"
#include "Emu/DbgCommand.h"
#include "Loader/Loader.h"
#include "SysCalls/Callback.h"
enum Status
{
Running,
Paused,
Stopped,
Ready,
};
class EventManager;
class ModuleManager;
class StaticFuncManager;

View File

@ -4,6 +4,7 @@
#include "Loader/ELF64.h"
#include <wx/aui/aui.h>
#include <wx/richtext/richtextctrl.h>
#include "Gui/MainFrame.h"
class CompilerELF : public FrameBase
{

View File

@ -1,4 +1,5 @@
#pragma once
#include "rpcs3/Ini.h"
class FrameBase : public wxFrame
{

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "GSFrame.h"
#include "rpcs3.h"
BEGIN_EVENT_TABLE(GSFrame, wxFrame)
EVT_PAINT(GSFrame::OnPaint)

View File

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "Gui/ConLogFrame.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "rpcs3.h"

View File

@ -1,6 +1,8 @@
#pragma once
#include "Gui/Debugger.h"
#include "Gui/ConLogFrame.h"
#include "Gui/FrameBase.h"
#include <wx/aui/aui.h>

View File

@ -16,7 +16,7 @@ CSimpleIniCaseA *getIniFile()
if (inited == false)
{
ini.SetUnicode(true);
ini.LoadFile(DEF_CONFIG_NAME);
ini.LoadFile(std::string(rPlatform::getConfigDir() + DEF_CONFIG_NAME).c_str());
inited = true;
}
return &ini;
@ -24,7 +24,7 @@ CSimpleIniCaseA *getIniFile()
void saveIniFile()
{
getIniFile()->SaveFile(DEF_CONFIG_NAME);
getIniFile()->SaveFile(std::string(rPlatform::getConfigDir() + DEF_CONFIG_NAME).c_str());
}
Inis Ini;
@ -77,14 +77,14 @@ static WindowInfo StringToWindowInfo(const std::string& str)
vec.push_back(std::stoi(str.substr(start, found == std::string::npos ? found : found - start)));
}
catch (const std::invalid_argument& e) {
return WindowInfo::GetDefault();
return WindowInfo();
}
if (found == std::string::npos)
break;
start = found + 1;
}
if (vec.size() < 4 || vec[0] <= 0 || vec[1] <= 0 || vec[2] < 0 || vec[3] < 0)
return WindowInfo::GetDefault();
return WindowInfo();
return WindowInfo(std::make_pair(vec[0], vec[1]), std::make_pair(vec[2], vec[3]));
}

View File

@ -1,7 +1,8 @@
#pragma once
#include <utility>
#include "../Utilities/simpleini/SimpleIni.h"
#include "Utilities/rPlatform.h"
#include "Utilities/simpleini/SimpleIni.h"
//TODO: make thread safe/remove static singleton
CSimpleIniCaseA *getIniFile();
@ -18,12 +19,6 @@ struct WindowInfo
, position(_position)
{
}
//TODO: remove
static WindowInfo GetDefault()
{
return WindowInfo({ -1, -1 }, { -1, -1 });
}
};
class Ini

View File

@ -6,9 +6,6 @@
#include <crtdbg.h>
#endif
/* size of statically declared array */
#define SARRSIZEOF(array) (sizeof(array)/sizeof(array[0]))
#define NOMINMAX
#ifndef QT_UI
#include <wx/wxprec.h>
@ -41,14 +38,10 @@
#include <wx/aui/auibook.h>
#endif
#ifdef MSVC_CRT_MEMLEAK_DETECTION
#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
#endif // _DEBUG
#endif // MSVC_CRT_MEMLEAK_DETECTION
#if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && !defined(DBG_NEW)
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
// This header should be frontend-agnostic, so don't assume wx includes everything
#include <cstdio>
@ -68,210 +61,6 @@ typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
union u128
{
struct
{
u64 hi;
u64 lo;
};
u64 _u64[2];
u32 _u32[4];
u16 _u16[8];
u8 _u8[16];
operator u64() const { return _u64[0]; }
operator u32() const { return _u32[0]; }
operator u16() const { return _u16[0]; }
operator u8() const { return _u8[0]; }
operator bool() const { return _u64[0] != 0 || _u64[1] != 0; }
static u128 From128( u64 hi, u64 lo )
{
u128 ret = {hi, lo};
return ret;
}
static u128 From64( u64 src )
{
u128 ret = {0, src};
return ret;
}
static u128 From32( u32 src )
{
u128 ret;
ret._u32[0] = src;
ret._u32[1] = 0;
ret._u32[2] = 0;
ret._u32[3] = 0;
return ret;
}
static u128 FromBit ( u32 bit )
{
u128 ret;
if (bit < 64)
{
ret.hi = 0;
ret.lo = (u64)1 << bit;
}
else if (bit < 128)
{
ret.hi = (u64)1 << (bit - 64);
ret.lo = 0;
}
else
{
ret.hi = 0;
ret.lo = 0;
}
return ret;
}
bool operator == ( const u128& right ) const
{
return (lo == right.lo) && (hi == right.hi);
}
bool operator != ( const u128& right ) const
{
return (lo != right.lo) || (hi != right.hi);
}
u128 operator | ( const u128& right ) const
{
return From128(hi | right.hi, lo | right.lo);
}
u128 operator & ( const u128& right ) const
{
return From128(hi & right.hi, lo & right.lo);
}
u128 operator ^ ( const u128& right ) const
{
return From128(hi ^ right.hi, lo ^ right.lo);
}
u128 operator ~ () const
{
return From128(~hi, ~lo);
}
};
union s128
{
struct
{
s64 hi;
s64 lo;
};
u64 _i64[2];
u32 _i32[4];
u16 _i16[8];
u8 _i8[16];
operator s64() const { return _i64[0]; }
operator s32() const { return _i32[0]; }
operator s16() const { return _i16[0]; }
operator s8() const { return _i8[0]; }
operator bool() const { return _i64[0] != 0 || _i64[1] != 0; }
static s128 From64( s64 src )
{
s128 ret = {src, 0};
return ret;
}
static s128 From32( s32 src )
{
s128 ret;
ret._i32[0] = src;
ret._i32[1] = 0;
ret.hi = 0;
return ret;
}
bool operator == ( const s128& right ) const
{
return (lo == right.lo) && (hi == right.hi);
}
bool operator != ( const s128& right ) const
{
return (lo != right.lo) || (hi != right.hi);
}
};
#include <memory>
#include <emmintrin.h>
//TODO: SSE style
/*
struct u128
{
__m128 m_val;
u128 GetValue128()
{
u128 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u64 GetValue64()
{
u64 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u32 GetValue32()
{
u32 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u16 GetValue16()
{
u16 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
u8 GetValue8()
{
u8 ret;
_mm_store_ps( (float*)&ret, m_val );
return ret;
}
};
*/
template<typename T>
static void safe_realloc(T* ptr, uint new_size)
{
if(new_size == 0) return;
ptr = (T*)((ptr == NULL) ? malloc(new_size * sizeof(T)) : realloc(ptr, new_size * sizeof(T)));
}
#define safe_delete(x) do {delete (x);(x)=nullptr;} while(0)
#define safe_free(x) do {free(x);(x)=nullptr;} while(0)
enum Status
{
Running,
Paused,
Stopped,
Ready,
};
#include "Utilities/StrFmt.h"
#include "Utilities/Log.h"
#include "Utilities/BEType.h"
@ -280,24 +69,16 @@ enum Status
#include "Utilities/rXml.h"
#include "Utilities/rConcurrency.h"
#include "Utilities/rMsgBox.h"
#include "Utilities/rPlatform.h"
#include "Utilities/Thread.h"
#include "Utilities/Array.h"
#include "Utilities/Timer.h"
#include "Utilities/IdManager.h"
#include "rpcs3/Ini.h"
#include "Gui/FrameBase.h"
#include "Gui/ConLogFrame.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/SysCalls/Callback.h"
#include "Emu/DbgCommand.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "Emu/SysCalls/Modules.h"
#include "Emu/FS/vfsDirBase.h"
#include "Emu/FS/vfsFileBase.h"
#include "Emu/FS/vfsLocalDir.h"
@ -306,9 +87,6 @@ enum Status
#include "Emu/FS/vfsStreamMemory.h"
#include "Emu/FS/vfsFile.h"
#include "Emu/FS/vfsDir.h"
#ifndef QT_UI
#include "rpcs3.h"
#endif
#define _PRGNAME_ "RPCS3"
#define _PRGVER_ "0.0.0.4"