From f16ec62b4aeb1256f7b3af9c13ae5f84fd3d0ab6 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 28 Dec 2014 18:53:02 +0300 Subject: [PATCH] Bugfix --- rpcs3/Emu/RSX/RSXThread.cpp | 8 -------- rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 11 ++++++----- rpcs3/Emu/SysCalls/Modules/cellDmux.cpp | 15 ++++++++------- rpcs3/Emu/SysCalls/Modules/cellVdec.cpp | 11 ++++++----- rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp | 2 +- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 0a453f66a5..b52268c044 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -198,19 +198,11 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const auto args = vm::ptr::make(args_addr); #if CMD_DEBUG -<<<<<<< HEAD - std::string debug = GetMethodName(cmd); - debug += "("; - for(u32 i=0; i>>>>>> 4b8d61736460fe75f264c7180bd7d9d898b540f5 #endif u32 index = 0; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 86fe49f60a..139ab029f0 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -214,12 +214,12 @@ next: } } -u32 adecOpen(AudioDecoder* data) +u32 adecOpen(AudioDecoder* adec_ptr) { - std::shared_ptr data_ptr(data); - AudioDecoder& adec = *data; + std::shared_ptr sptr(adec_ptr); + AudioDecoder& adec = *adec_ptr; - u32 adec_id = cellAdec->GetNewId(data_ptr); + u32 adec_id = cellAdec->GetNewId(sptr); adec.id = adec_id; @@ -232,8 +232,9 @@ u32 adecOpen(AudioDecoder* data) adec.adecCb->InitRegs(); adec.adecCb->DoRun(); - thread t("Audio Decoder[" + std::to_string(adec_id) + "] Thread", [&, data_ptr]() + thread t("Audio Decoder[" + std::to_string(adec_id) + "] Thread", [adec_ptr, sptr]() { + AudioDecoder& adec = *adec_ptr; cellAdec->Notice("Audio Decoder thread started"); AdecTask& task = adec.task; diff --git a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp index 2078fe6c96..3ad90bcc78 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellDmux.cpp @@ -288,20 +288,20 @@ void dmuxQueryEsAttr(u32 info_addr /* may be 0 */, vm::ptr attr) { if (esFilterId->filterIdMajor >= 0xe0) - attr->memSize = 0x400000; // 0x45fa49 from ps3 + attr->memSize = 0x500000; // 0x45fa49 from ps3 else - attr->memSize = 0x6000; // 0x73d9 from ps3 + attr->memSize = 0x7000; // 0x73d9 from ps3 cellDmux->Warning("*** filter(0x%x, 0x%x, 0x%x, 0x%x)", (u32)esFilterId->filterIdMajor, (u32)esFilterId->filterIdMinor, (u32)esFilterId->supplementalInfo1, (u32)esFilterId->supplementalInfo2); } -u32 dmuxOpen(Demuxer* data) +u32 dmuxOpen(Demuxer* dmux_ptr) { - std::shared_ptr data_ptr(data); - Demuxer& dmux = *data; + std::shared_ptr sptr(dmux_ptr); + Demuxer& dmux = *dmux_ptr; - u32 dmux_id = cellDmux->GetNewId(data_ptr); + u32 dmux_id = cellDmux->GetNewId(sptr); dmux.id = dmux_id; @@ -314,8 +314,9 @@ u32 dmuxOpen(Demuxer* data) dmux.dmuxCb->InitRegs(); dmux.dmuxCb->DoRun(); - thread t("Demuxer[" + std::to_string(dmux_id) + "] Thread", [&, data_ptr]() + thread t("Demuxer[" + std::to_string(dmux_id) + "] Thread", [dmux_ptr, sptr]() { + Demuxer& dmux = *dmux_ptr; cellDmux->Notice("Demuxer thread started (mem=0x%x, size=0x%x, cb=0x%x, arg=0x%x)", dmux.memAddr, dmux.memSize, dmux.cbFunc, dmux.cbArg); DemuxerTask task; diff --git a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp index 54d8f0370c..ddf5726ff4 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVdec.cpp @@ -204,12 +204,12 @@ u32 vdecQueryAttr(CellVdecCodecType type, u32 profile, u32 spec_addr /* may be 0 return CELL_OK; } -u32 vdecOpen(VideoDecoder* data) +u32 vdecOpen(VideoDecoder* vdec_ptr) { - std::shared_ptr data_ptr(data); - VideoDecoder& vdec = *data; + std::shared_ptr sptr(vdec_ptr); + VideoDecoder& vdec = *vdec_ptr; - u32 vdec_id = cellVdec->GetNewId(data_ptr); + u32 vdec_id = cellVdec->GetNewId(sptr); vdec.id = vdec_id; @@ -222,8 +222,9 @@ u32 vdecOpen(VideoDecoder* data) vdec.vdecCb->InitRegs(); vdec.vdecCb->DoRun(); - thread t("Video Decoder[" + std::to_string(vdec_id) + "] Thread", [&, data_ptr]() + thread t("Video Decoder[" + std::to_string(vdec_id) + "] Thread", [vdec_ptr, sptr]() { + VideoDecoder& vdec = *vdec_ptr; cellVdec->Notice("Video Decoder thread started"); VdecTask& task = vdec.task; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp b/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp index b7859b1530..6a38916373 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_mutex.cpp @@ -83,7 +83,7 @@ s32 sys_mutex_destroy(PPUThread& CPU, u32 mutex_id) const u32 tid = CPU.GetId(); - if (mutex->owner.compare_and_swap_test(0, tid)) // check if locked + if (!mutex->owner.compare_and_swap_test(0, tid)) // check if locked { return CELL_EBUSY; }