/* * Authors (alphabetical order) * - Andre Bernet * - Andreas Weitl * - Bertrand Songis * - Bryan J. Rentoul (Gruvin) * - Cameron Weeks * - Erez Raviv * - Gabriel Birkus * - Jean-Pierre Parisy * - Karl Szmutny * - Michael Blandford * - Michal Hlavinka * - Pat Mackenzie * - Philip Moss * - Rob Thomson * - Romolo Manfredini * - Thomas Husterer * * opentx is based on code named * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * er9x by Erez Raviv: http://code.google.com/p/er9x/, * and the original (and ongoing) project by * Thomas Husterer, th9x: http://code.google.com/p/th9x/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include "opentx.h" void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags) { bool blink = false; bool inv = false; if (flags & BLINK) { if (BLINK_ON_PHASE) { if (flags & INVERS) inv = true; else { blink = true; } } } else if (flags & INVERS) { inv = true; } uint8_t lines = (height+7)/8; assert(lines <= 5); for (int8_t i=0; i> 8)) : (0x0F - (GREY_MASK(att) >> 12))) void lcd_plot(xcoord_t x, uint8_t y, LcdFlags att) { uint8_t *p = &displayBuf[ y / 2 * LCD_W + x ]; uint8_t mask = PIXEL_GREY_MASK(y, att); if (p= LCD_H) return; if (x+w > LCD_W) { w = LCD_W - x; } uint8_t *p = &displayBuf[ y / 2 * LCD_W + x ]; uint8_t mask = PIXEL_GREY_MASK(y, att); while (w--) { if (pat&1) { lcd_mask(p, mask, att); pat = (pat >> 1) | 0x80; } else { pat = pat >> 1; } p++; } } void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att) { if (x >= LCD_W) return; if (y >= LCD_H) return; if (h<0) { y+=h; h=-h; } if (y<0) { h+=y; y=0; } if (y+h > LCD_H) { h = LCD_H - y; } if (pat==DOTTED && !(y%2)) { pat = ~pat; } while (h--) { if (pat & 1) { lcd_plot(x, y, att); pat = (pat >> 1) | 0x80; } else { pat = pat >> 1; } y++; } } void lcd_invert_line(int8_t y) { uint8_t *p = &displayBuf[y * 4 * LCD_W]; for (xcoord_t x=0; x> 4); } else { *p = b; } p++; } } } #endif