mGBA - implement IDebuggable.SetCpuRegister()

This commit is contained in:
adelikat 2020-04-11 12:57:47 -05:00
parent a1844f5d5c
commit 7c79cfab67
4 changed files with 31 additions and 3 deletions

View File

@ -140,6 +140,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
[DllImport(dll, CallingConvention = cc)]
public static extern void BizGetRegisters(IntPtr ctx, int[] dest);
[DllImport(dll, CallingConvention = cc)]
public static extern void BizSetRegister(IntPtr ctx, int index, int value);
[DllImport(dll, CallingConvention = cc)]
public static extern void BizWriteBus(IntPtr ctx, uint addr, byte val);

View File

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Nintendo.GBA
@ -23,7 +22,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
[FeatureNotImplemented]
public void SetCpuRegister(string register, int value)
{
throw new NotImplementedException();
int index = register?.ToUpper() switch
{
"R0" => 0,
"R1" => 1,
"R2" => 2,
"R3" => 3,
"R4" => 4,
"R5" => 5,
"R6" => 6,
"R7" => 7,
"R8" => 8,
"R9" => 9,
"R10" => 10,
"R11" => 11,
"R12" => 12,
"R13" => 13,
"R14" => 14,
"R15" => 15,
"CPSR" => 16,
"SPSR" => 17,
_=> -1
};
if (index != -1)
{
LibmGBA.BizSetRegister(Core, index, value);
}
}
[FeatureNotImplemented]

2
mgba

@ -1 +1 @@
Subproject commit c70b9a56dc3e197f400061b9635d4d9c1996e282
Subproject commit 13d650da6c89d5f82f03b73928b7d9f1643990c6

Binary file not shown.