Your FEZ1/FEZ2 arrays are very large, which will slow things up. Consider storing it as some sort of binary format which you can then open and run through as a stream.
A few quick thing’s i’ve noticed:
Consider changing:
for (int i = 0; i < 8; i++)
to
for (int i = 0; i < 8; i = i + 1)
In FillRect:
for (i = 0; i < (ey - sy + 1); i++)
for (j = 0; j < (ex - sx + 1); j++)
could be optimised to
int a = (ey - sy + 1);
int b = (ex - sx + 1);
for (i = 0; i < a; i++)
for (j = 0; j < b; j++)
This saves doing a subtract and addition every iteration.
in DrawImage:
for (int j = 0; j < y; j++)
for (int i = 0; i < x; i++)
{
WriteRegisterData((byte)(pic[k] >> 8), (byte)(pic[k]));
k++;
}
can optimise to:
for (int j = 0; j < y; j = j + 1)
for (int i = 0; i < x; i = i + 1)
{
ushort b = pic[k];
WriteRegisterData((byte)(b >> 8), (byte)b);
k = k + 1;
}
If you can, convert your code to use 32 bit values rather than 16 and 8 bit. Converting 8/16 bits up to 32 bit for running operations on them takes time.
For simple code cleanlyness:
//OutputPort method
private void TransferBytes(byte VH, byte VL)
{
byte data;
data = VH;
should be
//OutputPort method
private void TransferBytes(byte VH, byte VL)
{
byte data = VH;
Also consider changing variable names to be more verbose, so their usage is easier to understand. VH/VL mean nothing to me looking at this… 2 letter variables are bad. Code readability with C# is king, there is no need for short variables that are not ultra temporary (like i/j/k in loops for instance - those are very limited scope).