2012-11-15 01:39:56 +02:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include "PPCThread.h"
|
2014-08-22 20:36:27 +04:00
|
|
|
#include "Emu/Memory/Memory.h"
|
2012-11-15 01:39:56 +02:00
|
|
|
|
2013-06-30 11:46:29 +03:00
|
|
|
PPCThread* GetCurrentPPCThread()
|
|
|
|
|
{
|
2013-11-03 21:23:16 +02:00
|
|
|
CPUThread* thread = GetCurrentCPUThread();
|
|
|
|
|
|
|
|
|
|
if(!thread || (thread->GetType() != CPU_THREAD_PPU && thread->GetType() != CPU_THREAD_SPU && thread->GetType() != CPU_THREAD_RAW_SPU))
|
|
|
|
|
{
|
2014-04-01 02:33:55 +02:00
|
|
|
throw std::string("GetCurrentPPCThread: bad thread");
|
2013-11-03 21:23:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (PPCThread*)thread;
|
2013-06-30 11:46:29 +03:00
|
|
|
}
|
|
|
|
|
|
2013-11-05 20:12:18 +02:00
|
|
|
PPCThread::PPCThread(CPUThreadType type) : CPUThread(type)
|
2012-11-15 01:39:56 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PPCThread::~PPCThread()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 21:23:16 +02:00
|
|
|
void PPCThread::DoReset()
|
2012-11-15 01:39:56 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PPCThread::InitStack()
|
|
|
|
|
{
|
2013-11-03 21:23:16 +02:00
|
|
|
if(m_stack_addr) return;
|
|
|
|
|
if(m_stack_size == 0) m_stack_size = 0x10000;
|
2014-09-15 02:17:24 +04:00
|
|
|
m_stack_addr = (u32)Memory.StackMem.AllocAlign(m_stack_size, 0x100);
|
2012-11-15 01:39:56 +02:00
|
|
|
/*
|
2013-11-03 21:23:16 +02:00
|
|
|
m_stack_point += m_stack_size - 0x10;
|
|
|
|
|
m_stack_point &= -0x10;
|
2014-09-06 17:33:01 +04:00
|
|
|
vm::write64(m_stack_point, 0);
|
2013-11-03 21:23:16 +02:00
|
|
|
m_stack_point -= 0x60;
|
2014-09-06 17:33:01 +04:00
|
|
|
vm::write64(m_stack_point, m_stack_point + 0x60);
|
2012-11-15 01:39:56 +02:00
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|