start counting from 0, after scanline #242 (when VBlank starts) i'm calling the drawing routine (see below).
Code: Select all
static public void DrawFrame()
{
Surface Pixel = new Surface(PixelSize, PixelSize, 32);
for (int X = 0; X < 256; X++)
{
for (int Y = 0; Y < 240; Y++)
{
// Pantalla = Screen in spanish (:
Pixel.Fill(Color.FromArgb((int)ScreenBuffer[X, Y]));
Pantalla.Blit(Pixel, new Point(X * PixelSize, Y * PixelSize));
}
}
Pantalla.Update();
return;
}aslo, i didn't implement a frame regulator, so the FPS are completely crazy: using C# + SDL, the title screen takes about 5 seconds to show up, while using Code::Block + Allegro it appears almost instantly. plus, while using C# + SDL, my computer goes into 100% of usage, and there's no chance to switch to another application without having a big delay, while when using Code::Block + Allegro it works normally, with no delays.
i need to code the emulator in C# to make a more friendly interface for it, so it has to be SDL (otherwise, what do you recommend?)