diff --git a/BizHawk.Client.Common/cheats/NESGameGenieEncoderDecoder.cs b/BizHawk.Client.Common/cheats/NESGameGenieEncoderDecoder.cs index d318aee269..48a7c8a9db 100644 --- a/BizHawk.Client.Common/cheats/NESGameGenieEncoderDecoder.cs +++ b/BizHawk.Client.Common/cheats/NESGameGenieEncoderDecoder.cs @@ -112,62 +112,4 @@ namespace BizHawk.Client.Common } } } - - public class NESGameGenieEncoder - { - private readonly char[] _letters = { 'A', 'P', 'Z', 'L', 'G', 'I', 'T', 'Y', 'E', 'O', 'X', 'U', 'K', 'S', 'V', 'N' }; - - private readonly int _address; - private readonly int _value; - private int? _compare; - - public NESGameGenieEncoder(int address, int value, int? compare) - { - _address = address; - if (_address >= 0x8000) - { - _address -= 0x8000; - } - - _value = value; - _compare = compare; - - GameGenieCode = ""; - } - - public string GameGenieCode { get; private set; } - - public string Encode() - { - byte[] num = { 0, 0, 0, 0, 0, 0, 0, 0 }; - num[0] = (byte)((_value & 7) + ((_value >> 4) & 8)); - num[1] = (byte)(((_value >> 4) & 7) + ((_address >> 4) & 8)); - num[2] = (byte)((_address >> 4) & 7); - num[3] = (byte)((_address >> 12) + (_address & 8)); - num[4] = (byte)((_address & 7) + ((_address >> 8) & 8)); - num[5] = (byte)((_address >> 8) & 7); - - if (_compare.HasValue) - { - num[2] += 8; - num[5] += (byte)(_compare & 8); - num[6] = (byte)((_compare & 7) + ((_compare >> 4) & 8)); - num[7] = (byte)(((_compare >> 4) & 7) + (_value & 8)); - for (var i = 0; i < 8; i++) - { - GameGenieCode += _letters[num[i]]; - } - } - else - { - num[5] += (byte)(_value & 8); - for (var i = 0; i < 6; i++) - { - GameGenieCode += _letters[num[i]]; - } - } - - return GameGenieCode; - } - } }