I've been researching this problem for a while now, with nothing coming up. So how would I be able to convert a binary string, to something that I can edit like a string.
Something like this (sorry about the pseudo code.)
unsigned char binary = 0100001100001111;
string binaryString = binary.tostring;
//binaryString = 0100001100001111 (as a string)
If this is also possible, I was wondering if it was possible to "remove" certain characters off of a string, and replace them with something else. (Kinda like .remove() in C#.)
EDIT: The binary code is stored in
unsigned char gfx[32 * 64];
And is set in this code:
x = V[(opcode & 0x0F00) >> 8];
y = V[(opcode & 0x00F0) >> 4];
height = opcode & 0x000F;
V[0xF] = 0;
for (int yline = 0; yline < height; yline++)
{
pixel = memory[I + yline];
for (int xline = 0; xline < 8; xline++)
{
if ((pixel & (0x80 >> xline)) != 0)
{
if (gfx[(x + xline + ((y + yline) * 64))] == 1)
{
V[0xF] = 1;
}
gfx[x + xline + ((y + yline) * 64)] ^= 0x1;
}
}
}
Where opcode, V and Pixel are all hexadecimal values.