From 3e9cbb4a247ec49b230e710076a93ca981e0ac4a Mon Sep 17 00:00:00 2001 From: Sacha Date: Sat, 22 Mar 2014 00:07:05 +1000 Subject: [PATCH 1/2] Linux build fix. --- rpcs3/CMakeLists.txt | 2 +- rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp | 6 +++--- rpcs3/Emu/SysCalls/Modules/cellSysutil.h | 6 +++--- rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp | 9 ++++++--- rpcs3/Loader/TROPUSR.cpp | 6 +++--- rpcs3/Loader/TROPUSR.h | 6 +++--- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index b0e9b5eb5d..f696f842f8 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -15,7 +15,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/../bin") add_definitions(-DGL_GLEXT_PROTOTYPES) add_definitions(-DGLX_GLXEXT_PROTOTYPES) -find_package(wxWidgets COMPONENTS core base net aui gl REQUIRED) +find_package(wxWidgets COMPONENTS core base net aui gl xml REQUIRED) find_package(GLEW REQUIRED) find_package(OpenGL REQUIRED) find_package(ZLIB REQUIRED) diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp index 7ce3935dd4..f578345de2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp @@ -864,9 +864,9 @@ int cellHddGameCheck(u32 version, u32 dirName_addr, u32 errDialog, mem_func_ptr_ get->hddFreeSizeKB = 40000000; // 40 GB, TODO: Use the free space of the computer's HDD where RPCS3 is being run. get->isNewData = CELL_HDDGAME_ISNEWDATA_EXIST; get->sysSizeKB = 0; // TODO - get->st_atime = 0; // TODO - get->st_ctime = 0; // TODO - get->st_mtime = 0; // TODO + get->st_atime__ = 0; // TODO + get->st_ctime__ = 0; // TODO + get->st_mtime__ = 0; // TODO get->sizeKB = CELL_HDDGAME_SIZEKB_NOTCALC; memcpy(get->contentInfoPath, ("/dev_hdd0/game/"+dirName).c_str(), CELL_HDDGAME_PATH_MAX); memcpy(get->hddGamePath, ("/dev_hdd0/game/"+dirName+"/USRDIR").c_str(), CELL_HDDGAME_PATH_MAX); diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil.h b/rpcs3/Emu/SysCalls/Modules/cellSysutil.h index eb53f7ea34..b606438b50 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil.h @@ -204,9 +204,9 @@ struct CellHddGameStatGet u8 contentInfoPath[CELL_HDDGAME_PATH_MAX]; u8 hddGamePath[CELL_HDDGAME_PATH_MAX]; u8 reserved0[2]; - be_t st_atime; - be_t st_mtime; - be_t st_ctime; + be_t st_atime__; + be_t st_mtime__; + be_t st_ctime__; CellHddGameSystemFileParam getParam; be_t sizeKB; be_t sysSizeKB; diff --git a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp index 0a5613a8f9..1e137e562e 100644 --- a/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sceNpTrophy.cpp @@ -159,7 +159,9 @@ int sceNpTrophyRegisterContext(u32 context, u32 handle, u32 statusCb_addr, u32 a return SCE_NP_TROPHY_ERROR_ILLEGAL_UPDATE; TROPUSRLoader* tropusr = new TROPUSRLoader(); - tropusr->Load(trophyPath + "/TROPUSR.DAT", trophyPath + "/TROPCONF.SFM"); + std::string trophyUsrPath = trophyPath + "/TROPUSR.DAT"; + std::string trophyConfPath = trophyPath + "/TROPCONF.SFM"; + tropusr->Load(trophyUsrPath, trophyConfPath); ctxt.tropusr = tropusr; // TODO: Callbacks @@ -292,7 +294,8 @@ int sceNpTrophyUnlockTrophy(u32 context, u32 handle, s32 trophyId, mem32_t plati u64 timestamp1 = get_system_time(); // TODO: Either timestamp1 or timestamp2 is wrong u64 timestamp2 = get_system_time(); // TODO: Either timestamp1 or timestamp2 is wrong ctxt.tropusr->UnlockTrophy(trophyId, timestamp1, timestamp2); - ctxt.tropusr->Save("/dev_hdd0/home/00000001/trophy/" + ctxt.trp_name + "/TROPUSR.DAT"); + std::string trophyPath = "/dev_hdd0/home/00000001/trophy/" + ctxt.trp_name + "/TROPUSR.DAT"; + ctxt.tropusr->Save(trophyPath); platinumId = SCE_NP_TROPHY_INVALID_TROPHY_ID; // TODO return CELL_OK; @@ -419,4 +422,4 @@ void sceNpTrophy_init() sceNpTrophy.AddFunc(0xe3bf9a28, sceNpTrophyCreateContext); sceNpTrophy.AddFunc(0xfce6d30a, sceNpTrophyGetTrophyInfo); sceNpTrophy.AddFunc(0xff299e03, sceNpTrophyGetGameIcon); -} \ No newline at end of file +} diff --git a/rpcs3/Loader/TROPUSR.cpp b/rpcs3/Loader/TROPUSR.cpp index e9ed6bd30b..fc5a8fd0d3 100644 --- a/rpcs3/Loader/TROPUSR.cpp +++ b/rpcs3/Loader/TROPUSR.cpp @@ -14,7 +14,7 @@ TROPUSRLoader::~TROPUSRLoader() Close(); } -bool TROPUSRLoader::Load(std::string& filepath, std::string& configpath) +bool TROPUSRLoader::Load(const std::string& filepath, const std::string& configpath) { if (m_file) Close(); @@ -94,7 +94,7 @@ bool TROPUSRLoader::LoadTables() } // TODO: TROPUSRLoader::Save deletes the TROPUSR and creates it again. This is probably very slow. -bool TROPUSRLoader::Save(std::string& filepath) +bool TROPUSRLoader::Save(const std::string& filepath) { if (m_file) Close(); @@ -117,7 +117,7 @@ bool TROPUSRLoader::Save(std::string& filepath) return true; } -bool TROPUSRLoader::Generate(std::string& filepath, std::string& configpath) +bool TROPUSRLoader::Generate(const std::string& filepath, const std::string& configpath) { wxString path; wxXmlDocument doc; diff --git a/rpcs3/Loader/TROPUSR.h b/rpcs3/Loader/TROPUSR.h index a01fd75230..7fca0aa590 100644 --- a/rpcs3/Loader/TROPUSR.h +++ b/rpcs3/Loader/TROPUSR.h @@ -61,7 +61,7 @@ class TROPUSRLoader std::vector m_table4; std::vector m_table6; - virtual bool Generate(std::string& filepath, std::string& configpath); + virtual bool Generate(const std::string& filepath, const std::string& configpath); virtual bool LoadHeader(); virtual bool LoadTableHeaders(); virtual bool LoadTables(); @@ -70,8 +70,8 @@ public: TROPUSRLoader(); ~TROPUSRLoader(); - virtual bool Load(std::string& filepath, std::string& configpath); - virtual bool Save(std::string& filepath); + virtual bool Load(const std::string& filepath, const std::string& configpath); + virtual bool Save(const std::string& filepath); virtual bool Close(); virtual u32 GetTrophiesCount(); From ebc6b9e66ef5d71c48f816db6413a4b1af7a427a Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 26 Mar 2014 10:29:17 +1000 Subject: [PATCH 2/2] Fix an assign. Some other misc changes. --- rpcs3/Emu/SysCalls/Modules/cellDmux.h | 23 +++++++++-------------- rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.h b/rpcs3/Emu/SysCalls/Modules/cellDmux.h index f138d56db6..e57aca33c3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.h +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.h @@ -8,11 +8,11 @@ // Error Codes enum { - CELL_DMUX_ERROR_ARG = 0x80610201, - CELL_DMUX_ERROR_SEQ = 0x80610202, - CELL_DMUX_ERROR_BUSY = 0x80610203, - CELL_DMUX_ERROR_EMPTY = 0x80610204, - CELL_DMUX_ERROR_FATAL = 0x80610205, + CELL_DMUX_ERROR_ARG = 0x80610201, + CELL_DMUX_ERROR_SEQ = 0x80610202, + CELL_DMUX_ERROR_BUSY = 0x80610203, + CELL_DMUX_ERROR_EMPTY = 0x80610204, + CELL_DMUX_ERROR_FATAL = 0x80610205, }; enum CellDmuxStreamType @@ -605,14 +605,9 @@ public: //(u32)info->auSize, put, (u32)info->ptsLower); u32 new_addr = a128(put + 128 + size); - if ((new_addr + GetMaxAU()) > (memAddr + memSize)) - { - put = memAddr; - } - else - { - put = new_addr; - } + put = ((new_addr + GetMaxAU()) > (memAddr + memSize)) + ? memAddr : new_addr; + size = 0; put_count++; @@ -750,7 +745,7 @@ public: if (update_index) { /*u32 new_addr = a128(peek + 128 + info->auSize); - if (new_addr = put) + if (new_addr == put) { peek = 0; } diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp index 31fedbd349..1c9d0bd071 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Lwmutex.cpp @@ -175,7 +175,7 @@ bool SleepQueue::invalidate(u32 tid) if (tid) for (u32 i = 0; i < list.GetCount(); i++) { - if (list[i] = tid) + if (list[i] == tid) { list.RemoveAt(i); return true;