From 660fb500aefaad74c0949efc7275b5871efaedec Mon Sep 17 00:00:00 2001 From: Asnivor Date: Thu, 14 Jun 2018 11:31:09 +0100 Subject: [PATCH] ZXHawk: codebase cleanup --- .../BizHawk.Emulation.Cores.csproj | 3 - .../Hardware/Abstraction/IBeeperDevice.cs | 25 +- .../Hardware/Abstraction/IFDDHost.cs | 7 +- .../Hardware/Abstraction/IJoystick.cs | 8 +- .../Hardware/Abstraction/IKeyboard.cs | 6 +- .../Hardware/Abstraction/IPSG.cs | 5 - .../Hardware/Abstraction/IPortIODevice.cs | 7 +- .../Hardware/Datacorder/DatacorderDevice.cs | 3 - .../SinclairSpectrum/Hardware/Disk/CHRN.cs | 7 +- .../Hardware/Disk/NECUPD765.Definitions.cs | 4 - .../Hardware/Disk/NECUPD765.FDC.cs | 3 - .../Hardware/Disk/NECUPD765.FDD.cs | 3 - .../Hardware/Disk/NECUPD765.IPortIODevice.cs | 8 +- .../Hardware/Disk/NECUPD765.Registers.cs | 554 ------------------ .../Hardware/Disk/NECUPD765.Timing.cs | 33 +- .../Hardware/Disk/NECUPD765.cs | 5 - .../Hardware/Disk/NECUPS765.Static.cs | 7 +- .../Hardware/Input/CursorJoystick.cs | 6 +- .../Hardware/Input/KempstonJoystick.cs | 6 +- .../Hardware/Input/NullJoystick.cs | 6 +- .../Hardware/Input/SinclairJoystick1.cs | 6 +- .../Hardware/Input/SinclairJoystick2.cs | 6 +- .../Hardware/Input/StandardKeyboard.cs | 129 ---- .../SinclairSpectrum/Hardware/Rom/RomData.cs | 24 +- .../Hardware/SoundOuput/AY38912.cs | 3 - .../Hardware/SoundOuput/Beeper.cs | 14 - .../Hardware/SoundOuput/Buzzer.cs | 325 ---------- .../Hardware/SoundOuput/Pulse.cs | 26 - .../SinclairSpectrum/Machine/CPUMonitor.cs | 9 +- .../SinclairSpectrum/Machine/MachineType.cs | 10 +- .../Machine/SpectrumBase.Input.cs | 6 +- .../Machine/SpectrumBase.Media.cs | 8 +- .../Machine/SpectrumBase.Memory.cs | 4 - .../Machine/SpectrumBase.Port.cs | 7 +- .../SinclairSpectrum/Machine/SpectrumBase.cs | 3 - .../Computers/SinclairSpectrum/Machine/ULA.cs | 5 +- .../Machine/ZXSpectrum128K/ZX128.Memory.cs | 10 +- .../Machine/ZXSpectrum128K/ZX128.Port.cs | 7 +- .../Machine/ZXSpectrum128K/ZX128.Screen.cs | 10 +- .../Machine/ZXSpectrum128K/ZX128.cs | 17 +- .../Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs | 4 - .../ZX128Plus2a.Memory.cs | 3 + .../ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs | 7 +- .../ZX128Plus2a.Screen.cs | 10 +- .../ZXSpectrum128KPlus2a/ZX128Plus2a.cs | 12 +- .../ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs | 3 + .../ZXSpectrum128KPlus3/ZX128Plus3.Port.cs | 7 +- .../Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs | 12 +- .../Machine/ZXSpectrum16K/ZX16.cs | 7 +- .../Machine/ZXSpectrum48K/ZX48.Memory.cs | 3 + .../Machine/ZXSpectrum48K/ZX48.Port.cs | 10 +- .../Machine/ZXSpectrum48K/ZX48.Screen.cs | 10 +- .../Machine/ZXSpectrum48K/ZX48.cs | 6 +- .../Media/Disk/CPCExtendedFloppyDisk.cs | 7 +- .../Media/Disk/CPCFloppyDisk.cs | 7 +- .../SinclairSpectrum/Media/Disk/DiskType.cs | 7 +- .../SinclairSpectrum/Media/Disk/FloppyDisk.cs | 4 +- .../SinclairSpectrum/Media/MediaConverter.cs | 6 +- .../Media/MediaConverterType.cs | 7 +- .../Media/Tape/TapConverter.cs | 1 - .../Media/Tape/TapeCommand.cs | 7 +- .../Media/Tape/TapeDataBlock.cs | 2 - .../Media/Tape/TzxConverter.cs | 2 - .../SinclairSpectrum/SoundProviderMixer.cs | 3 +- .../ZXSpectrum.Controllers.cs | 43 +- .../ZXSpectrum.IDebuggable.cs | 6 +- .../SinclairSpectrum/ZXSpectrum.IEmulator.cs | 7 +- .../ZXSpectrum.IInputPollable.cs | 7 +- .../ZXSpectrum.IMemoryDomains.cs | 7 +- .../SinclairSpectrum/ZXSpectrum.ISettable.cs | 12 +- .../SinclairSpectrum/ZXSpectrum.IStatable.cs | 5 +- .../SinclairSpectrum/ZXSpectrum.Messaging.cs | 5 +- .../SinclairSpectrum/ZXSpectrum.Util.cs | 7 +- .../Computers/SinclairSpectrum/ZXSpectrum.cs | 5 +- 74 files changed, 166 insertions(+), 1420 deletions(-) delete mode 100644 BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Registers.cs delete mode 100644 BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Buzzer.cs delete mode 100644 BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Pulse.cs diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index de8a7e7314..08933f73d1 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -274,14 +274,12 @@ - - @@ -314,7 +312,6 @@ - diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IBeeperDevice.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IBeeperDevice.cs index 2e4d2dea50..3988706911 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IBeeperDevice.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IBeeperDevice.cs @@ -1,22 +1,29 @@ using BizHawk.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// Represents a beeper/buzzer device + /// public interface IBeeperDevice { + /// + /// Initialisation + /// + /// + /// void Init(int sampleRate, int tStatesPerFrame); + /// + /// Processes an incoming pulse value and adds it to the blipbuffer + /// + /// void ProcessPulseValue(bool pulse); - void StartFrame(); - - void EndFrame(); - + /// + /// State serialization + /// + /// void SyncState(Serializer ser); } } diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs index fd2a3016db..a62c6fe567 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IFDDHost.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IJoystick.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IJoystick.cs index 6421e99af4..b971e3c412 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IJoystick.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IJoystick.cs @@ -1,10 +1,4 @@ -using BizHawk.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IKeyboard.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IKeyboard.cs index 77282f1dfa..278d39b6fd 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IKeyboard.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IKeyboard.cs @@ -1,6 +1,4 @@ - - -using BizHawk.Common; +using BizHawk.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { @@ -77,8 +75,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// byte GetByteFromKeyMatrix(string key); - - void SyncState(Serializer ser); } } diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPSG.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPSG.cs index d359103d27..f3cde8c900 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPSG.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPSG.cs @@ -1,10 +1,5 @@ using BizHawk.Common; using BizHawk.Emulation.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPortIODevice.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPortIODevice.cs index 2fbd89a0db..4a30e5eaa6 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPortIODevice.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Abstraction/IPortIODevice.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs index abaa462406..6701d0a923 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs @@ -1,12 +1,9 @@ using BizHawk.Common; using BizHawk.Emulation.Cores.Components.Z80A; using System; -using System.Collections; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/CHRN.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/CHRN.cs index b5bba9600d..d9f5c9822e 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/CHRN.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/CHRN.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs index f1e89de394..0d025e4e24 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Definitions.cs @@ -1,9 +1,5 @@ using BizHawk.Common; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs index 90c8998f78..2e1a99a806 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDC.cs @@ -1,10 +1,7 @@ using BizHawk.Common.NumberExtensions; -using System; using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs index d5e7d9f4d7..5cf84876f5 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs @@ -1,10 +1,7 @@ using BizHawk.Common; using BizHawk.Common.NumberExtensions; using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs index f2e6d3e67d..b1ed8bce99 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.IPortIODevice.cs @@ -1,9 +1,6 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { @@ -20,6 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum #endregion public partial class NECUPD765 : IPortIODevice { + #region Dev Logging public string outputfile = @"D:\Dropbox\Dropbox\_Programming\TASVideos\BizHawk\output\zxhawkio-" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".csv"; public string outputString = "STATUS,WRITE,READ,CODE,MT,MF,SK,CMDCNT,RESCNT,EXECCNT,EXECLEN\r\n"; @@ -48,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } sb.Append(ActiveCommand.CommandCode).Append(","); - + sb.Append(CMD_FLAG_MT).Append(","); sb.Append(CMD_FLAG_MF).Append(","); sb.Append(CMD_FLAG_SK).Append(","); @@ -63,6 +61,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum outputString += sb.ToString(); } + #endregion + /// /// Device responds to an IN instruction /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Registers.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Registers.cs deleted file mode 100644 index 9ce1f467c8..0000000000 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Registers.cs +++ /dev/null @@ -1,554 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum -{ - /// - /// Registers - /// - #region Attribution - /* - Implementation based on the information contained here: - http://www.cpcwiki.eu/index.php/765_FDC - and here: - http://www.cpcwiki.eu/imgs/f/f3/UPD765_Datasheet_OCRed.pdf - */ - #endregion - public partial class NECUPD765 - { - /* - - #region Main Status Register - - /// - /// Main status register (accessed via reads to port 0x2ffd) - /// - private byte _RegMain; - - /// - /// FDD0 Busy (seek/recalib active, until succesful sense intstat) - /// - private bool MainDB0 - { - get { return GetBit(0, _RegMain); } - set - { - if (value) { SetBit(0, ref _RegMain); } - else { UnSetBit(0, ref _RegMain); } - } - } - - /// - /// FDD1 Busy (seek/recalib active, until succesful sense intstat) - /// - private bool MainDB1 - { - get { return GetBit(1, _RegMain); } - set - { - if (value) { SetBit(1, ref _RegMain); } - else { UnSetBit(1, ref _RegMain); } - } - } - - /// - /// FDD2 Busy (seek/recalib active, until succesful sense intstat) - /// - private bool MainDB2 - { - get { return GetBit(2, _RegMain); } - set - { - if (value) { SetBit(2, ref _RegMain); } - else { UnSetBit(2, ref _RegMain); } - } - } - - /// - /// FDD3 Busy (seek/recalib active, until succesful sense intstat) - /// - private bool MainDB3 - { - get { return GetBit(3, _RegMain); } - set - { - if (value) { SetBit(3, ref _RegMain); } - else { UnSetBit(3, ref _RegMain); } - } - } - - /// - /// FDC Busy (still in command-, execution- or result-phase) - /// - private bool MainCB - { - get { return GetBit(4, _RegMain); } - set - { - if (value) { SetBit(4, ref _RegMain); } - else { UnSetBit(4, ref _RegMain); } - } - } - - /// - /// Execution Mode (still in execution-phase, non_DMA_only) - /// - private bool MainEXM - { - get { return GetBit(5, _RegMain); } - set - { - if (value) { SetBit(5, ref _RegMain); } - else { UnSetBit(5, ref _RegMain); } - } - } - - /// - /// Data Input/Output (0=CPU->FDC, 1=FDC->CPU) (see b7) - /// - private bool MainDIO - { - get { return GetBit(6, _RegMain); } - set - { - if (value) { SetBit(6, ref _RegMain); } - else { UnSetBit(6, ref _RegMain); } - } - } - - /// - /// Request For Master (1=ready for next byte) (see b6 for direction) - /// - private bool MainRQM - { - get { return GetBit(7, _RegMain); } - set - { - if (value) { SetBit(7, ref _RegMain); } - else { UnSetBit(7, ref _RegMain); } - } - } - - #endregion - - #region Status Register 0 - - /// - /// Status Register 0 - /// - private byte _Reg0; - - /// - /// Unit Select (driveno during interrupt) - /// - private bool ST0US0 - { - get { return GetBit(0, _Reg0); } - set - { - if (value) { SetBit(0, ref _Reg0); } - else { UnSetBit(0, ref _Reg0); } - } - } - - /// - /// Unit Select (driveno during interrupt) - /// - private bool ST0US1 - { - get { return GetBit(1, _Reg0); } - set - { - if (value) { SetBit(1, ref _Reg0); } - else { UnSetBit(1, ref _Reg0); } - } - } - - /// - /// Head Address (head during interrupt) - /// - private bool ST0HD - { - get { return GetBit(2, _Reg0); } - set - { - if (value) { SetBit(2, ref _Reg0); } - else { UnSetBit(2, ref _Reg0); } - } - } - - /// - /// Not Ready (drive not ready or non-existing 2nd head selected) - /// - private bool ST0NR - { - get { return GetBit(3, _Reg0); } - set - { - if (value) { SetBit(3, ref _Reg0); } - else { UnSetBit(3, ref _Reg0); } - } - } - - /// - /// Equipment Check (drive failure or recalibrate failed (retry)) - /// - private bool ST0EC - { - get { return GetBit(4, _Reg0); } - set - { - if (value) { SetBit(4, ref _Reg0); } - else { UnSetBit(4, ref _Reg0); } - } - } - - /// - /// Seek End (Set if seek-command completed) - /// - private bool ST0SE - { - get { return GetBit(5, _Reg0); } - set - { - if (value) { SetBit(5, ref _Reg0); } - else { UnSetBit(5, ref _Reg0); } - } - } - - /// - /// Interrupt Code (0=OK, 1=aborted:readfail/OK if EN, 2=unknown cmd - /// or senseint with no int occured, 3=aborted:disc removed etc.) - /// - private bool ST0IC0 - { - get { return GetBit(6, _Reg0); } - set - { - if (value) { SetBit(6, ref _Reg0); } - else { UnSetBit(6, ref _Reg0); } - } - } - - /// - /// Interrupt Code (0=OK, 1=aborted:readfail/OK if EN, 2=unknown cmd - /// or senseint with no int occured, 3=aborted:disc removed etc.) - /// - private bool ST0IC1 - { - get { return GetBit(7, _Reg0); } - set - { - if (value) { SetBit(7, ref _Reg0); } - else { UnSetBit(7, ref _Reg0); } - } - } - - #endregion - - #region Status Register 1 - - /// - /// Status Register 1 - /// - private byte _Reg1; - - /// - /// Missing Address Mark (Sector_ID or DAM not found) - /// - private bool ST1MA - { - get { return GetBit(0, _Reg1); } - set - { - if (value) { SetBit(0, ref _Reg1); } - else { UnSetBit(0, ref _Reg1); } - } - } - - /// - /// Not Writeable (tried to write/format disc with wprot_tab=on) - /// - private bool ST1NW - { - get { return GetBit(1, _Reg1); } - set - { - if (value) { SetBit(1, ref _Reg1); } - else { UnSetBit(1, ref _Reg1); } - } - } - - /// - /// No Data (Sector_ID not found, CRC fail in ID_field) - /// - private bool ST1ND - { - get { return GetBit(2, _Reg1); } - set - { - if (value) { SetBit(2, ref _Reg1); } - else { UnSetBit(2, ref _Reg1); } - } - } - - /// - /// Over Run (CPU too slow in execution-phase (ca. 26us/Byte)) - /// - private bool ST1OR - { - get { return GetBit(4, _Reg1); } - set - { - if (value) { SetBit(4, ref _Reg1); } - else { UnSetBit(4, ref _Reg1); } - } - } - - /// - /// Data Error (CRC-fail in ID- or Data-Field) - /// - private bool ST1DE - { - get { return GetBit(5, _Reg1); } - set - { - if (value) { SetBit(5, ref _Reg1); } - else { UnSetBit(5, ref _Reg1); } - } - } - - /// - /// End of Track (set past most read/write commands) (see IC) - /// - private bool ST1EN - { - get { return GetBit(7, _Reg1); } - set - { - if (value) { SetBit(7, ref _Reg1); } - else { UnSetBit(7, ref _Reg1); } - } - } - - #endregion - - #region Status Register 2 - - /// - /// Status Register 2 - /// - private byte _Reg2; - - /// - /// Missing Address Mark in Data Field (DAM not found) - /// - private bool ST2MD - { - get { return GetBit(0, _Reg2); } - set - { - if (value) { SetBit(0, ref _Reg2); } - else { UnSetBit(0, ref _Reg2); } - } - } - - /// - /// Bad Cylinder (read/programmed track-ID different and read-ID = FF) - /// - private bool ST2BC - { - get { return GetBit(1, _Reg2); } - set - { - if (value) { SetBit(1, ref _Reg2); } - else { UnSetBit(1, ref _Reg2); } - } - } - - /// - /// Scan Not Satisfied (no fitting sector found) - /// - private bool ST2SN - { - get { return GetBit(2, _Reg2); } - set - { - if (value) { SetBit(2, ref _Reg2); } - else { UnSetBit(2, ref _Reg2); } - } - } - - /// - /// Scan Equal Hit (equal) - /// - private bool ST2SH - { - get { return GetBit(3, _Reg2); } - set - { - if (value) { SetBit(3, ref _Reg2); } - else { UnSetBit(3, ref _Reg2); } - } - } - - /// - /// Wrong Cylinder (read/programmed track-ID different) (see b1) - /// - private bool ST2WC - { - get { return GetBit(4, _Reg2); } - set - { - if (value) { SetBit(4, ref _Reg2); } - else { UnSetBit(4, ref _Reg2); } - } - } - - /// - /// Data Error in Data Field (CRC-fail in data-field) - /// - private bool ST2DD - { - get { return GetBit(5, _Reg2); } - set - { - if (value) { SetBit(5, ref _Reg2); } - else { UnSetBit(5, ref _Reg2); } - } - } - - /// - /// Control Mark (read/scan command found sector with deleted DAM) - /// - private bool ST2CM - { - get { return GetBit(6, _Reg2); } - set - { - if (value) { SetBit(6, ref _Reg2); } - else { UnSetBit(6, ref _Reg2); } - } - } - - #endregion - - #region Status Register 3 - - /// - /// Status Register 3 - /// - private byte _Reg3; - - /// - /// Unit Select (pin 28,29 of FDC) - /// - private bool ST3US0 - { - get { return GetBit(0, _Reg3); } - set - { - if (value) { SetBit(0, ref _Reg3); } - else { UnSetBit(0, ref _Reg3); } - } - } - - /// - /// Unit Select (pin 28,29 of FDC) - /// - private bool ST3US1 - { - get { return GetBit(1, _Reg3); } - set - { - if (value) { SetBit(1, ref _Reg3); } - else { UnSetBit(1, ref _Reg3); } - } - } - - /// - /// Head Address (pin 27 of FDC) - /// - private bool ST3HD - { - get { return GetBit(2, _Reg3); } - set - { - if (value) { SetBit(2, ref _Reg3); } - else { UnSetBit(2, ref _Reg3); } - } - } - - /// - /// Two Side (0=yes, 1=no (!)) - /// - private bool ST3TS - { - get { return GetBit(3, _Reg3); } - set - { - if (value) { SetBit(3, ref _Reg3); } - else { UnSetBit(3, ref _Reg3); } - } - } - - /// - /// Track 0 (on track 0 we are) - /// - private bool ST3T0 - { - get { return GetBit(4, _Reg3); } - set - { - if (value) { SetBit(4, ref _Reg3); } - else { UnSetBit(4, ref _Reg3); } - } - } - - /// - /// Ready (drive ready signal) - /// - private bool ST3RY - { - get { return GetBit(5, _Reg3); } - set - { - if (value) { SetBit(5, ref _Reg3); } - else { UnSetBit(5, ref _Reg3); } - } - } - - /// - /// Write Protected (write protected) - /// - private bool ST3WP - { - get { return GetBit(6, _Reg3); } - set - { - if (value) { SetBit(6, ref _Reg3); } - else { UnSetBit(6, ref _Reg3); } - } - } - - /// - /// Fault (if supported: 1=Drive failure) - /// - private bool ST3FT - { - get { return GetBit(7, _Reg3); } - set - { - if (value) { SetBit(7, ref _Reg3); } - else { UnSetBit(7, ref _Reg3); } - } - } - - #endregion - - */ - } -} diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Timing.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Timing.cs index 4fd33e062e..ee4224e8a9 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Timing.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.Timing.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// @@ -95,29 +90,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum StatesPerDriveTick = TStatesPerDriveCycle; } - /* - /// - /// Called every cycle by the emulated machine - /// Simulates the floppy drive and updates execution phase bits - /// - public void RunCPUCycle() - { - // decrement tick counter - TickCounter--; - - if (TickCounter > 0) - { - // not ready to emulate a floppy drive cycle yet - return; - } - - // time to emulate a floppy drive cycle - // reset the tick counter - TickCounter = StatesPerDriveTick; - - //RunDriveCycle(); - } - */ /// /// Called by reads to the main status register @@ -144,9 +116,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum LastCPUCycle = CurrentCPUCycle; return true; } - } - - } } diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.cs index 45f35b412a..a78c2f77df 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.cs @@ -1,10 +1,5 @@ using BizHawk.Common; -using System; -using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPS765.Static.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPS765.Static.cs index 7cbb83c13b..7788bca84c 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPS765.Static.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPS765.Static.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/CursorJoystick.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/CursorJoystick.cs index edd54dd9b1..e0828551f2 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/CursorJoystick.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/CursorJoystick.cs @@ -1,9 +1,5 @@ -using BizHawk.Common; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/KempstonJoystick.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/KempstonJoystick.cs index 880e388f3a..87cf5f491d 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/KempstonJoystick.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/KempstonJoystick.cs @@ -1,9 +1,5 @@ -using BizHawk.Common; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/NullJoystick.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/NullJoystick.cs index ba2d3ea467..850b371054 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/NullJoystick.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/NullJoystick.cs @@ -1,9 +1,5 @@ -using BizHawk.Common; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick1.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick1.cs index a3789b9e5d..e224646913 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick1.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick1.cs @@ -1,9 +1,5 @@ -using BizHawk.Common; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick2.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick2.cs index 82d9fd9857..6533e76f23 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick2.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/SinclairJoystick2.cs @@ -1,9 +1,5 @@ -using BizHawk.Common; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs index 0616003465..7e23f843a7 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Input/StandardKeyboard.cs @@ -2,8 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { @@ -95,118 +93,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum ? (byte)(_keyLine[lineIndex] & ~lineMask) : (byte)(_keyLine[lineIndex] | lineMask); } - - /* - if (isPressed) - { - switch (k) - { - // 0xfefe - 0 - 4 - case 0: _keyLine[0] = (_keyLine[0] & ~(0x1)); break; - case 1: _keyLine[0] = (_keyLine[0] & ~(0x02)); break; - case 2: _keyLine[0] = (_keyLine[0] & ~(0x04)); break; - case 3: _keyLine[0] = (_keyLine[0] & ~(0x08)); break; - case 4: _keyLine[0] = (_keyLine[0] & ~(0x10)); break; - // 0xfdfe - 5 - 9 - case 5: _keyLine[1] = (_keyLine[1] & ~(0x1)); break; - case 6: _keyLine[1] = (_keyLine[1] & ~(0x02)); break; - case 7: _keyLine[1] = (_keyLine[1] & ~(0x04)); break; - case 8: _keyLine[1] = (_keyLine[1] & ~(0x08)); break; - case 9: _keyLine[1] = (_keyLine[1] & ~(0x10)); break; - // 0xfbfe - 10 - 14 - case 10: _keyLine[2] = (_keyLine[2] & ~(0x1)); break; - case 11: _keyLine[2] = (_keyLine[2] & ~(0x02)); break; - case 12: _keyLine[2] = (_keyLine[2] & ~(0x04)); break; - case 13: _keyLine[2] = (_keyLine[2] & ~(0x08)); break; - case 14: _keyLine[2] = (_keyLine[2] & ~(0x10)); break; - // 0xf7fe - 15 - 19 - case 15: _keyLine[3] = (_keyLine[3] & ~(0x1)); break; - case 16: _keyLine[3] = (_keyLine[3] & ~(0x02)); break; - case 17: _keyLine[3] = (_keyLine[3] & ~(0x04)); break; - case 18: _keyLine[3] = (_keyLine[3] & ~(0x08)); break; - case 19: _keyLine[3] = (_keyLine[3] & ~(0x10)); break; - // 0xeffe - 20 - 24 - case 20: _keyLine[4] = (_keyLine[4] & ~(0x1)); break; - case 21: _keyLine[4] = (_keyLine[4] & ~(0x02)); break; - case 22: _keyLine[4] = (_keyLine[4] & ~(0x04)); break; - case 23: _keyLine[4] = (_keyLine[4] & ~(0x08)); break; - case 24: _keyLine[4] = (_keyLine[4] & ~(0x10)); break; - // 0xdffe - 25 - 29 - case 25: _keyLine[5] = (_keyLine[5] & ~(0x1)); break; - case 26: _keyLine[5] = (_keyLine[5] & ~(0x02)); break; - case 27: _keyLine[5] = (_keyLine[5] & ~(0x04)); break; - case 28: _keyLine[5] = (_keyLine[5] & ~(0x08)); break; - case 29: _keyLine[5] = (_keyLine[5] & ~(0x10)); break; - // 0xbffe - 30 - 34 - case 30: _keyLine[6] = (_keyLine[6] & ~(0x1)); break; - case 31: _keyLine[6] = (_keyLine[6] & ~(0x02)); break; - case 32: _keyLine[6] = (_keyLine[6] & ~(0x04)); break; - case 33: _keyLine[6] = (_keyLine[6] & ~(0x08)); break; - case 34: _keyLine[6] = (_keyLine[6] & ~(0x10)); break; - // 0x7ffe - 35 - 39 - case 35: _keyLine[7] = (_keyLine[7] & ~(0x1)); break; - case 36: _keyLine[7] = (_keyLine[7] & ~(0x02)); break; - case 37: _keyLine[7] = (_keyLine[7] & ~(0x04)); break; - case 38: _keyLine[7] = (_keyLine[7] & ~(0x08)); break; - case 39: _keyLine[7] = (_keyLine[7] & ~(0x10)); break; - } - } - else - { - switch (k) - { - // 0xfefe - 0 - 4 - case 0: _keyLine[0] = (_keyLine[0] | (0x1)); break; - case 1: _keyLine[0] = (_keyLine[0] | (0x02)); break; - case 2: _keyLine[0] = (_keyLine[0] | (0x04)); break; - case 3: _keyLine[0] = (_keyLine[0] | (0x08)); break; - case 4: _keyLine[0] = (_keyLine[0] | (0x10)); break; - // 0xfdfe - 5 - 9 - case 5: _keyLine[1] = (_keyLine[1] | (0x1)); break; - case 6: _keyLine[1] = (_keyLine[1] | (0x02)); break; - case 7: _keyLine[1] = (_keyLine[1] | (0x04)); break; - case 8: _keyLine[1] = (_keyLine[1] | (0x08)); break; - case 9: _keyLine[1] = (_keyLine[1] | (0x10)); break; - // 0xfbfe - 10 - 14 - case 10: _keyLine[2] = (_keyLine[2] | (0x1)); break; - case 11: _keyLine[2] = (_keyLine[2] | (0x02)); break; - case 12: _keyLine[2] = (_keyLine[2] | (0x04)); break; - case 13: _keyLine[2] = (_keyLine[2] | (0x08)); break; - case 14: _keyLine[2] = (_keyLine[2] | (0x10)); break; - // 0xf7fe - 15 - 19 - case 15: _keyLine[3] = (_keyLine[3] | (0x1)); break; - case 16: _keyLine[3] = (_keyLine[3] | (0x02)); break; - case 17: _keyLine[3] = (_keyLine[3] | (0x04)); break; - case 18: _keyLine[3] = (_keyLine[3] | (0x08)); break; - case 19: _keyLine[3] = (_keyLine[3] | (0x10)); break; - // 0xeffe - 20 - 24 - case 20: _keyLine[4] = (_keyLine[4] | (0x1)); break; - case 21: _keyLine[4] = (_keyLine[4] | (0x02)); break; - case 22: _keyLine[4] = (_keyLine[4] | (0x04)); break; - case 23: _keyLine[4] = (_keyLine[4] | (0x08)); break; - case 24: _keyLine[4] = (_keyLine[4] | (0x10)); break; - // 0xdffe - 25 - 29 - case 25: _keyLine[5] = (_keyLine[5] | (0x1)); break; - case 26: _keyLine[5] = (_keyLine[5] | (0x02)); break; - case 27: _keyLine[5] = (_keyLine[5] | (0x04)); break; - case 28: _keyLine[5] = (_keyLine[5] | (0x08)); break; - case 29: _keyLine[5] = (_keyLine[5] | (0x10)); break; - // 0xbffe - 30 - 34 - case 30: _keyLine[6] = (_keyLine[6] | (0x1)); break; - case 31: _keyLine[6] = (_keyLine[6] | (0x02)); break; - case 32: _keyLine[6] = (_keyLine[6] | (0x04)); break; - case 33: _keyLine[6] = (_keyLine[6] | (0x08)); break; - case 34: _keyLine[6] = (_keyLine[6] | (0x10)); break; - // 0x7ffe - 35 - 39 - case 35: _keyLine[7] = (_keyLine[7] | (0x1)); break; - case 36: _keyLine[7] = (_keyLine[7] | (0x02)); break; - case 37: _keyLine[7] = (_keyLine[7] | (0x04)); break; - case 38: _keyLine[7] = (_keyLine[7] | (0x08)); break; - case 39: _keyLine[7] = (_keyLine[7] | (0x10)); break; - } - } - - */ // Combination keys that are not in the keyboard matrix // but are available on the Spectrum+, 128k +2 & +3 @@ -284,21 +170,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum return result; } - - /* - switch (lines) - { - case 0xfe: return (byte)KeyLine[0]; - case 0xfd: return (byte)KeyLine[1]; - case 0xfb: return (byte)KeyLine[2]; - case 0xf7: return (byte)KeyLine[3]; - case 0xef: return (byte)KeyLine[4]; - case 0xdf: return (byte)KeyLine[5]; - case 0xbf: return (byte)KeyLine[6]; - case 0x7f: return (byte)KeyLine[7]; - default: return 0; - } - */ } public byte ReadKeyboardByte(ushort addr) diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs index 0f0f12110b..972f7030aa 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Rom/RomData.cs @@ -1,13 +1,9 @@ -using BizHawk.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { - + /// + /// Information about spectrum ROM + /// public class RomData { /// @@ -83,17 +79,5 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum return RD; } - - public void SyncState(Serializer ser) - { - ser.BeginSection("RomData"); - ser.Sync("RomBytes", ref _romBytes, false); - ser.Sync("_saveBytesRoutineAddress", ref _saveBytesRoutineAddress); - ser.Sync("_loadBytesRoutineAddress", ref _loadBytesRoutineAddress); - ser.Sync("_saveBytesResumeAddress", ref _saveBytesResumeAddress); - ser.Sync("_loadBytesResumeAddress", ref _loadBytesResumeAddress); - ser.Sync("_loadBytesInvalidHeaderAddress", ref _loadBytesInvalidHeaderAddress); - ser.EndSection(); - } } } diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs index dc5f101adf..394c18875b 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/AY38912.cs @@ -2,9 +2,6 @@ using BizHawk.Emulation.Common; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Beeper.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Beeper.cs index 6607e79e1e..5b518b031c 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Beeper.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Beeper.cs @@ -1,10 +1,6 @@ using BizHawk.Common; using BizHawk.Emulation.Common; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { @@ -166,19 +162,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum LastPulse = pulse; } - - - public void StartFrame() - { - } - - public void EndFrame() - { - } #endregion - #region ISoundProvider public bool CanProvideAsync => false; diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Buzzer.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Buzzer.cs deleted file mode 100644 index 7a12444892..0000000000 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Buzzer.cs +++ /dev/null @@ -1,325 +0,0 @@ - -using BizHawk.Common; -using BizHawk.Emulation.Common; -using System; -using System.Collections.Generic; - -namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum -{ - /* - /// - /// Represents the piezoelectric buzzer used in the Spectrum to produce sound - /// The beeper is controlled by rapidly toggling bit 4 of port &FE - /// - /// For the purposes of emulation this devices is locked to a frame - /// a list of Pulses is built up over the course of the frame and outputted at the end of the frame - /// - /// ZXHawk instantiates multiples of these buzzers to achieve separation between tape and spectrum audio output - /// - public class Buzzer : ISoundProvider, IBeeperDevice - { - #region Fields and Properties - - /// - /// Sample Rate - /// This usually has to be 44100 for ISoundProvider - /// - private int _sampleRate; - public int SampleRate - { - get { return _sampleRate; } - set { _sampleRate = value; } - } - - /// - /// Number of samples in one frame - /// - private int _samplesPerFrame; - public int SamplesPerFrame - { - get { return _samplesPerFrame; } - set { _samplesPerFrame = value; } - } - - /// - /// Number of TStates in each sample - /// - private int _tStatesPerSample; - public int TStatesPerSample - { - get { return _tStatesPerSample; } - set { _tStatesPerSample = value; } - } - - /// - /// Buzzer volume - /// Accepts an int 0-100 value - /// - private int _volume; - public int Volume - { - get - { - return VolumeConverterOut(_volume); - } - set - { - _volume = VolumeConverterIn(value); - } - } - - /// - /// The number of cpu cycles per frame - /// - private long _tStatesPerFrame; - - /// - /// The cycle at which the frame starts - /// - private long _frameStart; - - /// - /// The parent emulated machine - /// - private SpectrumBase _machine; - - /// - /// Pulses collected during the last frame - /// - public List Pulses { get; private set; } - - /// - /// The last pulse - /// - public bool LastPulse { get; set; } - - /// - /// The last T-State (cpu cycle) that the last pulse was received - /// - public long LastPulseTState { get; set; } - - #endregion - - #region Private Methods - - /// - /// Takes an int 0-100 and returns the relevant short volume to output - /// - /// - /// - private int VolumeConverterIn(int vol) - { - int maxLimit = short.MaxValue / 3; - int increment = maxLimit / 100; - - return vol * increment; - } - - /// - /// Takes an short volume and returns the relevant int value 0-100 - /// - /// - /// - private int VolumeConverterOut(int shortvol) - { - int maxLimit = short.MaxValue / 3; - int increment = maxLimit / 100; - - if (shortvol > maxLimit) - shortvol = maxLimit; - - return shortvol / increment; - } - - #endregion - - #region Construction & Initialisation - - public Buzzer(SpectrumBase machine) - { - _machine = machine; - } - - /// - /// Initialises the buzzer - /// - public void Init(int sampleRate, int tStatesPerFrame) - { - _sampleRate = sampleRate; - _tStatesPerFrame = tStatesPerFrame; - _tStatesPerSample = 99; // 79; - _samplesPerFrame = 705; // 882; // (int)_tStatesPerFrame / _tStatesPerSample; - - Pulses = new List(1000); - } - - #endregion - - #region IBeeperDevice - - /// - /// When the pulse value changes it is processed here - /// - /// - public void ProcessPulseValue(bool pulse) - { - if (!_machine._renderSound) - return; - - if (pulse == LastPulse) - { - // no change detected - return; - } - - // set the lastpulse - LastPulse = pulse; - - // get where we are in the frame - var currentULACycle = _machine.CurrentFrameCycle; - var currentBuzzerCycle = currentULACycle <= _tStatesPerFrame ? currentULACycle : _tStatesPerFrame; - var length = currentBuzzerCycle - LastPulseTState; - - if (length == 0) - { - // the first T-State has changed the pulse - // do not add it - } - else if (length > 0) - { - // add the pulse - Pulse p = new Pulse - { - State = !pulse, - Length = length - }; - Pulses.Add(p); - } - - // set the last pulse tstate - LastPulseTState = currentBuzzerCycle; - } - - /// - /// New frame starts - /// - public void StartFrame() - { - Pulses.Clear(); - LastPulseTState = 0; - } - - /// - /// Frame is completed - /// - public void EndFrame() - { - // store the last pulse information - if (LastPulseTState <= _tStatesPerFrame - 1) - { - Pulse p = new Pulse - { - State = LastPulse, - Length = _tStatesPerFrame - LastPulseTState - }; - Pulses.Add(p); - } - - // create the sample array - var firstSampleOffset = _frameStart % TStatesPerSample == 0 ? 0 : TStatesPerSample - (_frameStart + TStatesPerSample) % TStatesPerSample; - var samplesInFrame = (_tStatesPerFrame - firstSampleOffset - 1) / TStatesPerSample + 1; - var samples = new short[samplesInFrame]; - - // convert pulses to samples - var sampleIndex = 0; - var currentEnd = _frameStart; - - foreach (var pulse in Pulses) - { - var firstSample = currentEnd % TStatesPerSample == 0 - ? currentEnd : currentEnd + TStatesPerSample - currentEnd % TStatesPerSample; - - for (var i = firstSample; i < currentEnd + pulse.Length; i += TStatesPerSample) - { - samples[sampleIndex++] = pulse.State ? (short)(_volume) : (short)0; - } - - currentEnd += pulse.Length; - } - - // fill the _sampleBuffer for ISoundProvider - soundBufferContains = (int)samplesInFrame; - - if (soundBuffer.Length != soundBufferContains) - soundBuffer = new short[soundBufferContains]; - - samples.CopyTo(soundBuffer, 0); - - _frameStart += _tStatesPerFrame; - } - - #endregion - - #region ISoundProvider - - private short[] soundBuffer = new short[882]; - private int soundBufferContains = 0; - - public bool CanProvideAsync => false; - - public SyncSoundMode SyncMode => SyncSoundMode.Sync; - - public void SetSyncMode(SyncSoundMode mode) - { - if (mode != SyncSoundMode.Sync) - throw new InvalidOperationException("Only Sync mode is supported."); - } - - public void GetSamplesAsync(short[] samples) - { - throw new NotSupportedException("Async is not available"); - } - - public void DiscardSamples() - { - soundBufferContains = 0; - soundBuffer = new short[SamplesPerFrame]; - } - - public void GetSamplesSync(out short[] samples, out int nsamp) - { - // convert to stereo - short[] stereoBuffer = new short[soundBufferContains * 2]; - int index = 0; - for (int i = 0; i < soundBufferContains; i++) - { - stereoBuffer[index++] = soundBuffer[i]; - stereoBuffer[index++] = soundBuffer[i]; - } - - samples = stereoBuffer; - nsamp = soundBufferContains; // _samplesPerFrame; // soundBufferContains; - } - - #endregion - - #region State Serialization - - public void SyncState(Serializer ser) - { - ser.BeginSection("Buzzer"); - ser.Sync("_frameStart", ref _frameStart); - ser.Sync("_tStatesPerFrame", ref _tStatesPerFrame); - ser.Sync("_sampleRate", ref _sampleRate); - ser.Sync("_samplesPerFrame", ref _samplesPerFrame); - ser.Sync("_tStatesPerSample", ref _tStatesPerSample); - ser.Sync("soundBuffer", ref soundBuffer, false); - ser.Sync("soundBufferContains", ref soundBufferContains); - ser.EndSection(); - } - - #endregion - } - - */ -} diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Pulse.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Pulse.cs deleted file mode 100644 index 140c1d136a..0000000000 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/SoundOuput/Pulse.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum -{ - /// - /// The MIC and EAR pins in the spectrum deal in on/off pulses of varying lengths - /// This struct therefore represents 1 of these pulses - /// - public struct Pulse - { - /// - /// True: High State - /// False: Low State - /// - public bool State { get; set; } - - /// - /// Pulse length in Z80 T-States (cycles) - /// - public long Length { get; set; } - } -} diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs index 9ae88a6e8d..10a1728cb9 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/CPUMonitor.cs @@ -1,13 +1,12 @@ using BizHawk.Common; using BizHawk.Emulation.Cores.Components.Z80A; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// An intermediary class that manages cycling the ULA and CPU + /// along with inherent Port and Memory contention + /// public class CPUMonitor { #region Devices diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/MachineType.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/MachineType.cs index cee9f524da..1e5901a6ad 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/MachineType.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/MachineType.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// The various spectrum models ZXHawk emulates + /// public enum MachineType { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs index cb80c28bd4..6aab944eb7 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Input.cs @@ -1,11 +1,11 @@ - -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// - /// Handles all ZX-level input + /// The abstract class that all emulated models will inherit from + /// * Input * /// public abstract partial class SpectrumBase { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Media.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Media.cs index f49c84989c..5d38566152 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Media.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Media.cs @@ -1,11 +1,13 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// The abstract class that all emulated models will inherit from + /// * Imported media * + /// public abstract partial class SpectrumBase { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs index e3511847b8..bdb8416c3a 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Memory.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Port.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Port.cs index 3eba9a46f2..2d15f3f2fa 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Port.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.Port.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs index c2968a08a2..7d50d216b4 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/SpectrumBase.cs @@ -1,8 +1,5 @@ using BizHawk.Common; -using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Components.Z80A; -using System; -using System.Collections.Generic; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs index 9a8de555ce..3def75bca8 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ULA.cs @@ -2,14 +2,11 @@ using BizHawk.Emulation.Common; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// - /// 3rd attempt at a base ULA implementation + /// Uncommitted logic array implementation (ULA) /// public abstract class ULA : IVideoProvider { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs index 770d861c5f..374ccb13eb 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Memory.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 128K and +2 Memory + /// public partial class ZX128 : SpectrumBase { /* 128k paging controlled by writes to port 0x7ffd diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs index 256716f315..6b33600bcc 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Port.cs @@ -1,12 +1,11 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 128K/+2 Port + /// public partial class ZX128 : SpectrumBase { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs index 06b1d7d9ba..2c7d1a722b 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.Screen.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 128K/+2 ULA + /// class Screen128 : ULA { #region Construction diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs index ed556a3025..009c882d38 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128K/ZX128.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using BizHawk.Emulation.Cores.Components.Z80A; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 128K Constructor + /// public partial class ZX128 : SpectrumBase { #region Construction @@ -28,9 +27,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum SHADOWPaged = false; RAMPaged = 0; PagingDisabled = false; - - //ULADevice = new ULA128(this); - ULADevice = new Screen128(this); // still todo + + ULADevice = new Screen128(this); BuzzerDevice = new Beeper(this); BuzzerDevice.Init(44100, ULADevice.FrameLength); @@ -51,7 +49,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum InitializeMedia(files); } - #endregion - + #endregion } } diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs index 72c546da51..c5f833dfe4 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2/ZX128Plus2.cs @@ -1,9 +1,5 @@ using BizHawk.Emulation.Cores.Components.Z80A; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs index 323e683b94..e8c384efd9 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Memory.cs @@ -7,6 +7,9 @@ using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +2A Memory + /// public partial class ZX128Plus2a : SpectrumBase { /* http://www.worldofspectrum.org/faq/reference/128kreference.htm diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs index 57fab06df4..6809731766 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Port.cs @@ -1,12 +1,11 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +2a Port + /// public partial class ZX128Plus2a : SpectrumBase { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Screen.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Screen.cs index 53c0f3a0cb..7d9deeed41 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Screen.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.Screen.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +2A/+3 ULA + /// class Screen128Plus2a : ULA { #region Construction diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.cs index 363f1a52ac..b38ba2ef0a 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus2a/ZX128Plus2a.cs @@ -1,12 +1,11 @@ using BizHawk.Emulation.Cores.Components.Z80A; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +2A Constructor + /// public partial class ZX128Plus2a : SpectrumBase { #region Construction @@ -28,9 +27,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum SHADOWPaged = false; RAMPaged = 0; PagingDisabled = false; - - //ULADevice = new ULAPlus2a(this); - ULADevice = new Screen128Plus2a(this); // still todo + + ULADevice = new Screen128Plus2a(this); BuzzerDevice = new Beeper(this); BuzzerDevice.Init(44100, ULADevice.FrameLength); diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs index 6bec98ab37..54295e06d8 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Memory.cs @@ -7,6 +7,9 @@ using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +3 Memory + /// public partial class ZX128Plus3 : SpectrumBase { /* http://www.worldofspectrum.org/faq/reference/128kreference.htm diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs index e7a4a7304b..5e13f828ca 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.Port.cs @@ -1,12 +1,11 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +3 Port + /// public partial class ZX128Plus3 : SpectrumBase { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs index 4e6d889d55..c27f74a265 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum128KPlus3/ZX128Plus3.cs @@ -1,12 +1,11 @@ using BizHawk.Emulation.Cores.Components.Z80A; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// +3 Constructor + /// public partial class ZX128Plus3 : SpectrumBase { #region Construction @@ -29,9 +28,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum SHADOWPaged = false; RAMPaged = 0; PagingDisabled = false; - - // ULADevice = new ULAPlus3(this); - ULADevice = new Screen128Plus2a(this); // still todo + + ULADevice = new Screen128Plus2a(this); BuzzerDevice = new Beeper(this); BuzzerDevice.Init(44100, ULADevice.FrameLength); diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs index 7f52c2dcc8..f59a7652a1 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum16K/ZX16.cs @@ -1,12 +1,11 @@ using BizHawk.Emulation.Cores.Components.Z80A; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 16K is idential to 48K, just without the top 32KB of RAM + /// public class ZX16 : ZX48 { #region Construction diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs index 6d49076f41..e222e7114a 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Memory.cs @@ -6,6 +6,9 @@ using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 48K Memory + /// public partial class ZX48 : SpectrumBase { /* 48K Spectrum has NO memory paging diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs index a4cbc9bd5b..019b82e666 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Port.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 48K Port + /// public partial class ZX48 : SpectrumBase { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Screen.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Screen.cs index d572f44e37..9f01e83c04 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Screen.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.Screen.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 48K ULA + /// class Screen48 : ULA { #region Construction diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs index a8d33eb03a..1f2508dd63 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Machine/ZXSpectrum48K/ZX48.cs @@ -1,12 +1,12 @@ using BizHawk.Emulation.Cores.Components.Z80A; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// 48K construction + /// public partial class ZX48 : SpectrumBase { #region Construction diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCExtendedFloppyDisk.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCExtendedFloppyDisk.cs index b8cbf0968e..3d00d74cb6 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCExtendedFloppyDisk.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCExtendedFloppyDisk.cs @@ -1,9 +1,4 @@ -using BizHawk.Common.NumberExtensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Text; using BizHawk.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFloppyDisk.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFloppyDisk.cs index 99818cc932..43f36a6a76 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFloppyDisk.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/CPCFloppyDisk.cs @@ -1,9 +1,4 @@ -using BizHawk.Common.NumberExtensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Text; using BizHawk.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/DiskType.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/DiskType.cs index fe185248ee..51ee9f75f4 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/DiskType.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/DiskType.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs index e9b5252a9d..bebf139c7b 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Disk/FloppyDisk.cs @@ -1,15 +1,13 @@ using BizHawk.Common; -using BizHawk.Common.NumberExtensions; using System; using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// - /// This interface defines a logical floppy disk + /// This abstract class defines a logical floppy disk /// public abstract class FloppyDisk { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs index f3e56b38fd..6f9dc4c130 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverter.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// - /// Abtract class that represents all Media Serializers + /// Abtract class that represents all Media Converters /// public abstract class MediaConverter { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverterType.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverterType.cs index d7b456919f..034e45e5d0 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverterType.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/MediaConverterType.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapConverter.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapConverter.cs index c74e3fa5a6..945585cc71 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapConverter.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapConverter.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeCommand.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeCommand.cs index 14fc54a460..f61fc49e0f 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeCommand.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeCommand.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeDataBlock.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeDataBlock.cs index ee1a6bc4d8..0b1c4e910f 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeDataBlock.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TapeDataBlock.cs @@ -1,9 +1,7 @@ using BizHawk.Common; -using System; using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TzxConverter.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TzxConverter.cs index fe6ef6fe6c..2533e1fef9 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TzxConverter.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Media/Tape/TzxConverter.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/SoundProviderMixer.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/SoundProviderMixer.cs index b5ffebe64f..55df2265f9 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/SoundProviderMixer.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/SoundProviderMixer.cs @@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum /// My attempt at mixing multiple ISoundProvider sources together and outputting another ISoundProvider /// Currently only supports SyncSoundMode.Sync /// Attached ISoundProvider sources must already be stereo 44.1khz and ideally sound buffers should be the same length (882) - /// (if not, their buffer will be truncated/expanded) + /// (if not, only 882 samples of their buffer will be used) /// internal sealed class SoundProviderMixer : ISoundProvider { @@ -209,6 +209,5 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum #endregion - } } diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs index fa69c5164f..b44e1af74c 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Controllers.cs @@ -1,13 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using BizHawk.Common; -using BizHawk.Common.ReflectionExtensions; +using System.Collections.Generic; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * Controllers * + /// public partial class ZXSpectrum { /// @@ -125,38 +124,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum return definition; } } - - - - /* - /// - /// Controller mapping includes all keyboard keys from the following models: - /// https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/ZXSpectrum48k.jpg/1200px-ZXSpectrum48k.jpg - /// https://upload.wikimedia.org/wikipedia/commons/c/ca/ZX_Spectrum%2B.jpg - /// - public static readonly ControllerDefinition ZXSpectrumControllerDefinition = new ControllerDefinition - { - Name = "ZXSpectrum Controller", - BoolButtons = - { - // Kempston Joystick (P1) - "P1 Up", "P1 Down", "P1 Left", "P1 Right", "P1 Button", - // Keyboard - row 1 - "Key True Video", "Key Inv Video", "Key 1", "Key 2", "Key 3", "Key 4", "Key 5", "Key 6", "Key 7", "Key 8", "Key 9", "Key 0", "Key Break", - // Keyboard - row 2 - "Key Delete", "Key Graph", "Key Q", "Key W", "Key E", "Key R", "Key T", "Key Y", "Key U", "Key I", "Key O", "Key P", - // Keyboard - row 3 - "Key Extend Mode", "Key Edit", "Key A", "Key S", "Key D", "Key F", "Key G", "Key H", "Key J", "Key K", "Key L", "Key Return", - // Keyboard - row 4 - "Key Caps Shift", "Key Caps Lock", "Key Z", "Key X", "Key C", "Key V", "Key B", "Key N", "Key M", "Key Period", - // Keyboard - row 5 - "Key Symbol Shift", "Key Semi-Colon", "Key Quote", "Key Left Cursor", "Key Right Cursor", "Key Space", "Key Up Cursor", "Key Down Cursor", "Key Comma", - // Tape functions - "Play Tape", "Stop Tape", "RTZ Tape", "Record Tape", "Insert Next Tape", "Insert Previous Tape", "Next Tape Block", "Prev Tape Block" - } - }; - - */ } /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IDebuggable.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IDebuggable.cs index caa161e0d7..ccb68cf475 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IDebuggable.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IDebuggable.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; - -using BizHawk.Common.NumberExtensions; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * IDebugggable * + /// public partial class ZXSpectrum : IDebuggable { public IDictionary GetCpuFlagsAndRegisters() diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs index c87c9991d7..1276521373 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs @@ -1,8 +1,11 @@ using BizHawk.Emulation.Common; -using BizHawk.Common.NumberExtensions; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * IEmulator * + /// public partial class ZXSpectrum : IEmulator { public IEmulatorServiceProvider ServiceProvider { get; } @@ -60,8 +63,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum get { return deterministicEmulation; } } - //public bool DeterministicEmulation => true; - public void ResetCounters() { _machine.FrameCount = 0; diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IInputPollable.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IInputPollable.cs index da34d34c66..6861bb50ff 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IInputPollable.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IInputPollable.cs @@ -1,9 +1,12 @@ - -using System; +using System; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * IInputPollable * + /// public partial class ZXSpectrum : IInputPollable { public int LagCount diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs index 5245886f7c..47e9bd83be 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IMemoryDomains.cs @@ -1,12 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; - using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { - public partial class ZXSpectrum //: IMemoryDomains + /// + /// ZXHawk: Core Class + /// * Memory Domains * + /// + public partial class ZXSpectrum { internal IMemoryDomains memoryDomains; private readonly Dictionary _byteArrayDomains = new Dictionary(); diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs index 0c76d3e863..59bbe6e9c4 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.ISettable.cs @@ -1,13 +1,14 @@ -using System; -using Newtonsoft.Json; - -using BizHawk.Common; +using BizHawk.Common; using BizHawk.Emulation.Common; using System.ComponentModel; using System.Text; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * ISettable * + /// public partial class ZXSpectrum : ISettable { internal ZXSpectrumSettings Settings = new ZXSpectrumSettings(); @@ -150,6 +151,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } } + /// + /// Verbosity of the ZXHawk generated OSD messages + /// public enum OSDVerbosity { /// diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs index 01419fd093..74ab460903 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IStatable.cs @@ -1,10 +1,13 @@ using System.IO; - using BizHawk.Common; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * IStatable * + /// public partial class ZXSpectrum : IStatable { public bool BinarySaveStatesPreferred diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Messaging.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Messaging.cs index 7b14980b30..4a3a20d6ca 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Messaging.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Messaging.cs @@ -1,13 +1,12 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// - /// Handles all messaging (OSD) operations + /// ZXHawk: Core Class + /// * Handles all messaging (OSD) operations * /// public partial class ZXSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Util.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Util.cs index 2444e87c30..8423f50e1f 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Util.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.Util.cs @@ -1,14 +1,11 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { /// - /// Utilities + /// ZXHawk: Core Class + /// * Misc Utilities * /// public partial class ZXSpectrum { diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs index 37de2d0a63..811ede903c 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs @@ -1,6 +1,5 @@ using BizHawk.Common; using BizHawk.Emulation.Common; -using BizHawk.Emulation.Cores.Components; using BizHawk.Emulation.Cores.Components.Z80A; using BizHawk.Emulation.Cores.Properties; using System; @@ -10,6 +9,10 @@ using System.Linq; namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum { + /// + /// ZXHawk: Core Class + /// * Main Initialization * + /// [Core( "ZXHawk", "Asnivor, Alyosha",