X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Flcd_gfx_qt.cpp;h=9ec7f8a57f24acc9b7afac19b176e2947d83eb6e;hb=972073a11abb5cf0b382b1a74298185ee4a9466a;hp=b8e91cfa59a64bb700cf84974dd95d29346430e4;hpb=0d276e51619c092016aebb0955cd83b5022d6c28;p=bertos.git diff --git a/drv/lcd_gfx_qt.cpp b/drv/lcd_gfx_qt.cpp index b8e91cfa..9ec7f8a5 100755 --- a/drv/lcd_gfx_qt.cpp +++ b/drv/lcd_gfx_qt.cpp @@ -14,6 +14,12 @@ /*#* *#* $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. + *#* *#* Revision 1.3 2006/01/23 23:11:07 bernie *#* Use RASTER_SIZE() to compute... err... the raster size. *#* @@ -28,6 +34,7 @@ #include "lcd_gfx_qt.h" #include #include +#include // CONFIG_BITMAP_FMT #include #include @@ -85,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); } @@ -98,6 +128,7 @@ void EmulLCD::writeRaster(uint8_t *new_raster) /*! * Raster buffer to draw into. + * * Bits in the bitmap bytes have vertical orientation, * as required by the LCD driver. */ @@ -108,18 +139,18 @@ DECLARE_WALL(wall_after_raster, WALL_SIZE) /*! Default LCD bitmap */ struct Bitmap lcd_bitmap; -extern "C" void lcd_init(void) +/*extern "C"*/ void lcd_init(void) { - //INIT_WALL(wall_before_raster); - //INIT_WALL(wall_after_raster); + //FIXME INIT_WALL(wall_before_raster); + //FIXME INIT_WALL(wall_after_raster); gfx_bitmapInit(&lcd_bitmap, lcd_raster, EmulLCD::WIDTH, EmulLCD::HEIGHT); gfx_bitmapClear(&lcd_bitmap); } -extern "C" void lcd_blit_bitmap(Bitmap *bm) +/*extern "C"*/ void lcd_blit_bitmap(Bitmap *bm) { - //CHECK_WALL(wall_before_raster); - //CHECK_WALL(wall_after_raster); + //FIXME CHECK_WALL(wall_before_raster); + //FIXME CHECK_WALL(wall_after_raster); emul->emulLCD->writeRaster(bm->raster); }