diff --git a/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs index 7ab9b7b5c3..17db7e3aed 100644 --- a/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.cs @@ -58,7 +58,6 @@ namespace BizHawk new KeyValuePair("Flag V", cpu.FlagV ? 1 : 0), new KeyValuePair("Flag N", cpu.FlagN ? 1 : 0), new KeyValuePair("Flag T", cpu.FlagT ? 1 : 0) - }; } diff --git a/BizHawk.Emulation/Consoles/Calculator/TI83.cs b/BizHawk.Emulation/Consoles/Calculator/TI83.cs index aef8be61eb..2c651fe74f 100644 --- a/BizHawk.Emulation/Consoles/Calculator/TI83.cs +++ b/BizHawk.Emulation/Consoles/Calculator/TI83.cs @@ -43,7 +43,39 @@ namespace BizHawk.Emulation.Consoles.Calculator public List> GetCpuFlagsAndRegisters() { - throw new NotImplementedException(); + return new List> + { + new KeyValuePair("A", cpu.RegisterA), + new KeyValuePair("AF", cpu.RegisterAF), + new KeyValuePair("B", cpu.RegisterB), + new KeyValuePair("BC", cpu.RegisterBC), + new KeyValuePair("C", cpu.RegisterC), + new KeyValuePair("D", cpu.RegisterD), + new KeyValuePair("DE", cpu.RegisterDE), + new KeyValuePair("E", cpu.RegisterE), + new KeyValuePair("F", cpu.RegisterF), + new KeyValuePair("H", cpu.RegisterH), + new KeyValuePair("HL", cpu.RegisterHL), + new KeyValuePair("I", cpu.RegisterI), + new KeyValuePair("IX", cpu.RegisterIX), + new KeyValuePair("IY", cpu.RegisterIY), + new KeyValuePair("L", cpu.RegisterL), + new KeyValuePair("PC", cpu.RegisterPC), + new KeyValuePair("R", cpu.RegisterR), + new KeyValuePair("Shadow AF", cpu.RegisterShadowAF), + new KeyValuePair("Shadow BC", cpu.RegisterShadowBC), + new KeyValuePair("Shadow DE", cpu.RegisterShadowDE), + new KeyValuePair("Shadow HL", cpu.RegisterShadowHL), + new KeyValuePair("SP", cpu.RegisterSP), + new KeyValuePair("Flag C", cpu.RegisterF.Bit(0) ? 1 : 0), + new KeyValuePair("Flag N", cpu.RegisterF.Bit(1) ? 1 : 0), + new KeyValuePair("Flag P/V", cpu.RegisterF.Bit(2) ? 1 : 0), + new KeyValuePair("Flag 3rd", cpu.RegisterF.Bit(3) ? 1 : 0), + new KeyValuePair("Flag H", cpu.RegisterF.Bit(4) ? 1 : 0), + new KeyValuePair("Flag 5th", cpu.RegisterF.Bit(5) ? 1 : 0), + new KeyValuePair("Flag Z", cpu.RegisterF.Bit(6) ? 1 : 0), + new KeyValuePair("Flag S", cpu.RegisterF.Bit(7) ? 1 : 0), + }; } public byte ReadMemory(ushort addr) diff --git a/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs index eb7decdbf9..dc2e005c34 100644 --- a/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation/Consoles/Coleco/ColecoVision.cs @@ -82,14 +82,46 @@ namespace BizHawk.Emulation.Consoles.Coleco public List> GetCpuFlagsAndRegisters() { - throw new NotImplementedException(); + return new List> + { + new KeyValuePair("A", Cpu.RegisterA), + new KeyValuePair("AF", Cpu.RegisterAF), + new KeyValuePair("B", Cpu.RegisterB), + new KeyValuePair("BC", Cpu.RegisterBC), + new KeyValuePair("C", Cpu.RegisterC), + new KeyValuePair("D", Cpu.RegisterD), + new KeyValuePair("DE", Cpu.RegisterDE), + new KeyValuePair("E", Cpu.RegisterE), + new KeyValuePair("F", Cpu.RegisterF), + new KeyValuePair("H", Cpu.RegisterH), + new KeyValuePair("HL", Cpu.RegisterHL), + new KeyValuePair("I", Cpu.RegisterI), + new KeyValuePair("IX", Cpu.RegisterIX), + new KeyValuePair("IY", Cpu.RegisterIY), + new KeyValuePair("L", Cpu.RegisterL), + new KeyValuePair("PC", Cpu.RegisterPC), + new KeyValuePair("R", Cpu.RegisterR), + new KeyValuePair("Shadow AF", Cpu.RegisterShadowAF), + new KeyValuePair("Shadow BC", Cpu.RegisterShadowBC), + new KeyValuePair("Shadow DE", Cpu.RegisterShadowDE), + new KeyValuePair("Shadow HL", Cpu.RegisterShadowHL), + new KeyValuePair("SP", Cpu.RegisterSP), + new KeyValuePair("Flag C", Cpu.RegisterF.Bit(0) ? 1 : 0), + new KeyValuePair("Flag N", Cpu.RegisterF.Bit(1) ? 1 : 0), + new KeyValuePair("Flag P/V", Cpu.RegisterF.Bit(2) ? 1 : 0), + new KeyValuePair("Flag 3rd", Cpu.RegisterF.Bit(3) ? 1 : 0), + new KeyValuePair("Flag H", Cpu.RegisterF.Bit(4) ? 1 : 0), + new KeyValuePair("Flag 5th", Cpu.RegisterF.Bit(5) ? 1 : 0), + new KeyValuePair("Flag Z", Cpu.RegisterF.Bit(6) ? 1 : 0), + new KeyValuePair("Flag S", Cpu.RegisterF.Bit(7) ? 1 : 0), + }; } - void LoadRom(byte[] rom, bool skipbios) - { - RomData = new byte[0x8000]; - for (int i = 0; i < 0x8000; i++) - RomData[i] = rom[i % rom.Length]; + void LoadRom(byte[] rom, bool skipbios) + { + RomData = new byte[0x8000]; + for (int i = 0; i < 0x8000; i++) + RomData[i] = rom[i % rom.Length]; // hack to skip colecovision title screen if (skipbios) @@ -97,7 +129,7 @@ namespace BizHawk.Emulation.Consoles.Coleco RomData[0] = 0x55; RomData[1] = 0xAA; } - } + } byte ReadPort(ushort port) { @@ -110,12 +142,12 @@ namespace BizHawk.Emulation.Consoles.Coleco return VDP.ReadVdpStatus(); } - if (port >= 0xE0) - { - if ((port & 1) == 0) - return ReadController1(); - return ReadController2(); - } + if (port >= 0xE0) + { + if ((port & 1) == 0) + return ReadController1(); + return ReadController2(); + } return 0xFF; } @@ -124,7 +156,7 @@ namespace BizHawk.Emulation.Consoles.Coleco { port &= 0xFF; - if (port >= 0xA0 && port <= 0xBF) + if (port >= 0xA0 && port <= 0xBF) { if ((port & 1) == 0) VDP.WriteVdpData(value); @@ -133,23 +165,23 @@ namespace BizHawk.Emulation.Consoles.Coleco return; } - if (port >= 0x80 && port <= 0x9F) - { - InputPortSelection = InputPortMode.Right; - return; - } + if (port >= 0x80 && port <= 0x9F) + { + InputPortSelection = InputPortMode.Right; + return; + } - if (port >= 0xC0 && port <= 0xDF) - { - InputPortSelection = InputPortMode.Left; - return; - } + if (port >= 0xC0 && port <= 0xDF) + { + InputPortSelection = InputPortMode.Left; + return; + } - if (port >= 0xE0) - { - PSG.WritePsgData(value, Cpu.TotalExecutedCycles); - return; - } + if (port >= 0xE0) + { + PSG.WritePsgData(value, Cpu.TotalExecutedCycles); + return; + } } public byte[] ReadSaveRam() { return null; } @@ -158,7 +190,7 @@ namespace BizHawk.Emulation.Consoles.Coleco public bool SaveRamModified { get; set; } public bool DeterministicEmulation { get { return true; } } - + public void SaveStateText(TextWriter writer) { writer.WriteLine("[Coleco]\n"); @@ -173,7 +205,7 @@ namespace BizHawk.Emulation.Consoles.Coleco Ram.SaveAsHex(writer); writer.WriteLine("[/Coleco]"); } - + public void LoadStateText(TextReader reader) { while (true) diff --git a/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs b/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs index b0b5a24b35..bdbafca63f 100644 --- a/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs +++ b/BizHawk.Emulation/Consoles/Sega/SMS/SMS.cs @@ -80,7 +80,39 @@ namespace BizHawk.Emulation.Consoles.Sega public List> GetCpuFlagsAndRegisters() { - throw new NotImplementedException(); + return new List> + { + new KeyValuePair("A", Cpu.RegisterA), + new KeyValuePair("AF", Cpu.RegisterAF), + new KeyValuePair("B", Cpu.RegisterB), + new KeyValuePair("BC", Cpu.RegisterBC), + new KeyValuePair("C", Cpu.RegisterC), + new KeyValuePair("D", Cpu.RegisterD), + new KeyValuePair("DE", Cpu.RegisterDE), + new KeyValuePair("E", Cpu.RegisterE), + new KeyValuePair("F", Cpu.RegisterF), + new KeyValuePair("H", Cpu.RegisterH), + new KeyValuePair("HL", Cpu.RegisterHL), + new KeyValuePair("I", Cpu.RegisterI), + new KeyValuePair("IX", Cpu.RegisterIX), + new KeyValuePair("IY", Cpu.RegisterIY), + new KeyValuePair("L", Cpu.RegisterL), + new KeyValuePair("PC", Cpu.RegisterPC), + new KeyValuePair("R", Cpu.RegisterR), + new KeyValuePair("Shadow AF", Cpu.RegisterShadowAF), + new KeyValuePair("Shadow BC", Cpu.RegisterShadowBC), + new KeyValuePair("Shadow DE", Cpu.RegisterShadowDE), + new KeyValuePair("Shadow HL", Cpu.RegisterShadowHL), + new KeyValuePair("SP", Cpu.RegisterSP), + new KeyValuePair("Flag C", Cpu.RegisterF.Bit(0) ? 1 : 0), + new KeyValuePair("Flag N", Cpu.RegisterF.Bit(1) ? 1 : 0), + new KeyValuePair("Flag P/V", Cpu.RegisterF.Bit(2) ? 1 : 0), + new KeyValuePair("Flag 3rd", Cpu.RegisterF.Bit(3) ? 1 : 0), + new KeyValuePair("Flag H", Cpu.RegisterF.Bit(4) ? 1 : 0), + new KeyValuePair("Flag 5th", Cpu.RegisterF.Bit(5) ? 1 : 0), + new KeyValuePair("Flag Z", Cpu.RegisterF.Bit(6) ? 1 : 0), + new KeyValuePair("Flag S", Cpu.RegisterF.Bit(7) ? 1 : 0), + }; } public int LagCount { get { return _lagcount; } set { _lagcount = value; } }