diff --git a/BizHawk.Emulation/Computers/Commodore64/Savestate.cs b/BizHawk.Emulation/Computers/Commodore64/Savestate.cs index c7b5683623..7148d53f15 100644 --- a/BizHawk.Emulation/Computers/Commodore64/Savestate.cs +++ b/BizHawk.Emulation/Computers/Commodore64/Savestate.cs @@ -47,7 +47,6 @@ namespace BizHawk.Emulation.Computers.Commodore64 public class StateParameters { private Dictionary integerList = new Dictionary(); - private Dictionary stringList = new Dictionary(); 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 kv in stringList) - { - writer.Write(kv.Key); - writer.Write(kv.Value); - } - writer.Flush(); } @@ -108,13 +84,7 @@ namespace BizHawk.Emulation.Computers.Commodore64 foreach (KeyValuePair kv in integerList) { - sb.Append("i" + kv.Key + "="); - sb.AppendLine(kv.Value.ToString()); - } - - foreach (KeyValuePair 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); } } } diff --git a/BizHawk.Emulation/Computers/Commodore64/SidSoundProvider.cs b/BizHawk.Emulation/Computers/Commodore64/SidSoundProvider.cs index 301b031fe6..4c0fd19a13 100644 --- a/BizHawk.Emulation/Computers/Commodore64/SidSoundProvider.cs +++ b/BizHawk.Emulation/Computers/Commodore64/SidSoundProvider.cs @@ -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;