2012-11-15 00:39:56 +01:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "PPCThread.h"
|
|
|
|
|
#include "Gui/InterpreterDisAsm.h"
|
|
|
|
|
|
2013-06-30 10:46:29 +02:00
|
|
|
PPCThread* GetCurrentPPCThread()
|
|
|
|
|
{
|
2013-11-03 20:23:16 +01:00
|
|
|
CPUThread* thread = GetCurrentCPUThread();
|
|
|
|
|
|
|
|
|
|
if(!thread || (thread->GetType() != CPU_THREAD_PPU && thread->GetType() != CPU_THREAD_SPU && thread->GetType() != CPU_THREAD_RAW_SPU))
|
|
|
|
|
{
|
|
|
|
|
throw wxString("GetCurrentPPCThread: bad thread");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (PPCThread*)thread;
|
2013-06-30 10:46:29 +02:00
|
|
|
}
|
|
|
|
|
|
2013-11-05 19:12:18 +01:00
|
|
|
PPCThread::PPCThread(CPUThreadType type) : CPUThread(type)
|
2012-11-15 00:39:56 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PPCThread::~PPCThread()
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 20:23:16 +01:00
|
|
|
void PPCThread::DoReset()
|
2012-11-15 00:39:56 +01:00
|
|
|
{
|
2013-07-08 15:24:46 +02:00
|
|
|
memset(m_args, 0, sizeof(u64) * 4);
|
2012-11-15 00:39:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PPCThread::InitStack()
|
|
|
|
|
{
|
2013-11-03 20:23:16 +01:00
|
|
|
if(m_stack_addr) return;
|
|
|
|
|
if(m_stack_size == 0) m_stack_size = 0x10000;
|
2014-02-02 20:49:10 +01:00
|
|
|
m_stack_addr = Memory.StackMem.AllocAlign(m_stack_size, 0x100);
|
2012-11-15 00:39:56 +01:00
|
|
|
|
2013-11-03 20:23:16 +01:00
|
|
|
m_stack_point = m_stack_addr + m_stack_size;
|
2012-11-15 00:39:56 +01:00
|
|
|
/*
|
2013-11-03 20:23:16 +01:00
|
|
|
m_stack_point += m_stack_size - 0x10;
|
|
|
|
|
m_stack_point &= -0x10;
|
|
|
|
|
Memory.Write64(m_stack_point, 0);
|
|
|
|
|
m_stack_point -= 0x60;
|
|
|
|
|
Memory.Write64(m_stack_point, m_stack_point + 0x60);
|
2012-11-15 00:39:56 +01:00
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|