private void OnParamsChanged() { // rebuild tables... VideoData = new FrameVideo(Params.c_ulaWidth, Params.c_ulaHeight, 2F); m_ulaAction = new UlaAction[Params.c_frameTactCount]; m_ulaBwOffset = new int[Params.c_frameTactCount]; m_ulaVideoOffset = new int[Params.c_frameTactCount]; for (var tact = 0; tact < Params.c_frameTactCount; tact++) { var tactScreen = tact + Params.c_ulaIntBegin; if (tactScreen < 0) { tactScreen += Params.c_frameTactCount; } else if (tactScreen >= Params.c_frameTactCount) { tactScreen -= Params.c_frameTactCount; } CalcTableItem( tact, tactScreen / Params.c_ulaLineTime, tactScreen % Params.c_ulaLineTime); } }
public void Update(IFrameVideo videoData) { IFrameVideo clone; if (!_updateQueue.TryDequeue(out clone)) { return; } if (clone.Size != videoData.Size || clone.Ratio != videoData.Ratio) { clone = new FrameVideo(videoData.Size, videoData.Ratio); } Array.Copy( videoData.Buffer, clone.Buffer, clone.Buffer.Length); if (VideoFilter == VideoFilter.NoFlick) { FilterNoFlick( clone.Buffer, clone.Size.Width, clone.Size.Height); } _showQueue.Enqueue(clone); }
protected virtual void OnParamsChanged() { VideoData = new FrameVideo(Params.c_ulaWidth, Params.c_ulaHeight, 2F); m_ulaAction = new UlaAction[Params.c_frameTactCount]; m_videoOffset = new int[Params.c_frameTactCount]; m_memoryMask = new int[Params.c_frameTactCount]; m_ulaAddrTXT640BW = new int[Params.c_frameTactCount]; m_ulaAddrTXT640AT = new int[Params.c_frameTactCount]; m_ulaAddrTXT640CG = new int[Params.c_frameTactCount]; for (var tact = 0; tact < m_ulaAction.Length; tact++) { var tvy = tact / Params.c_ulaLineTime; var tvx = tact - (tvy * Params.c_ulaLineTime); var zy = tvy - (Params.c_ulaFirstPaperLine - Params.c_ulaBorderTop); var zx = tvx - (Params.c_ulaFirstPaperTact - Params.c_ulaBorderLeftT); var y = zy - Params.c_ulaBorderTop; var x = zx - Params.c_ulaBorderLeftT; if (y >= 0 && y < 200 && x >= 0 && x < 160) { m_ulaAction[tact] = UlaAction.Paper; m_videoOffset[tact] = Params.c_ulaWidth * zy + 4 * zx; m_memoryMask[tact] = (x & 1) == 0 ? 0x80 : 0x08; x = x / 2; var pageOffsetBw = (x & 1) == 0 ? 0x01C0 : 0x11C0; var pageOffsetAt = ((x + 1) & 1) == 0 ? 0x21C0 : 0x31C0; pageOffsetBw += x >> 1; pageOffsetAt += (x + 1) >> 1; pageOffsetBw += (y >> 3) * 64; pageOffsetAt += (y >> 3) * 64; m_ulaAddrTXT640BW[tact] = pageOffsetBw; m_ulaAddrTXT640AT[tact] = pageOffsetAt; m_ulaAddrTXT640CG[tact] = y & 7; } else if (zy >= 0 && zy < (200 + Params.c_ulaBorderTop + Params.c_ulaBorderBottom) && zx >= 0 && zx < (160 + Params.c_ulaBorderLeftT + Params.c_ulaBorderRightT)) { m_ulaAction[tact] = UlaAction.Border; m_videoOffset[tact] = Params.c_ulaWidth * zy + 4 * zx; } else { m_ulaAction[tact] = UlaAction.None; } } }
protected virtual void OnParamsChanged() { VideoData = new FrameVideo(Params.c_ulaWidth, Params.c_ulaHeight, 1F); m_ulaAction = new UlaAction[Params.c_frameTactCount]; m_videoOffset = new int[Params.c_frameTactCount]; m_memoryOffset = new int[Params.c_frameTactCount]; m_memoryPage = new bool[Params.c_frameTactCount]; for (var tact = 0; tact < m_ulaAction.Length; tact++) { var tvy = tact / Params.c_ulaLineTime; var tvx = tact - (tvy * Params.c_ulaLineTime); var zy = tvy - (Params.c_ulaFirstPaperLine - Params.c_ulaBorderTop); var zx = tvx - (Params.c_ulaFirstPaperTact - Params.c_ulaBorderLeftT); var y = zy - Params.c_ulaBorderTop; var x = zx - Params.c_ulaBorderLeftT; if (y >= 0 && y < 200 && x >= 0 && x < 160) { m_ulaAction[tact] = UlaAction.Paper; m_videoOffset[tact] = Params.c_ulaWidth * zy + 2 * zx; switch (x & 3) { case 0: m_memoryOffset[tact] = 0x0000 + y * 160 / 4 + x / 4; break; case 1: m_memoryOffset[tact] = 0x0000 + y * 160 / 4 + x / 4; break; case 2: m_memoryOffset[tact] = 0x2000 + y * 160 / 4 + x / 4; break; case 3: m_memoryOffset[tact] = 0x2000 + y * 160 / 4 + x / 4; break; } m_memoryPage[tact] = (x & 1) == 0; } else if (zy >= 0 && zy < (200 + Params.c_ulaBorderTop + Params.c_ulaBorderBottom) && zx >= 0 && zx < (160 + Params.c_ulaBorderLeftT + Params.c_ulaBorderRightT)) { m_ulaAction[tact] = UlaAction.Border; m_videoOffset[tact] = Params.c_ulaWidth * zy + 2 * zx; } else { m_ulaAction[tact] = UlaAction.None; } } }
protected virtual void OnParamsChanged() { // rebuild tables... VideoData = new FrameVideo(Params.c_ulaWidth, Params.c_ulaHeight, 1F); m_ulaLineOffset = new int[Params.c_frameTactCount]; m_ulaAddrBw = new int[Params.c_frameTactCount]; m_ulaAddrAt = new int[Params.c_frameTactCount]; m_ulaAction = new UlaAction[Params.c_frameTactCount]; for (var tact = 0; tact < Params.c_frameTactCount; tact++) { var tactScreen = tact + Params.c_ulaIntBegin; if (tactScreen < 0) { tactScreen += Params.c_frameTactCount; } else if (tactScreen >= Params.c_frameTactCount) { tactScreen -= Params.c_frameTactCount; } CalcTableItem( tact, tactScreen / Params.c_ulaLineTime, tactScreen % Params.c_ulaLineTime); } //{ // var xml = new System.Xml.XmlDocument(); // var root = xml.AppendChild(xml.CreateElement("ULA")); // for (var i = 0; i < Params.c_frameTactCount; i++) // { // var xe = xml.CreateElement("Item"); // xe.SetAttribute("tact", i.ToString("D5")); // xe.SetAttribute("offset", m_ulaLineOffset[i].ToString("D6")); // xe.SetAttribute("y", (m_ulaLineOffset[i] / Params.c_ulaWidth).ToString("D3")); // xe.SetAttribute("x", (m_ulaLineOffset[i] % Params.c_ulaWidth).ToString("D3")); // xe.SetAttribute("addrBw", m_ulaAddrBw[i].ToString("X4")); // xe.SetAttribute("addrAt", m_ulaAddrAt[i].ToString("X4")); // xe.SetAttribute("action", m_ulaAction[i].ToString()); // root.AppendChild(xe); // } // xml.Save("_ulaAction.xml"); //} }
protected virtual void OnParamsChanged() { VideoData = new FrameVideo(Params.c_ulaWidth, Params.c_ulaHeight, 2F); m_ulaAction = new UlaAction[Params.c_frameTactCount]; m_videoOffset = new int[Params.c_frameTactCount]; m_memoryOffset = new int[Params.c_frameTactCount]; m_memoryMask = new int[Params.c_frameTactCount]; for (var tact = 0; tact < m_ulaAction.Length; tact++) { var tvy = tact / Params.c_ulaLineTime; var tvx = tact - (tvy * Params.c_ulaLineTime); var zy = tvy - (Params.c_ulaFirstPaperLine - Params.c_ulaBorderTop); var zx = tvx - (Params.c_ulaFirstPaperTact - Params.c_ulaBorderLeftT); var y = zy - Params.c_ulaBorderTop; var x = zx - Params.c_ulaBorderLeftT; if (y >= 0 && y < 200 && x >= 0 && x < 160) { m_ulaAction[tact] = UlaAction.Paper; m_videoOffset[tact] = Params.c_ulaWidth * zy + 4 * zx; m_memoryMask[tact] = (x & 1) == 0 ? 0x80 : 0x08; x /= 2; m_memoryOffset[tact] = (y * 80 + x) / 2 + 0x2000 * ((y * 80 + x) & 1); } else if (zy >= 0 && zy < (200 + Params.c_ulaBorderTop + Params.c_ulaBorderBottom) && zx >= 0 && zx < (160 + Params.c_ulaBorderLeftT + Params.c_ulaBorderRightT)) { m_ulaAction[tact] = UlaAction.Border; m_videoOffset[tact] = Params.c_ulaWidth * zy + 4 * zx; } else { m_ulaAction[tact] = UlaAction.None; } } }
public SprinterRenderer() { VideoData = new FrameVideo(640, 256, 2F); }