void CachedInterpreter::SingleStep()
{
	int block = GetBlockNumberFromStartAddress(PC);
	if (block >= 0)
	{
		Instruction* code = (Instruction*)GetCompiledCodeFromBlock(block);

		while (true)
		{
			switch (code->type)
			{
			case Instruction::INSTRUCTION_ABORT:
				return;

			case Instruction::INSTRUCTION_TYPE_COMMON:
				code->common_callback(UGeckoInstruction(code->data));
				code++;
				break;

			case Instruction::INSTRUCTION_TYPE_CONDITIONAL:
				bool ret = code->conditional_callback(code->data);
				code++;
				if (ret)
					return;
				break;
			}
		}
	}

	Jit(PC);
}
Beispiel #2
0
void CachedInterpreter::ExecuteOneBlock()
{
  const u8* normal_entry = m_block_cache.Dispatch();
  if (!normal_entry)
  {
    Jit(PC);
    return;
  }

  const Instruction* code = reinterpret_cast<const Instruction*>(normal_entry);

  for (; code->type != Instruction::Type::Abort; ++code)
  {
    switch (code->type)
    {
    case Instruction::Type::Common:
      code->common_callback(UGeckoInstruction(code->data));
      break;

    case Instruction::Type::Conditional:
      if (code->conditional_callback(code->data))
        return;
      break;

    default:
      ERROR_LOG(POWERPC, "Unknown CachedInterpreter Instruction: %d", code->type);
      break;
    }
  }
}