コード例 #1
0
ファイル: FiFo.cpp プロジェクト: Aced14/pcsx2
void __fastcall ReadFIFO_VIF1(mem128_t* out)
{
	if (vif1Regs.stat.test(VIF1_STAT_INT | VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS) )
		DevCon.Warning( "Reading from vif1 fifo when stalled" );

	ZeroQWC(out); // Clear first in case no data gets written...
	pxAssertRel(vif1Regs.stat.FQC != 0, "FQC = 0 on VIF FIFO READ!");
	if (vif1Regs.stat.FDR) {
		if (vif1Regs.stat.FQC > vif1.GSLastDownloadSize) {
			DevCon.Warning("Warning! GS Download size < FIFO count!");
		}
		if (vif1Regs.stat.FQC > 0) {
			GetMTGS().WaitGS();
			if (GSinitReadFIFO) {
				GetMTGS().SendPointerPacket(GS_RINGTYPE_INIT_READ_FIFO1, 0, out);
				GetMTGS().WaitGS(false); // wait without reg sync
			}
			GSreadFIFO((u64*)out);
			vif1.GSLastDownloadSize--;
			GUNIT_LOG("ReadFIFO_VIF1");
			if (vif1.GSLastDownloadSize <= 16)
				gifRegs.stat.OPH = false;
			vif1Regs.stat.FQC = std::min((u32)16, vif1.GSLastDownloadSize);
		}
	}

	VIF_LOG("ReadFIFO/VIF1 -> %ls", WX_STR(out->ToString()));
}
コード例 #2
0
ファイル: FiFo.cpp プロジェクト: mauzus/progenitor
void __fastcall ReadFIFO_VIF1(mem128_t* out)
{
	if (vif1Regs.stat.test(VIF1_STAT_INT | VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS) )
		DevCon.Warning( "Reading from vif1 fifo when stalled" );

	pxAssertRel(vif1Regs.stat.FQC != 0, "FQC = 0 on VIF FIFO READ!");
	if (vif1Regs.stat.FDR)
	{
		if(vif1Regs.stat.FQC > vif1.GSLastDownloadSize)
		{
			DevCon.Warning("Warning! GS Download size < FIFO count!");
		}
		if (vif1Regs.stat.FQC > 0)
		{
			GetMTGS().WaitGS();
			GSreadFIFO((u64*)out);
			vif1.GSLastDownloadSize--;
			if (vif1.GSLastDownloadSize <= 16)
				gifRegs.stat.OPH = false;
			vif1Regs.stat.FQC = min((u32)16, vif1.GSLastDownloadSize);
		}
	}

	VIF_LOG("ReadFIFO/VIF1 -> %ls", out->ToString().c_str());
}
コード例 #3
0
ファイル: LnxHostSys.cpp プロジェクト: docbray/pcsx2-online
void HostSys::MmapResetPtr(void* base, size_t size)
{
	// On linux the only way to reset the memory is to unmap and remap it as PROT_NONE.
	// That forces linux to unload all committed pages and start from scratch.

	// FIXME: Ideally this code would have some threading lock on it to prevent any other
	// malloc/free code in the current process from interfering with the operation, but I
	// can't think of any good way to do that.  (generally it shouldn't be a problem in
	// PCSX2 anyway, since MmapReset is only called when the ps2vm is suspended; so that
	// pretty well stops all PCSX2 threads anyway).

	Munmap(base, size);
	void* result = MmapReservePtr(base, size);

	pxAssertRel ((uptr)result == (uptr)base, pxsFmt(
		"Virtual memory decommit failed: memory at 0x%08X -> 0x%08X could not be remapped.  "
		"This is likely caused by multi-thread memory contention.", base, (uptr)base+size
	));
}