Пример #1
0
        public static void Update(int yOffset)
        {
            var byteOffset = yOffset % Height * bytesPrLine;

            Array.Copy(displayBuf, byteOffset, hwBuffer, 0, hwBufferSize - byteOffset);
            Array.Copy(displayBuf, 0, hwBuffer, hwBufferSize - byteOffset, byteOffset);
            memory.Write(0, hwBuffer);
        }
Пример #2
0
        public void Update(int yOffset = 0)
        {
            int byteOffset = (yOffset % Lcd.Height) * bytesPrLine;

            Array.Copy(displayBuf, byteOffset, hwBuffer, 0, hwBufferSize - byteOffset);
            Array.Copy(displayBuf, 0, hwBuffer, hwBufferSize - byteOffset, byteOffset);
            memory.Write(0, hwBuffer);
        }
Пример #3
0
        public void Update(int yoffset = 0)
        {
            const int bytesPrLine = 3 * 7 + 2;
            int       inOffset    = (yoffset % Lcd.Height) * (bytesPrLine);
            int       outOffset   = 0;

            for (int row = 0; row < Height; row++)
            {
                int pixels;
                for (int i = 0; i < 7; i++)
                {
                    pixels  = displayBuf[inOffset++] & 0xff;
                    pixels |= (displayBuf[inOffset++] & 0xff) << 8;
                    pixels |= (displayBuf[inOffset++] & 0xff) << 16;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                    pixels >>= 3;
                    hwBuffer[outOffset++] = convert[pixels & 0x7];
                }
                pixels  = displayBuf[inOffset++] & 0xff;
                pixels |= (displayBuf[inOffset++] & 0xff) << 8;
                hwBuffer[outOffset++] = convert[pixels & 0x7];
                pixels >>= 3;
                hwBuffer[outOffset++] = convert[pixels & 0x7];
                pixels >>= 3;
                hwBuffer[outOffset++] = convert[pixels & 0x7];
                pixels >>= 3;
                hwBuffer[outOffset++] = convert[pixels & 0x7];
                if (inOffset >= Height * bytesPrLine)
                {
                    inOffset = 0;
                }
            }
            memory.Write(0, hwBuffer);
        }
Пример #4
0
 private void ClearPortChanged()
 {
     SensorManager.Instance.ClearUartPortChanged(this.port);
     uartMemory.Write(UartStatusOffset + (int)port, new byte[] { (byte)(uartMemory.Read(UartStatusOffset + (int)port, 1) [0] & ~UartPortChanged) });
     this.uartMode = UARTMode.Mode0;
 }