Added double buffering
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Core.Io
|
||||
public const int ScreenWidth = 320;
|
||||
public const int ScreenHeight = 256; // Perfectly cropped size
|
||||
public int[] FrameBuffer { get; private set; }
|
||||
public int[] FrontBuffer { get; private set; } = new int[ScreenWidth * ScreenHeight];
|
||||
|
||||
private int _ulaFrameCount = 0;
|
||||
|
||||
@@ -124,5 +125,10 @@ namespace Core.Io
|
||||
FrameBuffer[rowStartIndex + b] = currentBorderColor;
|
||||
}
|
||||
}
|
||||
|
||||
public void CommitFrame()
|
||||
{
|
||||
Array.Copy(FrameBuffer, FrontBuffer, FrameBuffer.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user