This commit is contained in:
Nekotekina 2015-07-02 13:54:28 +03:00
parent 32d3d1fbe5
commit 8c00dcd02d
11 changed files with 28 additions and 38 deletions

View File

@ -1212,7 +1212,7 @@ thread_t::thread_t(std::function<std::string()> name, std::function<void()> func
start(std::move(name), func); start(std::move(name), func);
} }
thread_t::~thread_t() thread_t::~thread_t() noexcept(false)
{ {
if (m_thread) if (m_thread)
{ {

View File

@ -1605,7 +1605,7 @@ void ARMv7_instrs::CLZ(ARMv7Context& context, const ARMv7Code code, const ARMv7_
if (ConditionPassed(context, cond)) if (ConditionPassed(context, cond))
{ {
context.write_gpr(d, cntlz32(context.read_gpr(m)), type == T1 ? 2 : 4); context.write_gpr(d, cntlz32(context.read_gpr(m)), 4);
} }
} }
@ -3475,7 +3475,7 @@ void ARMv7_instrs::POP(ARMv7Context& context, const ARMv7Code code, const ARMv7_
{ {
if (reg_list & (1 << i)) if (reg_list & (1 << i))
{ {
context.write_gpr(i, *stack++, type < A1 ? 2 : 4); context.write_gpr(i, *stack++, type == T1 ? 2 : 4);
} }
} }
@ -5572,7 +5572,7 @@ void ARMv7_instrs::UXTB(ARMv7Context& context, const ARMv7Code code, const ARMv7
if (ConditionPassed(context, cond)) if (ConditionPassed(context, cond))
{ {
context.write_gpr(d, (context.read_gpr(m) >> rot) & 0xff, type < A1 ? 2 : 4); context.write_gpr(d, (context.read_gpr(m) >> rot) & 0xff, type == T1 ? 2 : 4);
} }
} }

View File

@ -91,7 +91,7 @@ s32 sceKernelExitThread(ARMv7Context& context, s32 exitStatus)
sceLibKernel.Warning("sceKernelExitThread(exitStatus=0x%x)", exitStatus); sceLibKernel.Warning("sceKernelExitThread(exitStatus=0x%x)", exitStatus);
// exit status is stored in r0 // exit status is stored in r0
static_cast<ARMv7Thread&>(context).Stop(); static_cast<ARMv7Thread&>(context).Exit();
return SCE_OK; return SCE_OK;
} }

View File

@ -2,7 +2,6 @@
#include "Emu/RSX/RSXFragmentProgram.h" #include "Emu/RSX/RSXFragmentProgram.h"
#include "Emu/RSX/RSXVertexProgram.h" #include "Emu/RSX/RSXVertexProgram.h"
#include "Utilities/Log.h"
enum class SHADER_TYPE enum class SHADER_TYPE

View File

@ -1,5 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "rpcs3/Ini.h" #include "rpcs3/Ini.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "sysutil_video.h" #include "sysutil_video.h"

View File

@ -252,9 +252,9 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
if (m_flip_handler) if (m_flip_handler)
{ {
auto cb = m_flip_handler; auto cb = m_flip_handler;
Emu.GetCallbackManager().Async([cb](PPUThread& CPU) Emu.GetCallbackManager().Async([=](CPUThread& CPU)
{ {
cb(CPU, 1); cb(static_cast<PPUThread&>(CPU), 1);
}); });
} }
@ -2307,9 +2307,9 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
{ {
const u32 cause = ARGS(0); const u32 cause = ARGS(0);
auto cb = m_user_handler; auto cb = m_user_handler;
Emu.GetCallbackManager().Async([cb, cause](PPUThread& CPU) Emu.GetCallbackManager().Async([=](CPUThread& CPU)
{ {
cb(CPU, cause); cb(static_cast<PPUThread&>(CPU), cause);
}); });
break; break;
} }
@ -2470,9 +2470,9 @@ void RSXThread::Task()
if (auto cb = m_vblank_handler) if (auto cb = m_vblank_handler)
{ {
Emu.GetCallbackManager().Async([=](PPUThread& CPU) Emu.GetCallbackManager().Async([=](CPUThread& CPU)
{ {
cb(CPU, 1); cb(static_cast<PPUThread&>(CPU), 1);
}); });
} }
} }

View File

@ -20,32 +20,18 @@ void CallbackManager::Register(std::function<s32(PPUThread& PPU)> func)
}); });
} }
void CallbackManager::Async(std::function<void(PPUThread& PPU)> func) void CallbackManager::Async(std::function<void(CPUThread& CPU)> func)
{ {
std::lock_guard<std::mutex> lock(m_mutex); std::lock_guard<std::mutex> lock(m_mutex);
m_async_list.push_back([=](CPUThread& CPU) m_async_list.push_back([=](CPUThread& CPU)
{ {
if (CPU.GetType() != CPU_THREAD_PPU) throw EXCEPTION("PPU thread expected"); func(CPU);
func(static_cast<PPUThread&>(CPU));
}); });
m_cv.notify_one(); m_cv.notify_one();
} }
//void CallbackManager::Async(std::function<void(ARMv7Context& context)> func)
//{
// std::lock_guard<std::mutex> lock(m_mutex);
//
// m_async_list.push_back([=](CPUThread& CPU)
// {
// if (CPU.GetType() != CPU_THREAD_ARMv7) throw EXCEPTION("ARMv7 thread expected");
// func(static_cast<ARMv7Thread&>(CPU));
// });
//
// m_cv.notify_one();
//}
bool CallbackManager::Check(CPUThread& CPU, s32& result) bool CallbackManager::Check(CPUThread& CPU, s32& result)
{ {
std::function<s32(CPUThread& CPU)> func; std::function<s32(CPUThread& CPU)> func;

View File

@ -26,8 +26,7 @@ class CallbackManager
public: public:
void Register(std::function<s32(PPUThread& CPU)> func); // register callback (called in Check() method) void Register(std::function<s32(PPUThread& CPU)> func); // register callback (called in Check() method)
void Async(std::function<void(PPUThread& CPU)> func); // register callback for callback thread (called immediately) void Async(std::function<void(CPUThread& CPU)> func); // register callback for callback thread (called immediately)
//void Async(std::function<void(ARMv7Context& context)> func);
bool Check(CPUThread& CPU, s32& result); // call one callback registered by Register() method bool Check(CPUThread& CPU, s32& result); // call one callback registered by Register() method

View File

@ -527,9 +527,9 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
{ {
const auto func = file->st_callback.exchange({}).func; const auto func = file->st_callback.exchange({}).func;
Emu.GetCallbackManager().Async([=](PPUThread& CPU) Emu.GetCallbackManager().Async([=](CPUThread& CPU)
{ {
func(CPU, fd, available); func(static_cast<PPUThread&>(CPU), fd, available);
}); });
} }
} }
@ -898,9 +898,9 @@ void fsAio(vm::ptr<CellFsAio> aio, bool write, s32 xid, fs_aio_cb_t func)
} }
// should be executed directly by FS AIO thread // should be executed directly by FS AIO thread
Emu.GetCallbackManager().Async([=](PPUThread& CPU) Emu.GetCallbackManager().Async([=](CPUThread& CPU)
{ {
func(CPU, aio, error, xid, result); func(static_cast<PPUThread&>(CPU), aio, error, xid, result);
}); });
} }

View File

@ -1067,10 +1067,13 @@ struct SceNpMatching2LobbyDataInternal
union SceNpMatching2LobbyMessageDestination union SceNpMatching2LobbyMessageDestination
{ {
be_t<u16> unicastTarget; be_t<u16> unicastTarget;
struct multicastTarget {
be_t<u16> *memberId; struct
{
vm::bptr<u16> memberId;
be_t<u32> memberIdNum; be_t<u32> memberIdNum;
}; }
multicastTarget;
}; };
// Group label // Group label
@ -1973,7 +1976,8 @@ struct SceNpScoreClanIdRankData
}; };
// Union for connection information // Union for connection information
union SceNpSignalingConnectionInfo { union SceNpSignalingConnectionInfo
{
be_t<u32> rtt; be_t<u32> rtt;
be_t<u32> bandwidth; be_t<u32> bandwidth;
SceNpId npId; SceNpId npId;

View File

@ -1,4 +1,5 @@
#include "stdafx_gui.h" #include "stdafx_gui.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "GLGSFrame.h" #include "GLGSFrame.h"