Esempio n. 1
0
void CPS2VM::ResetVM()
{
	m_ee->Reset();

	m_iop->Reset();
	m_iop->SetBios(m_iopOs);

	//LoadBIOS();

	if(m_ee->m_gs != NULL)
	{
		m_ee->m_gs->Reset();
	}

	m_iopOs->Reset(new Iop::CSifManPs2(m_ee->m_sif, m_ee->m_ram, m_iop->m_ram));

	CDROM0_Reset();

	m_iopOs->GetIoman()->RegisterDevice("host", Iop::CIoman::DevicePtr(new Iop::Ioman::CDirectoryDevice(PREF_PS2_HOST_DIRECTORY)));
	m_iopOs->GetIoman()->RegisterDevice("mc0", Iop::CIoman::DevicePtr(new Iop::Ioman::CDirectoryDevice(PREF_PS2_MC0_DIRECTORY)));
	m_iopOs->GetIoman()->RegisterDevice("mc1", Iop::CIoman::DevicePtr(new Iop::Ioman::CDirectoryDevice(PREF_PS2_MC1_DIRECTORY)));
	m_iopOs->GetIoman()->RegisterDevice("cdrom0", Iop::CIoman::DevicePtr(new Iop::Ioman::CIsoDevice(m_pCDROM0)));

	m_iopOs->GetLoadcore()->SetLoadExecutableHandler(std::bind(&CPS2OS::LoadExecutable, m_ee->m_os, std::placeholders::_1, std::placeholders::_2));

	m_iopOs->GetCdvdfsv()->SetReadToEeRamHandler(std::bind(&CPS2VM::ReadToEeRam, this, std::placeholders::_1, std::placeholders::_2));

	m_vblankTicks = ONSCREEN_TICKS;
	m_inVblank = false;

	m_eeExecutionTicks = 0;
	m_iopExecutionTicks = 0;

	m_spuUpdateTicks = SPU_UPDATE_TICKS;
	m_currentSpuBlock = 0;

	RegisterModulesInPadHandler();

#ifdef DEBUGGER_INCLUDED
	try
	{
		boost::filesystem::path logPath(VPU_LOG_BASE);
		boost::filesystem::remove_all(logPath);
		boost::filesystem::create_directory(logPath);
	}
	catch(...)
	{

	}
#endif
}
Esempio n. 2
0
void CPS2VM::CreatePadHandlerImpl(const CPadHandler::FactoryFunction& factoryFunction)
{
	m_pad = factoryFunction();
	RegisterModulesInPadHandler();
}