public Hardware(ushort portBaseAddress, int boardLayoutWidth, int boardLayoutHeight) { this.PortBaseAddress = portBaseAddress; this.m_boardLayoutWidth = boardLayoutWidth; this.m_boardLayoutHeight = boardLayoutHeight; this.m_blankFrame = new ParsedFrame(1, this.m_boardLayoutWidth, this.m_boardLayoutHeight); }
public void OutputFrame(ParsedFrame frame) { this.m_cells.Clear(); for (short i = 0; i < 0x10; i = (short)(i + 1)) { for (short j = 0; j < 0x30; j = (short)(j + 1)) { byte num3 = frame.CellData(i, j); byte num5 = 1; for (int k = 0; k < this.m_boardsUsed; k++) { Point point = this.m_boardLocations[k]; Point point2 = (this.m_boardMultipliers[point.Y, point.X]); if ((num3 & num5) != 0) { this.m_cells.Add((uint)((((j + point2.X) << 0x10) * this.m_cellSize) | ((i + point2.Y) * this.m_cellSize))); } num5 = (byte)(num5 << 1); } } } if (!base.IsDisposed) { if (base.InvokeRequired) { base.Invoke(new MethodInvoker(this.Refresh)); } else { this.Refresh(); } } }
public static ParsedFrame ParseFrame(Frame frame, int boardLayoutWidth, int boardLayoutHeight) { ParsedFrame frame2 = new ParsedFrame(frame.Length, boardLayoutWidth, boardLayoutHeight); foreach (uint num in frame.Cells) { frame2.AddCell(num); } return frame2; }
public static ParsedFrame ParseFrame(Frame frame, int boardLayoutWidth, int boardLayoutHeight) { ParsedFrame frame2 = new ParsedFrame(frame.Length, boardLayoutWidth, boardLayoutHeight); foreach (uint num in frame.Cells) { frame2.AddCell(num); } return(frame2); }
public void UpdateFrame(Frame frame) { if (((this.m_state == RunState.Running) && (this.m_display != null)) && !this.m_display.IsDisposed) { lock (this.m_display) { this.m_display.OutputFrame(ParsedFrame.ParseFrame(frame, this.m_boardLayout.Width, this.m_boardLayout.Height)); } } }
private void OutputFrame(ParsedFrame frame) { for (short i = 0; i < 0x10; i = (short)(i + 1)) { for (short j = 0; j < 0x30; j = (short)(j + 1)) { Out(this.m_dataPort, frame.CellData(i, j)); Out(this.m_controlPort, 10); Out(this.m_controlPort, 11); } Out(this.m_controlPort, 12); Out(this.m_dataPort, i); Out(this.m_controlPort, 6); Out(this.m_controlPort, 11); } }
private void MaintenanceThread() { ParsedFrame frameBuffer = null; this.m_running = true; while (this.m_running) { if (this.m_frameBuffer != null) { frameBuffer = this.m_frameBuffer; this.m_frameBuffer = null; } if (frameBuffer != null) { this.OutputFrame(frameBuffer); } } }
public ParsedFrame MergeWith(ParsedFrame frame) { ParsedFrame frame2 = new ParsedFrame(Math.Max(this.m_length, frame.m_length), Math.Min(this.m_boardLayoutWidth, frame.m_boardLayoutWidth), Math.Min(this.m_boardLayoutHeight, frame.m_boardLayoutHeight)); int length = frame2.m_boardCells.Length; for (int i = 0; i < length; i++) { byte[,] buffer = this.m_boardCells[i]; byte[,] buffer2 = frame.m_boardCells[i]; byte[,] buffer3 = frame2.m_boardCells[i]; int num4 = buffer3.GetLength(0); int num3 = buffer3.GetLength(1); for (int j = 0; j < num4; j++) { for (int k = 0; k < num3; k++) { buffer3[j, k] = (byte)(buffer[j, k] | buffer2[j, k]); } } } return(frame2); }
public ParsedFrame MergeWith(ParsedFrame frame) { ParsedFrame frame2 = new ParsedFrame(Math.Max(this.m_length, frame.m_length), Math.Min(this.m_boardLayoutWidth, frame.m_boardLayoutWidth), Math.Min(this.m_boardLayoutHeight, frame.m_boardLayoutHeight)); int length = frame2.m_boardCells.Length; for (int i = 0; i < length; i++) { byte[,] buffer = this.m_boardCells[i]; byte[,] buffer2 = frame.m_boardCells[i]; byte[,] buffer3 = frame2.m_boardCells[i]; int num4 = buffer3.GetLength(0); int num3 = buffer3.GetLength(1); for (int j = 0; j < num4; j++) { for (int k = 0; k < num3; k++) { buffer3[j, k] = (byte) (buffer[j, k] | buffer2[j, k]); } } } return frame2; }
public void UpdateFrame(Frame frame) { this.m_frameBuffer = ParsedFrame.ParseFrame(frame, this.m_boardLayoutWidth, this.m_boardLayoutHeight); }
private void OutputFrame(ParsedFrame frame) { for (short i = 0; i < 0x10; i = (short) (i + 1)) { for (short j = 0; j < 0x30; j = (short) (j + 1)) { Out(this.m_dataPort, frame.CellData(i, j)); Out(this.m_controlPort, 10); Out(this.m_controlPort, 11); } Out(this.m_controlPort, 12); Out(this.m_dataPort, i); Out(this.m_controlPort, 6); Out(this.m_controlPort, 11); } }