From 213f569b4ec44c845890603808e9e660758936fe Mon Sep 17 00:00:00 2001 From: bernie Date: Wed, 15 Feb 2006 09:13:16 +0000 Subject: [PATCH] Switch to BITMAP_FMT_PLANAR_V_LSB. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@514 38d2e660-2303-0410-9eaa-f027e97ec537 --- appconfig.h | 5 ++++- drv/lcd_gfx.h | 7 +++++-- drv/lcd_gfx_qt.cpp | 27 +++++++++++++++++++++++++++ drv/lcd_gfx_qt.h | 5 ++++- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/appconfig.h b/appconfig.h index a30746da..2a71457b 100755 --- a/appconfig.h +++ b/appconfig.h @@ -46,6 +46,9 @@ /*#* *#* $Log$ + *#* Revision 1.6 2006/02/15 09:12:56 bernie + *#* Switch to BITMAP_FMT_PLANAR_V_LSB. + *#* *#* Revision 1.5 2006/02/10 12:34:33 bernie *#* Add missing config options for gfx and kbd. *#* @@ -168,7 +171,7 @@ #define CONFIG_EEPROM_TYPE EEPROM_24XX256 /// Select bitmap pixel format. -#define CONFIG_BITMAP_FMT BITMAP_FMT_PLANAR_H_MSB +#define CONFIG_BITMAP_FMT BITMAP_FMT_PLANAR_V_LSB /// Enable line clipping algorithm. #define CONFIG_GFX_CLIPPING 1 diff --git a/drv/lcd_gfx.h b/drv/lcd_gfx.h index d8626313..3bff2ee1 100755 --- a/drv/lcd_gfx.h +++ b/drv/lcd_gfx.h @@ -16,6 +16,9 @@ /*#* *#* $Log$ + *#* Revision 1.4 2006/02/15 09:13:16 bernie + *#* Switch to BITMAP_FMT_PLANAR_V_LSB. + *#* *#* Revision 1.3 2006/02/10 12:33:51 bernie *#* Make emulator display a bit larger. *#* @@ -35,8 +38,8 @@ #define LCD_MIN_PWM 130 /* Display bitmap dims */ -#define LCD_WIDTH 320 -#define LCD_HEIGHT 200 +#define LCD_WIDTH 128 +#define LCD_HEIGHT 64 /* fwd decl */ struct Bitmap; diff --git a/drv/lcd_gfx_qt.cpp b/drv/lcd_gfx_qt.cpp index 7c2b25f2..9ec7f8a5 100755 --- a/drv/lcd_gfx_qt.cpp +++ b/drv/lcd_gfx_qt.cpp @@ -14,6 +14,9 @@ /*#* *#* $Log$ + *#* Revision 1.5 2006/02/15 09:13:16 bernie + *#* Switch to BITMAP_FMT_PLANAR_V_LSB. + *#* *#* Revision 1.4 2006/02/10 12:33:49 bernie *#* Make emulator display a bit larger. *#* @@ -31,6 +34,7 @@ #include "lcd_gfx_qt.h" #include #include +#include // CONFIG_BITMAP_FMT #include #include @@ -88,8 +92,31 @@ void EmulLCD::drawContents(QPainter *p) void EmulLCD::writeRaster(uint8_t *new_raster) { +#if CONFIG_BITMAP_FMT == BITMAP_FMT_PLANAR_H_MSB + + /* Straight copy */ memcpy(raster, new_raster, sizeof(raster)); +#elif CONFIG_BITMAP_FMT == BITMAP_FMT_PLANAR_V_LSB + + /* Rotation */ + for (int y = 0; y < HEIGHT; ++y) + { + for (int xbyte = 0; xbyte < WIDTH/8; ++xbyte) + { + uint8_t v = 0; + for (int xbit = 0; xbit < 8; ++xbit) + v |= (new_raster[(xbyte * 8 + xbit) + (y / 8) * WIDTH] & (1 << (y%8)) ) + ? (1 << (7 - xbit)) : 0; + + raster[y * ((WIDTH + 7) / 8) + xbyte] = v; + } + } + +#else + #error Unsupported bitmap format +#endif + QPainter p(this); drawContents(&p); } diff --git a/drv/lcd_gfx_qt.h b/drv/lcd_gfx_qt.h index 0b7e1d23..b6864e43 100755 --- a/drv/lcd_gfx_qt.h +++ b/drv/lcd_gfx_qt.h @@ -14,6 +14,9 @@ /*#* *#* $Log$ + *#* Revision 1.3 2006/02/15 09:13:16 bernie + *#* Switch to BITMAP_FMT_PLANAR_V_LSB. + *#* *#* Revision 1.2 2006/02/10 12:33:51 bernie *#* Make emulator display a bit larger. *#* @@ -40,7 +43,7 @@ class EmulLCD : public QFrame public: // Attributes - enum { WIDTH = 320, HEIGHT = 200 }; + enum { WIDTH = 128, HEIGHT = 64 }; // Construction EmulLCD(QWidget *parent = 0, const char *name = 0); -- 2.25.1