diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs index 8596f894c4..3957c0a618 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.IDebuggable.cs @@ -8,7 +8,6 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII { public partial class AppleII : IDebuggable { - [FeatureNotImplemented] public IDictionary GetCpuFlagsAndRegisters() { var regs = _machine.GetCpuFlagsAndRegisters(); @@ -27,10 +26,52 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII return dic; } - [FeatureNotImplemented] public void SetCpuRegister(string register, int value) { - throw new NotImplementedException(); + switch (register) + { + default: + throw new InvalidOperationException(); + case "A": + _machine.Cpu.RA = (byte)value; + break; + case "X": + _machine.Cpu.RX = (byte)value; + break; + case "Y": + _machine.Cpu.RY = (byte)value; + break; + case "S": + _machine.Cpu.RS = (byte)value; + break; + case "PC": + _machine.Cpu.RPC = (ushort)value; + break; + case "Flag C": + _machine.Cpu.FlagC = value > 0; + break; + case "Flag Z": + _machine.Cpu.FlagZ = value > 0; + break; + case "Flag I": + _machine.Cpu.FlagI = value > 0; + break; + case "Flag D": + _machine.Cpu.FlagD = value > 0; + break; + case "Flag B": + _machine.Cpu.FlagB = value > 0; + break; + case "Flag T": + _machine.Cpu.FlagT = value > 0; + break; + case "Flag V": + _machine.Cpu.FlagV = value > 0; + break; + case "Flag N": + _machine.Cpu.FlagV = value > 0; + break; + } } public bool CanStep(StepType type) { return false; } diff --git a/ExternalCoreProjects/Virtu/Cpu.cs b/ExternalCoreProjects/Virtu/Cpu.cs index e6258a81e8..1b0dcb027c 100644 --- a/ExternalCoreProjects/Virtu/Cpu.cs +++ b/ExternalCoreProjects/Virtu/Cpu.cs @@ -3206,12 +3206,12 @@ namespace Jellyfish.Virtu public bool IsThrottled { get; set; } public int Multiplier { get; set; } - public int RA { get; private set; } - public int RX { get; private set; } - public int RY { get; private set; } - public int RS { get; private set; } - public int RP { get; private set; } - public int RPC { get; private set; } + public int RA { get; set; } + public int RX { get; set; } + public int RY { get; set; } + public int RS { get; set; } + public int RP { get; set; } + public int RPC { get; set; } public int EA { get; private set; } public int CC { get; private set; } public int OpCode { get; private set; } @@ -3222,12 +3222,12 @@ namespace Jellyfish.Virtu private bool _is65C02; private Action[] _executeOpCode; - /// Carry Flag + /// Carry Flag [JsonIgnore] public bool FlagC { get { return (RP & 0x01) != 0; } - private set { RP = (byte)((RP & ~0x01) | (value ? 0x01 : 0x00)); } + set { RP = (byte)((RP & ~0x01) | (value ? 0x01 : 0x00)); } } /// Zero Flag @@ -3235,7 +3235,7 @@ namespace Jellyfish.Virtu public bool FlagZ { get { return (RP & 0x02) != 0; } - private set { RP = (byte)((RP & ~0x02) | (value ? 0x02 : 0x00)); } + set { RP = (byte)((RP & ~0x02) | (value ? 0x02 : 0x00)); } } /// Interrupt Disable Flag @@ -3251,7 +3251,7 @@ namespace Jellyfish.Virtu public bool FlagD { get { return (RP & 0x08) != 0; } - private set { RP = (byte)((RP & ~0x08) | (value ? 0x08 : 0x00)); } + set { RP = (byte)((RP & ~0x08) | (value ? 0x08 : 0x00)); } } /// Break Flag @@ -3259,7 +3259,7 @@ namespace Jellyfish.Virtu public bool FlagB { get { return (RP & 0x10) != 0; } - private set { RP = (byte)((RP & ~0x10) | (value ? 0x10 : 0x00)); } + set { RP = (byte)((RP & ~0x10) | (value ? 0x10 : 0x00)); } } /// T... Flag @@ -3267,7 +3267,7 @@ namespace Jellyfish.Virtu public bool FlagT { get { return (RP & 0x20) != 0; } - private set { RP = (byte)((RP & ~0x20) | (value ? 0x20 : 0x00)); } + set { RP = (byte)((RP & ~0x20) | (value ? 0x20 : 0x00)); } } /// Overflow Flag @@ -3275,7 +3275,7 @@ namespace Jellyfish.Virtu public bool FlagV { get { return (RP & 0x40) != 0; } - private set { RP = (byte)((RP & ~0x40) | (value ? 0x40 : 0x00)); } + set { RP = (byte)((RP & ~0x40) | (value ? 0x40 : 0x00)); } } /// Negative Flag @@ -3283,7 +3283,7 @@ namespace Jellyfish.Virtu public bool FlagN { get { return (RP & 0x80) != 0; } - private set { RP = (byte)((RP & ~0x80) | (value ? 0x80 : 0x00)); } + set { RP = (byte)((RP & ~0x80) | (value ? 0x80 : 0x00)); } } } } diff --git a/References/Virtu.dll b/References/Virtu.dll index 0919675fee..91fdc3c778 100644 Binary files a/References/Virtu.dll and b/References/Virtu.dll differ