- Implemented RAW SPU.

- Implemented memory mapping.
This commit is contained in:
DH 2013-07-12 15:42:17 +03:00
parent 027a31bd84
commit 559852a8fc
43 changed files with 1106 additions and 224 deletions

View file

@ -2,6 +2,7 @@
#include "PPCThreadManager.h"
#include "PPUThread.h"
#include "SPUThread.h"
#include "RawSPUThread.h"
PPCThreadManager::PPCThreadManager()
{
@ -17,13 +18,19 @@ void PPCThreadManager::Close()
while(m_threads.GetCount()) RemoveThread(m_threads[0].GetId());
}
PPCThread& PPCThreadManager::AddThread(bool isPPU)
PPCThread& PPCThreadManager::AddThread(PPCThreadType type)
{
PPCThread* new_thread = isPPU ? (PPCThread*)new PPUThread() : (PPCThread*)new SPUThread();
new_thread->SetId(Emu.GetIdManager().GetNewID(
wxString::Format("%s Thread", isPPU ? "PPU" : "SPU"), new_thread, 0)
);
PPCThread* new_thread;
char* name;
switch(type)
{
case PPC_THREAD_PPU: new_thread = new PPUThread(); name = "PPU"; break;
case PPC_THREAD_SPU: new_thread = new SPUThread(); name = "SPU"; break;
case PPC_THREAD_RAW_SPU: new_thread = new RawSPUThread(); name = "RawSPU"; break;
default: assert(0);
}
new_thread->SetId(Emu.GetIdManager().GetNewID(wxString::Format("%s Thread", name), new_thread));
m_threads.Add(new_thread);
wxGetApp().SendDbgCommand(DID_CREATE_THREAD, new_thread);
@ -54,14 +61,14 @@ void PPCThreadManager::RemoveThread(const u32 id)
Emu.CheckStatus();
}
s32 PPCThreadManager::GetThreadNumById(bool isPPU, u32 id)
s32 PPCThreadManager::GetThreadNumById(PPCThreadType type, u32 id)
{
s32 num = 0;
for(u32 i=0; i<m_threads.GetCount(); ++i)
{
if(m_threads[i].GetId() == id) return num;
if(m_threads[i].IsSPU() == !isPPU) num++;
if(m_threads[i].GetType() == type) num++;
}
return -1;