1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

RawSPU initialization fix

This commit is contained in:
Nekotekina 2014-07-16 16:06:58 +04:00
parent 8e19af530b
commit b487dcee27
4 changed files with 24 additions and 12 deletions

View File

@ -11,7 +11,6 @@
#include "Emu/ARMv7/ARMv7Thread.h"
CPUThreadManager::CPUThreadManager()
: m_raw_spu_num(0)
{
}
@ -22,7 +21,6 @@ CPUThreadManager::~CPUThreadManager()
void CPUThreadManager::Close()
{
m_raw_spu_num = 0;
while(m_threads.size()) RemoveThread(m_threads[0]->GetId());
}
@ -34,10 +32,26 @@ CPUThread& CPUThreadManager::AddThread(CPUThreadType type)
switch(type)
{
case CPU_THREAD_PPU: new_thread = new PPUThread(); break;
case CPU_THREAD_SPU: new_thread = new SPUThread(); break;
case CPU_THREAD_RAW_SPU: new_thread = new RawSPUThread(m_raw_spu_num++); break;
case CPU_THREAD_ARMv7: new_thread = new ARMv7Thread(); break;
case CPU_THREAD_PPU:
{
new_thread = new PPUThread();
break;
}
case CPU_THREAD_SPU:
{
new_thread = new SPUThread();
break;
}
case CPU_THREAD_RAW_SPU:
{
new_thread = new RawSPUThread();
break;
}
case CPU_THREAD_ARMv7:
{
new_thread = new ARMv7Thread();
break;
}
default: assert(0);
}

View File

@ -7,7 +7,6 @@ class CPUThreadManager
{
std::vector<CPUThread*> m_threads;
std::mutex m_mtx_thread;
u32 m_raw_spu_num;
public:
CPUThreadManager();

View File

@ -7,12 +7,11 @@
#include "Emu/Cell/RawSPUThread.h"
RawSPUThread::RawSPUThread(u32 index, CPUThreadType type)
RawSPUThread::RawSPUThread(CPUThreadType type)
: SPUThread(type)
, MemoryBlock()
, m_index(index)
{
Memory.InitRawSPU(SetRange(RAW_SPU_BASE_ADDR + RAW_SPU_OFFSET * index, RAW_SPU_PROB_OFFSET), m_index);
m_index = Memory.InitRawSPU(this);
Reset();
}
@ -344,7 +343,7 @@ void RawSPUThread::Task()
{
PC = SPU.NPC.GetValue();
CPUThread::Task();
SPUThread::Task();
SPU.NPC.SetValue(PC);
}

View File

@ -19,7 +19,7 @@ class RawSPUThread
u32 m_index;
public:
RawSPUThread(u32 index, CPUThreadType type = CPU_THREAD_RAW_SPU);
RawSPUThread(CPUThreadType type = CPU_THREAD_RAW_SPU);
virtual ~RawSPUThread();
virtual bool Read32(const u64 addr, u32* value) override;