From 9d00197c2a396a83bf2e885a61451ec2ab250db1 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Mon, 16 May 2016 07:55:58 -0400 Subject: [PATCH] fixes 0 sample size in audio --- BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs index 76584b068b..2574b64148 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs @@ -1490,7 +1490,10 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // the explicit exact times in the scanline, instead of just approximately spaced public void GetSamples(short[] samples) { - var samples31khz = new short[_audioClocks]; // mono + var sample_size = _audioClocks; + if (sample_size == 0) sample_size = 2; + + var samples31khz = new short[sample_size]; // mono int elapsedCycles = frameEndCycles - frameStartCycles; if (elapsedCycles == 0) @@ -1552,6 +1555,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 ser.Sync("vsyncEnabled", ref _vsyncEnabled); ser.Sync("CurrentScanLine", ref _CurrentScanLine); ser.Sync("scanlinebuffer", ref _scanlinebuffer, false); + ser.Sync("AudioClocks", ref _audioClocks); ser.BeginSection("Player0"); _player0.SyncState(ser);