public void ShowGrid(byte[] grid)
{
uint gridData = 0;
byte bitsLeft = 0;
var gridBuf = 0;
for (ushort cnty = 0; cnty < GameScreenHeight >> 3; cnty++)
{
for (ushort cntx = 0; cntx < GameScreenWidth >> 3; cntx++)
{
if (bitsLeft == 0)
{
bitsLeft = 32;
gridData = grid.ToUInt32(gridBuf);
gridBuf += 4;
}
if ((gridData & 0x80000000) != 0)
PaintBox((ushort)(cntx << 3), (ushort)(cnty << 3));
bitsLeft--;
gridData <<= 1;
}
}
_system.GraphicsManager.CopyRectToScreen(Current, GameScreenWidth, 0, 0, GameScreenWidth, GameScreenHeight);
}