diff --git a/ChangeLog b/ChangeLog
index 95d4b9f6338c47bf133d13da86550d6710da5acf..b170601ef22d8bbb54b92b6ba8c52174b06a94d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -591,4 +591,6 @@
 0.3.20 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
 	* Initial release of a tiny windowing system for NuttX (not well tested at initial check-in)
 	* Add fixed precision sin() and cos() (not well tested at initial check-in)
-
+	* Add an X11-based simulated framebuffer driver
+	* The simulated target now has an option (CONFIG_SIM_WALLTIME) that will let the simulation
+	  run in more-or-less realtime.
diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index 6dcce8b587d8e2da649e4b8d210eb0af1f5893aa..ecf01aa7c284d75f28c3257c668e75b1d5754753 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -1207,6 +1207,9 @@ buildroot-0.1.2 2007-11-06 &lt;spudmonkey@racsa.co.cr&gt
 nuttx-0.3.20 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
 	* Initial release of a tiny windowing system for NuttX (not well tested at initial check-in)
 	* Add fixed precision sin() and cos() (not well tested at initial check-in)
+	* Add an X11-based simulated framebuffer driver
+	* The simulated target now has an option (CONFIG_SIM_WALLTIME) that will let the simulation
+	  run in more-or-less realtime.
 
 pascal-0.1.3 2008-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
 
diff --git a/TODO b/TODO
index e69cc20e6272332a36346d784b1206760b490f63..5a2a00fad7b68a9ac31a08ffcdd37ac038cce62f 100644
--- a/TODO
+++ b/TODO
@@ -16,7 +16,7 @@ NuttX TODO List (Last updated November 20, 2008)
   (3)  Build system
   (2)  NuttShell (NSH) (examples/nsh)
   (1)  Other Applications & Tests (examples/)
-  (2)  Linux/Cywgin simulation (arch/sim)
+  (1)  Linux/Cywgin simulation (arch/sim)
   (2)  ARM (arch/arm/)
   (1)  ARM/C5471 (arch/arm/src/c5471/)
   (3)  ARM/DM320 (arch/arm/src/dm320/)
@@ -383,14 +383,7 @@ o Other Applications & Tests (examples/)
 o Linux/Cywgin simulation (arch/sim)
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-  Description: Need to implement timing.  Use system timing resources to fake
-               a NuttX real time clock.  At present, the timer is driven in
-               non-realtime (like 1000x realtime) and causes some behavior
-               differences from real platforms.
-  Status:      Open
-  Priority:    Low (because the simulator is only a test/development platform)
-
-  Description: The simulated serial driver also has some odd behavior.  It
+  Description: The simulated serial driver has some odd behavior.  It
                will stall for a long time on reads when the C stdio buffers are
                being refilled. This only effects the behavior of things like
                fgetc().  Workaround: Set CONFIG_STDIO_BUFFER_SIZE=0, suppressing
diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile
index 6897f2f636e4b44e05439fba57e8d44f7fa100c6..eace0a903ee4dc9729d3052753a02d474a93149b 100644
--- a/arch/sim/src/Makefile
+++ b/arch/sim/src/Makefile
@@ -45,7 +45,7 @@ CSRCS		= up_initialize.c up_idle.c up_interruptcontext.c \
 		  up_releasepending.c up_reprioritizertr.c \
 		  up_exit.c up_schedulesigaction.c up_allocateheap.c \
 		  up_devconsole.c up_framebuffer.c
-HOSTSRCS	= up_stdio.c up_x11framebuffer.c
+HOSTSRCS	= up_stdio.c up_hostusleep.c up_x11framebuffer.c
 ifeq ($(CONFIG_FS_FAT),y)
 CSRCS		+= up_blockdevice.c up_deviceimage.c
 endif
diff --git a/arch/sim/src/up_framebuffer.c b/arch/sim/src/up_framebuffer.c
index f81a5512b757ae3a65d354d32a6683a0fe10150a..c7c9ee216b924af44183d3918e167630e76dd8fa 100644
--- a/arch/sim/src/up_framebuffer.c
+++ b/arch/sim/src/up_framebuffer.c
@@ -124,7 +124,7 @@ extern int up_x11initialize(unsigned short width, unsigned short height,
 #ifdef CONFIG_FB_CMAP
 extern int up_x11cmap(unsigned short first, unsigned short len,
                       unsigned char *red, unsigned char *green,
-                      unsigned char *blue, unsigned char  *transp)
+                      unsigned char *blue, unsigned char  *transp);
 #endif
 #endif
 
@@ -132,7 +132,11 @@ extern int up_x11cmap(unsigned short first, unsigned short len,
  * Private Data
  ****************************************************************************/
 
+/* The simulated framebuffer memory */
+
+#ifndef CONFIG_SIM_X11FB
 static ubyte g_fb[FB_SIZE];
+#endif
 
 /* This structure describes the simulated video controller */
 
@@ -160,12 +164,6 @@ static const struct fb_planeinfo_s g_planeinfo =
 static struct fb_planeinfo_s g_planeinfo;
 #endif
 
-/* Simulated RGB mapping */
-
-#ifdef CONFIG_FB_CMAP
-static struct fb_cmap_s g_cmap;
-#endif
-
 /* Current cursor position */
 
 #ifdef CONFIG_FB_HWCURSOR
@@ -245,16 +243,13 @@ static int up_getplaneinfo(FAR struct fb_vtable_s *vtable, int planeno,
 #ifdef CONFIG_FB_CMAP
 static int up_getcmap(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap)
 {
-#ifdef CONFIG_SIM_X11FB
-  return up_x11cmap(cmap->start, cmap->len, cmap->red, cmap->green, cmap->blue, cmap->transp);
-#else
-  int len
+  int len;
   int i;
 
-  dbg("vtable=%p cmap=%p cmap->len\n", vtable, cmap, cmap->len);
+  dbg("vtable=%p cmap=%p len=%d\n", vtable, cmap, cmap->len);
   if (vtable && cmap)
     {
-      for (i = cmap.first, len = 0; i < 256 && len < cmap.len, i++, len++)
+      for (i = cmap->first, len = 0; i < 256 && len < cmap->len; i++, len++)
         {
           cmap->red[i]    = i;
           cmap->green[i]  = i;
@@ -263,12 +258,12 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap
           cmap->transp[i] = i;
 #endif
         }
-      cmap.len = len;
+
+      cmap->len = len;
       return OK;
     }
   dbg("Returning EINVAL\n");
   return -EINVAL;
-#endif
 }
 #endif
 
@@ -279,13 +274,17 @@ static int up_getcmap(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap
 #ifdef CONFIG_FB_CMAP
 static int up_putcmap(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s *cmap)
 {
-  dbg("vtable=%p cmap=%p cmap->len\n", vtable, cmap, cmap->len);
+#ifdef CONFIG_SIM_X11FB
+  return up_x11cmap(cmap->first, cmap->len, cmap->red, cmap->green, cmap->blue, NULL);
+#else
+  dbg("vtable=%p cmap=%p len=%d\n", vtable, cmap, cmap->len);
   if (vtable && cmap)
     {
       return OK;
     }
   dbg("Returning EINVAL\n");
   return -EINVAL;
+#endif
 }
 #endif
 
diff --git a/arch/sim/src/up_x11framebuffer.c b/arch/sim/src/up_x11framebuffer.c
index d19a56f809a7f7bde5eed7f89a3aec24eb16bf99..346f1380f3bab93d1244ebf5466f5f4588552b68 100644
--- a/arch/sim/src/up_x11framebuffer.c
+++ b/arch/sim/src/up_x11framebuffer.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/sim/src/up_framebuffer.c
+ * arch/sim/src/up_x11framebuffer.c
  *
  *   Copyright (C) 2008 Gregory Nutt. All rights reserved.
  *   Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -170,12 +170,12 @@ static int up_x11untraperrors(void)
 #endif
 
 /****************************************************************************
- * Name: up_x11uninitialize
+ * Name: up_x11uninitX
  ***************************************************************************/
 
-void up_x11uninitialize(void)
+static void up_x11uninitX(void)
 {
-  fprintf(stderr, "Uninitalizing\n");
+  fprintf(stderr, "Uninitalizing X\n");
 #ifndef CONFIG_SIM_X11NOSHM
   if (g_shmcheckpoint > 4)
     {
@@ -196,9 +196,24 @@ void up_x11uninitialize(void)
   if (g_shmcheckpoint > 1)
     {
       XDestroyImage(g_image);
-      if (!b_useshm)
+    }
+  XCloseDisplay(g_display);
+}
+
+/****************************************************************************
+ * Name: up_x11uninitialize
+ ***************************************************************************/
+
+#ifndef CONFIG_SIM_X11NOSHM
+static void up_x11uninitialize(void)
+{
+  fprintf(stderr, "Uninitalizing\n");
+  if (g_shmcheckpoint > 1)
+    {
+      if (!b_useshm && g_framebuffer)
         {
           free(g_framebuffer);
+          g_framebuffer = 0;
         }
     }
 
@@ -206,8 +221,8 @@ void up_x11uninitialize(void)
     {
       g_shmcheckpoint = 1;
     }
-  XCloseDisplay(g_display);
 }
+#endif
 
 /****************************************************************************
  * Name: up_x11mapsharedmem
@@ -219,7 +234,7 @@ static inline int up_x11mapsharedmem(int bpp, unsigned int fblen)
   Status result;
 #endif
 
-  atexit(up_x11uninitialize);
+  atexit(up_x11uninitX);
   g_shmcheckpoint = 1;
   b_useshm = 0;
 
@@ -289,7 +304,7 @@ shmerror:
       g_framebuffer = (unsigned char*)malloc(fblen);
 
       g_image = XCreateImage(g_display, DefaultVisual(g_display,g_screen), bpp,
-                             ZPixmap, 0, (char *) g_framebuffer, g_fbpixelwidth, g_fbpixelheight,
+                             ZPixmap, 0, (char*)g_framebuffer, g_fbpixelwidth, g_fbpixelheight,
                              8, 0);
 
       if (g_image == NULL)
@@ -303,27 +318,6 @@ shmerror:
   return 0;
 }
 
-/****************************************************************************
- * Name: up_x11update
- ***************************************************************************/
-
-static void up_x11update(void)
-{
-#ifndef CONFIG_SIM_X11NOSHM
-  if (b_useshm)
-    {
-      XShmPutImage(g_display, g_window, g_gc, g_image, 0, 0, 0, 0,
-                   g_fbpixelwidth, g_fbpixelheight, 0);
-    }
-  else
-#endif
-    {
-      XPutImage(g_display, g_window, g_gc, g_image, 0, 0, 0, 0,
-                g_fbpixelwidth, g_fbpixelheight);
-    }
-  XSync(g_display, 0);
-}
-
 /****************************************************************************
  * Public Functions
  ***************************************************************************/
@@ -363,12 +357,13 @@ int up_x11initialize(unsigned short width, unsigned short height,
 
   *bpp    = windowAttributes.depth;
   *stride = (windowAttributes.depth * width / 8);
-  *fbmem  = (void*)g_framebuffer;
   *fblen  = (*stride * height);
 
   /* Map the window to shared memory */
 
   up_x11mapsharedmem(windowAttributes.depth, *fblen);
+
+  *fbmem  = (void*)g_framebuffer;
   return 0;
 }
 
@@ -411,3 +406,25 @@ int up_x11cmap(unsigned short first, unsigned short len,
 
   return 0;
 }
+
+/****************************************************************************
+ * Name: up_x11update
+ ***************************************************************************/
+
+void up_x11update(void)
+{
+#ifndef CONFIG_SIM_X11NOSHM
+  if (b_useshm)
+    {
+      XShmPutImage(g_display, g_window, g_gc, g_image, 0, 0, 0, 0,
+                   g_fbpixelwidth, g_fbpixelheight, 0);
+    }
+  else
+#endif
+    {
+      XPutImage(g_display, g_window, g_gc, g_image, 0, 0, 0, 0,
+                g_fbpixelwidth, g_fbpixelheight);
+    }
+  XSync(g_display, 0);
+}
+
diff --git a/configs/sim/README.txt b/configs/sim/README.txt
index 8e8fe42f12765206f80c7f274340b9c4a8e1d0d3..aed86deff10630f4dfe6b872670c26d0a06b163f 100644
--- a/configs/sim/README.txt
+++ b/configs/sim/README.txt
@@ -50,6 +50,11 @@ nx
   - The default in defconfig is to use a generic memory buffer
     for the framebuffer.  defconfig-x11 is an example with X11
     support enabled.
+  - The default is the single-user NX implementation.  To select
+    the multi-user NX implementation:
+
+      CONFG_NX_MULTIUSER=y
+      CONFIG_DISABLE_MQUEUE=n
 
 ostest
 
diff --git a/configs/sim/nx/defconfig b/configs/sim/nx/defconfig
index 1eaa2ca54a9cd86401a0fd5106cf04ae74310559..33e7732bbd9479165d7dded14e3e6eedaeabe477 100644
--- a/configs/sim/nx/defconfig
+++ b/configs/sim/nx/defconfig
@@ -124,7 +124,7 @@ CONFIG_DEV_LOWCONSOLE=n
 CONFIG_DISABLE_CLOCK=n
 CONFIG_DISABLE_POSIX_TIMERS=y
 CONFIG_DISABLE_PTHREAD=y
-CONFIG_DISABLE_SIGNALS=y
+CONFIG_DISABLE_SIGNALS=n
 CONFIG_DISABLE_MQUEUE=y
 CONFIG_DISABLE_MOUNTPOINT=y
 CONFIG_DISABLE_ENVIRON=y
diff --git a/configs/sim/nx/defconfig-x11 b/configs/sim/nx/defconfig-x11
index 58ae6a81d67f4d3ea8f98a1536c5aadb8b932bd4..be2feabbc6d9c1526f7bba2d4767dea69a3e2113 100644
--- a/configs/sim/nx/defconfig-x11
+++ b/configs/sim/nx/defconfig-x11
@@ -124,7 +124,7 @@ CONFIG_DEV_LOWCONSOLE=n
 CONFIG_DISABLE_CLOCK=n
 CONFIG_DISABLE_POSIX_TIMERS=y
 CONFIG_DISABLE_PTHREAD=y
-CONFIG_DISABLE_SIGNALS=y
+CONFIG_DISABLE_SIGNALS=n
 CONFIG_DISABLE_MQUEUE=y
 CONFIG_DISABLE_MOUNTPOINT=y
 CONFIG_DISABLE_ENVIRON=y
diff --git a/examples/nx/nx_internal.h b/examples/nx/nx_internal.h
index fa3120906e9020ede3fcf9017f401a9919c38c52..40bf62059e93e8f01f2ff9c77edbbf4f56268b0c 100644
--- a/examples/nx/nx_internal.h
+++ b/examples/nx/nx_internal.h
@@ -54,19 +54,37 @@
 #endif
 
 #ifndef CONFIG_EXAMPLES_NX_VPLANE
-#  define CONFIG_EXAMPLES_NX_VPLANE 0
+#    define CONFIG_EXAMPLES_NX_VPLANE 0
 #endif
 
 #ifndef CONFIG_EXAMPLES_NX_BGCOLOR
-#  define CONFIG_EXAMPLES_NX_BGCOLOR ' '
+#  if CONFIG_SIM_FBBPP == 24 || CONFIG_SIM_FBBPP == 32
+#    define CONFIG_EXAMPLES_NX_BGCOLOR 0x00602020
+#  elif CONFIG_SIM_FBBPP = 16
+#    define CONFIG_EXAMPLES_NX_BGCOLOR 0x3088
+#  else
+#    define CONFIG_EXAMPLES_NX_BGCOLOR ' '
+# endif
 #endif
 
 #ifndef CONFIG_EXAMPLES_NX_COLOR1
-#  define CONFIG_EXAMPLES_NX_COLOR1 '1'
+#  if CONFIG_SIM_FBBPP == 24 || CONFIG_SIM_FBBPP == 32
+#    define CONFIG_EXAMPLES_NX_COLOR1 0x00606020
+#  elif CONFIG_SIM_FBBPP = 16
+#    define CONFIG_EXAMPLES_NX_COLOR1 0x30c8
+#  else
+#    define CONFIG_EXAMPLES_NX_COLOR1 '1'
+# endif
 #endif
 
 #ifndef CONFIG_EXAMPLES_NX_COLOR2
-#  define CONFIG_EXAMPLES_NX_COLOR2 '2'
+#  if CONFIG_SIM_FBBPP == 24 || CONFIG_SIM_FBBPP == 32
+#    define CONFIG_EXAMPLES_NX_COLOR2 0x00606060
+#  elif CONFIG_SIM_FBBPP = 16
+#    define CONFIG_EXAMPLES_NX_COLOR2 0x30cc
+#  else
+#    define CONFIG_EXAMPLES_NX_COLOR2 '2'
+# endif
 #endif
 
 #ifdef CONFIG_NX_MULTIUSER
diff --git a/graphics/nxbe/nxbe.h b/graphics/nxbe/nxbe.h
index 393a0607513a8cfa5dbc7e9600f161ff8d2e4232..5f5e14b76ebe36dc66973aadd618bd2c225451bf 100644
--- a/graphics/nxbe/nxbe.h
+++ b/graphics/nxbe/nxbe.h
@@ -55,6 +55,10 @@
 #  define CONFIG_NX_NPLANES      1  /* Max number of color planes supported */
 #endif
 
+#ifndef CONFIG_NX_NCOLORS
+#  define CONFIG_NX_NCOLORS 256
+#endif
+
 /* These are the values for the clipping order provided to nx_clipper */
 
 #define NX_CLIPORDER_TLRB    (0)   /* Top-left-right-bottom */
@@ -199,7 +203,7 @@ extern "C" {
  ****************************************************************************/
 
 #if CONFIG_FB_CMAP
-EXTERN int nxbe_colormap(FAR const fb_vtable_s *fb);
+EXTERN int nxbe_colormap(FAR struct fb_vtable_s *fb);
 #endif
 
 /****************************************************************************
diff --git a/graphics/nxbe/nxbe_colormap.c b/graphics/nxbe/nxbe_colormap.c
index 2d4b34b7f489c7886097574cd6699a44d6db767b..509cf4f45273bb6078b4df77dc6f78231af8a336 100644
--- a/graphics/nxbe/nxbe_colormap.c
+++ b/graphics/nxbe/nxbe_colormap.c
@@ -40,9 +40,13 @@
 #include <nuttx/config.h>
 
 #include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 #include <debug.h>
 
+#include <nuttx/fb.h>
+
 #include "nxbe.h"
 
 /****************************************************************************
@@ -78,9 +82,9 @@
  ****************************************************************************/
 
 #if CONFIG_FB_CMAP
-int nxbe_colormap(FAR const fb_vtable_s *fb)
+int nxbe_colormap(FAR struct fb_vtable_s *fb)
 {
-  struct fb_cmap cmap;
+  struct fb_cmap_s cmap;
   ubyte  *alloc;
   ubyte  *red;
   ubyte  *green;
@@ -94,7 +98,7 @@ int nxbe_colormap(FAR const fb_vtable_s *fb)
 
   /* Allocate the color map tables */
 
-  size  = 3 * NX_NCOLORS * sizeof(uint16);
+  size  = 3 * CONFIG_NX_NCOLORS * sizeof(uint16);
   alloc = (ubyte*)malloc(size);
   if (alloc < 0)
     {
@@ -103,8 +107,8 @@ int nxbe_colormap(FAR const fb_vtable_s *fb)
   memset(alloc, 0xff, size);
 
   red   = alloc;
-  green = &alloc[NX_NCOLORS];
-  blue  = &alloc[2*NX_NCOLORS];
+  green = &alloc[CONFIG_NX_NCOLORS];
+  blue  = &alloc[2*CONFIG_NX_NCOLORS];
 
   /* Initialize the color map tables. 6*6*6 = 216, the rest
    * are (0xffff, 0xffff, 0xffff)
@@ -113,15 +117,15 @@ int nxbe_colormap(FAR const fb_vtable_s *fb)
   ndx = 0;
   for (i = 0; i < 6; i++)
     {
-      rval = (i * (NX_NCOLORS-1) / 5) << 8;
+      rval = (i * (CONFIG_NX_NCOLORS-1) / 5) << 8;
       for (j = 0; j < 6; j++)
         {
-          gval = (j * (NX_NCOLORS-1) / 5) << 8;
+          gval = (j * (CONFIG_NX_NCOLORS-1) / 5) << 8;
           for (k = 0; k < 6; k++)
             {
               red[ndx]   = rval;
               green[ndx] = gval;
-              blue[ndx]  = k * (NX_NCOLORS-1) / 5;
+              blue[ndx]  = k * (CONFIG_NX_NCOLORS-1) / 5;
               ndx++;
             }
         }
@@ -129,7 +133,7 @@ int nxbe_colormap(FAR const fb_vtable_s *fb)
 
   /* Now configure the cmap structure */
 
-  cmap.len    = NX_NCOLORS;
+  cmap.len    = CONFIG_NX_NCOLORS;
   cmap.red    = red;
   cmap.green  = green;
   cmap.blue   = blue;
@@ -141,7 +145,7 @@ int nxbe_colormap(FAR const fb_vtable_s *fb)
 
   ret =fb->putcmap(fb, &cmap);
 
-  free(cmap);
+  free(alloc);
   return ret;
 }
 #endif
diff --git a/graphics/nxglib/nxglib_filltrapezoid.c b/graphics/nxglib/nxglib_filltrapezoid.c
index 35ded6139d5a967723a71a8973904173f49c318e..b20b46570d212f997572490cf7248fe01b0b5e3f 100644
--- a/graphics/nxglib/nxglib_filltrapezoid.c
+++ b/graphics/nxglib/nxglib_filltrapezoid.c
@@ -117,6 +117,12 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)(
   x1 = trap->top.x1;
   x2 = trap->top.x2;
 
+  /* Calculate the number of rows to render */
+
+  y1    = trap->top.y;
+  y2    = trap->bot.y;
+  nrows = y2 - y1 + 1;
+
   /* Calculate the slope of the left and right side of the trapezoid */
 
   dx1dy = b16divi((trap->bot.x1 - x1), nrows);
@@ -124,28 +130,31 @@ void NXGL_FUNCNAME(nxgl_filltrapezoid,NXGLIB_SUFFIX)(
 
   /* Perform vertical clipping */
 
-  y1 = trap->top.y;
   if (y1 < bounds->pt1.y)
     {
+      /* Calculate the x values for the new top run */
+
       int dy = bounds->pt1.y - y1;
       x1    += dy * dx1dy;
       x2    += dy * dx2dy;
+
+      /* Clip and re-calculate the number of rows to render */
+
       y1     = bounds->pt1.y;
+      nrows  = y2 - y1 + 1;
     }
 
-  y2 = trap->bot.y;
   if (y2 > bounds->pt2.y)
     {
-      y2 = bounds->pt2.y;
-    }
+      /* Clip and re-calculate the number of rows to render */
 
-  /* Then calculate the number of rows to render */
-
-  nrows  = y2 - y1 + 1;
+      y2     = bounds->pt2.y;
+      nrows  = y2 - y1 + 1;
+    }
 
   /* Get the address of the first byte on the first line */
 
-  line   = pinfo->fbmem + y1 * stride ;
+  line = pinfo->fbmem + y1 * stride ;
 
   /* Then fill the trapezoid line-by-line */
 
diff --git a/graphics/nxmu/nxmu_server.c b/graphics/nxmu/nxmu_server.c
index c193dc7cba20c6275c66097982f8b0f356030dd9..186a22ea817126ed5077d68a14407d0588bfd64d 100644
--- a/graphics/nxmu/nxmu_server.c
+++ b/graphics/nxmu/nxmu_server.c
@@ -56,8 +56,6 @@
  * Pre-Processor Definitions
  ****************************************************************************/
 
-#define NX_NCOLORS 256
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
diff --git a/include/nuttx/nxglib.h b/include/nuttx/nxglib.h
index 18284a2d4c0ca18e49a61aa1c1805139dcd04135..5edd639aaa8062959fdb3d7a26d21b820abd9e5d 100644
--- a/include/nuttx/nxglib.h
+++ b/include/nuttx/nxglib.h
@@ -75,7 +75,7 @@
  * the smallest common pixel representation:
  */
 
-#if !defined(CONFIG_NXGLIB_DISABLE_32BPP) || defined(CONFIG_NXGLIB_DISABLE_24BPP)
+#if !defined(CONFIG_NXGLIB_DISABLE_32BPP) || !defined(CONFIG_NXGLIB_DISABLE_24BPP)
 typedef uint32 nxgl_mxpixel_t;
 #elif !defined(CONFIG_NXGLIB_DISABLE_16BPP)
 typedef uint16 nxgl_mxpixel_t;