CMipsExecutor::BasicBlockPtr CEeExecutor::BlockFactory(CMIPS& context, uint32 start, uint32 end) { //Kernel area is below 0x100000 and isn't protected. Some games will write code in there //but it is safe to assume that it won't change (code writes some data just besides itself //so it keeps generating exceptions, making the game slower) if(start >= 0x100000 && start < PS2::EE_RAM_SIZE) { SetMemoryProtected(m_ram + start, end - start + 4, true); } return CMipsExecutor::BlockFactory(context, start, end); }
void CEeExecutor::ClearActiveBlocksInRange(uint32 start, uint32 end) { uint32 rangeSize = end - start; SetMemoryProtected(m_ram + start, rangeSize, false); CBasicBlock* currentBlock = nullptr; if(m_context.m_State.nPC >= start && m_context.m_State.nPC < end) { //We are currently executing a block in that range, we need to protect it //We assume that we're not writing in the same place as the currently executed block currentBlock = FindBlockStartingAt(m_context.m_State.nPC); assert(currentBlock != nullptr); } ClearActiveBlocksInRangeInternal(start, end, currentBlock); }
void CEeExecutor::Reset() { SetMemoryProtected(m_ram, PS2::EE_RAM_SIZE, false); CMipsExecutor::Reset(); }