From 06c9c60717d1a677571e6e8183e8c71df588deb6 Mon Sep 17 00:00:00 2001 From: Ty Lamontagne Date: Wed, 3 Jul 2024 13:48:56 -0400 Subject: [PATCH] Debugger Expressions: Add FPU registers to breakpoint conditionals. --- pcsx2/DebugTools/DebugInterface.cpp | 12 +++++++++++- pcsx2/DebugTools/ExpressionParser.cpp | 10 ++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pcsx2/DebugTools/DebugInterface.cpp b/pcsx2/DebugTools/DebugInterface.cpp index b9eb5982ca..7d2ffadfd3 100644 --- a/pcsx2/DebugTools/DebugInterface.cpp +++ b/pcsx2/DebugTools/DebugInterface.cpp @@ -55,12 +55,18 @@ public: { char reg[8]; std::snprintf(reg, std::size(reg), "r%d", i); - if (StringUtil::Strcasecmp(str, reg) == 0 || StringUtil::Strcasecmp(str, cpu->getRegisterName(0, i)) == 0) { referenceIndex = i; return true; } + + std::snprintf(reg, std::size(reg), "f%d", i); + if (StringUtil::Strcasecmp(str, reg) == 0) + { + referenceIndex = i | REF_INDEX_FPU; + return true; + } } if (StringUtil::Strcasecmp(str, "pc") == 0) @@ -145,6 +151,10 @@ public: } return 0; } + if (referenceIndex & REF_INDEX_FPU) + { + return cpu->getRegister(EECAT_FPR, referenceIndex & 0x1F)._u64[0]; + } return -1; } diff --git a/pcsx2/DebugTools/ExpressionParser.cpp b/pcsx2/DebugTools/ExpressionParser.cpp index cc9c83d322..52638fb288 100644 --- a/pcsx2/DebugTools/ExpressionParser.cpp +++ b/pcsx2/DebugTools/ExpressionParser.cpp @@ -539,10 +539,16 @@ bool parsePostfixExpression(PostfixExpression& exp, IExpressionFunctions* funcs, valueStack.push_back(arg[1]