From a40840b2ff5ed97a31c4d8a10b74d492038bfc2c Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 31 Dec 2008 06:24:35 +0000 Subject: ported r834 from volker_dev git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@923 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- drv_serdisplib.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'drv_serdisplib.c') diff --git a/drv_serdisplib.c b/drv_serdisplib.c index 96c5dc7..a2a8db2 100644 --- a/drv_serdisplib.c +++ b/drv_serdisplib.c @@ -33,6 +33,7 @@ */ #include "config.h" +#include "debug.h" // verbose_level #include #include @@ -66,6 +67,8 @@ static char Name[] = "serdisplib"; static serdisp_CONN_t *sdcd; static serdisp_t *dd; +int NUMCOLS = 1; + /****************************************/ /*** hardware dependant functions ***/ @@ -74,10 +77,12 @@ static serdisp_t *dd; static void drv_SD_blit(const int row, const int col, const int height, const int width) { int r, c; + RGBA p; for (r = row; r < row + height; r++) { for (c = col; c < col + width; c++) { - RGBA p = drv_generic_graphic_rgb(r, c); + p = drv_generic_graphic_rgb(r, c); + // printf("blit (%d,%d) A%d.R%d.G%d.B%d\n", c, r, p.A, p.R, p.G, p.B); serdisp_setcolour(dd, c, r, serdisp_pack2ARGB(0xff, p.R, p.G, p.B)); } } @@ -183,7 +188,8 @@ static int drv_SD_start(const char *section) DROWS = serdisp_getheight(dd); DCOLS = serdisp_getwidth(dd); - info("%s: display size %dx%d", Name, DCOLS, DROWS); + NUMCOLS = serdisp_getcolours(dd); + info("%s: display size %dx%d, %d colors", Name, DCOLS, DROWS, NUMCOLS); XRES = -1; YRES = -1; @@ -274,7 +280,24 @@ static void plugin_rotate(RESULT * result, RESULT * arg1) /* list models */ int drv_SD_list(void) { - printf("%s", "any"); + serdisp_display_t displaydesc; + + if (verbose_level > 0) { + printf(" Supported displays:\n"); + displaydesc.dispname = ""; + printf(" display name alias names description\n"); + printf(" --------------- -------------------- -----------------------------------\n"); + while (serdisp_nextdisplaydescription(&displaydesc)) { + printf(" %-15s %-20s %-35s\n", displaydesc.dispname, displaydesc.aliasnames, displaydesc.description); + } + } else { + displaydesc.dispname = ""; + while (serdisp_nextdisplaydescription(&displaydesc)) { + printf("%s ", displaydesc.dispname); + } + printf("\n (use -vl to see detailed list of serdisplib)"); + } + return 0; } -- cgit v1.2.3