Added double buffering 2

This commit is contained in:
2026-04-24 21:52:30 +01:00
parent d7fd5b6ad8
commit 97267bed7a
3 changed files with 3 additions and 2 deletions

View File

@@ -1596,7 +1596,7 @@ namespace Core.Cpu
if ((n & 0x02) != 0) AF.Low |= 0x20;
return 16;
}
case 0xA9: // CPD (The opcode that just crashed!)
case 0xA9: // CPD
{
byte memVal = ReadMemory(HL.Word);
byte result = (byte)(AF.High - memVal);

View File

@@ -11,7 +11,7 @@ namespace Core.Io
// The ULA owns the frame buffer now!
public const int ScreenWidth = 320;
public const int ScreenHeight = 256; // Perfectly cropped size
public int[] FrameBuffer { get; private set; }
public int[] FrameBuffer { get; private set; } = new int[ScreenWidth * ScreenHeight];
public int[] FrontBuffer { get; private set; } = new int[ScreenWidth * ScreenHeight];
private int _ulaFrameCount = 0;

View File

@@ -170,6 +170,7 @@ namespace Desktop
if (scanlineCount % 312 == 0)
{
_cpu.RequestInterrupt(); // 50Hz interrupt
_ula.CommitFrame();
TotalFrameCount++;
if (highSpeed)