diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp index 3dbc68eb0..16217e6fa 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp @@ -394,6 +394,18 @@ bool CX86RegInfo::IsFPStatusRegMapped() return false; } +asmjit::x86::Gp CX86RegInfo::GetFPStatusReg() const +{ + for (int32_t i = 0, n = x86RegIndex_Size; i < n; i++) + { + if (GetX86Mapped((x86RegIndex)i) == FPStatusReg_Mapped) + { + return GetX86RegFromIndex((x86RegIndex)i); + } + } + return x86Reg_Unknown; +} + asmjit::x86::Gp CX86RegInfo::FreeX86Reg() { if (GetX86Mapped(x86RegIndex_EDI) == NotMapped && !GetX86Protected(x86RegIndex_EDI)) diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.h b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.h index 78c32bb11..cdcc8bc66 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.h +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.h @@ -90,6 +90,7 @@ public: const asmjit::x86::St & StackPosition(int32_t Reg); bool IsFPStatusRegMapped(); + asmjit::x86::Gp GetFPStatusReg() const; asmjit::x86::Gp FreeX86Reg(); asmjit::x86::Gp Free8BitX86Reg(); void Map_GPR_32bit(int32_t MipsReg, bool SignValue, int32_t MipsRegToLoad);