Fix VerifiedDisassembler to not expose the internal cpu property
This commit is contained in:
parent
0765b559a1
commit
83124a8d20
|
@ -34,11 +34,11 @@ namespace BizHawk.Emulation.Common
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// does santiy checking on Cpu parameters
|
||||
/// does sanity checking on CPU parameters
|
||||
/// </summary>
|
||||
public abstract class VerifiedDisassembler : IDisassemblable
|
||||
{
|
||||
protected string _cpu;
|
||||
private string _cpu;
|
||||
|
||||
public virtual string Cpu
|
||||
{
|
||||
|
|
|
@ -1,33 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Components.ARM;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public class ArmV4Disassembler : VerifiedDisassembler
|
||||
{
|
||||
public override IEnumerable<string> AvailableCpus
|
||||
public override IEnumerable<string> AvailableCpus => new[]
|
||||
{
|
||||
get
|
||||
{
|
||||
return new[] { "ARM v4", "ARM v4 (Thumb)" };
|
||||
}
|
||||
}
|
||||
"ARM v4",
|
||||
"ARM v4 (Thumb)"
|
||||
};
|
||||
|
||||
public override string PCRegisterName
|
||||
{
|
||||
get { return "R15"; }
|
||||
}
|
||||
public override string PCRegisterName => "R15";
|
||||
|
||||
public override string Disassemble(MemoryDomain m, uint addr, out int length)
|
||||
{
|
||||
if (_cpu == "ARM v4 (Thumb)")
|
||||
if (Cpu == "ARM v4 (Thumb)")
|
||||
{
|
||||
addr &= unchecked((uint)~1);
|
||||
int op = m.PeekByte((int)addr) | m.PeekByte((int)addr + 1) << 8;
|
||||
string ret = Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr | 1, (uint)op);
|
||||
string ret = Darm.DisassembleStuff(addr | 1, (uint)op);
|
||||
length = 2;
|
||||
return ret;
|
||||
}
|
||||
|
@ -38,7 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
| m.PeekByte((int)addr + 1) << 8
|
||||
| m.PeekByte((int)addr + 2) << 16
|
||||
| m.PeekByte((int)addr + 3) << 24;
|
||||
string ret = Emulation.Cores.Components.ARM.Darm.DisassembleStuff(addr, (uint)op);
|
||||
string ret = Darm.DisassembleStuff(addr, (uint)op);
|
||||
length = 4;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue