Example #1
0
void CSubSystem::LoadState(Framework::CZipArchiveReader& archive)
{
    archive.BeginReadFile(STATE_CPU			)->Read(&m_cpu.m_State,	sizeof(MIPSSTATE));
    archive.BeginReadFile(STATE_RAM			)->Read(m_ram,			IOP_RAM_SIZE);
    archive.BeginReadFile(STATE_SCRATCH		)->Read(m_scratchPad,	IOP_SCRATCH_SIZE);
    archive.BeginReadFile(STATE_SPURAM		)->Read(m_spuRam,		SPU_RAM_SIZE);
    m_intc.LoadState(archive);
    m_counters.LoadState(archive);
    m_spuCore0.LoadState(archive);
    m_spuCore1.LoadState(archive);
    m_bios->LoadState(archive);
}
void CFileIoHandler2300::LoadState(Framework::CZipArchiveReader& archive)
{
	auto registerFile = CRegisterStateFile(*archive.BeginReadFile(STATE_XML));
	m_resultPtr[0]       = registerFile.GetRegister32(STATE_RESULTPTR0);
	m_resultPtr[1]       = registerFile.GetRegister32(STATE_RESULTPTR1);
	m_pendingReadCommand = registerFile.GetRegister32(STATE_PENDINGREADCMD) != 0;
}
Example #3
0
void CVIF::LoadState(Framework::CZipArchiveReader& archive)
{
	CRegisterStateFile registerFile(*archive.BeginReadFile(STATE_REGS_XML));
	m_VPU_STAT = registerFile.GetRegister32(STATE_REGS_VPU_STAT);

	m_pVPU[0]->LoadState(archive);
	m_pVPU[1]->LoadState(archive);
}
Example #4
0
void CGSHandler::LoadState(Framework::CZipArchiveReader& archive)
{
	archive.BeginReadFile(STATE_RAM		)->Read(m_pRAM,		RAMSIZE);
	archive.BeginReadFile(STATE_REGS	)->Read(m_nReg,		sizeof(uint64) * 0x80);
	archive.BeginReadFile(STATE_TRXCTX	)->Read(&m_trxCtx,	sizeof(TRXCONTEXT));

	{
		CRegisterStateFile registerFile(*archive.BeginReadFile(STATE_PRIVREGS));
		m_nPMODE			= registerFile.GetRegister64(STATE_PRIVREGS_PMODE);
		m_nSMODE2			= registerFile.GetRegister64(STATE_PRIVREGS_SMODE2);
		m_nDISPFB1.value.q	= registerFile.GetRegister64(STATE_PRIVREGS_DISPFB1);
		m_nDISPLAY1.value.q	= registerFile.GetRegister64(STATE_PRIVREGS_DISPLAY1);
		m_nDISPFB2.value.q	= registerFile.GetRegister64(STATE_PRIVREGS_DISPFB2);
		m_nDISPLAY2.value.q	= registerFile.GetRegister64(STATE_PRIVREGS_DISPLAY2);
		m_nCSR				= registerFile.GetRegister64(STATE_PRIVREGS_CSR);
		m_nIMR				= registerFile.GetRegister64(STATE_PRIVREGS_IMR);
		m_nCrtMode			= registerFile.GetRegister32(STATE_PRIVREGS_CRTMODE);
	}
}
Example #5
0
void CVif1::LoadState(Framework::CZipArchiveReader& archive)
{
    CVif::LoadState(archive);

    auto path = string_format(STATE_PATH_FORMAT, m_number);
    CRegisterStateFile registerFile(*archive.BeginReadFile(path.c_str()));
    m_BASE	= registerFile.GetRegister32(STATE_REGS_BASE);
    m_TOP	= registerFile.GetRegister32(STATE_REGS_TOP);
    m_TOPS	= registerFile.GetRegister32(STATE_REGS_TOPS);
    m_OFST	= registerFile.GetRegister32(STATE_REGS_OFST);
}
Example #6
0
void CVPU1::LoadState(Framework::CZipArchiveReader& archive)
{
	CVPU::LoadState(archive);

	std::string path = STATE_PREFIX + boost::lexical_cast<std::string>(m_vpuNumber) + STATE_SUFFIX;
	CRegisterStateFile registerFile(*archive.BeginReadFile(path.c_str()));
	m_BASE	= registerFile.GetRegister32(STATE_REGS_BASE);
	m_TOP	= registerFile.GetRegister32(STATE_REGS_TOP);
	m_TOPS	= registerFile.GetRegister32(STATE_REGS_TOPS);
	m_OFST	= registerFile.GetRegister32(STATE_REGS_OFST);
}
Example #7
0
void CCdvdfsv::LoadState(Framework::CZipArchiveReader& archive)
{
	auto registerFile = CRegisterStateFile(*archive.BeginReadFile(STATE_FILENAME));

	m_pendingCommand = static_cast<COMMAND>(registerFile.GetRegister32(STATE_PENDINGCOMMAND));
	m_pendingReadSector = registerFile.GetRegister32(STATE_PENDINGREADSECTOR);
	m_pendingReadCount = registerFile.GetRegister32(STATE_PENDINGREADCOUNT);
	m_pendingReadAddr = registerFile.GetRegister32(STATE_PENDINGREADADDR);

	m_streaming = registerFile.GetRegister32(STATE_STREAMING) != 0;
	m_streamPos = registerFile.GetRegister32(STATE_STREAMPOS);
	m_streamBufferSize = registerFile.GetRegister32(STATE_STREAMBUFFERSIZE);
}
Example #8
0
void CSIF::LoadState(Framework::CZipArchiveReader& archive)
{
	CRegisterStateFile registerFile(*archive.BeginReadFile(STATE_REGS_XML));
	m_nMAINADDR		= registerFile.GetRegister32("MAINADDR");
	m_nSUBADDR		= registerFile.GetRegister32("SUBADDR");
	m_nMSFLAG		= registerFile.GetRegister32("MSFLAG");
	m_nSMFLAG		= registerFile.GetRegister32("SMFLAG");
	m_nEERecvAddr	= registerFile.GetRegister32("EERecvAddr");
	m_nDataAddr		= registerFile.GetRegister32("DataAddr");

	{
		CStructCollectionStateFile callRepliesFile(*archive.BeginReadFile(STATE_CALL_REPLIES_XML));
		for(CStructCollectionStateFile::StructIterator callReplyIterator(callRepliesFile.GetStructBegin());
			callReplyIterator != callRepliesFile.GetStructEnd(); callReplyIterator++)
		{
			const CStructFile& structFile(callReplyIterator->second);
			uint32 replyId = lexical_cast_hex<std::string>(callReplyIterator->first);
			CALLREQUESTINFO callReply;
			LoadState_RpcCall(structFile, callReply.call); 
			LoadState_RequestEnd(structFile, callReply.reply);
			m_callReplies[replyId] = callReply;
		}
	}
}
Example #9
0
void CSifCmd::LoadState(Framework::CZipArchiveReader& archive)
{
	ClearServers();

	auto modulesFile = CStructCollectionStateFile(*archive.BeginReadFile(STATE_MODULES));
	{
		for(CStructCollectionStateFile::StructIterator structIterator(modulesFile.GetStructBegin());
		    structIterator != modulesFile.GetStructEnd(); ++structIterator)
		{
			const auto& structFile(structIterator->second);
			uint32 serverDataAddress = structFile.GetRegister32(STATE_MODULE_SERVER_DATA_ADDRESS);
			auto serverData = reinterpret_cast<SIFRPCSERVERDATA*>(m_ram + serverDataAddress);
			auto module = new CSifDynamic(*this, serverDataAddress);
			m_servers.push_back(module);
			m_sifMan.RegisterModule(serverData->serverId, module);
		}
	}
}
Example #10
0
void CSubSystem::LoadState(Framework::CZipArchiveReader& archive)
{
    archive.BeginReadFile(STATE_EE			)->Read(&m_EE.m_State,	sizeof(MIPSSTATE));
    archive.BeginReadFile(STATE_VU0			)->Read(&m_VU0.m_State,	sizeof(MIPSSTATE));
    archive.BeginReadFile(STATE_VU1			)->Read(&m_VU1.m_State,	sizeof(MIPSSTATE));
    archive.BeginReadFile(STATE_RAM			)->Read(m_ram,			PS2::EE_RAM_SIZE);
    archive.BeginReadFile(STATE_SPR			)->Read(m_spr,			PS2::EE_SPR_SIZE);
    archive.BeginReadFile(STATE_VUMEM0		)->Read(m_vuMem0,		PS2::VUMEM0SIZE);
    archive.BeginReadFile(STATE_MICROMEM0	)->Read(m_microMem0,	PS2::MICROMEM0SIZE);
    archive.BeginReadFile(STATE_VUMEM1		)->Read(m_vuMem1,		PS2::VUMEM1SIZE);
    archive.BeginReadFile(STATE_MICROMEM1	)->Read(m_microMem1,	PS2::MICROMEM1SIZE);

    m_dmac.LoadState(archive);
    m_intc.LoadState(archive);
    m_sif.LoadState(archive);
    m_vpu0->LoadState(archive);
    m_vpu1->LoadState(archive);
    m_timer.LoadState(archive);

    m_executor.Reset();
}
Example #11
0
File: VPU.cpp Project: cmexp/Play-
void CVPU::LoadState(Framework::CZipArchiveReader& archive)
{
	std::string path = STATE_PREFIX + boost::lexical_cast<std::string>(m_vpuNumber) + STATE_SUFFIX;
	CRegisterStateFile registerFile(*archive.BeginReadFile(path.c_str()));
	m_STAT		<<= registerFile.GetRegister32(STATE_REGS_STAT);
	m_CODE		<<= registerFile.GetRegister32(STATE_REGS_CODE);
	m_CYCLE		<<= registerFile.GetRegister32(STATE_REGS_CYCLE);
	m_NUM		= static_cast<uint8>(registerFile.GetRegister32(STATE_REGS_NUM));
	m_MODE		= registerFile.GetRegister32(STATE_REGS_MODE);
	m_MASK		= registerFile.GetRegister32(STATE_REGS_MASK);
	m_MARK		= registerFile.GetRegister32(STATE_REGS_MARK);
	m_R[0]		= registerFile.GetRegister32(STATE_REGS_ROW0);
	m_R[1]		= registerFile.GetRegister32(STATE_REGS_ROW1);
	m_R[2]		= registerFile.GetRegister32(STATE_REGS_ROW2);
	m_R[3]		= registerFile.GetRegister32(STATE_REGS_ROW3);
	m_C[0]		= registerFile.GetRegister32(STATE_REGS_COL0);
	m_C[1]		= registerFile.GetRegister32(STATE_REGS_COL1);
	m_C[2]		= registerFile.GetRegister32(STATE_REGS_COL2);
	m_C[3]		= registerFile.GetRegister32(STATE_REGS_COL3);
	m_ITOP		= registerFile.GetRegister32(STATE_REGS_ITOP);
	m_ITOPS		= registerFile.GetRegister32(STATE_REGS_ITOPS);
	m_readTick	= registerFile.GetRegister32(STATE_REGS_READTICK);
	m_writeTick	= registerFile.GetRegister32(STATE_REGS_WRITETICK);
}
Example #12
0
void CCdvdman::LoadState(Framework::CZipArchiveReader& archive)
{
	CRegisterStateFile registerFile(*archive.BeginReadFile(STATE_FILENAME));
	m_callbackPtr = registerFile.GetRegister32(STATE_CALLBACK_ADDRESS);
	m_status = registerFile.GetRegister32(STATE_STATUS);
}
Example #13
0
File: GIF.cpp Project: unpeng/Play-
void CGIF::LoadState(Framework::CZipArchiveReader& archive)
{
	CRegisterStateFile registerFile(*archive.BeginReadFile(STATE_REGS_XML));
	m_path3Masked = registerFile.GetRegister32(STATE_REGS_M3P) != 0;
}