diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-04 12:07:39 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-04 12:07:39 +1000 |
| commit | 72f297a479b6749674ec80e91be53b8c482123d2 (patch) | |
| tree | 05465784b2b5b5adbd695b50e8394c6f78e3a455 /Chip/DisplayDevice.cs | |
| parent | 86452af2d48e2d1883dbfd67316e371f2a593bfe (diff) | |
crowbar
Diffstat (limited to 'Chip/DisplayDevice.cs')
| -rw-r--r-- | Chip/DisplayDevice.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Chip/DisplayDevice.cs b/Chip/DisplayDevice.cs index ea34cfb..28bf4e0 100644 --- a/Chip/DisplayDevice.cs +++ b/Chip/DisplayDevice.cs @@ -2,6 +2,7 @@ namespace Q1Emu.Chip; using System; using System.Collections.Generic; +using System.Threading; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -11,6 +12,7 @@ public class DisplayDevice : RamDevice private readonly u16 _paletteSize; private readonly u16 _displayWidth; private readonly u16 _displayHeight; + private Color[] textureData; public DisplayDevice(u16 paletteSize, u16 displayWidth, u16 displayHeight, u16 addressableStart) : base(addressableStart, DisplayDevice.DetermineSize(paletteSize, displayWidth, displayHeight)) @@ -18,6 +20,7 @@ public class DisplayDevice : RamDevice this._paletteSize = paletteSize; this._displayWidth = displayWidth; this._displayHeight = displayHeight; + this.textureData = new Color[this._displayWidth * this._displayHeight]; } private static u16 DetermineSize(u16 paletteSize, u16 displayWidth, u16 displayHeight) @@ -30,7 +33,6 @@ public class DisplayDevice : RamDevice Color[] palette = this.ReadPalette(); ref8 pixelData = this.ReadSeq((u16) (this.AddressableStart + this._paletteSize * 3), (u16) (this._displayWidth * this._displayHeight)); - Color[] textureData = new Color[this._displayWidth * this._displayHeight]; for (u16 i = 0; i < textureData.Length; i++) { u8 pixelValue = pixelData[i]; @@ -73,4 +75,15 @@ public class DisplayDevice : RamDevice paletteData[offset + 2] = palette[i].B; } } + + public override void Write(u16 address, u8 value) + { + Console.WriteLine($"DisplayDevice.Write: {address:X4} = {value:X2}"); + base.Write(address, value); + } + public override void WriteSeq(u16 address, u16 length, ref8 value) + { + Console.WriteLine($"DisplayDevice.WriteSeq: {address:X4} length={length} value={Make.u16(value)}"); + base.WriteSeq(address, length, value); + } }
\ No newline at end of file |
