new IPSG interface ahead of trying to A/B a version of the ColecoHawk AY-3-8910
This commit is contained in:
parent
4e088574cf
commit
a7ed14cfe1
|
@ -258,6 +258,7 @@
|
||||||
<Compile Include="Computers\Commodore64\User\UserPortDevice.cs" />
|
<Compile Include="Computers\Commodore64\User\UserPortDevice.cs" />
|
||||||
<Compile Include="Computers\SinclairSpectrum\Hardware\Abstraction\IJoystick.cs" />
|
<Compile Include="Computers\SinclairSpectrum\Hardware\Abstraction\IJoystick.cs" />
|
||||||
<Compile Include="Computers\SinclairSpectrum\Hardware\Abstraction\IPortIODevice.cs" />
|
<Compile Include="Computers\SinclairSpectrum\Hardware\Abstraction\IPortIODevice.cs" />
|
||||||
|
<Compile Include="Computers\SinclairSpectrum\Hardware\Abstraction\IPSG.cs" />
|
||||||
<Compile Include="Computers\SinclairSpectrum\Hardware\Input\CursorJoystick.cs" />
|
<Compile Include="Computers\SinclairSpectrum\Hardware\Input\CursorJoystick.cs" />
|
||||||
<Compile Include="Computers\SinclairSpectrum\Hardware\Input\SinclairJoystick2.cs" />
|
<Compile Include="Computers\SinclairSpectrum\Hardware\Input\SinclairJoystick2.cs" />
|
||||||
<Compile Include="Computers\SinclairSpectrum\Hardware\Input\SinclairJoystick1.cs" />
|
<Compile Include="Computers\SinclairSpectrum\Hardware\Input\SinclairJoystick1.cs" />
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a PSG device (in this case an AY-3-891x)
|
||||||
|
/// </summary>
|
||||||
|
public interface IPSG : ISoundProvider
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initlization routine
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sampleRate"></param>
|
||||||
|
/// <param name="tStatesPerFrame"></param>
|
||||||
|
void Init(int sampleRate, int tStatesPerFrame);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Activates a register
|
||||||
|
/// </summary>
|
||||||
|
int SelectedRegister { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Writes to the PSG
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
void PortWrite(int value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads from the PSG
|
||||||
|
/// </summary>
|
||||||
|
int PortRead();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the PSG
|
||||||
|
/// </summary>
|
||||||
|
void Reset();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called at the start of a frame
|
||||||
|
/// </summary>
|
||||||
|
void StartFrame();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// called at the end of a frame
|
||||||
|
/// </summary>
|
||||||
|
void EndFrame();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the sound based on number of frame cycles
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="frameCycle"></param>
|
||||||
|
void UpdateSound(int frameCycle);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IStatable serialization
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ser"></param>
|
||||||
|
void SyncState(Serializer ser);
|
||||||
|
}
|
||||||
|
}
|
|
@ -594,7 +594,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
_machine.Spectrum.OSD_TapePlayingAuto();
|
_machine.Spectrum.OSD_TapePlayingAuto();
|
||||||
}
|
}
|
||||||
|
|
||||||
_monitorTimeOut = 90;
|
_monitorTimeOut = 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
{
|
{
|
||||||
public class AY38912 : ISoundProvider
|
public class AY38912 : IPSG
|
||||||
{
|
{
|
||||||
private int _tStatesPerFrame;
|
private int _tStatesPerFrame;
|
||||||
private int _sampleRate;
|
private int _sampleRate;
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Device representing the AY-3-8912 chip found in the 128k and up spectrums
|
/// Device representing the AY-3-8912 chip found in the 128k and up spectrums
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AY38912 AYDevice { get; set; }
|
public IPSG AYDevice { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The spectrum keyboard
|
/// The spectrum keyboard
|
||||||
|
|
Loading…
Reference in New Issue