diff --git a/BizHawk.MultiClient/tools/Cheats/CheatList.cs b/BizHawk.MultiClient/tools/Cheats/CheatList.cs index a679595e91..1a46fa3833 100644 --- a/BizHawk.MultiClient/tools/Cheats/CheatList.cs +++ b/BizHawk.MultiClient/tools/Cheats/CheatList.cs @@ -215,6 +215,10 @@ namespace BizHawk.MultiClient MemoryDomain DOMAIN; bool ENABLED; string NAME; + Watch.WatchSize SIZE = Watch.WatchSize.Byte; + Watch.DisplayType TYPE = Watch.DisplayType.Hex; + bool BIGENDIAN = false; + if (s.Length < 6) continue; //NewCheat c = new NewCheat( @@ -234,13 +238,21 @@ namespace BizHawk.MultiClient ENABLED = vals[4] == "1"; NAME = vals[5]; + //For backwards compatibility, don't assume these values exist + if (vals.Length > 6) + { + SIZE = Watch.SizeFromChar(vals[6][0]); + TYPE = Watch.DisplayTypeFromChar(vals[7][0]); + BIGENDIAN = vals[8] == "1"; + } + Watch w = Watch.GenerateWatch( DOMAIN, ADDR, - Watch.WatchSize.Byte, - Watch.DisplayType.Hex, + SIZE, + TYPE, NAME, - false + BIGENDIAN ); NewCheat c = new NewCheat(w, COMPARE, Global.Config.DisableCheatsOnLoad ? false : ENABLED); @@ -480,9 +492,10 @@ namespace BizHawk.MultiClient .Append(cheat.Domain != null ? cheat.Domain.Name : String.Empty).Append('\t') .Append(cheat.Enabled ? '1' : '0').Append('\t') .Append(cheat.Name) + .Append(cheat.SizeAsChar).Append('\t') + .Append(cheat.SizeAsChar).Append('\t') + .Append(cheat.BigEndian.Value ? '1' : '0').Append('\t') .AppendLine(); - - //TODO: save big endian, size, and display type } } diff --git a/BizHawk.MultiClient/tools/Cheats/NewCheat.cs b/BizHawk.MultiClient/tools/Cheats/NewCheat.cs index c9c67cd7d7..2090a83f7e 100644 --- a/BizHawk.MultiClient/tools/Cheats/NewCheat.cs +++ b/BizHawk.MultiClient/tools/Cheats/NewCheat.cs @@ -94,11 +94,21 @@ namespace BizHawk.MultiClient get { return _watch.Size; } } + public char SizeAsChar + { + get { return _watch.SizeAsChar; } + } + public Watch.DisplayType Type { get { return _watch.Type; } } + public char TypeAsChar + { + get { return _watch.TypeAsChar; } + } + public string Name { get { if (IsSeparator) return String.Empty; else return _watch.Notes; }