pce: disassemble
This commit is contained in:
parent
efc8d26ac7
commit
574cd2f649
|
@ -575,6 +575,7 @@
|
|||
<Compile Include="CPUs\HuC6280\Disassembler.cs" />
|
||||
<Compile Include="CPUs\HuC6280\Execute.cs" />
|
||||
<Compile Include="CPUs\HuC6280\HuC6280.cs" />
|
||||
<Compile Include="CPUs\HuC6280\IDisassemblable.cs" />
|
||||
<Compile Include="CPUs\MOS 6502X\Disassembler.cs" />
|
||||
<Compile Include="CPUs\MOS 6502X\Execute.cs" />
|
||||
<Compile Include="CPUs\MOS 6502X\MOS6502X.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<string> 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));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<ITraceable>(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<ITraceable>(Tracer);
|
||||
ser.Register<IDisassemblable>(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);
|
||||
|
|
Loading…
Reference in New Issue