parent
36a1c37cfe
commit
64ef1bfc17
|
@ -52,7 +52,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
|
|
||||||
public IMemoryCallbackSystem MemoryCallbacks => _memoryCallbacks;
|
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 _readCallback;
|
||||||
private LibMelonDS.MemoryCallback _writeCallback;
|
private LibMelonDS.MemoryCallback _writeCallback;
|
||||||
|
@ -67,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
{
|
{
|
||||||
if (getHasCBOfType())
|
if (getHasCBOfType())
|
||||||
{
|
{
|
||||||
MemoryCallbacks.CallMemoryCallbacks(address, 0, rawFlags, "System Bus");
|
MemoryCallbacks.CallMemoryCallbacks(address, 0, rawFlags, "ARM9 System Bus");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -576,7 +576,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
Size = 1L << 32;
|
Size = 1L << 32;
|
||||||
WordSize = 4;
|
WordSize = 4;
|
||||||
EndianType = Endian.Little;
|
EndianType = Endian.Little;
|
||||||
Writable = false;
|
Writable = true;
|
||||||
|
|
||||||
Arm9Bus = arm9;
|
Arm9Bus = arm9;
|
||||||
Arm7Bus = arm7;
|
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 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue