/*#*
*#* $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.
*#*
#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
/*#*
*#* $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.
*#*
#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;
/*#*
*#* $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.
*#*
#include "lcd_gfx_qt.h"
#include <emul/emul.h>
#include <cfg/debug.h>
+#include <gfx/gfx.h> // CONFIG_BITMAP_FMT
#include <qpainter.h>
#include <qimage.h>
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);
}
/*#*
*#* $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.
*#*
public:
// Attributes
- enum { WIDTH = 320, HEIGHT = 200 };
+ enum { WIDTH = 128, HEIGHT = 64 };
// Construction
EmulLCD(QWidget *parent = 0, const char *name = 0);