commodore64: clean up unneeded files since the Sid is hooked up to the Speex resampler now

This commit is contained in:
saxxonpike 2012-12-10 22:51:02 +00:00
parent cc4b683006
commit 5a8ce4000b
4 changed files with 13 additions and 115 deletions

View File

@ -115,8 +115,6 @@
<Compile Include="Computers\Commodore64\MOS\Port.cs" />
<Compile Include="Computers\Commodore64\MOS\SerialPort.cs" />
<Compile Include="Computers\Commodore64\MOS\Sid.cs" />
<Compile Include="Computers\Commodore64\MOS\Sid.SoundProvider.cs" />
<Compile Include="Computers\Commodore64\MOS\Sid.SyncSoundProvider.cs" />
<Compile Include="Computers\Commodore64\MOS\Timer.cs" />
<Compile Include="Computers\Commodore64\MOS\UserPort.cs" />
<Compile Include="Computers\Commodore64\MOS\Vic.cs" />

View File

@ -1,67 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Computers.Commodore64.MOS
{
/*
* this wasn't sounding as good as a vecna metaspu
*/
public abstract partial class Sid //: ISoundProvider
{
/*
private short[] buffer;
private uint bufferCounter;
private uint bufferFrequency;
private uint bufferIndex;
private uint bufferLength;
private uint bufferReadOffset;
*/
private uint cyclesPerSec;
/*
public void GetSamples(short[] samples)
{
bool overrun = false;
uint count = (uint)samples.Length;
uint overrunOffset;
if (bufferIndex == 0)
overrunOffset = bufferLength - 1;
else
overrunOffset = bufferIndex - 1;
uint i = 0;
while (i < count)
{
if (bufferReadOffset == bufferIndex)
overrun = true;
if (!overrun)
{
samples[i++] = buffer[bufferReadOffset++];
samples[i++] = buffer[bufferReadOffset++];
}
else
{
samples[i++] = buffer[overrunOffset];
samples[i++] = buffer[overrunOffset];
}
if (bufferReadOffset == bufferLength)
bufferReadOffset = 0;
}
}
public int MaxVolume
{
get
{
return 15;
}
set
{
// no change in volume
}
}
*/
}
}

View File

@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Computers.Commodore64.MOS
{
public abstract partial class Sid : IDisposable
{
public Sound.Utilities.SpeexResampler resampler;
/*
public void GetSamples(out short[] samples, out int nsamp)
{
if (bufferIndex > bufferReadOffset)
samples = new short[bufferIndex - bufferReadOffset];
else
samples = new short[bufferIndex + (bufferLength - bufferReadOffset)];
nsamp = samples.Length;
for (uint i = 0; i < nsamp; i++)
{
samples[i] = buffer[bufferReadOffset];
if (bufferReadOffset != bufferIndex)
bufferReadOffset++;
if (bufferReadOffset == bufferLength)
bufferReadOffset = 0;
}
nsamp /= 2;
}
public void DiscardSamples()
{
bufferIndex = 0;
bufferReadOffset = 0;
}
*/
public void Dispose()
{
if (resampler != null)
{
resampler.Dispose();
resampler = null;
}
}
}
}

View File

@ -618,6 +618,8 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
// ------------------------------------
public Sound.Utilities.SpeexResampler resampler;
private static uint[] syncNextTable = new uint[] { 1, 2, 0 };
private static uint[] syncPrevTable = new uint[] { 2, 0, 1 };
@ -643,6 +645,8 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
public Sid(uint[][] newWaveformTable, uint newSampleRate, Region newRegion)
{
uint cyclesPerSec = 0;
switch (newRegion)
{
case Region.NTSC: cyclesPerSec = 14318181 / 14; /*bufferLength = (newSampleRate / 60) * 4;*/ break;
@ -670,6 +674,15 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS
resampler = new Sound.Utilities.SpeexResampler(0, cyclesPerSec, 44100, cyclesPerSec, 44100, null, null);
}
public void Dispose()
{
if (resampler != null)
{
resampler.Dispose();
resampler = null;
}
}
// ------------------------------------
public void HardReset()