commodore64: fix build error in savestate code

This commit is contained in:
saxxonpike 2012-11-19 20:35:27 +00:00
parent a304b5666b
commit fddbf1197b
2 changed files with 12 additions and 52 deletions

View File

@ -47,7 +47,6 @@ namespace BizHawk.Emulation.Computers.Commodore64
public class StateParameters
{
private Dictionary<string, int> integerList = new Dictionary<string, int>();
private Dictionary<string, string> stringList = new Dictionary<string, string>();
public int this[string key]
{
@ -65,22 +64,6 @@ namespace BizHawk.Emulation.Computers.Commodore64
}
}
public string this[string key]
{
get
{
if (stringList.ContainsKey(key))
{
return stringList[key];
}
return "";
}
set
{
stringList[key] = value;
}
}
public void ExportBinary(Stream target)
{
BinaryWriter writer = new BinaryWriter(target);
@ -92,13 +75,6 @@ namespace BizHawk.Emulation.Computers.Commodore64
writer.Write(kv.Value);
}
writer.Write((Int32)stringList.Count);
foreach (KeyValuePair<string, string> kv in stringList)
{
writer.Write(kv.Key);
writer.Write(kv.Value);
}
writer.Flush();
}
@ -108,13 +84,7 @@ namespace BizHawk.Emulation.Computers.Commodore64
foreach (KeyValuePair<string, int> kv in integerList)
{
sb.Append("i" + kv.Key + "=");
sb.AppendLine(kv.Value.ToString());
}
foreach (KeyValuePair<string, string> kv in stringList)
{
sb.Append("s" + kv.Key + "=");
sb.Append(kv.Key + "=");
sb.AppendLine(kv.Value.ToString());
}
@ -134,14 +104,6 @@ namespace BizHawk.Emulation.Computers.Commodore64
int val = reader.ReadInt32();
integerList[key] = val;
}
count = reader.ReadInt32();
for (int i = 0; i < count; i++)
{
string key = reader.ReadString();
string val = reader.ReadString();
stringList[key] = val;
}
}
public void ImportText(Stream source)
@ -160,17 +122,7 @@ namespace BizHawk.Emulation.Computers.Commodore64
if (val.Length > 0 && key.Length > 0)
{
string valType = val.Substring(0, 1);
val = val.Substring(1);
switch (valType)
{
case @"i":
integerList[key] = int.Parse(val);
break;
case @"s":
stringList[key] = val;
break;
}
integerList[key] = int.Parse(val);
}
}
}

View File

@ -82,10 +82,18 @@ namespace BizHawk.Emulation.Computers.Commodore64
mixer = voices[0].Output();
mixer += voices[1].Output();
mixer += voices[2].Output();
if (!regs.D3 || !regs.FILT[2])
mixer += voices[2].Output();
// apply volume
mixer *= regs.VOL;
mixer >>= 4;
// apply filter
// (todo)
// the mixer is very loud at this point, let's make it quieter
mixer /= 8;
mixer /= 4;
if (mixer > 32767)
mixer = 326767;