diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index 21421b1191..bc17e7f44a 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -52,6 +52,7 @@ namespace BizHawk.Emulation.Cores.Intellivision _psg.Reset(); _psg.ReadMemory = ReadMemory; _psg.WriteMemory = WriteMemory; + (ServiceProvider as BasicServiceProvider).Register(_psg); Connect(); diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs index 0bafe05e05..79a0a61e33 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/PSG.cs @@ -6,7 +6,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Intellivision { // Sound refactor todo: Implement ISoundProvider, and register _psg in the Intellivision core - public sealed class PSG + public sealed class PSG : ISoundProvider { public ushort[] Register = new ushort[16]; @@ -30,6 +30,37 @@ namespace BizHawk.Emulation.Cores.Intellivision } } + public void GetSamplesAsync(short[] samples) + { + throw new NotSupportedException("Async is not available"); + } + + public bool CanProvideAsync + { + get { return false; } + } + + public SyncSoundMode SyncMode + { + get { return SyncSoundMode.Sync; } + } + + public void SetSyncMode(SyncSoundMode mode) + { + if (mode != SyncSoundMode.Sync) + { + throw new InvalidOperationException("Only Sync mode is supported."); + } + } + + public void GetSamplesSync(out short[] samples, out int nsamp) + { + short[] ret = new short[735 * 2]; + GetSamples(ret); + samples = ret; + nsamp = 735; + } + public void GetSamples(short[] samples) { for (int i = 0; i < samples.Length / 2; i++)