diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs index c3f3064fca..a59af3dc2c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/LibmGBA.cs @@ -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); diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs index 2726f8ec96..0936bcd607 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBA/MGBAHawk.IDebuggable.cs @@ -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] diff --git a/mgba b/mgba index c70b9a56dc..13d650da6c 160000 --- a/mgba +++ b/mgba @@ -1 +1 @@ -Subproject commit c70b9a56dc3e197f400061b9635d4d9c1996e282 +Subproject commit 13d650da6c89d5f82f03b73928b7d9f1643990c6 diff --git a/output/dll/mgba.dll b/output/dll/mgba.dll index eeabb7d39b..0316c5c775 100644 Binary files a/output/dll/mgba.dll and b/output/dll/mgba.dll differ