diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 092aad3021..8c38a41d73 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -575,6 +575,7 @@ + diff --git a/BizHawk.Emulation.Cores/CPUs/HuC6280/IDisassemblable.cs b/BizHawk.Emulation.Cores/CPUs/HuC6280/IDisassemblable.cs new file mode 100644 index 0000000000..688890ec68 --- /dev/null +++ b/BizHawk.Emulation.Cores/CPUs/HuC6280/IDisassemblable.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BizHawk.Emulation.Common; + +namespace BizHawk.Emulation.Cores.Components.H6280 +{ + partial class HuC6280 : IDisassemblable + { + public string Cpu + { + get { return "6280"; } + set { } + } + + public string PCRegisterName + { + get { return "PC"; } + } + + public IEnumerable AvailableCpus + { + get { yield return "6280"; } + } + + public string Disassemble(MemoryDomain m, uint addr, out int length) + { + if (m.Size != 0x10000) + throw new InvalidOperationException("Something needs to be figured out..."); + + return DisassembleExt((ushort)addr, out length, + (a) => m.PeekByte(a), + (a) => (ushort)(m.PeekByte(a) | m.PeekByte(a + 1) << 8)); + + } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 43e0c3ef89..bdab94b22f 100644 --- a/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -68,9 +68,6 @@ namespace BizHawk.Emulation.Cores.PCEngine [CoreConstructor("PCE", "SGX")] public PCEngine(CoreComm comm, GameInfo game, byte[] rom, object Settings, object syncSettings) { - ServiceProvider = new BasicServiceProvider(this); - Tracer = new TraceBuffer(); - (ServiceProvider as BasicServiceProvider).Register(Tracer); MemoryCallbacks = new MemoryCallbackSystem(); CoreComm = comm; @@ -90,6 +87,14 @@ namespace BizHawk.Emulation.Cores.PCEngine _syncSettings = (PCESyncSettings)syncSettings ?? new PCESyncSettings(); Init(game, rom); SetControllerButtons(); + + { + var ser = new BasicServiceProvider(this); + ServiceProvider = ser; + Tracer = new TraceBuffer(); + ser.Register(Tracer); + ser.Register(Cpu); + } } public IEmulatorServiceProvider ServiceProvider { get; private set; } @@ -491,6 +496,21 @@ namespace BizHawk.Emulation.Cores.PCEngine }); domains.Add(SystemBusDomain); + var CpuBusDomain = new MemoryDomain("CPU Bus", 0x10000, MemoryDomain.Endian.Little, + (addr) => + { + if (addr < 0 || addr >= 0x10000) + throw new ArgumentOutOfRangeException(); + return Cpu.ReadMemory((ushort)addr); + }, + (addr, value) => + { + if (addr < 0 || addr >= 0x10000) + throw new ArgumentOutOfRangeException(); + Cpu.WriteMemory((ushort)addr, value); + }); + domains.Add(CpuBusDomain); + var RomDomain = new MemoryDomain("ROM", RomLength, MemoryDomain.Endian.Little, addr => RomData[addr], (addr, value) => RomData[addr] = value);