Intellivion copy paste enough stuff to get the sound working
Sound now fully implemented including in savestates
This commit is contained in:
parent
ed091083d2
commit
c6d8666f23
|
@ -52,6 +52,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
|
||||||
_psg.Reset();
|
_psg.Reset();
|
||||||
_psg.ReadMemory = ReadMemory;
|
_psg.ReadMemory = ReadMemory;
|
||||||
_psg.WriteMemory = WriteMemory;
|
_psg.WriteMemory = WriteMemory;
|
||||||
|
(ServiceProvider as BasicServiceProvider).Register<ISoundProvider>(_psg);
|
||||||
|
|
||||||
Connect();
|
Connect();
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Common;
|
||||||
namespace BizHawk.Emulation.Cores.Intellivision
|
namespace BizHawk.Emulation.Cores.Intellivision
|
||||||
{
|
{
|
||||||
// Sound refactor todo: Implement ISoundProvider, and register _psg in the Intellivision core
|
// 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];
|
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)
|
public void GetSamples(short[] samples)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < samples.Length / 2; i++)
|
for (int i = 0; i < samples.Length / 2; i++)
|
||||||
|
|
Loading…
Reference in New Issue