Added double buffering

This commit is contained in:
2026-04-24 17:24:53 +01:00
parent dce4240842
commit d7fd5b6ad8
14 changed files with 163 additions and 63 deletions

View File

@@ -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);
}
}
}