Esempio n. 1
0
// Only run this once per VU! ;)
void mVUinit(microVU& mVU, uint vuIndex) {

	if(!x86caps.hasMultimediaExtensions)	 mVUthrowHardwareDeficiency( L"MMX",  vuIndex );
	if(!x86caps.hasStreamingSIMDExtensions)	 mVUthrowHardwareDeficiency( L"SSE",  vuIndex );
	if(!x86caps.hasStreamingSIMD2Extensions) mVUthrowHardwareDeficiency( L"SSE2", vuIndex );

	memzero(mVU.prog);

	mVU.index			=  vuIndex;
	mVU.cop2			=  0;
	mVU.vuMemSize		= (mVU.index ? 0x4000 : 0x1000);
	mVU.microMemSize	= (mVU.index ? 0x4000 : 0x1000);
	mVU.progSize		= (mVU.index ? 0x4000 : 0x1000) / 4;
	mVU.progMemMask		=  mVU.progSize-1;
	mVU.cacheSize		=  vuIndex ? mVU1cacheReserve : mVU0cacheReserve;
	mVU.cache			= NULL;
	mVU.dispCache		= NULL;
	mVU.startFunct		= NULL;
	mVU.exitFunct		= NULL;

	mVUreserveCache(mVU);

	mVU.dispCache = SysMmapEx(0, mVUdispCacheSize, 0,(mVU.index ?  "Micro VU1 Dispatcher" :  "Micro VU0 Dispatcher"));
	if (!mVU.dispCache) throw Exception::OutOfMemory (mVU.index ? L"Micro VU1 Dispatcher" : L"Micro VU0 Dispatcher");
	memset(mVU.dispCache, 0xcc, mVUdispCacheSize);

	mVU.regAlloc = new microRegAlloc(mVU.index);
}
Esempio n. 2
0
// Only run this once per VU! ;)
void microVU::init(uint vuIndex) {

	if(!x86caps.hasMultimediaExtensions)		mVUthrowHardwareDeficiency( L"MMX", vuIndex );
	if(!x86caps.hasStreamingSIMDExtensions)		mVUthrowHardwareDeficiency( L"SSE", vuIndex );
	if(!x86caps.hasStreamingSIMD2Extensions)	mVUthrowHardwareDeficiency( L"SSE2", vuIndex );

	memzero(prog);

	index			= vuIndex;
	cop2			= 0;
	vuMemSize		= (index ? 0x4000 : 0x1000);
	microMemSize	= (index ? 0x4000 : 0x1000);
	progSize		= (index ? 0x4000 : 0x1000) / 4;
	progMemMask		= progSize-1;
	dispCache		= NULL;
	cache			= NULL;
	cacheSize		= mVUcacheSize;
	regAlloc		= new microRegAlloc(index);

	for (u32 i = 0; i < (progSize / 2); i++) {
		prog.prog[i] = new deque<microProgram*>();
	}

	dispCache = SysMmapEx(0, mVUdispCacheSize, 0, (index ? "Micro VU1 Dispatcher" : "Micro VU0 Dispatcher"));
	if (!dispCache) throw Exception::OutOfMemory( index ? L"Micro VU1 Dispatcher" : L"Micro VU0 Dispatcher" );
	memset(dispCache, 0xcc, mVUdispCacheSize);

	// Allocates rec-cache and calls mVUreset()
	mVUresizeCache(this, cacheSize + mVUcacheSafeZone);
	//if (vuIndex) gen_memcpy_vibes();
}
Esempio n. 3
0
// Only run this once per VU! ;)
void mVUinit(microVU& mVU, uint vuIndex) {

	if(!x86caps.hasStreamingSIMD2Extensions) mVUthrowHardwareDeficiency( L"SSE2", vuIndex );

	memzero(mVU.prog);

	mVU.index			=  vuIndex;
	mVU.cop2			=  0;
	mVU.vuMemSize		= (mVU.index ? 0x4000 : 0x1000);
	mVU.microMemSize	= (mVU.index ? 0x4000 : 0x1000);
	mVU.progSize		= (mVU.index ? 0x4000 : 0x1000) / 4;
	mVU.progMemMask		=  mVU.progSize-1;
	mVU.cacheSize		=  vuIndex ? mVU1cacheReserve : mVU0cacheReserve;
	mVU.cache			= NULL;
	mVU.dispCache		= NULL;
	mVU.startFunct		= NULL;
	mVU.exitFunct		= NULL;

	mVUreserveCache(mVU);

	if (vuIndex) mVU.dispCache = vu1_RecDispatchers;
	else mVU.dispCache = vu0_RecDispatchers;

	mVU.regAlloc.reset(new microRegAlloc(mVU.index));
}