diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs index a35d857290..0ecf734c2b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.IDebuggable.cs @@ -52,7 +52,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS public IMemoryCallbackSystem MemoryCallbacks => _memoryCallbacks; - private readonly MemoryCallbackSystem _memoryCallbacks = new(new[] { "System Bus" }); + // FIXME: internally the code actually just does this for either bus (probably don't want to bother adding support) + private readonly MemoryCallbackSystem _memoryCallbacks = new([ "ARM9 System Bus" ]); private LibMelonDS.MemoryCallback _readCallback; private LibMelonDS.MemoryCallback _writeCallback; @@ -67,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS { if (getHasCBOfType()) { - MemoryCallbacks.CallMemoryCallbacks(address, 0, rawFlags, "System Bus"); + MemoryCallbacks.CallMemoryCallbacks(address, 0, rawFlags, "ARM9 System Bus"); } }; } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs index 71b59712e0..aba1a36105 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs @@ -576,7 +576,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS Size = 1L << 32; WordSize = 4; EndianType = Endian.Little; - Writable = false; + Writable = true; Arm9Bus = arm9; Arm7Bus = arm7; @@ -596,7 +596,17 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS public override byte PeekByte(long addr) => UseArm9 ? Arm9Bus.PeekByte(addr) : Arm7Bus.PeekByte(addr); - public override void PokeByte(long addr, byte val) => throw new InvalidOperationException(); + public override void PokeByte(long addr, byte val) + { + if (UseArm9) + { + Arm9Bus.PokeByte(addr, val); + } + else + { + Arm7Bus.PokeByte(addr, val); + } + } } } }