From 608fb85f0d268be33c5c5e31f74e5c94ae6f0d0a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 Feb 2013 12:25:51 -0800 Subject: [PATCH 1/2] Make changing register values actually work. --- Core/MIPS/MIPSDebugInterface.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/MIPS/MIPSDebugInterface.h b/Core/MIPS/MIPSDebugInterface.h index 46ae3ae439..7a3ff54662 100644 --- a/Core/MIPS/MIPSDebugInterface.h +++ b/Core/MIPS/MIPSDebugInterface.h @@ -77,4 +77,8 @@ public: return cpu->r[index]; } + void SetRegValue(int cat, int index, u32 value) + { + cpu->r[index] = value; + } }; From 0c1b6fecfe55335eca03e5187eeca3e15152fcc4 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 Feb 2013 12:30:18 -0800 Subject: [PATCH 2/2] Allow changing fpu/vfpu regs. --- Core/MIPS/MIPSDebugInterface.h | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/MIPSDebugInterface.h b/Core/MIPS/MIPSDebugInterface.h index 7a3ff54662..70e70a900f 100644 --- a/Core/MIPS/MIPSDebugInterface.h +++ b/Core/MIPS/MIPSDebugInterface.h @@ -74,11 +74,40 @@ public: u32 GetRegValue(int cat, int index) { - return cpu->r[index]; + switch (cat) + { + case 0: + return cpu->r[index]; + + case 1: + return *(u32 *)&cpu->f[index]; + + case 2: + return *(u32 *)&cpu->v[index]; + + default: + return 0; + } } void SetRegValue(int cat, int index, u32 value) { - cpu->r[index] = value; + switch (cat) + { + case 0: + cpu->r[index] = value; + break; + + case 1: + cpu->f[index] = *(float *)&value; + break; + + case 2: + cpu->v[index] = *(float *)&value; + break; + + default: + break; + } } };