// 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); 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); }
// 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)); }
void recMicroVU1::SetCacheReserve(uint reserveInMegs) const { DevCon.WriteLn("microVU1: Changing cache size [%dmb]", reserveInMegs); microVU1.cacheSize = std::min(reserveInMegs, mVU1cacheReserve); safe_delete(microVU1.cache_reserve); // I assume this unmaps the memory mVUreserveCache(microVU1); // Need rec-reset after this }