mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
emulation: memlcd: format cs file
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
80419955fb
commit
0ed99d1eba
1 changed files with 19 additions and 18 deletions
|
|
@ -6,14 +6,10 @@
|
|||
//
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Antmicro.Renode.Backends.Display;
|
||||
using Antmicro.Renode.Core;
|
||||
using Antmicro.Renode.Core.Structure.Registers;
|
||||
using Antmicro.Renode.Logging;
|
||||
using Antmicro.Renode.Peripherals.Bus;
|
||||
using Antmicro.Renode.Peripherals.Memory;
|
||||
using Antmicro.Renode.Utilities;
|
||||
|
||||
namespace Antmicro.Renode.Peripherals.Video
|
||||
{
|
||||
|
|
@ -46,23 +42,28 @@ namespace Antmicro.Renode.Peripherals.Video
|
|||
RegistersCollection.Reset();
|
||||
}
|
||||
|
||||
public long Size { get{ return 0x800; }}
|
||||
public long Size { get { return 0x800; } }
|
||||
public DoubleWordRegisterCollection RegistersCollection { get; private set; }
|
||||
|
||||
protected override void Repaint()
|
||||
{
|
||||
var newbuf = new Byte[44*Height];
|
||||
var newbuf = new Byte[44 * Height];
|
||||
machine.SystemBus.ReadBytes(bufferAddress, newbuf.Length, newbuf, 0);
|
||||
for (int y = 0; y < Height; y++) {
|
||||
if (!updateDirty || updateAll || ((newbuf[y*44+0x2a] & 0x1) == 0x1)) for (int x = 0; x < Width; x++) {
|
||||
if (((newbuf[((x+y*44*8))/8] >> (x%8))&1) > 0) {
|
||||
buffer[2*(x+y*Width)] = 0xFF;
|
||||
buffer[2*(x+y*Width)+1] = 0xFF;
|
||||
} else {
|
||||
buffer[2*(x+y*Width)] = 0x0;
|
||||
buffer[2*(x+y*Width)+1] = 0x0;
|
||||
for (int y = 0; y < Height; y++)
|
||||
{
|
||||
if (!updateDirty || updateAll || ((newbuf[y * 44 + 0x2a] & 0x1) == 0x1)) for (int x = 0; x < Width; x++)
|
||||
{
|
||||
if (((newbuf[((x + y * 44 * 8)) / 8] >> (x % 8)) & 1) > 0)
|
||||
{
|
||||
buffer[2 * (x + y * Width)] = 0xFF;
|
||||
buffer[2 * (x + y * Width) + 1] = 0xFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer[2 * (x + y * Width)] = 0x0;
|
||||
buffer[2 * (x + y * Width) + 1] = 0x0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -71,9 +72,9 @@ namespace Antmicro.Renode.Peripherals.Video
|
|||
Registers.COMMAND.Define(this)
|
||||
.WithValueField(0, 32, writeCallback: (_, val) =>
|
||||
{
|
||||
updateDirty = (val & 0x1) == 0x1;
|
||||
updateAll = (val & 0x2) == 0x2;
|
||||
DoRepaint();
|
||||
updateDirty = (val & 0x1) == 0x1;
|
||||
updateAll = (val & 0x2) == 0x2;
|
||||
DoRepaint();
|
||||
})
|
||||
;
|
||||
Registers.BUSY.Define(this)
|
||||
|
|
|
|||
Loading…
Reference in a new issue