Intellivision: Sound improvements

Sound is still not quite right, after asking on AtariAge it seems I'm not timing it properly.

Still a couple of bugs to work out but this should be closer.
This commit is contained in:
alyosha-tas 2017-02-07 11:31:05 -05:00 committed by GitHub
parent 230dcc2356
commit f0ffd4d835
2 changed files with 7 additions and 6 deletions

View File

@ -93,7 +93,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
while (_cpu.GetPendingCycles() > 0)
{
int cycles = _cpu.Execute();
//_psg.generate_sound(cycles);
_psg.generate_sound(cycles);
Connect();
}
@ -104,7 +104,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
while (_cpu.GetPendingCycles() > 0)
{
int cycles = _cpu.Execute();
//_psg.generate_sound(cycles);
_psg.generate_sound(cycles);
Connect();
}
_stic.in_vb_2 = false;

View File

@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
sample_count = 0;
for (int i = 0; i < 3733; i++)
for (int i = 0; i < 4000; i++)
{
audio_samples[i] = 0;
}
@ -54,17 +54,18 @@ namespace BizHawk.Emulation.Cores.Intellivision
public void GetSamplesSync(out short[] samples, out int nsamp)
{
short[] ret = new short[735 * 2];
short[] ret = new short[932 * 2];
GetSamples(ret);
samples = ret;
nsamp = 735;
nsamp = 932;
}
public void GetSamples(short[] samples)
{
for (int i = 0; i < samples.Length / 2; i++)
{
samples[i * 2] = (short)(audio_samples[(int)Math.Floor(3.7904 * i)]);
//samples[i * 2] = (short)(audio_samples[(int)Math.Floor(3.7904 * i)]);
samples[i * 2] = (short)(audio_samples[(4 * i)]);
samples[(i * 2) + 1] = samples[i * 2];
}
}