aboutsummaryrefslogtreecommitdiffstats
path: root/drv_serdisplib.c
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-12-31 06:24:35 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2008-12-31 06:24:35 +0000
commita40840b2ff5ed97a31c4d8a10b74d492038bfc2c (patch)
tree294271bc45faa760f55ed7fac6acd4dc106e2267 /drv_serdisplib.c
parent457102be1ccf791d2a70902dfd3eabf408744d8d (diff)
downloadlcd4linux-a40840b2ff5ed97a31c4d8a10b74d492038bfc2c.tar.gz
ported r834 from volker_dev
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@923 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'drv_serdisplib.c')
-rw-r--r--drv_serdisplib.c29
1 files changed, 26 insertions, 3 deletions
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 <stdlib.h>
#include <stdio.h>
@@ -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;
}