diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs index 00c1b0b3e7..a306054894 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.IDebuggable.cs @@ -19,8 +19,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 for (int i = 0; i < 32; i++) { var reg = BitConverter.ToInt64(data, i * 8); - ret.Add("REG" + i + "_lo", (int)(reg)); - ret.Add("REG" + i + "_hi", (int)(reg >> 32)); + ret.Add(GPRnames[i] + "_lo", (int)(reg)); + ret.Add(GPRnames[i] + "_hi", (int)(reg >> 32)); } var PC = BitConverter.ToUInt32(data, 32 * 8); @@ -55,6 +55,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 return ret; } + public string[] GPRnames = new string[32] + { + "r0", + "at", + "v0", "v1", + "a0", "a1", "a2", "a3", + "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + "t8", "t9", + "k0", "k1", + "gp", + "sp", + "s8", + "ra" + }; + [FeatureNotImplemented] public void SetCpuRegister(string register, int value) { diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs index bbd3ed2f90..ee887c2dbd 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ITraceable.cs @@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 for (int i = 1; i < 32; i++) // r0 is always zero { - UInt64 val = (regs["REG" + i + "_hi"].Value << 32) | regs["REG" + i + "_lo"].Value; + UInt64 val = (regs[GPRnames[i] + "_hi"].Value << 32) | regs[GPRnames[i] + "_lo"].Value; string name = GPRnames[i]; sb.Append(string.Format("{0}:{1:X16} ", name, val)); } @@ -62,21 +62,5 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 (ServiceProvider as BasicServiceProvider).Register(Tracer); _tracecb = new mupen64plusApi.TraceCallback(MakeTrace); } - - private string[] GPRnames = new string[32] - { - "r0", - "at", - "v0", "v1", - "a0", "a1", "a2", "a3", - "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", - "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", - "t8", "t9", - "k0", "k1", - "gp", - "sp", - "s8", - "ra" - }; } } \ No newline at end of file