CPU/Recompiler: Add GetCurrentCodePointer()

This commit is contained in:
Connor McLaughlin 2019-12-27 17:49:32 +10:00
parent 390b6da0b8
commit aabe5b9287
2 changed files with 12 additions and 1 deletions

View File

@ -290,6 +290,17 @@ void CodeGenerator::ConvertValueSizeInPlace(Value* value, RegSize size, bool sig
value->size = size; value->size = size;
} }
void* CodeGenerator::GetCurrentCodePointer() const
{
if (m_emit == &m_near_emitter)
return GetCurrentNearCodePointer();
else if (m_emit == &m_far_emitter)
return GetCurrentFarCodePointer();
Panic("unknown emitter");
return nullptr;
}
Value CodeGenerator::AddValues(const Value& lhs, const Value& rhs, bool set_flags) Value CodeGenerator::AddValues(const Value& lhs, const Value& rhs, bool set_flags)
{ {
DebugAssert(lhs.size == rhs.size); DebugAssert(lhs.size == rhs.size);
@ -1722,5 +1733,4 @@ bool CodeGenerator::Compile_cop2(const CodeBlockInstruction& cbi)
return true; return true;
} }
} }
} // namespace CPU::Recompiler } // namespace CPU::Recompiler

View File

@ -159,6 +159,7 @@ private:
void SwitchToFarCode(); void SwitchToFarCode();
void SwitchToNearCode(); void SwitchToNearCode();
void* GetCurrentCodePointer() const;
void* GetCurrentNearCodePointer() const; void* GetCurrentNearCodePointer() const;
void* GetCurrentFarCodePointer() const; void* GetCurrentFarCodePointer() const;