i should maybe actually test these things
This commit is contained in:
parent
6f53e6dab4
commit
f167c0fcb1
1 changed files with 4 additions and 4 deletions
|
@ -238,14 +238,14 @@ namespace PC2Player
|
||||||
List<string> tmpOut = new List<string>();
|
List<string> tmpOut = new List<string>();
|
||||||
foreach (string frame in stringyBits)
|
foreach (string frame in stringyBits)
|
||||||
{
|
{
|
||||||
uint b = uint.Parse(frame, NumberStyles.HexNumber);
|
int b = int.Parse(frame, NumberStyles.HexNumber);
|
||||||
char[] bytesOut = new char[8];
|
char[] bytesOut = new char[8];
|
||||||
int bytes = int.Parse(ShowtapeBits)/4;
|
int bytes = int.Parse(ShowtapeBits)/4;
|
||||||
for (int i = 0; i < bytes; i++)
|
for (int i = 0; i < bytes; i++)
|
||||||
{
|
{
|
||||||
uint offset = 4 * i;
|
int offset = 4 * i;
|
||||||
uint mask = 0b1111 << offset;
|
int mask = 0b1111 << offset;
|
||||||
uint masked_value = (b & mask) >> offset;
|
int masked_value = (b & mask) >> offset;
|
||||||
bytesOut[i] = (char)(64 | masked_value);
|
bytesOut[i] = (char)(64 | masked_value);
|
||||||
}
|
}
|
||||||
tmpOut.Add(new string(bytesOut));
|
tmpOut.Add(new string(bytesOut));
|
||||||
|
|
Loading…
Add table
Reference in a new issue