diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 60b0580317..1e7a2f79ba 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -145,9 +145,10 @@ + + - diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs new file mode 100644 index 0000000000..baa1c9314f --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.IDebuggable.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; + +using BizHawk.Emulation.Common; + +namespace BizHawk.Emulation.Cores.Atari.Atari2600 +{ + public partial class Atari2600 : IDebuggable + { + public IDictionary GetCpuFlagsAndRegisters() + { + return new Dictionary + { + { "A", Cpu.A }, + { "X", Cpu.X }, + { "Y", Cpu.Y }, + { "S", Cpu.S }, + { "PC", Cpu.PC }, + + { "Flag C", Cpu.FlagC ? 1 : 0 }, + { "Flag Z", Cpu.FlagZ ? 1 : 0 }, + { "Flag I", Cpu.FlagI ? 1 : 0 }, + { "Flag D", Cpu.FlagD ? 1 : 0 }, + + { "Flag B", Cpu.FlagB ? 1 : 0 }, + { "Flag V", Cpu.FlagV ? 1 : 0 }, + { "Flag N", Cpu.FlagN ? 1 : 0 }, + { "Flag T", Cpu.FlagT ? 1 : 0 } + }; + } + + public void SetCpuRegister(string register, int value) + { + switch (register) + { + default: + throw new InvalidOperationException(); + case "A": + Cpu.A = (byte)value; + break; + case "X": + Cpu.X = (byte)value; + break; + case "Y": + Cpu.Y = (byte)value; + break; + case "S": + Cpu.S = (byte)value; + break; + case "PC": + Cpu.PC = (ushort)value; + break; + case "Flag I": + Cpu.FlagI = value > 0; + break; + } + } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Settings.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.ISettable.cs similarity index 96% rename from BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Settings.cs rename to BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.ISettable.cs index 4723711cf2..e2d26d54f2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.Settings.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.ISettable.cs @@ -1,8 +1,10 @@ using System; using System.ComponentModel; using System.Drawing; -using BizHawk.Emulation.Common; + using Newtonsoft.Json; + +using BizHawk.Emulation.Common; using BizHawk.Common; namespace BizHawk.Emulation.Cores.Atari.Atari2600 @@ -24,7 +26,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 if (Settings == null || Settings.SECAMColors != o.SECAMColors) { if (_tia != null) + { _tia.SetSECAM(o.SECAMColors); + } } Settings = o; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index 262c2d09d2..e19d75aa3c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 isPorted: false, isReleased: true )] - public partial class Atari2600 : IEmulator, IMemoryDomains, IDebuggable + public partial class Atari2600 : IEmulator, IMemoryDomains, IDebuggable, ISettable { private readonly GameInfo _game; private bool _islag = true; @@ -122,54 +122,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 }; } - public IDictionary GetCpuFlagsAndRegisters() - { - return new Dictionary - { - { "A", Cpu.A }, - { "X", Cpu.X }, - { "Y", Cpu.Y }, - { "S", Cpu.S }, - { "PC", Cpu.PC }, - - { "Flag C", Cpu.FlagC ? 1 : 0 }, - { "Flag Z", Cpu.FlagZ ? 1 : 0 }, - { "Flag I", Cpu.FlagI ? 1 : 0 }, - { "Flag D", Cpu.FlagD ? 1 : 0 }, - - { "Flag B", Cpu.FlagB ? 1 : 0 }, - { "Flag V", Cpu.FlagV ? 1 : 0 }, - { "Flag N", Cpu.FlagN ? 1 : 0 }, - { "Flag T", Cpu.FlagT ? 1 : 0 } - }; - } - - public void SetCpuRegister(string register, int value) - { - switch(register) - { - default: - throw new InvalidOperationException(); - case "A": - Cpu.A = (byte)value; - break; - case "X": - Cpu.X = (byte)value; - break; - case "Y": - Cpu.Y = (byte)value; - break; - case "S": - Cpu.S = (byte)value; - break; - case "PC": - Cpu.PC = (ushort)value; - break; - case "Flag I": - Cpu.FlagI = value > 0; - break; - } - } + public bool StartAsyncSound() { return true; }