Index: uspace/srv/hid/console/gcons.c
===================================================================
--- uspace/srv/hid/console/gcons.c	(revision e3a46c2cf3ba747132a58a4fd76e04283030a577)
+++ uspace/srv/hid/console/gcons.c	(revision 67b05ff8a6156c062aa30c1388fc37fc148a7ea2)
@@ -41,7 +41,9 @@
 #include <align.h>
 #include <bool.h>
+#include <imgmap.h>
 
 #include "console.h"
 #include "gcons.h"
+#include "images.h"
 
 #define CONSOLE_TOP     66
@@ -57,9 +59,4 @@
 #define COLOR_FOREGROUND  0x202020
 #define COLOR_BACKGROUND  0xffffff
-
-extern char _binary_gfx_helenos_ppm_start[0];
-extern int _binary_gfx_helenos_ppm_size;
-extern char _binary_gfx_nameic_ppm_start[0];
-extern int _binary_gfx_nameic_ppm_size;
 
 extern char _binary_gfx_anim_1_ppm_start[0];
@@ -84,4 +81,7 @@
 static sysarg_t xres;
 static sysarg_t yres;
+
+static imgmap_t *helenos_img;
+static imgmap_t *nameic_img;
 
 enum butstate {
@@ -358,13 +358,73 @@
 }
 
-/** Draw a PPM pixmap to framebuffer
- *
- * @param logo Pointer to PPM data
- * @param size Size of PPM data
- * @param x Coordinate of upper left corner
- * @param y Coordinate of upper left corner
- *
- */
-static void draw_pixmap(char *logo, size_t size, sysarg_t x, sysarg_t y)
+/** Draw an image map to framebuffer
+ *
+ * @param img  Image map
+ * @param x    Coordinate of upper left corner
+ * @param y    Coordinate of upper left corner
+ *
+ */
+static void draw_imgmap(imgmap_t *img, sysarg_t x, sysarg_t y)
+{
+	if (img == NULL)
+		return;
+	
+	/* Create area */
+	char *shm = mmap(NULL, img->size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
+	    MAP_ANONYMOUS, 0, 0);
+	if (shm == MAP_FAILED)
+		return;
+	
+	memcpy(shm, img, img->size);
+	
+	/* Send area */
+	int rc = async_obsolete_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
+	if (rc)
+		goto exit;
+	
+	rc = async_obsolete_share_out_start(fbphone, shm, PROTO_READ);
+	if (rc)
+		goto drop;
+	
+	/* Draw logo */
+	async_obsolete_msg_2(fbphone, FB_DRAW_PPM, x, y);
+	
+drop:
+	/* Drop area */
+	async_obsolete_msg_0(fbphone, FB_DROP_SHM);
+	
+exit:
+	/* Remove area */
+	munmap(shm, img->size);
+}
+
+/** Redraws console graphics */
+void gcons_redraw_console(void)
+{
+	if (!use_gcons)
+		return;
+	
+	vp_switch(0);
+	set_rgb_color(COLOR_MAIN, COLOR_MAIN);
+	clear();
+	draw_imgmap(helenos_img, xres - 66, 2);
+	draw_imgmap(nameic_img, 5, 17);
+	
+	unsigned int i;
+	for (i = 0; i < CONSOLE_COUNT; i++)
+		redraw_state(i);
+	
+	vp_switch(console_vp);
+}
+
+/** Creates a pixmap on framebuffer
+ *
+ * @param data PPM data
+ * @param size PPM data size
+ *
+ * @return Pixmap identification
+ *
+ */
+static int make_pixmap(char *data, size_t size)
 {
 	/* Create area */
@@ -372,7 +432,9 @@
 	    MAP_ANONYMOUS, 0, 0);
 	if (shm == MAP_FAILED)
-		return;
-	
-	memcpy(shm, logo, size);
+		return -1;
+	
+	memcpy(shm, data, size);
+	
+	int pxid = -1;
 	
 	/* Send area */
@@ -385,66 +447,4 @@
 		goto drop;
 	
-	/* Draw logo */
-	async_obsolete_msg_2(fbphone, FB_DRAW_PPM, x, y);
-	
-drop:
-	/* Drop area */
-	async_obsolete_msg_0(fbphone, FB_DROP_SHM);
-	
-exit:
-	/* Remove area */
-	munmap(shm, size);
-}
-
-/** Redraws console graphics */
-void gcons_redraw_console(void)
-{
-	if (!use_gcons)
-		return;
-	
-	vp_switch(0);
-	set_rgb_color(COLOR_MAIN, COLOR_MAIN);
-	clear();
-	draw_pixmap(_binary_gfx_helenos_ppm_start,
-	    (size_t) &_binary_gfx_helenos_ppm_size, xres - 66, 2);
-	draw_pixmap(_binary_gfx_nameic_ppm_start,
-	    (size_t) &_binary_gfx_nameic_ppm_size, 5, 17);
-	
-	unsigned int i;
-	for (i = 0; i < CONSOLE_COUNT; i++)
-		redraw_state(i);
-	
-	vp_switch(console_vp);
-}
-
-/** Creates a pixmap on framebuffer
- *
- * @param data PPM data
- * @param size PPM data size
- *
- * @return Pixmap identification
- *
- */
-static int make_pixmap(char *data, size_t size)
-{
-	/* Create area */
-	char *shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED |
-	    MAP_ANONYMOUS, 0, 0);
-	if (shm == MAP_FAILED)
-		return -1;
-	
-	memcpy(shm, data, size);
-	
-	int pxid = -1;
-	
-	/* Send area */
-	int rc = async_obsolete_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
-	if (rc)
-		goto exit;
-	
-	rc = async_obsolete_share_out_start(fbphone, shm, PROTO_READ);
-	if (rc)
-		goto drop;
-	
 	/* Obtain pixmap */
 	rc = async_obsolete_req_0_0(fbphone, FB_SHM2PIXMAP);
@@ -504,4 +504,8 @@
 	if ((xres < 800) || (yres < 600))
 		return;
+	
+	/* Create image maps */
+	helenos_img = imgmap_decode_tga((void *) helenos_tga);
+	nameic_img = imgmap_decode_tga((void *) nameic_tga);
 	
 	/* Create console viewport */
