private void mapScreen_Paint(object sender, PaintEventArgs e)
{
var g = e.Graphics;
for (int i = 0; i < 32*30; i++)
{
int x = i % 32;
int y = i / 32;
int colorByte = mapData[0x3C0 + x / 4 + 8* (y / 4)];
int subPal = (colorByte >> (x%4/2*2 + y%4/2*4))& 0x03;
g.DrawImage(videos[subPal].Images[mapData[i]], new Point(x * 16, y * 16));
}
//add axis
if (showAxis)
{
for (int x = 0; x < 32; x++)
g.DrawLine(new Pen(Color.White, 1.0f), new Point(x * 32, 0), new Point(x * 32, 32 * 30));
for (int y = 0; y < 30; y++)
g.DrawLine(new Pen(Color.White, 1.0f), new Point(0, y * 32), new Point(32 * 32, y * 32));
}
}