remove NesGameGenieEncoder that i snow unused

This commit is contained in:
adelikat 2020-02-28 19:15:15 -06:00
parent d2fd1dc11c
commit 95463071d2
1 changed files with 0 additions and 58 deletions

View File

@ -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;
}
}
}