Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ HelenOS.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -487,12 +487,9 @@
 ! [PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_IRQC (y)
 
-% Support for TI AM335x on-chip UART
-! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=beaglebone] CONFIG_AM335X_UART (y/n)
-
 % Support for TI AM335x timers support
 ! [PLATFORM=arm32&MACHINE=beaglebone] CONFIG_AM335X_TIMERS (y)
 
-% Support for TI AMDM37x on-chip UART
-! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=beagleboardxm] CONFIG_AMDM37X_UART (y/n)
+% Support for OMAP on-chip UART
+! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&(MACHINE=beagleboardxm|MACHINE=beaglebone)] CONFIG_OMAP_UART (y/n)
 
 % Support for i8042 controller
@@ -515,5 +512,5 @@
 
 % Serial line input module
-! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_AM335X_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_AMDM37X_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
+! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_OMAP_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_OMAP_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
 
 % EGA support
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ boot/Makefile.common	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -112,4 +112,5 @@
 	$(USPACE_PATH)/srv/hid/remcons/remcons \
 	$(USPACE_PATH)/srv/hid/isdv4_tablet/isdv4_tablet \
+	$(USPACE_PATH)/srv/net/dnsrsrv/dnsrsrv \
 	$(USPACE_PATH)/srv/net/ethip/ethip \
 	$(USPACE_PATH)/srv/net/inetsrv/inetsrv \
@@ -167,4 +168,6 @@
 	$(USPACE_PATH)/app/dltest2/dltest2 \
 	$(USPACE_PATH)/app/dload/dload \
+	$(USPACE_PATH)/app/dnscfg/dnscfg \
+	$(USPACE_PATH)/app/dnsres/dnsres \
 	$(USPACE_PATH)/app/edit/edit \
 	$(USPACE_PATH)/app/inet/inet \
Index: boot/generic/include/memstr.h
===================================================================
--- boot/generic/include/memstr.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ boot/generic/include/memstr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -35,6 +35,8 @@
 #include <typedefs.h>
 
-extern void *memcpy(void *, const void *, size_t);
-extern void *memset(void *, int, size_t);
+extern void *memcpy(void *, const void *, size_t)
+    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
+extern void *memset(void *, int, size_t)
+    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
 extern void *memmove(void *, const void *, size_t);
 
Index: defaults/amd64/Makefile.config
===================================================================
--- defaults/amd64/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/amd64/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/arm32/Makefile.config
===================================================================
--- defaults/arm32/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/arm32/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/arm32/beagleboardxm/Makefile.config
===================================================================
--- defaults/arm32/beagleboardxm/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/arm32/beagleboardxm/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # RAM disk format
-RDFMT = fat
+RDFMT = ext4fs
 
 #framebuffer
Index: defaults/arm32/beaglebone/Makefile.config
===================================================================
--- defaults/arm32/beaglebone/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/arm32/beaglebone/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # RAM disk format
-RDFMT = fat
+RDFMT = ext4fs
 
 #framebuffer
Index: defaults/arm32/gta02/Makefile.config
===================================================================
--- defaults/arm32/gta02/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/arm32/gta02/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,3 +3,3 @@
 
 # RAM disk format
-RDFMT = fat
+RDFMT = ext4fs
Index: defaults/ia32/Makefile.config
===================================================================
--- defaults/ia32/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/ia32/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -6,5 +6,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/ia64/Makefile.config
===================================================================
--- defaults/ia64/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/ia64/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/mips32/Makefile.config
===================================================================
--- defaults/mips32/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/mips32/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/mips64/Makefile.config
===================================================================
--- defaults/mips64/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/mips64/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/ppc32/Makefile.config
===================================================================
--- defaults/ppc32/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/ppc32/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/sparc64/Makefile.config
===================================================================
--- defaults/sparc64/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/sparc64/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -3,5 +3,5 @@
 
 # Ramdisk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: defaults/special/Makefile.config
===================================================================
--- defaults/special/Makefile.config	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ defaults/special/Makefile.config	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -1,4 +1,4 @@
 # RAM disk format
-RDFMT = fat
+RDFMT = ext4fs
 
 # Compiler
Index: kernel/arch/amd64/include/arch/pm.h
===================================================================
--- kernel/arch/amd64/include/arch/pm.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/amd64/include/arch/pm.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -57,9 +57,10 @@
 #ifdef CONFIG_FB
 
-#define VESA_INIT_DES      8
 #define VESA_INIT_SEGMENT  0x8000
+#define VESA_INIT_CODE_DES      8
+#define VESA_INIT_DATA_DES      9
 
 #undef GDT_ITEMS
-#define GDT_ITEMS  9
+#define GDT_ITEMS  10
 
 #endif /* CONFIG_FB */
Index: kernel/arch/amd64/src/pm.c
===================================================================
--- kernel/arch/amd64/src/pm.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/amd64/src/pm.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -112,8 +112,6 @@
 	/* VESA Init descriptor */
 #ifdef CONFIG_FB
-	{
-		0xffff, 0, VESA_INIT_SEGMENT >> 12, AR_PRESENT | AR_CODE | DPL_KERNEL,
-		    0xf, 0, 0, 0, 0, 0
-	}
+	{ 0xffff, 0, VESA_INIT_SEGMENT >> 12, AR_PRESENT | AR_CODE | AR_READABLE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 },
+	{ 0xffff, 0, VESA_INIT_SEGMENT >> 12, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 }
 #endif
 };
Index: kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c
===================================================================
--- kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -61,5 +61,5 @@
 static struct beagleboard {
 	amdm37x_irc_regs_t *irc_addr;
-	amdm37x_uart_t uart;
+	omap_uart_t uart;
 	amdm37x_gpt_t timer;
 } beagleboard;
@@ -167,21 +167,25 @@
 static void bbxm_output_init(void)
 {
+#ifdef CONFIG_OMAP_UART
 	/* UART3 is wired to external RS232 connector */
-	const bool ok = amdm37x_uart_init(&beagleboard.uart,
+	const bool ok = omap_uart_init(&beagleboard.uart,
 	    AMDM37x_UART3_IRQ, AMDM37x_UART3_BASE_ADDRESS, AMDM37x_UART3_SIZE);
 	if (ok) {
 		stdout_wire(&beagleboard.uart.outdev);
 	}
+#endif
 }
 
 static void bbxm_input_init(void)
 {
+#ifdef CONFIG_OMAP_UART
 	srln_instance_t *srln_instance = srln_init();
 	if (srln_instance) {
 		indev_t *sink = stdin_wire();
 		indev_t *srln = srln_wire(srln_instance, sink);
-		amdm37x_uart_input_wire(&beagleboard.uart, srln);
+		omap_uart_input_wire(&beagleboard.uart, srln);
 		amdm37x_irc_enable(beagleboard.irc_addr, AMDM37x_UART3_IRQ);
 	}
+#endif
 }
 
Index: kernel/arch/arm32/src/mach/beaglebone/beaglebone.c
===================================================================
--- kernel/arch/arm32/src/mach/beaglebone/beaglebone.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/arm32/src/mach/beaglebone/beaglebone.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -68,5 +68,5 @@
 	am335x_ctrl_module_t  *ctrl_module;
 	am335x_timer_t timer;
-	am335x_uart_t uart;
+	omap_uart_t uart;
 } bbone;
 
@@ -195,5 +195,6 @@
 static void bbone_output_init(void)
 {
-	const bool ok = am335x_uart_init(&bbone.uart,
+#ifdef CONFIG_OMAP_UART
+	const bool ok = omap_uart_init(&bbone.uart,
 	    AM335x_UART0_IRQ, AM335x_UART0_BASE_ADDRESS,
 	    AM335x_UART0_SIZE);
@@ -201,15 +202,18 @@
 	if (ok)
 		stdout_wire(&bbone.uart.outdev);
+#endif
 }
 
 static void bbone_input_init(void)
 {
+#ifdef CONFIG_OMAP_UART
 	srln_instance_t *srln_instance = srln_init();
 	if (srln_instance) {
 		indev_t *sink = stdin_wire();
 		indev_t *srln = srln_wire(srln_instance, sink);
-		am335x_uart_input_wire(&bbone.uart, srln);
+		omap_uart_input_wire(&bbone.uart, srln);
 		am335x_irc_enable(bbone.irc_addr, AM335x_UART0_IRQ);
 	}
+#endif
 }
 
Index: kernel/arch/ia32/include/arch/pm.h
===================================================================
--- kernel/arch/ia32/include/arch/pm.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/ia32/include/arch/pm.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -50,9 +50,10 @@
 
 #define VESA_INIT_SEGMENT  0x8000
-#define VESA_INIT_DES      7
+#define VESA_INIT_CODE_DES      7
+#define VESA_INIT_DATA_DES      8
 #define KTEXT32_DES        KTEXT_DES
 
 #undef GDT_ITEMS
-#define GDT_ITEMS  8
+#define GDT_ITEMS  9
 
 #endif /* CONFIG_FB */
@@ -67,4 +68,5 @@
 #define AR_CODE       (3 << 3)
 #define AR_WRITABLE   (1 << 1)
+#define AR_READABLE   (1 << 1)
 #define AR_INTERRUPT  (0xe)
 #define AR_TRAP       (0xf)
Index: kernel/arch/ia32/src/boot/vesa_real.inc
===================================================================
--- kernel/arch/ia32/src/boot/vesa_real.inc	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/ia32/src/boot/vesa_real.inc	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -31,5 +31,14 @@
 vesa_init:
 	lidtl vesa_idtr
-	jmp $GDT_SELECTOR(VESA_INIT_DES), $vesa_init_real - vesa_init
+	
+	mov $GDT_SELECTOR(VESA_INIT_DATA_DES), %bx
+	
+	mov %bx, %es
+	mov %bx, %fs
+	mov %bx, %gs
+	mov %bx, %ds
+	mov %bx, %ss
+	
+	jmp $GDT_SELECTOR(VESA_INIT_CODE_DES), $vesa_init_real - vesa_init
 
 vesa_idtr:
@@ -39,5 +48,4 @@
 .code16
 vesa_init_real:
-	
 	mov %cr0, %eax
 	and $~1, %eax
@@ -45,5 +53,5 @@
 	
 	jmp $VESA_INIT_SEGMENT, $vesa_init_real2 - vesa_init
-	
+
 vesa_init_real2:
 	mov $VESA_INIT_SEGMENT, %bx
Index: kernel/arch/ia32/src/pm.c
===================================================================
--- kernel/arch/ia32/src/pm.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/arch/ia32/src/pm.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -75,5 +75,6 @@
 	/* VESA Init descriptor */
 #ifdef CONFIG_FB
-	{ 0xffff, 0, VESA_INIT_SEGMENT >> 12, AR_PRESENT | AR_CODE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 }
+	{ 0xffff, 0, VESA_INIT_SEGMENT >> 12, AR_PRESENT | AR_CODE | AR_READABLE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 },
+	{ 0xffff, 0, VESA_INIT_SEGMENT >> 12, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_KERNEL, 0xf, 0, 0, 0, 0, 0 }
 #endif
 };
Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/genarch/Makefile.inc	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -66,5 +66,4 @@
 	GENARCH_SOURCES += \
 		genarch/src/fb/font-8x16.c \
-		genarch/src/fb/logo-196x66.c \
 		genarch/src/fb/fb.c \
 		genarch/src/fb/bfb.c
@@ -106,7 +105,7 @@
 endif
 
-ifeq ($(CONFIG_AM335X_UART),y)
+ifeq ($(CONFIG_OMAP_UART),y)
 	GENARCH_SOURCES += \
-		genarch/src/drivers/am335x/uart.c
+		genarch/src/drivers/omap/uart.c
 endif
 
@@ -114,9 +113,4 @@
 	GENARCH_SOURCES += \
 		genarch/src/drivers/am335x/timer.c
-endif
-
-ifeq ($(CONFIG_AMDM37X_UART),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/amdm37x/uart.c
 endif
 
Index: kernel/genarch/include/genarch/drivers/am335x/uart.h
===================================================================
--- kernel/genarch/include/genarch/drivers/am335x/uart.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/genarch/include/genarch/drivers/am335x/uart.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -37,5 +37,5 @@
 #define _KERN_AM335X_UART_H_
 
-#include "uart_regs.h"
+#include <genarch/drivers/omap/uart.h>
 
 #define AM335x_UART0_BASE_ADDRESS    0x44E09000
@@ -63,24 +63,4 @@
 #define AM335x_UART5_IRQ             46
 
-typedef struct {
-	am335x_uart_regs_t *regs;
-	indev_t *indev;
-	outdev_t outdev;
-	irq_t irq;
-} am335x_uart_t;
-
-#ifdef CONFIG_AM335X_UART
-extern bool am335x_uart_init(am335x_uart_t *uart, inr_t interrupt,
-    uintptr_t addr, size_t size);
-
-extern void am335x_uart_input_wire(am335x_uart_t *uart, indev_t *indev);
-#else
-static bool am335x_uart_init(am335x_uart_t *uart, inr_t interrupt,
-    uintptr_t addr, size_t size)
-{ return true; }
-
-static void am335x_uart_input_wire(am335x_uart_t *uart, indev_t *indev) {}
-#endif
-
 #endif
 
Index: rnel/genarch/include/genarch/drivers/am335x/uart_regs.h
===================================================================
--- kernel/genarch/include/genarch/drivers/am335x/uart_regs.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ 	(revision )
@@ -1,431 +1,0 @@
-/*
- * Copyright (c) 2012 Jan Vesely
- * Copyright (c) 2012 Maurizio Lombardi
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/** @addtogroup genarch
- * @{
- */
-/**
- * @file
- * @brief Texas Instruments AM335x UART memory mapped registers.
- */
-
-#ifndef _KERN_AM335X_UART_REGS_H_
-#define _KERN_AM335X_UART_REGS_H_
-
-#include <typedefs.h>
-#include <console/chardev.h>
-#include <ddi/irq.h>
-
-typedef struct {
-	union {
-		/** Stores lower part of the 14-bit baud divisor */
-		ioport32_t dll;
-#define AM335x_UART_DLL_MASK   (0xff)
-
-		/** Receive holding register */
-		const ioport32_t rhr;
-#define AM335x_UART_RHR_MASK   (0xff)
-
-		/** Transmit holding register */
-		ioport32_t thr;
-#define AM335x_UART_THR_MASK   (0xff)
-	};
-
-	union {
-		/** Stores higher part of the 14-bit baud divisor */
-		ioport32_t dlh;
-#define AM335x_UART_DLH_MASK   (0x1f)
-
-		/** Interrupt enable registers */
-		ioport32_t ier;
-#define AM335x_UART_IER_RHR_IRQ_FLAG   (1 << 0)
-#define AM335x_UART_IER_THR_IRQ_FLAG   (1 << 1)
-#define AM335x_UART_IER_LINE_STS_IRQ_FLAG   (1 << 2)
-#define AM335x_UART_IER_MODEM_STS_IRQ_FLAG   (1 << 3)
-#define AM335x_UART_IER_SLEEP_MODE_FLAG   (1 << 4)
-#define AM335x_UART_IER_XOFF_IRQ_FLAG   (1 << 5)
-#define AM335x_UART_IER_RTS_IRQ_FLAG   (1 << 6)
-#define AM335x_UART_IER_CTS_IRQ_FLAG   (1 << 7)
-
-#define AM335x_CIR_IER_RHR_IRQ_FLAG   (1 << 0)
-#define AM335x_CIR_IER_THR_IRQ_FLAG   (1 << 1)
-#define AM335x_CIR_IER_RX_STOP_IRQ_FLAG   (1 << 2)
-#define AM335x_CIR_IER_RX_OVERRUN_IRQ_FLAG   (1 << 3)
-#define AM335x_CIR_IER_TX_STS_IRQ_FLAG   (1 << 5)
-
-#define AM335x_IRDA_IER_RHR_IRQ_FLAG   (1 << 0)
-#define AM335x_IRDA_IER_THR_IRQ_FLAG   (1 << 1)
-#define AM335x_IRDA_IER_LAST_RX_BYTE_IRQ_FLAG   (1 << 2)
-#define AM335x_IRDA_IER_RX_OVERRUN_IRQ_FLAG   (1 << 3)
-#define AM335x_IRDA_IER_STS_FIFO_TRIG_IRQ_FLAG   (1 << 4)
-#define AM335x_IRDA_IER_TX_STS_IRQ_FLAG   (1 << 5)
-#define AM335x_IRDA_IER_LINE_STS_IRQ_FLAG   (1 << 6)
-#define AM335x_IRDA_IER_EOF_IRQ_FLAG   (1 << 7)
-	};
-
-	union {
-		/** Interrupt identification register */
-		const ioport32_t iir;
-#define AM335x_UART_IIR_IRQ_PENDING_FLAG   (1 << 0)
-#define AM335x_UART_IIR_TYPE_MASK   (0x1f)
-#define AM335x_UART_IIR_TYPE_SHIFT   (1)
-#define AM335x_UART_IIR_FCR_MASK   (0x3)
-#define AM335x_UART_IIR_FCR_SHIFT   (6)
-
-#define AM335x_CIR_IIR_RHR_IRQ_FLAG   (1 << 0)
-#define AM335x_CIR_IIR_THR_IRQ_FLAG   (1 << 1)
-#define AM335x_CIR_IIR_RX_STOP_IRQ_FLAG   (1 << 2)
-#define AM335x_CIR_IIR_RX_OE_IRQ_FLAG   (1 << 3)
-#define AM335x_CIR_IIR_TX_STS_IRQ_FLAG   (1 << 5)
-
-#define AM335x_IRDA_IIR_RHR_IRQ_FLAG   (1 << 0)
-#define AM335x_IRDA_IIR_THR_IRQ_FLAG   (1 << 1)
-#define AM335x_IRDA_IIR_RX_FIFO_LB_IRQ_FLAG   (1 << 2)
-#define AM335x_IRDA_IIR_RX_OE_IRQ_FLAG   (1 << 3)
-#define AM335x_IRDA_IIR_STS_FIFO_IRQ_FLAG   (1 << 4)
-#define AM335x_IRDA_IIR_TX_STS_IRQ_FLAG   (1 << 5)
-#define AM335x_IRDA_IIR_LINE_STS_IRQ_FLAG   (1 << 6)
-#define AM335x_IRDA_IIR_EOF_IRQ_FLAG   (1 << 7)
-
-		/** FIFO control register */
-		ioport32_t fcr;
-#define AM335x_UART_FCR_FIFO_EN_FLAG   (1 << 0)
-#define AM335x_UART_FCR_RX_FIFO_CLR_FLAG   (1 << 1)
-#define AM335x_UART_FCR_TX_FIFO_CLR_FLAG   (1 << 3)
-#define AM335x_UART_FCR_DMA_MODE_FLAG   (1 << 4)
-
-#define AM335x_UART_FCR_TX_FIFO_TRIG_MASK   (0x3)
-#define AM335x_UART_FCR_TX_FIFO_TRIG_SHIFT   (4)
-
-#define AM335x_UART_FCR_RX_FIFO_TRIG_MASK   (0x3)
-#define AM335x_UART_FCR_RX_FIFO_TRIG_SHIFT   (6)
-
-		/** Enhanced feature register */
-		ioport32_t efr;
-#define AM335x_UART_EFR_SW_FLOW_CTRL_RX_MASK   (0x3)
-#define AM335x_UART_EFR_SW_FLOW_CTRL_RX_SHIFT   (0)
-#define AM335x_UART_EFR_SW_FLOW_CTRL_TX_MASK   (0x3)
-#define AM335x_UART_EFR_SW_FLOW_CTRL_TX_SHIFT   (2)
-
-#define AM335x_UART_EFR_SW_FLOW_CTRL_NONE   (0x0)
-#define AM335x_UART_EFR_SW_FLOW_CTRL_X2   (0x1)
-#define AM335x_UART_EFR_SW_FLOW_CTRL_X1   (0x2)
-#define AM335x_UART_EFR_SW_FLOW_CTRL_XBOTH   (0x3)
-
-#define AM335x_UART_EFR_ENH_FLAG   (1 << 4)
-#define AM335x_UART_EFR_SPEC_CHAR_FLAG   (1 << 5)
-#define AM335x_UART_EFR_AUTO_RTS_EN_FLAG   (1 << 6)
-#define AM335x_UART_EFR_AUTO_CTS_EN_FLAG   (1 << 7)
-	};
-
-	/** Line control register */
-	ioport32_t lcr;
-#define AM335x_UART_LCR_CHAR_LENGTH_MASK   (0x3)
-#define AM335x_UART_LCR_CHAR_LENGTH_SHIFT   (0)
-#define AM335x_UART_LCR_CHAR_LENGTH_5BITS   (0x0)
-#define AM335x_UART_LCR_CHAR_LENGTH_6BITS   (0x1)
-#define AM335x_UART_LCR_CHAR_LENGTH_7BITS   (0x2)
-#define AM335x_UART_LCR_CHAR_LENGTH_8BITS   (0x3)
-#define AM335x_UART_LCR_NB_STOP_FLAG   (1 << 2)
-#define AM335x_UART_LCR_PARITY_EN_FLAG   (1 << 3)
-#define AM335x_UART_LCR_PARITY_TYPE1_FLAG   (1 << 4)
-#define AM335x_UART_LCR_PARITY_TYPE2_FLAG   (1 << 5)
-#define AM335x_UART_LCR_BREAK_EN_FLAG   (1 << 6)
-#define AM335x_UART_LCR_DIV_EN_FLAG   (1 << 7)
-
-
-	union {
-		/** Modem control register */
-		ioport32_t mcr;
-#define AM335x_UART_MCR_DTR_FLAG   (1 << 0)
-#define AM335x_UART_MCR_RTS_FLAG   (1 << 1)
-#define AM335x_UART_MCR_RI_STS_CH_FLAG   (1 << 2)
-#define AM335x_UART_MCR_CD_STS_CH_FLAG   (1 << 3)
-#define AM335x_UART_MCR_LOOPBACK_EN_FLAG   (1 << 4)
-#define AM335x_UART_MCR_XON_EN_FLAG   (1 << 5)
-#define AM335x_UART_MCR_TCR_TLR_FLAG   (1 << 6)
-
-		/** UART: XON1 char, IRDA: ADDR1 address */
-		ioport32_t xon1_addr1;
-#define AM335x_UART_XON1_ADDR1_MASK   (0xff)
-	};
-
-	union {
-		/** Line status register */
-		const ioport32_t lsr;
-#define AM335x_UART_LSR_RX_FIFO_E_FLAG   (1 << 0)
-#define AM335x_UART_LSR_RX_OE_FLAG   (1 << 1)
-#define AM335x_UART_LSR_RX_PE_FLAG   (1 << 2)
-#define AM335x_UART_LSR_RX_FE_FLAG   (1 << 3)
-#define AM335x_UART_LSR_RX_BI_FLAG   (1 << 4)
-#define AM335x_UART_LSR_TX_FIFO_E_FLAG   (1 << 5)
-#define AM335x_UART_LSR_TX_SR_E_FLAG   (1 << 6)
-#define AM335x_UART_LSR_RX_FIFO_STS_FLAG   (1 << 7)
-
-#define AM335x_CIR_LSR_RX_FIFO_E_FLAG   (1 << 0)
-#define AM335x_CIR_LSR_RX_STOP_FLAG   (1 << 5)
-#define AM335x_CIR_LSR_THR_EMPTY_FLAG   (1 << 7)
-
-#define AM335x_IRDA_LSR_RX_FIFO_E_FLAG   (1 << 0)
-#define AM335x_IRDA_LSR_STS_FIFO_E_FLAG   (1 << 1)
-#define AM335x_IRDA_LSR_CRC_FLAG   (1 << 2)
-#define AM335x_IRDA_LSR_ABORT_FLAG   (1 << 3)
-#define AM335x_IRDA_LSR_FTL_FLAG   (1 << 4)
-#define AM335x_IRDA_LSR_RX_LAST_FLAG   (1 << 5)
-#define AM335x_IRDA_LSR_STS_FIFO_FULL_FLAG   (1 << 6)
-#define AM335x_IRDA_LSR_THR_EMPTY_FLAG   (1 << 7)
-
-		/** UART: XON2 char, IRDA: ADDR2 address */
-		ioport32_t xon2_addr2;
-	};
-
-	union {
-		/** Modem status register */
-		const ioport32_t msr;
-#define AM335x_UART_MSR_CTS_STS_FLAG   (1 << 0)
-#define AM335x_UART_MSR_DSR_STS_FLAG   (1 << 1)
-#define AM335x_UART_MSR_RI_STS_FLAG   (1 << 2)
-#define AM335x_UART_MSR_DCD_STS_FLAG   (1 << 3)
-#define AM335x_UART_MSR_NCTS_STS_FLAG   (1 << 4)
-#define AM335x_UART_MSR_NDSR_STS_FLAG   (1 << 5)
-#define AM335x_UART_MSR_NRI_STS_FLAG   (1 << 6)
-#define AM335x_UART_MSR_NCD_STS_FLAG   (1 << 7)
-
-		/** Transmission control register */
-		ioport32_t tcr;
-#define AM335x_UART_TCR_FIFO_TRIG_MASK   (0xf)
-#define AM335x_UART_TCR_FIFO_TRIG_HALT_SHIFT   (0)
-#define AM335x_UART_TCR_FIFO_TRIG_START_SHIFT   (4)
-
-		/** UART: XOFF1 char */
-		ioport32_t xoff1;
-#define AM335x_UART_XOFF1_MASK   (0xff)
-	};
-
-	union {
-		/* Scratchpad register, does nothing */
-		ioport32_t spr;
-#define AM335x_UART_SPR_MASK   (0xff)
-
-		/* Trigger level register */
-		ioport32_t tlr;
-#define AM335x_UART_TLR_LEVEL_MASK   (0xf)
-#define AM335x_UART_TLR_TX_FIFO_TRIG_SHIFT   (0)
-#define AM335x_UART_TLR_RX_FIFO_TRIG_SHIFT   (4)
-
-		/** UART: XOFF2 char */
-		ioport32_t xoff2;
-#define AM335x_UART_XOFF2_MASK   (0xff)
-	};
-
-	/** Mode definition register. */
-	ioport32_t mdr1;
-#define AM335x_UART_MDR_MS_MASK   (0x7)
-#define AM335x_UART_MDR_MS_SHIFT   (0)
-#define AM335x_UART_MDR_MS_UART16   (0x0)
-#define AM335x_UART_MDR_MS_SIR   (0x1)
-#define AM335x_UART_MDR_MS_UART16_AUTO   (0x2)
-#define AM335x_UART_MDR_MS_UART13   (0x3)
-#define AM335x_UART_MDR_MS_MIR   (0x4)
-#define AM335x_UART_MDR_MS_FIR   (0x5)
-#define AM335x_UART_MDR_MS_CIR   (0x6)
-#define AM335x_UART_MDR_MS_DISABLE   (0x7)
-
-#define AM335x_UART_MDR_IR_SLEEP_FLAG   (1 << 3)
-#define AM335x_UART_MDR_SET_TXIR_FLAG   (1 << 4)
-#define AM335x_UART_MDR_SCT_FLAG   (1 << 5)
-#define AM335x_UART_MDR_SIP_FLAG   (1 << 6)
-#define AM335x_UART_MDR_FRAME_END_MODE_FLAG   (1 << 7)
-
-	/** Mode definition register */
-	ioport32_t mdr2;
-#define AM335x_UART_MDR_IRTX_UNDERRUN_FLAG   (1 << 0)
-#define AM335x_UART_MDR_STS_FIFO_TRIG_MASK   (0x3)
-#define AM335x_UART_MDR_STS_FIFO_TRIG_SHIFT   (1)
-#define AM335x_UART_MDR_PULSE_SHAPING_FLAG   (1 << 3)
-#define AM335x_UART_MDR_CIR_PULSE_MODE_MASK   (0x3)
-#define AM335x_UART_MDR_CIR_PULSE_MODE_SHIFT   (4)
-#define AM335x_UART_MDR_IRRXINVERT_FLAG   (1 << 6)
-
-	union {
-		/** Status FIFO line status register (IrDA only) */
-		const ioport32_t sflsr;
-#define AM335x_IRDA_SFLSR_CRC_ERROR_FLAG   (1 << 1)
-#define AM335x_IRDA_SFLSR_ABORT_FLAG   (1 << 2)
-#define AM335x_IRDA_SFLSR_FTL_FLAG   (1 << 3)
-#define AM335x_IRDA_SFLSR_OE_FLAG   (1 << 4)
-
-		/** Transmit frame length low (IrDA only) */
-		ioport32_t txfll;
-#define AM335x_UART_TXFLL_MASK   (0xff)
-	};
-
-	union {
-		/** Dummy register to restart TX or RX (IrDA only) */
-		const ioport32_t resume;
-		/** Transmit frame length high (IrDA only) */
-		ioport32_t txflh;
-#define AM335x_UART_TXFLH_MASK   (0xff)
-	};
-
-	union {
-		/** Status FIFO register low (IrDA only) */
-		const ioport32_t sfregl;
-#define AM335x_UART_SFREGL_MASK   (0xff)
-		/** Received frame length low (IrDA only) */
-		ioport32_t rxfll;
-#define AM335x_UART_RXFLL_MASK   (0xff)
-	};
-
-	union {
-		/** Status FIFO register high (IrDA only) */
-		const ioport32_t sfregh;
-#define AM335x_UART_SFREGH_MASK   (0xf)
-		/** Received frame length high (IrDA only) */
-		ioport32_t rxflh;
-#define AM335x_UART_RXFLH_MASK   (0xf)
-	};
-
-	union {
-		/** UART autobauding status register */
-		const ioport32_t uasr;
-#define AM335x_UART_UASR_SPEED_MASK   (0x1f)
-#define AM335x_UART_UASR_SPEED_SHIFT   (0)
-#define AM335x_UART_UASR_8BIT_CHAR_FLAG   (1 << 5)
-#define AM335x_UART_UASR_PARITY_MASK   (0x3)
-#define AM335x_UART_UASR_PARITY_SHIFT   (6)
-
-		/** BOF control register (IrDA only) */
-		ioport32_t blr;
-#define AM335x_IRDA_BLR_XBOF_TYPE_FLAG   (1 << 6)
-#define AM335x_IRDA_BLR_STS_FIFO_RESET   (1 << 7)
-	};
-
-	/** Auxiliary control register (IrDA only) */
-	ioport32_t acreg;
-#define AM335x_IRDA_ACREG_EOT_EN_FLAG   (1 << 0)
-#define AM335x_IRDA_ACREG_ABORT_EN_FLAG   (1 << 1)
-#define AM335x_IRDA_ACREG_SCTX_EN_FLAG   (1 << 2)
-#define AM335x_IRDA_ACREG_SEND_SIP_FLAG   (1 << 3)
-#define AM335x_IRDA_ACREG_DIS_TX_UNDERRUN_FLAG   (1 << 4)
-#define AM335x_IRDA_ACREG_DIS_IR_RX_FLAG   (1 << 5)
-#define AM335x_IRDA_ACREG_SD_MOD_FLAG   (1 << 6)
-#define AM335x_IRDA_ACREG_PULSE_TYPE_FLAG   (1 << 7)
-
-	/** Supplementary control register */
-	ioport32_t scr;
-#define AM335x_UART_SCR_DMA_MODE_CTL_FLAG   (1 << 0)
-#define AM335x_UART_SCR_DMA_MODE_MASK   (0x3)
-#define AM335x_UART_SCR_DMA_MODE_SHIFT   (1)
-#define AM335x_UART_SCR_TX_EMPTY_CTL_IRQ_FLAG   (1 << 3)
-#define AM335x_UART_SCR_RX_CTS_WU_EN_FLAG   (1 << 4)
-#define AM335x_UART_SCR_TX_TRIG_GRANU1_FLAG   (1 << 6)
-#define AM335x_UART_SCR_RX_TRIG_GRANU1_FLAG   (1 << 7)
-
-	/** Supplementary status register */
-	const ioport32_t ssr;
-#define AM335x_UART_SSR_TX_FIFO_FULL_FLAG   (1 << 0)
-#define AM335x_UART_SSR_RX_CTS_WU_STS_FLAG   (1 << 1)
-#define AM335x_UART_SSR_DMA_COUNTER_RESET_FLAG   (1 << 2)
-
-	/** BOF Length register (IrDA only)*/
-	ioport32_t eblr;
-#define AM335x_IRDA_EBLR_DISABLED   (0x00)
-#define AM335x_IRDA_EBLR_RX_STOP_BITS(bits)   (bits & 0xff)
-
-	uint32_t padd0_;
-
-	/** Module version register */
-	const ioport32_t mvr;
-#define AM335x_UART_MVR_MINOR_MASK   (0xf)
-#define AM335x_UART_MVR_MINOR_SHIFT   (0)
-#define AM335x_UART_MVR_MAJOR_MASK   (0xf)
-#define AM335x_UART_MVR_MAJOR_SHIFT   (4)
-
-	/** System configuration register */
-	ioport32_t sysc;
-#define AM335x_UART_SYSC_AUTOIDLE_FLAG   (1 << 0)
-#define AM335x_UART_SYSC_SOFTRESET_FLAG   (1 << 1)
-#define AM335x_UART_SYSC_ENWAKEUP_FLAG   (1 << 2)
-#define AM335x_UART_SYSC_IDLE_MODE_MASK   (0x3)
-#define AM335x_UART_SYSC_IDLE_MODE_SHIFT   (3)
-#define AM335x_UART_SYSC_IDLE_MODE_FORCE   (0x0)
-#define AM335x_UART_SYSC_IDLE_MODE_NO   (0x1)
-#define AM335x_UART_SYSC_IDLE_MODE_SMART   (0x2)
-
-	/** System status register */
-	const ioport32_t syss;
-#define AM335x_UART_SYSS_RESETDONE_FLAG   (1 << 0)
-
-	/** Wake-up enable register */
-	ioport32_t wer;
-#define AM335x_UART_WER_CTS_ACTIVITY_FLAG  (1 << 0)
-#define AM335x_UART_WER_RI_ACTIVITY_FLAG  (1 << 2)
-#define AM335x_UART_WER_RX_ACTIVITY_FLAG  (1 << 4)
-#define AM335x_UART_WER_RHR_IRQ_FLAG  (1 << 5)
-#define AM335x_UART_WER_RLS_IRQ_FLAG  (1 << 6)
-#define AM335x_UART_WER_TX_WAKEUP_EN_FLAG  (1 << 7)
-
-	/** Carrier frequency prescaler */
-	ioport32_t cfps;
-#define AM335x_UART_CFPS_MASK   (0xff)
-
-	/** Number of bytes in RX fifo */
-	const ioport32_t rx_fifo_lvl;
-#define AM335x_UART_RX_FIFO_LVL_MASK   (0xff)
-
-	/** Number of bytes in TX fifo */
-	const ioport32_t tx_fifo_lvl;
-#define AM335x_UART_TX_FIFO_LVL_MASK   (0xff)
-
-	/** RX/TX empty interrupts */
-	ioport32_t ier2;
-#define AM335x_UART_IER2_RX_FIFO_EMPTY_IRQ_EN_FLAG  (1 << 0)
-#define AM335x_UART_IER2_TX_FIFO_EMPTY_IRQ_EN_FLAG  (1 << 1)
-
-	/** RX/TX empty status */
-	ioport32_t isr2;
-#define AM335x_UART_ISR2_RX_FIFO_EMPTY_FLAG  (1 << 0)
-#define AM335x_UART_ISR2_TX_FIFO_EMPTY_FLAG  (1 << 1)
-
-	/** Set the sample per bit if non default frequency is used */
-	ioport32_t freq_sel;
-#define AM335x_UART_FREQ_SEL_MASK  (0x000000FF)
-
-	uint32_t padd2_[2];
-
-	/** Mode definition register 3 */
-	ioport32_t mdr3;
-#define AM335x_UART_MDR3_DIS_CIR_RX_DEMOD_FLAG   (1 << 0)
-} am335x_uart_regs_t;
-
-#endif
-
-/**
- * @}
- */
Index: kernel/genarch/include/genarch/drivers/amdm37x/uart.h
===================================================================
--- kernel/genarch/include/genarch/drivers/amdm37x/uart.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/genarch/include/genarch/drivers/amdm37x/uart.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -37,5 +37,5 @@
 #define _AMDM37x_UART_H_
 
-#include "uart_regs.h"
+#include <genarch/drivers/omap/uart.h>
 
 /* AMDM37x TRM p. 2950 */
@@ -56,15 +56,4 @@
 #define AMDM37x_UART4_IRQ   80 /* AMDM37x TRM p. 2418 */
 
-typedef struct {
-	amdm37x_uart_regs_t *regs;
-	indev_t *indev;
-	outdev_t outdev;
-	irq_t irq;
-} amdm37x_uart_t;
-
-
-bool amdm37x_uart_init(amdm37x_uart_t *, inr_t, uintptr_t, size_t);
-void amdm37x_uart_input_wire(amdm37x_uart_t *, indev_t *);
-
 #endif
 
Index: rnel/genarch/include/genarch/drivers/amdm37x/uart_regs.h
===================================================================
--- kernel/genarch/include/genarch/drivers/amdm37x/uart_regs.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ 	(revision )
@@ -1,431 +1,0 @@
-/*
- * Copyright (c) 2012 Jan Vesely
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/** @addtogroup genarch
- * @{
- */
-/**
- * @file
- * @brief Texas Instruments AMDM37x UART memory mapped registers.
- */
-
-#ifndef KERN_AMDM37x_UART_H_
-#define KERN_AMDM37x_UART_H_
-
-#include <typedefs.h>
-#include <console/chardev.h>
-#include <ddi/irq.h>
-
-typedef struct {
-	union {
-		/** Stores lower part of the 14-bit baud divisor */
-		ioport32_t dll;
-#define AMDM37x_UART_DLL_MASK   (0xff)
-
-		/** Receive holding register */
-		const ioport32_t rhr;
-#define AMDM37x_UART_RHR_MASK   (0xff)
-
-		/** Transmit holding register */
-		ioport32_t thr;
-#define AMDM37x_UART_THR_MASK   (0xff)
-	};
-
-	union {
-		/** Stores higher part of the 14-bit baud divisor */
-		ioport32_t dlh;
-#define AMDM37x_UART_DLH_MASK   (0x1f)
-
-		/** Interrupt enable registers */
-		ioport32_t ier;
-#define AMDM37x_UART_IER_RHR_IRQ_FLAG   (1 << 0)
-#define AMDM37x_UART_IER_THR_IRQ_FLAG   (1 << 1)
-#define AMDM37x_UART_IER_LINE_STS_IRQ_FLAG   (1 << 2)
-#define AMDM37x_UART_IER_MODEM_STS_IRQ_FLAG   (1 << 3)
-#define AMDM37x_UART_IER_SLEEP_MODE_FLAG   (1 << 4)
-#define AMDM37x_UART_IER_XOFF_IRQ_FLAG   (1 << 5)
-#define AMDM37x_UART_IER_RTS_IRQ_FLAG   (1 << 6)
-#define AMDM37x_UART_IER_CTS_IRQ_FLAG   (1 << 7)
-
-#define AMDM37x_CIR_IER_RHR_IRQ_FLAG   (1 << 0)
-#define AMDM37x_CIR_IER_THR_IRQ_FLAG   (1 << 1)
-#define AMDM37x_CIR_IER_RX_STOP_IRQ_FLAG   (1 << 2)
-#define AMDM37x_CIR_IER_RX_OVERRUN_IRQ_FLAG   (1 << 3)
-#define AMDM37x_CIR_IER_TX_STS_IRQ_FLAG   (1 << 5)
-
-#define AMDM37x_IRDA_IER_RHR_IRQ_FLAG   (1 << 0)
-#define AMDM37x_IRDA_IER_THR_IRQ_FLAG   (1 << 1)
-#define AMDM37x_IRDA_IER_LAST_RX_BYTE_IRQ_FLAG   (1 << 2)
-#define AMDM37x_IRDA_IER_RX_OVERRUN_IRQ_FLAG   (1 << 3)
-#define AMDM37x_IRDA_IER_STS_FIFO_TRIG_IRQ_FLAG   (1 << 4)
-#define AMDM37x_IRDA_IER_TX_STS_IRQ_FLAG   (1 << 5)
-#define AMDM37x_IRDA_IER_LINE_STS_IRQ_FLAG   (1 << 6)
-#define AMDM37x_IRDA_IER_EOF_IRQ_FLAG   (1 << 7)
-	};
-
-	union {
-		/** Interrupt identification register */
-		const ioport32_t iir;
-#define AMDM37x_UART_IIR_IRQ_PENDING_FLAG   (1 << 0)
-#define AMDM37x_UART_IIR_TYPE_MASK   (0x1f)
-#define AMDM37x_UART_IIR_TYPE_SHIFT   (1)
-#define AMDM37x_UART_IIR_FCR_MASK   (0x3)
-#define AMDM37x_UART_IIR_FCR_SHIFT   (6)
-
-#define AMDM37x_CIR_IIR_RHR_IRQ_FLAG   (1 << 0)
-#define AMDM37x_CIR_IIR_THR_IRQ_FLAG   (1 << 1)
-#define AMDM37x_CIR_IIR_RX_STOP_IRQ_FLAG   (1 << 2)
-#define AMDM37x_CIR_IIR_RX_OE_IRQ_FLAG   (1 << 3)
-#define AMDM37x_CIR_IIR_TX_STS_IRQ_FLAG   (1 << 5)
-
-#define AMDM37x_IRDA_IIR_RHR_IRQ_FLAG   (1 << 0)
-#define AMDM37x_IRDA_IIR_THR_IRQ_FLAG   (1 << 1)
-#define AMDM37x_IRDA_IIR_RX_FIFO_LB_IRQ_FLAG   (1 << 2)
-#define AMDM37x_IRDA_IIR_RX_OE_IRQ_FLAG   (1 << 3)
-#define AMDM37x_IRDA_IIR_STS_FIFO_IRQ_FLAG   (1 << 4)
-#define AMDM37x_IRDA_IIR_TX_STS_IRQ_FLAG   (1 << 5)
-#define AMDM37x_IRDA_IIR_LINE_STS_IRQ_FLAG   (1 << 6)
-#define AMDM37x_IRDA_IIR_EOF_IRQ_FLAG   (1 << 7)
-
-		/** FIFO control register */
-		ioport32_t fcr;
-#define AMDM37x_UART_FCR_FIFO_EN_FLAG   (1 << 0)
-#define AMDM37x_UART_FCR_RX_FIFO_CLR_FLAG   (1 << 1)
-#define AMDM37x_UART_FCR_TX_FIFO_CLR_FLAG   (1 << 3)
-#define AMDM37x_UART_FCR_DMA_MODE_FLAG   (1 << 4)
-
-#define AMDM37x_UART_FCR_TX_FIFO_TRIG_MASK   (0x3)
-#define AMDM37x_UART_FCR_TX_FIFO_TRIG_SHIFT   (4)
-
-#define AMDM37x_UART_FCR_RX_FIFO_TRIG_MASK   (0x3)
-#define AMDM37x_UART_FCR_RX_FIFO_TRIG_SHIFT   (6)
-
-		/** Enhanced feature register */
-		ioport32_t efr;
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_RX_MASK   (0x3)
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_RX_SHIFT   (0)
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_TX_MASK   (0x3)
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_TX_SHIFT   (2)
-
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_NONE   (0x0)
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_X2   (0x1)
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_X1   (0x2)
-#define AMDM37x_UART_EFR_SW_FLOW_CTRL_XBOTH   (0x3)
-
-#define AMDM37x_UART_EFR_ENH_FLAG   (1 << 4)
-#define AMDM37x_UART_EFR_SPEC_CHAR_FLAG   (1 << 5)
-#define AMDM37x_UART_EFR_AUTO_RTS_EN_FLAG   (1 << 6)
-#define AMDM37x_UART_EFR_AUTO_CTS_EN_FLAG   (1 << 7)
-	};
-
-	/** Line control register */
-	ioport32_t lcr;
-#define AMDM37x_UART_LCR_CHAR_LENGTH_MASK   (0x3)
-#define AMDM37x_UART_LCR_CHAR_LENGTH_SHIFT   (0)
-#define AMDM37x_UART_LCR_CHAR_LENGTH_5BITS   (0x0)
-#define AMDM37x_UART_LCR_CHAR_LENGTH_6BITS   (0x1)
-#define AMDM37x_UART_LCR_CHAR_LENGTH_7BITS   (0x2)
-#define AMDM37x_UART_LCR_CHAR_LENGTH_8BITS   (0x3)
-#define AMDM37x_UART_LCR_NB_STOP_FLAG   (1 << 2)
-#define AMDM37x_UART_LCR_PARITY_EN_FLAG   (1 << 3)
-#define AMDM37x_UART_LCR_PARITY_TYPE1_FLAG   (1 << 4)
-#define AMDM37x_UART_LCR_PARITY_TYPE2_FLAG   (1 << 5)
-#define AMDM37x_UART_LCR_BREAK_EN_FLAG   (1 << 6)
-#define AMDM37x_UART_LCR_DIV_EN_FLAG   (1 << 7)
-
-
-	union {
-		/** Modem control register */
-		ioport32_t mcr;
-#define AMDM37x_UART_MCR_DTR_FLAG   (1 << 0)
-#define AMDM37x_UART_MCR_RTS_FLAG   (1 << 1)
-#define AMDM37x_UART_MCR_RI_STS_CH_FLAG   (1 << 2)
-#define AMDM37x_UART_MCR_CD_STS_CH_FLAG   (1 << 3)
-#define AMDM37x_UART_MCR_LOOPBACK_EN_FLAG   (1 << 4)
-#define AMDM37x_UART_MCR_XON_EN_FLAG   (1 << 5)
-#define AMDM37x_UART_MCR_TCR_TLR_FLAG   (1 << 6)
-
-		/** UART: XON1 char, IRDA: ADDR1 address */
-		ioport32_t xon1_addr1;
-#define AMDM37x_UART_XON1_ADDR1_MASK   (0xff)
-	};
-
-	union {
-		/** Line status register */
-		const ioport32_t lsr;
-#define AMDM37x_UART_LSR_RX_FIFO_E_FLAG   (1 << 0)
-#define AMDM37x_UART_LSR_RX_OE_FLAG   (1 << 1)
-#define AMDM37x_UART_LSR_RX_PE_FLAG   (1 << 2)
-#define AMDM37x_UART_LSR_RX_FE_FLAG   (1 << 3)
-#define AMDM37x_UART_LSR_RX_BI_FLAG   (1 << 4)
-#define AMDM37x_UART_LSR_TX_FIFO_E_FLAG   (1 << 5)
-#define AMDM37x_UART_LSR_TX_SR_E_FLAG   (1 << 6)
-#define AMDM37x_UART_LSR_RX_FIFO_STS_FLAG   (1 << 7)
-
-#define AMDM37x_CIR_LSR_RX_FIFO_E_FLAG   (1 << 0)
-#define AMDM37x_CIR_LSR_RX_STOP_FLAG   (1 << 5)
-#define AMDM37x_CIR_LSR_THR_EMPTY_FLAG   (1 << 7)
-
-#define AMDM37x_IRDA_LSR_RX_FIFO_E_FLAG   (1 << 0)
-#define AMDM37x_IRDA_LSR_STS_FIFO_E_FLAG   (1 << 1)
-#define AMDM37x_IRDA_LSR_CRC_FLAG   (1 << 2)
-#define AMDM37x_IRDA_LSR_ABORT_FLAG   (1 << 3)
-#define AMDM37x_IRDA_LSR_FTL_FLAG   (1 << 4)
-#define AMDM37x_IRDA_LSR_RX_LAST_FLAG   (1 << 5)
-#define AMDM37x_IRDA_LSR_STS_FIFO_FULL_FLAG   (1 << 6)
-#define AMDM37x_IRDA_LSR_THR_EMPTY_FLAG   (1 << 7)
-
-		/** UART: XON2 char, IRDA: ADDR2 address */
-		ioport32_t xon2_addr2;
-	};
-
-	union {
-		/** Modem status register */
-		const ioport32_t msr;
-#define AMDM37x_UART_MSR_CTS_STS_FLAG   (1 << 0)
-#define AMDM37x_UART_MSR_DSR_STS_FLAG   (1 << 1)
-#define AMDM37x_UART_MSR_RI_STS_FLAG   (1 << 2)
-#define AMDM37x_UART_MSR_DCD_STS_FLAG   (1 << 3)
-#define AMDM37x_UART_MSR_NCTS_STS_FLAG   (1 << 4)
-#define AMDM37x_UART_MSR_NDSR_STS_FLAG   (1 << 5)
-#define AMDM37x_UART_MSR_NRI_STS_FLAG   (1 << 6)
-#define AMDM37x_UART_MSR_NCD_STS_FLAG   (1 << 7)
-
-		/** Transmission control register */
-		ioport32_t tcr;
-#define AMDM37x_UART_TCR_FIFO_TRIG_MASK   (0xf)
-#define AMDM37x_UART_TCR_FIFO_TRIG_HALT_SHIFT   (0)
-#define AMDM37x_UART_TCR_FIFO_TRIG_START_SHIFT   (4)
-
-		/** UART: XOFF1 char */
-		ioport32_t xoff1;
-#define AMDM37x_UART_XOFF1_MASK   (0xff)
-	};
-
-	union {
-		/* Scratchpad register, does nothing */
-		ioport32_t spr;
-#define AMDM37x_UART_SPR_MASK   (0xff)
-
-		/* Trigger level register */
-		ioport32_t tlr;
-#define AMDM37x_UART_TLR_LEVEL_MASK   (0xf)
-#define AMDM37x_UART_TLR_TX_FIFO_TRIG_SHIFT   (0)
-#define AMDM37x_UART_TLR_RX_FIFO_TRIG_SHIFT   (4)
-
-		/** UART: XOFF2 char */
-		ioport32_t xoff2;
-#define AMDM37x_UART_XOFF2_MASK   (0xff)
-	};
-
-	/** Mode definition register. */
-	ioport32_t mdr1;
-#define AMDM37x_UART_MDR_MS_MASK   (0x7)
-#define AMDM37x_UART_MDR_MS_SHIFT   (0)
-#define AMDM37x_UART_MDR_MS_UART16   (0x0)
-#define AMDM37x_UART_MDR_MS_SIR   (0x1)
-#define AMDM37x_UART_MDR_MS_UART16_AUTO   (0x2)
-#define AMDM37x_UART_MDR_MS_UART13   (0x3)
-#define AMDM37x_UART_MDR_MS_MIR   (0x4)
-#define AMDM37x_UART_MDR_MS_FIR   (0x5)
-#define AMDM37x_UART_MDR_MS_CIR   (0x6)
-#define AMDM37x_UART_MDR_MS_DISABLE   (0x7)
-
-#define AMDM37x_UART_MDR_IR_SLEEP_FLAG   (1 << 3)
-#define AMDM37x_UART_MDR_SET_TXIR_FLAG   (1 << 4)
-#define AMDM37x_UART_MDR_SCT_FLAG   (1 << 5)
-#define AMDM37x_UART_MDR_SIP_FLAG   (1 << 6)
-#define AMDM37x_UART_MDR_FRAME_END_MODE_FLAG   (1 << 7)
-
-	/** Mode definition register */
-	ioport32_t mdr2;
-#define AMDM37x_UART_MDR_IRTX_UNDERRUN_FLAG   (1 << 0)
-#define AMDM37x_UART_MDR_STS_FIFO_TRIG_MASK   (0x3)
-#define AMDM37x_UART_MDR_STS_FIFO_TRIG_SHIFT   (1)
-#define AMDM37x_UART_MDR_PULSE_SHAPING_FLAG   (1 << 3)
-#define AMDM37x_UART_MDR_CIR_PULSE_MODE_MASK   (0x3)
-#define AMDM37x_UART_MDR_CIR_PULSE_MODE_SHIFT   (4)
-#define AMDM37x_UART_MDR_IRRXINVERT_FLAG   (1 << 6)
-
-
-	/* UART3 specific */
-	union {
-		/** Status FIFO line status register (IrDA only) */
-		const ioport32_t sflsr;
-#define AMDM37x_IRDA_SFLSR_CRC_ERROR_FLAG   (1 << 1)
-#define AMDM37x_IRDA_SFLSR_ABORT_FLAG   (1 << 2)
-#define AMDM37x_IRDA_SFLSR_FTL_FLAG   (1 << 3)
-#define AMDM37x_IRDA_SFLSR_OE_FLAG   (1 << 4)
-
-		/** Transmit frame length low (IrDA only) */
-		ioport32_t txfll;
-#define AMDM37x_UART_TXFLL_MASK   (0xff)
-	};
-
-	/* UART3 specific */
-	union {
-		/** Dummy register to restart TX or RX (IrDA only) */
-		const ioport32_t resume;
-		/** Transmit frame length high (IrDA only) */
-		ioport32_t txflh;
-#define AMDM37x_UART_TXFLH_MASK   (0xff)
-	};
-
-	/* UART3 specific */
-	union {
-		/** Status FIFO register low (IrDA only) */
-		const ioport32_t sfregl;
-#define AMDM37x_UART_SFREGL_MASK   (0xff)
-		/** Received frame length low (IrDA only) */
-		ioport32_t rxfll;
-#define AMDM37x_UART_RXFLL_MASK   (0xff)
-	};
-
-	/* UART3 specific */
-	union {
-		/** Status FIFO register high (IrDA only) */
-		const ioport32_t sfregh;
-#define AMDM37x_UART_SFREGH_MASK   (0xf)
-		/** Received frame length high (IrDA only) */
-		ioport32_t rxflh;
-#define AMDM37x_UART_RXFLH_MASK   (0xf)
-	};
-
-	union {
-		/** UART autobauding status register */
-		const ioport32_t uasr;
-#define AMDM37x_UART_UASR_SPEED_MASK   (0x1f)
-#define AMDM37x_UART_UASR_SPEED_SHIFT   (0)
-#define AMDM37x_UART_UASR_8BIT_CHAR_FLAG   (1 << 5)
-#define AMDM37x_UART_UASR_PARITY_MASK   (0x3)
-#define AMDM37x_UART_UASR_PARITY_SHIFT   (6)
-
-		/** BOF control register (IrDA only) */
-		ioport32_t blr; /* UART3 specific */
-#define AMDM37x_IRDA_BLR_XBOF_TYPE_FLAG   (1 << 6)
-#define AMDM37x_IRDA_BLR_STS_FIFO_RESET   (1 << 7)
-	};
-
-	/** Auxiliary control register (IrDA only) */
-	ioport32_t acreg; /* UART3 specific */
-#define AMDM37x_IRDA_ACREG_EOT_EN_FLAG   (1 << 0)
-#define AMDM37x_IRDA_ACREG_ABORT_EN_FLAG   (1 << 1)
-#define AMDM37x_IRDA_ACREG_SCTX_EN_FLAG   (1 << 2)
-#define AMDM37x_IRDA_ACREG_SEND_SIP_FLAG   (1 << 3)
-#define AMDM37x_IRDA_ACREG_DIS_TX_UNDERRUN_FLAG   (1 << 4)
-#define AMDM37x_IRDA_ACREG_DIS_IR_RX_FLAG   (1 << 5)
-#define AMDM37x_IRDA_ACREG_SD_MOD_FLAG   (1 << 6)
-#define AMDM37x_IRDA_ACREG_PULSE_TYPE_FLAG   (1 << 7)
-
-	/** Supplementary control register */
-	ioport32_t scr;
-#define AMDM37x_UART_SCR_DMA_MODE_CTL_FLAG   (1 << 0)
-#define AMDM37x_UART_SCR_DMA_MODE_MASK   (0x3)
-#define AMDM37x_UART_SCR_DMA_MODE_SHIFT   (1)
-#define AMDM37x_UART_SCR_TX_EMPTY_CTL_IRQ_FLAG   (1 << 3)
-#define AMDM37x_UART_SCR_RX_CTS_WU_EN_FLAG   (1 << 4)
-#define AMDM37x_UART_SCR_TX_TRIG_GRANU1_FLAG   (1 << 6)
-#define AMDM37x_UART_SCR_RX_TRIG_GRANU1_FLAG   (1 << 7)
-
-	/** Supplementary status register */
-	const ioport32_t ssr;
-#define AMDM37x_UART_SSR_TX_FIFO_FULL_FLAG   (1 << 0)
-#define AMDM37x_UART_SSR_RX_CTS_WU_STS_FLAG   (1 << 1)
-#define AMDM37x_UART_SSR_DMA_COUNTER_RESET_FLAG   (1 << 2)
-
-	/** BOF Length register (IrDA only)*/
-	ioport32_t eblr; /* UART3 specific */
-#define AMDM37x_IRDA_EBLR_DISABLED   (0x00)
-#define AMDM37x_IRDA_EBLR_RX_STOP_BITS(bits)   (bits & 0xff)
-
-	uint32_t padd0_;
-
-	/** Module version register */
-	const ioport32_t mvr;
-#define AMDM37x_UART_MVR_MINOR_MASK   (0xf)
-#define AMDM37x_UART_MVR_MINOR_SHIFT   (0)
-#define AMDM37x_UART_MVR_MAJOR_MASK   (0xf)
-#define AMDM37x_UART_MVR_MAJOR_SHIFT   (4)
-
-	/** System configuration register */
-	ioport32_t sysc;
-#define AMDM37x_UART_SYSC_AUTOIDLE_FLAG   (1 << 0)
-#define AMDM37x_UART_SYSC_SOFTRESET_FLAG   (1 << 1)
-#define AMDM37x_UART_SYSC_ENWAKEUP_FLAG   (1 << 2)
-#define AMDM37x_UART_SYSC_IDLE_MODE_MASK   (0x3)
-#define AMDM37x_UART_SYSC_IDLE_MODE_SHIFT   (3)
-#define AMDM37x_UART_SYSC_IDLE_MODE_FORCE   (0x0)
-#define AMDM37x_UART_SYSC_IDLE_MODE_NO   (0x1)
-#define AMDM37x_UART_SYSC_IDLE_MODE_SMART   (0x2)
-
-	/** System status register */
-	const ioport32_t syss;
-#define AMDM37x_UART_SYSS_RESETDONE_FLAG   (1 << 0)
-
-	/** Wake-up enable register */
-	ioport32_t wer;
-#define AMDM37x_UART_WER_CTS_ACTIVITY_FLAG  (1 << 0)
-#define AMDM37x_UART_WER_RI_ACTIVITY_FLAG  (1 << 2)
-#define AMDM37x_UART_WER_RX_ACTIVITY_FLAG  (1 << 4)
-#define AMDM37x_UART_WER_RHR_IRQ_FLAG  (1 << 5)
-#define AMDM37x_UART_WER_RLS_IRQ_FLAG  (1 << 6)
-#define AMDM37x_UART_WER_TX_WAKEUP_EN_FLAG  (1 << 7)
-
-	/** Carrier frequency prescaler */
-	ioport32_t cfps;	/* UART3 specific */
-#define AMDM37x_UART_CFPS_MASK   (0xff)
-
-	/** Number of bytes in RX fifo */
-	const ioport32_t rx_fifo_lvl;
-#define AMDM37x_UART_RX_FIFO_LVL_MASK   (0xff)
-
-	/** Number of bytes in TX fifo */
-	const ioport32_t tx_fifo_lvl;
-#define AMDM37x_UART_TX_FIFO_LVL_MASK   (0xff)
-
-	/** RX/TX empty interrupts */
-	ioport32_t ier2;
-#define AMDM37x_UART_IER2_RX_FIFO_EMPTY_IRQ_EN_FLAG  (1 << 0)
-#define AMDM37x_UART_IER2_TX_FIFO_EMPTY_IRQ_EN_FLAG  (1 << 1)
-
-	/** RX/TX empty status */
-	ioport32_t isr2;
-#define AMDM37x_UART_ISR2_RX_FIFO_EMPTY_FLAG  (1 << 0)
-#define AMDM37x_UART_ISR2_TX_FIFO_EMPTY_FLAG  (1 << 1)
-
-	uint32_t padd2_[3];
-
-	/** Mode definition register 3 */
-	ioport32_t mdr3;
-#define AMDM37x_UART_MDR3_DIS_CIR_RX_DEMOD_FLAG   (1 << 0)
-} amdm37x_uart_regs_t;
-
-#endif
-
-/**
- * @}
- */
Index: kernel/genarch/include/genarch/drivers/omap/uart.h
===================================================================
--- kernel/genarch/include/genarch/drivers/omap/uart.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ kernel/genarch/include/genarch/drivers/omap/uart.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) Maurizio Lombardi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** @addtogroup genarch
+ * @{
+ */
+/**
+ * @file
+ * @brief Texas Instruments OMAP UART driver.
+ */
+
+#ifndef _KERN_OMAP_UART_H_
+#define _KERN_OMAP_UART_H_
+
+#include "uart_regs.h"
+
+typedef struct {
+	omap_uart_regs_t *regs;
+	indev_t *indev;
+	outdev_t outdev;
+	irq_t irq;
+} omap_uart_t;
+
+extern bool omap_uart_init(omap_uart_t *uart, inr_t interrupt,
+    uintptr_t addr, size_t size);
+
+extern void omap_uart_input_wire(omap_uart_t *uart, indev_t *indev);
+
+#endif
+
+/**
+ * @}
+ */
+
Index: kernel/genarch/include/genarch/drivers/omap/uart_regs.h
===================================================================
--- kernel/genarch/include/genarch/drivers/omap/uart_regs.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ kernel/genarch/include/genarch/drivers/omap/uart_regs.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,431 @@
+/*
+ * Copyright (c) 2012 Jan Vesely
+ * Copyright (c) 2012 Maurizio Lombardi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** @addtogroup genarch
+ * @{
+ */
+/**
+ * @file
+ * @brief Texas Instruments OMAP UART memory mapped registers.
+ */
+
+#ifndef _KERN_OMAP_UART_REGS_H_
+#define _KERN_OMAP_UART_REGS_H_
+
+#include <typedefs.h>
+#include <console/chardev.h>
+#include <ddi/irq.h>
+
+typedef struct {
+	union {
+		/** Stores lower part of the 14-bit baud divisor */
+		ioport32_t dll;
+#define OMAP_UART_DLL_MASK   (0xff)
+
+		/** Receive holding register */
+		const ioport32_t rhr;
+#define OMAP_UART_RHR_MASK   (0xff)
+
+		/** Transmit holding register */
+		ioport32_t thr;
+#define OMAP_UART_THR_MASK   (0xff)
+	};
+
+	union {
+		/** Stores higher part of the 14-bit baud divisor */
+		ioport32_t dlh;
+#define OMAP_UART_DLH_MASK   (0x1f)
+
+		/** Interrupt enable registers */
+		ioport32_t ier;
+#define OMAP_UART_IER_RHR_IRQ_FLAG   (1 << 0)
+#define OMAP_UART_IER_THR_IRQ_FLAG   (1 << 1)
+#define OMAP_UART_IER_LINE_STS_IRQ_FLAG   (1 << 2)
+#define OMAP_UART_IER_MODEM_STS_IRQ_FLAG   (1 << 3)
+#define OMAP_UART_IER_SLEEP_MODE_FLAG   (1 << 4)
+#define OMAP_UART_IER_XOFF_IRQ_FLAG   (1 << 5)
+#define OMAP_UART_IER_RTS_IRQ_FLAG   (1 << 6)
+#define OMAP_UART_IER_CTS_IRQ_FLAG   (1 << 7)
+
+#define OMAP_CIR_IER_RHR_IRQ_FLAG   (1 << 0)
+#define OMAP_CIR_IER_THR_IRQ_FLAG   (1 << 1)
+#define OMAP_CIR_IER_RX_STOP_IRQ_FLAG   (1 << 2)
+#define OMAP_CIR_IER_RX_OVERRUN_IRQ_FLAG   (1 << 3)
+#define OMAP_CIR_IER_TX_STS_IRQ_FLAG   (1 << 5)
+
+#define OMAP_IRDA_IER_RHR_IRQ_FLAG   (1 << 0)
+#define OMAP_IRDA_IER_THR_IRQ_FLAG   (1 << 1)
+#define OMAP_IRDA_IER_LAST_RX_BYTE_IRQ_FLAG   (1 << 2)
+#define OMAP_IRDA_IER_RX_OVERRUN_IRQ_FLAG   (1 << 3)
+#define OMAP_IRDA_IER_STS_FIFO_TRIG_IRQ_FLAG   (1 << 4)
+#define OMAP_IRDA_IER_TX_STS_IRQ_FLAG   (1 << 5)
+#define OMAP_IRDA_IER_LINE_STS_IRQ_FLAG   (1 << 6)
+#define OMAP_IRDA_IER_EOF_IRQ_FLAG   (1 << 7)
+	};
+
+	union {
+		/** Interrupt identification register */
+		const ioport32_t iir;
+#define OMAP_UART_IIR_IRQ_PENDING_FLAG   (1 << 0)
+#define OMAP_UART_IIR_TYPE_MASK   (0x1f)
+#define OMAP_UART_IIR_TYPE_SHIFT   (1)
+#define OMAP_UART_IIR_FCR_MASK   (0x3)
+#define OMAP_UART_IIR_FCR_SHIFT   (6)
+
+#define OMAP_CIR_IIR_RHR_IRQ_FLAG   (1 << 0)
+#define OMAP_CIR_IIR_THR_IRQ_FLAG   (1 << 1)
+#define OMAP_CIR_IIR_RX_STOP_IRQ_FLAG   (1 << 2)
+#define OMAP_CIR_IIR_RX_OE_IRQ_FLAG   (1 << 3)
+#define OMAP_CIR_IIR_TX_STS_IRQ_FLAG   (1 << 5)
+
+#define OMAP_IRDA_IIR_RHR_IRQ_FLAG   (1 << 0)
+#define OMAP_IRDA_IIR_THR_IRQ_FLAG   (1 << 1)
+#define OMAP_IRDA_IIR_RX_FIFO_LB_IRQ_FLAG   (1 << 2)
+#define OMAP_IRDA_IIR_RX_OE_IRQ_FLAG   (1 << 3)
+#define OMAP_IRDA_IIR_STS_FIFO_IRQ_FLAG   (1 << 4)
+#define OMAP_IRDA_IIR_TX_STS_IRQ_FLAG   (1 << 5)
+#define OMAP_IRDA_IIR_LINE_STS_IRQ_FLAG   (1 << 6)
+#define OMAP_IRDA_IIR_EOF_IRQ_FLAG   (1 << 7)
+
+		/** FIFO control register */
+		ioport32_t fcr;
+#define OMAP_UART_FCR_FIFO_EN_FLAG   (1 << 0)
+#define OMAP_UART_FCR_RX_FIFO_CLR_FLAG   (1 << 1)
+#define OMAP_UART_FCR_TX_FIFO_CLR_FLAG   (1 << 3)
+#define OMAP_UART_FCR_DMA_MODE_FLAG   (1 << 4)
+
+#define OMAP_UART_FCR_TX_FIFO_TRIG_MASK   (0x3)
+#define OMAP_UART_FCR_TX_FIFO_TRIG_SHIFT   (4)
+
+#define OMAP_UART_FCR_RX_FIFO_TRIG_MASK   (0x3)
+#define OMAP_UART_FCR_RX_FIFO_TRIG_SHIFT   (6)
+
+		/** Enhanced feature register */
+		ioport32_t efr;
+#define OMAP_UART_EFR_SW_FLOW_CTRL_RX_MASK   (0x3)
+#define OMAP_UART_EFR_SW_FLOW_CTRL_RX_SHIFT   (0)
+#define OMAP_UART_EFR_SW_FLOW_CTRL_TX_MASK   (0x3)
+#define OMAP_UART_EFR_SW_FLOW_CTRL_TX_SHIFT   (2)
+
+#define OMAP_UART_EFR_SW_FLOW_CTRL_NONE   (0x0)
+#define OMAP_UART_EFR_SW_FLOW_CTRL_X2   (0x1)
+#define OMAP_UART_EFR_SW_FLOW_CTRL_X1   (0x2)
+#define OMAP_UART_EFR_SW_FLOW_CTRL_XBOTH   (0x3)
+
+#define OMAP_UART_EFR_ENH_FLAG   (1 << 4)
+#define OMAP_UART_EFR_SPEC_CHAR_FLAG   (1 << 5)
+#define OMAP_UART_EFR_AUTO_RTS_EN_FLAG   (1 << 6)
+#define OMAP_UART_EFR_AUTO_CTS_EN_FLAG   (1 << 7)
+	};
+
+	/** Line control register */
+	ioport32_t lcr;
+#define OMAP_UART_LCR_CHAR_LENGTH_MASK   (0x3)
+#define OMAP_UART_LCR_CHAR_LENGTH_SHIFT   (0)
+#define OMAP_UART_LCR_CHAR_LENGTH_5BITS   (0x0)
+#define OMAP_UART_LCR_CHAR_LENGTH_6BITS   (0x1)
+#define OMAP_UART_LCR_CHAR_LENGTH_7BITS   (0x2)
+#define OMAP_UART_LCR_CHAR_LENGTH_8BITS   (0x3)
+#define OMAP_UART_LCR_NB_STOP_FLAG   (1 << 2)
+#define OMAP_UART_LCR_PARITY_EN_FLAG   (1 << 3)
+#define OMAP_UART_LCR_PARITY_TYPE1_FLAG   (1 << 4)
+#define OMAP_UART_LCR_PARITY_TYPE2_FLAG   (1 << 5)
+#define OMAP_UART_LCR_BREAK_EN_FLAG   (1 << 6)
+#define OMAP_UART_LCR_DIV_EN_FLAG   (1 << 7)
+
+
+	union {
+		/** Modem control register */
+		ioport32_t mcr;
+#define OMAP_UART_MCR_DTR_FLAG   (1 << 0)
+#define OMAP_UART_MCR_RTS_FLAG   (1 << 1)
+#define OMAP_UART_MCR_RI_STS_CH_FLAG   (1 << 2)
+#define OMAP_UART_MCR_CD_STS_CH_FLAG   (1 << 3)
+#define OMAP_UART_MCR_LOOPBACK_EN_FLAG   (1 << 4)
+#define OMAP_UART_MCR_XON_EN_FLAG   (1 << 5)
+#define OMAP_UART_MCR_TCR_TLR_FLAG   (1 << 6)
+
+		/** UART: XON1 char, IRDA: ADDR1 address */
+		ioport32_t xon1_addr1;
+#define OMAP_UART_XON1_ADDR1_MASK   (0xff)
+	};
+
+	union {
+		/** Line status register */
+		const ioport32_t lsr;
+#define OMAP_UART_LSR_RX_FIFO_E_FLAG   (1 << 0)
+#define OMAP_UART_LSR_RX_OE_FLAG   (1 << 1)
+#define OMAP_UART_LSR_RX_PE_FLAG   (1 << 2)
+#define OMAP_UART_LSR_RX_FE_FLAG   (1 << 3)
+#define OMAP_UART_LSR_RX_BI_FLAG   (1 << 4)
+#define OMAP_UART_LSR_TX_FIFO_E_FLAG   (1 << 5)
+#define OMAP_UART_LSR_TX_SR_E_FLAG   (1 << 6)
+#define OMAP_UART_LSR_RX_FIFO_STS_FLAG   (1 << 7)
+
+#define OMAP_CIR_LSR_RX_FIFO_E_FLAG   (1 << 0)
+#define OMAP_CIR_LSR_RX_STOP_FLAG   (1 << 5)
+#define OMAP_CIR_LSR_THR_EMPTY_FLAG   (1 << 7)
+
+#define OMAP_IRDA_LSR_RX_FIFO_E_FLAG   (1 << 0)
+#define OMAP_IRDA_LSR_STS_FIFO_E_FLAG   (1 << 1)
+#define OMAP_IRDA_LSR_CRC_FLAG   (1 << 2)
+#define OMAP_IRDA_LSR_ABORT_FLAG   (1 << 3)
+#define OMAP_IRDA_LSR_FTL_FLAG   (1 << 4)
+#define OMAP_IRDA_LSR_RX_LAST_FLAG   (1 << 5)
+#define OMAP_IRDA_LSR_STS_FIFO_FULL_FLAG   (1 << 6)
+#define OMAP_IRDA_LSR_THR_EMPTY_FLAG   (1 << 7)
+
+		/** UART: XON2 char, IRDA: ADDR2 address */
+		ioport32_t xon2_addr2;
+	};
+
+	union {
+		/** Modem status register */
+		const ioport32_t msr;
+#define OMAP_UART_MSR_CTS_STS_FLAG   (1 << 0)
+#define OMAP_UART_MSR_DSR_STS_FLAG   (1 << 1)
+#define OMAP_UART_MSR_RI_STS_FLAG   (1 << 2)
+#define OMAP_UART_MSR_DCD_STS_FLAG   (1 << 3)
+#define OMAP_UART_MSR_NCTS_STS_FLAG   (1 << 4)
+#define OMAP_UART_MSR_NDSR_STS_FLAG   (1 << 5)
+#define OMAP_UART_MSR_NRI_STS_FLAG   (1 << 6)
+#define OMAP_UART_MSR_NCD_STS_FLAG   (1 << 7)
+
+		/** Transmission control register */
+		ioport32_t tcr;
+#define OMAP_UART_TCR_FIFO_TRIG_MASK   (0xf)
+#define OMAP_UART_TCR_FIFO_TRIG_HALT_SHIFT   (0)
+#define OMAP_UART_TCR_FIFO_TRIG_START_SHIFT   (4)
+
+		/** UART: XOFF1 char */
+		ioport32_t xoff1;
+#define OMAP_UART_XOFF1_MASK   (0xff)
+	};
+
+	union {
+		/* Scratchpad register, does nothing */
+		ioport32_t spr;
+#define OMAP_UART_SPR_MASK   (0xff)
+
+		/* Trigger level register */
+		ioport32_t tlr;
+#define OMAP_UART_TLR_LEVEL_MASK   (0xf)
+#define OMAP_UART_TLR_TX_FIFO_TRIG_SHIFT   (0)
+#define OMAP_UART_TLR_RX_FIFO_TRIG_SHIFT   (4)
+
+		/** UART: XOFF2 char */
+		ioport32_t xoff2;
+#define OMAP_UART_XOFF2_MASK   (0xff)
+	};
+
+	/** Mode definition register. */
+	ioport32_t mdr1;
+#define OMAP_UART_MDR_MS_MASK   (0x7)
+#define OMAP_UART_MDR_MS_SHIFT   (0)
+#define OMAP_UART_MDR_MS_UART16   (0x0)
+#define OMAP_UART_MDR_MS_SIR   (0x1)
+#define OMAP_UART_MDR_MS_UART16_AUTO   (0x2)
+#define OMAP_UART_MDR_MS_UART13   (0x3)
+#define OMAP_UART_MDR_MS_MIR   (0x4)
+#define OMAP_UART_MDR_MS_FIR   (0x5)
+#define OMAP_UART_MDR_MS_CIR   (0x6)
+#define OMAP_UART_MDR_MS_DISABLE   (0x7)
+
+#define OMAP_UART_MDR_IR_SLEEP_FLAG   (1 << 3)
+#define OMAP_UART_MDR_SET_TXIR_FLAG   (1 << 4)
+#define OMAP_UART_MDR_SCT_FLAG   (1 << 5)
+#define OMAP_UART_MDR_SIP_FLAG   (1 << 6)
+#define OMAP_UART_MDR_FRAME_END_MODE_FLAG   (1 << 7)
+
+	/** Mode definition register */
+	ioport32_t mdr2;
+#define OMAP_UART_MDR_IRTX_UNDERRUN_FLAG   (1 << 0)
+#define OMAP_UART_MDR_STS_FIFO_TRIG_MASK   (0x3)
+#define OMAP_UART_MDR_STS_FIFO_TRIG_SHIFT   (1)
+#define OMAP_UART_MDR_PULSE_SHAPING_FLAG   (1 << 3)
+#define OMAP_UART_MDR_CIR_PULSE_MODE_MASK   (0x3)
+#define OMAP_UART_MDR_CIR_PULSE_MODE_SHIFT   (4)
+#define OMAP_UART_MDR_IRRXINVERT_FLAG   (1 << 6)
+
+	union {
+		/** Status FIFO line status register (IrDA only) */
+		const ioport32_t sflsr;
+#define OMAP_IRDA_SFLSR_CRC_ERROR_FLAG   (1 << 1)
+#define OMAP_IRDA_SFLSR_ABORT_FLAG   (1 << 2)
+#define OMAP_IRDA_SFLSR_FTL_FLAG   (1 << 3)
+#define OMAP_IRDA_SFLSR_OE_FLAG   (1 << 4)
+
+		/** Transmit frame length low (IrDA only) */
+		ioport32_t txfll;
+#define OMAP_UART_TXFLL_MASK   (0xff)
+	};
+
+	union {
+		/** Dummy register to restart TX or RX (IrDA only) */
+		const ioport32_t resume;
+		/** Transmit frame length high (IrDA only) */
+		ioport32_t txflh;
+#define OMAP_UART_TXFLH_MASK   (0xff)
+	};
+
+	union {
+		/** Status FIFO register low (IrDA only) */
+		const ioport32_t sfregl;
+#define OMAP_UART_SFREGL_MASK   (0xff)
+		/** Received frame length low (IrDA only) */
+		ioport32_t rxfll;
+#define OMAP_UART_RXFLL_MASK   (0xff)
+	};
+
+	union {
+		/** Status FIFO register high (IrDA only) */
+		const ioport32_t sfregh;
+#define OMAP_UART_SFREGH_MASK   (0xf)
+		/** Received frame length high (IrDA only) */
+		ioport32_t rxflh;
+#define OMAP_UART_RXFLH_MASK   (0xf)
+	};
+
+	union {
+		/** UART autobauding status register */
+		const ioport32_t uasr;
+#define OMAP_UART_UASR_SPEED_MASK   (0x1f)
+#define OMAP_UART_UASR_SPEED_SHIFT   (0)
+#define OMAP_UART_UASR_8BIT_CHAR_FLAG   (1 << 5)
+#define OMAP_UART_UASR_PARITY_MASK   (0x3)
+#define OMAP_UART_UASR_PARITY_SHIFT   (6)
+
+		/** BOF control register (IrDA only) */
+		ioport32_t blr;
+#define OMAP_IRDA_BLR_XBOF_TYPE_FLAG   (1 << 6)
+#define OMAP_IRDA_BLR_STS_FIFO_RESET   (1 << 7)
+	};
+
+	/** Auxiliary control register (IrDA only) */
+	ioport32_t acreg;
+#define OMAP_IRDA_ACREG_EOT_EN_FLAG   (1 << 0)
+#define OMAP_IRDA_ACREG_ABORT_EN_FLAG   (1 << 1)
+#define OMAP_IRDA_ACREG_SCTX_EN_FLAG   (1 << 2)
+#define OMAP_IRDA_ACREG_SEND_SIP_FLAG   (1 << 3)
+#define OMAP_IRDA_ACREG_DIS_TX_UNDERRUN_FLAG   (1 << 4)
+#define OMAP_IRDA_ACREG_DIS_IR_RX_FLAG   (1 << 5)
+#define OMAP_IRDA_ACREG_SD_MOD_FLAG   (1 << 6)
+#define OMAP_IRDA_ACREG_PULSE_TYPE_FLAG   (1 << 7)
+
+	/** Supplementary control register */
+	ioport32_t scr;
+#define OMAP_UART_SCR_DMA_MODE_CTL_FLAG   (1 << 0)
+#define OMAP_UART_SCR_DMA_MODE_MASK   (0x3)
+#define OMAP_UART_SCR_DMA_MODE_SHIFT   (1)
+#define OMAP_UART_SCR_TX_EMPTY_CTL_IRQ_FLAG   (1 << 3)
+#define OMAP_UART_SCR_RX_CTS_WU_EN_FLAG   (1 << 4)
+#define OMAP_UART_SCR_TX_TRIG_GRANU1_FLAG   (1 << 6)
+#define OMAP_UART_SCR_RX_TRIG_GRANU1_FLAG   (1 << 7)
+
+	/** Supplementary status register */
+	const ioport32_t ssr;
+#define OMAP_UART_SSR_TX_FIFO_FULL_FLAG   (1 << 0)
+#define OMAP_UART_SSR_RX_CTS_WU_STS_FLAG   (1 << 1)
+#define OMAP_UART_SSR_DMA_COUNTER_RESET_FLAG   (1 << 2)
+
+	/** BOF Length register (IrDA only)*/
+	ioport32_t eblr;
+#define OMAP_IRDA_EBLR_DISABLED   (0x00)
+#define OMAP_IRDA_EBLR_RX_STOP_BITS(bits)   (bits & 0xff)
+
+	uint32_t padd0_;
+
+	/** Module version register */
+	const ioport32_t mvr;
+#define OMAP_UART_MVR_MINOR_MASK   (0xf)
+#define OMAP_UART_MVR_MINOR_SHIFT   (0)
+#define OMAP_UART_MVR_MAJOR_MASK   (0xf)
+#define OMAP_UART_MVR_MAJOR_SHIFT   (4)
+
+	/** System configuration register */
+	ioport32_t sysc;
+#define OMAP_UART_SYSC_AUTOIDLE_FLAG   (1 << 0)
+#define OMAP_UART_SYSC_SOFTRESET_FLAG   (1 << 1)
+#define OMAP_UART_SYSC_ENWAKEUP_FLAG   (1 << 2)
+#define OMAP_UART_SYSC_IDLE_MODE_MASK   (0x3)
+#define OMAP_UART_SYSC_IDLE_MODE_SHIFT   (3)
+#define OMAP_UART_SYSC_IDLE_MODE_FORCE   (0x0)
+#define OMAP_UART_SYSC_IDLE_MODE_NO   (0x1)
+#define OMAP_UART_SYSC_IDLE_MODE_SMART   (0x2)
+
+	/** System status register */
+	const ioport32_t syss;
+#define OMAP_UART_SYSS_RESETDONE_FLAG   (1 << 0)
+
+	/** Wake-up enable register */
+	ioport32_t wer;
+#define OMAP_UART_WER_CTS_ACTIVITY_FLAG  (1 << 0)
+#define OMAP_UART_WER_RI_ACTIVITY_FLAG  (1 << 2)
+#define OMAP_UART_WER_RX_ACTIVITY_FLAG  (1 << 4)
+#define OMAP_UART_WER_RHR_IRQ_FLAG  (1 << 5)
+#define OMAP_UART_WER_RLS_IRQ_FLAG  (1 << 6)
+#define OMAP_UART_WER_TX_WAKEUP_EN_FLAG  (1 << 7)
+
+	/** Carrier frequency prescaler */
+	ioport32_t cfps;
+#define OMAP_UART_CFPS_MASK   (0xff)
+
+	/** Number of bytes in RX fifo */
+	const ioport32_t rx_fifo_lvl;
+#define OMAP_UART_RX_FIFO_LVL_MASK   (0xff)
+
+	/** Number of bytes in TX fifo */
+	const ioport32_t tx_fifo_lvl;
+#define OMAP_UART_TX_FIFO_LVL_MASK   (0xff)
+
+	/** RX/TX empty interrupts */
+	ioport32_t ier2;
+#define OMAP_UART_IER2_RX_FIFO_EMPTY_IRQ_EN_FLAG  (1 << 0)
+#define OMAP_UART_IER2_TX_FIFO_EMPTY_IRQ_EN_FLAG  (1 << 1)
+
+	/** RX/TX empty status */
+	ioport32_t isr2;
+#define OMAP_UART_ISR2_RX_FIFO_EMPTY_FLAG  (1 << 0)
+#define OMAP_UART_ISR2_TX_FIFO_EMPTY_FLAG  (1 << 1)
+
+	/** Set the sample per bit if non default frequency is used */
+	ioport32_t freq_sel;
+#define OMAP_UART_FREQ_SEL_MASK  (0x000000FF)
+
+	uint32_t padd2_[2];
+
+	/** Mode definition register 3 */
+	ioport32_t mdr3;
+#define OMAP_UART_MDR3_DIS_CIR_RX_DEMOD_FLAG   (1 << 0)
+} omap_uart_regs_t;
+
+#endif
+
+/**
+ * @}
+ */
Index: rnel/genarch/include/genarch/fb/logo-196x66.h
===================================================================
--- kernel/genarch/include/genarch/fb/logo-196x66.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2008 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genarch
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_LOGO_196X66_H_
-#define KERN_LOGO_196X66_H_
-
-#define LOGO_WIDTH   196
-#define LOGO_HEIGHT  66
-#define LOGO_COLOR   0xffffff
-
-#include <typedefs.h>
-
-extern uint32_t fb_logo[LOGO_WIDTH * LOGO_HEIGHT];
-
-#endif
-
-/** @}
- */
Index: rnel/genarch/src/drivers/am335x/uart.c
===================================================================
--- kernel/genarch/src/drivers/am335x/uart.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ 	(revision )
@@ -1,183 +1,0 @@
-/*
- * Copyright (c) 2012 Jan Vesely
- * Copyright (c) 2013 Maurizio Lombardi
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/** @addtogroup genarch
- * @{
- */
-/**
- * @file
- * @brief Texas Instruments AM335x on-chip uart serial line driver.
- */
-
-#include <genarch/drivers/am335x/uart.h>
-#include <ddi/device.h>
-#include <str.h>
-#include <mm/km.h>
-
-static void am335x_uart_txb(am335x_uart_t *uart, uint8_t b)
-{
-	/* Wait for buffer */
-	while (uart->regs->ssr & AM335x_UART_SSR_TX_FIFO_FULL_FLAG);
-	/* Write to the outgoing fifo */
-	uart->regs->thr = b;
-}
-
-static void am335x_uart_putchar(outdev_t *dev, wchar_t ch)
-{
-	am335x_uart_t *uart = dev->data;
-	if (!ascii_check(ch)) {
-		am335x_uart_txb(uart, U_SPECIAL);
-	} else {
-		if (ch == '\n')
-			am335x_uart_txb(uart, '\r');
-		am335x_uart_txb(uart, ch);
-	}
-}
-
-static outdev_operations_t am335x_uart_ops = {
-	.redraw = NULL,
-	.write = am335x_uart_putchar,
-};
-
-static irq_ownership_t am335x_uart_claim(irq_t *irq)
-{
-	return IRQ_ACCEPT;
-}
-
-static void am335x_uart_handler(irq_t *irq)
-{
-	am335x_uart_t *uart = irq->instance;
-	while ((uart->regs->rx_fifo_lvl)) {
-		const uint8_t val = uart->regs->rhr;
-		if (uart->indev && val) {
-			indev_push_character(uart->indev, val);
-		}
-	}
-}
-
-bool am335x_uart_init(
-    am335x_uart_t *uart, inr_t interrupt, uintptr_t addr, size_t size)
-{
-	ASSERT(uart);
-	uart->regs = (void *)km_map(addr, size, PAGE_NOT_CACHEABLE);
-
-	ASSERT(uart->regs);
-
-	/* Soft reset the port */
-	uart->regs->sysc = AM335x_UART_SYSC_SOFTRESET_FLAG;
-	while (!(uart->regs->syss & AM335x_UART_SYSS_RESETDONE_FLAG));
-
-	/* Disable the UART module */
-	uart->regs->mdr1 |= AM335x_UART_MDR_MS_DISABLE;
-
-	/* Enable access to EFR register */
-	uart->regs->lcr = 0xbf;              /* Sets config mode B */
-
-	/* Enable access to TCL_TLR register */
-	const bool enhanced = uart->regs->efr & AM335x_UART_EFR_ENH_FLAG;
-	uart->regs->efr |= AM335x_UART_EFR_ENH_FLAG; /* Turn on enh. */
-	uart->regs->lcr = 0x80;              /* Config mode A */
-
-	/* Set default (val 0) triggers, disable DMA enable FIFOs */
-	const bool tcl_tlr = uart->regs->mcr & AM335x_UART_MCR_TCR_TLR_FLAG;
-	/* Enable access to tcr and tlr registers */
-	uart->regs->mcr |= AM335x_UART_MCR_TCR_TLR_FLAG;
-
-	/* Enable FIFOs */
-	uart->regs->fcr = AM335x_UART_FCR_FIFO_EN_FLAG;
-
-	/* Enable fine granularity for RX FIFO and set trigger level to 1,
-	 * TX FIFO, trigger level is irrelevant*/
-	uart->regs->lcr = 0xBF;              /* Sets config mode B */
-	uart->regs->scr = AM335x_UART_SCR_RX_TRIG_GRANU1_FLAG;
-	uart->regs->tlr = 1 << AM335x_UART_TLR_RX_FIFO_TRIG_SHIFT;
-
-	/* Sets config mode A */
-	uart->regs->lcr = 0x80;
-	/* Restore tcl_tlr access flag */
-	if (!tcl_tlr)
-		uart->regs->mcr &= ~AM335x_UART_MCR_TCR_TLR_FLAG;
-	/* Sets config mode B */
-	uart->regs->lcr = 0xBF;
-
-	/* Set the divisor value to get a baud rate of 115200 bps */
-	uart->regs->dll = 0x1A;
-	uart->regs->dlh = 0x00;
-
-	/* Restore enhanced */
-	if (!enhanced)
-		uart->regs->efr &= ~AM335x_UART_EFR_ENH_FLAG;
-
-	/* Set the DIV_EN bit to 0 */
-	uart->regs->lcr &= ~AM335x_UART_LCR_DIV_EN_FLAG;
-	/* Set the BREAK_EN bit to 0 */
-	uart->regs->lcr &= ~AM335x_UART_LCR_BREAK_EN_FLAG;
-	/* No parity */
-	uart->regs->lcr &= ~AM335x_UART_LCR_PARITY_EN_FLAG;
-	/* Stop = 1 bit */
-	uart->regs->lcr &= ~AM335x_UART_LCR_NB_STOP_FLAG;
-	/* Char length = 8 bits */
-	uart->regs->lcr |= AM335x_UART_LCR_CHAR_LENGTH_8BITS;
-
-	/* Enable the UART module */
-	uart->regs->mdr1 &= (AM335x_UART_MDR_MS_UART16 &
-	    ~AM335x_UART_MDR_MS_MASK);
-
-	/* Disable interrupts */
-	uart->regs->ier = 0;
-
-	/* Setup outdev */
-	outdev_initialize("am335x_uart_dev", &uart->outdev, &am335x_uart_ops);
-	uart->outdev.data = uart;
-
-	/* Initialize IRQ */
-	irq_initialize(&uart->irq);
-	uart->irq.devno = device_assign_devno();
-	uart->irq.inr = interrupt;
-	uart->irq.claim = am335x_uart_claim;
-	uart->irq.handler = am335x_uart_handler;
-	uart->irq.instance = uart;
-
-	return true;
-}
-
-void am335x_uart_input_wire(am335x_uart_t *uart, indev_t *indev)
-{
-	ASSERT(uart);
-	/* Set indev */
-	uart->indev = indev;
-	/* Register interrupt. */
-	irq_register(&uart->irq);
-	/* Enable interrupt on receive */
-	uart->regs->ier |= AM335x_UART_IER_RHR_IRQ_FLAG;
-}
-
-/**
- * @}
- */
-
Index: rnel/genarch/src/drivers/amdm37x/uart.c
===================================================================
--- kernel/genarch/src/drivers/amdm37x/uart.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ 	(revision )
@@ -1,163 +1,0 @@
-/*
- * Copyright (c) 2012 Jan Vesely
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/** @addtogroup genarch
- * @{
- */
-/**
- * @file
- * @brief Texas Instruments AMDM37x on-chip uart serial line driver.
- */
-
-#include <genarch/drivers/amdm37x/uart.h>
-#include <ddi/device.h>
-#include <str.h>
-#include <mm/km.h>
-
-static void amdm37x_uart_txb(amdm37x_uart_t *uart, uint8_t b)
-{
-	/* Wait for buffer */
-	while (uart->regs->ssr & AMDM37x_UART_SSR_TX_FIFO_FULL_FLAG);
-	/* Write to the outgoing fifo */
-	uart->regs->thr = b;
-}
-
-static void amdm37x_uart_putchar(outdev_t *dev, wchar_t ch)
-{
-	amdm37x_uart_t *uart = dev->data;
-	if (!ascii_check(ch)) {
-		amdm37x_uart_txb(uart, U_SPECIAL);
-	} else {
-		if (ch == '\n')
-			amdm37x_uart_txb(uart, '\r');
-		amdm37x_uart_txb(uart, ch);
-	}
-}
-
-static outdev_operations_t amdm37x_uart_ops = {
-	.redraw = NULL,
-	.write = amdm37x_uart_putchar,
-};
-
-static irq_ownership_t amdm37x_uart_claim(irq_t *irq)
-{
-	return IRQ_ACCEPT;
-}
-
-static void amdm37x_uart_handler(irq_t *irq)
-{
-	amdm37x_uart_t *uart = irq->instance;
-	while ((uart->regs->rx_fifo_lvl)) {
-		const uint8_t val = uart->regs->rhr;
-		if (uart->indev && val) {
-			indev_push_character(uart->indev, val);
-		}
-	}
-}
-
-bool amdm37x_uart_init(
-    amdm37x_uart_t *uart, inr_t interrupt, uintptr_t addr, size_t size)
-{
-	ASSERT(uart);
-	uart->regs = (void *)km_map(addr, size, PAGE_NOT_CACHEABLE);
-
-	ASSERT(uart->regs);
-
-	/* See TI OMAP35X TRM ch 17.5.1.1 p. 2732 for startup routine */
-#if 0
-	/* Soft reset the port */
-	uart->regs->sysc = AMDM37x_UART_SYSC_SOFTRESET_FLAG;
-	while (!(uart->regs->syss & AMDM37x_UART_SYSS_RESETDONE_FLAG)) ;
-#endif
-
-	/* Enable access to EFR register */
-	const uint8_t lcr = uart->regs->lcr; /* Save old value */
-	uart->regs->lcr = 0xbf;              /* Sets config mode B */
-
-	/* Enable access to TCL_TLR register */
-	const bool enhanced = uart->regs->efr & AMDM37x_UART_EFR_ENH_FLAG;
-	uart->regs->efr |= AMDM37x_UART_EFR_ENH_FLAG; /* Turn on enh. */
-	uart->regs->lcr = 0x80;              /* Config mode A */
-
-	/* Set default (val 0) triggers, disable DMA enable FIFOs */
-	const bool tcl_tlr = uart->regs->mcr & AMDM37x_UART_MCR_TCR_TLR_FLAG;
-	/* Enable access to tcr and tlr registers */
-	uart->regs->mcr |= AMDM37x_UART_MCR_TCR_TLR_FLAG;
-
-	/* Enable FIFOs */
-	uart->regs->fcr = AMDM37x_UART_FCR_FIFO_EN_FLAG;
-
-	/* Eneble fine granularity for RX FIFO and set trigger level to 1,
-	 * TX FIFO, trigger level is irelevant*/
-	uart->regs->lcr = 0xbf;              /* Sets config mode B */
-	uart->regs->scr = AMDM37x_UART_SCR_RX_TRIG_GRANU1_FLAG;
-	uart->regs->tlr = 1 << AMDM37x_UART_TLR_RX_FIFO_TRIG_SHIFT;
-
-	/* Restore enhanced */
-	if (!enhanced)
-		uart->regs->efr &= ~AMDM37x_UART_EFR_ENH_FLAG;
-
-	uart->regs->lcr = 0x80;              /* Config mode A */
-	/* Restore tcl_lcr access flag*/
-	if (!tcl_tlr)
-		uart->regs->mcr &= ~AMDM37x_UART_MCR_TCR_TLR_FLAG;
-
-	/* Restore lcr */
-	uart->regs->lcr = lcr;
-
-	/* Disable interrupts */
-	uart->regs->ier = 0;
-
-	/* Setup outdev */
-	outdev_initialize("amdm37x_uart_dev", &uart->outdev, &amdm37x_uart_ops);
-	uart->outdev.data = uart;
-
-	/* Initialize IRQ */
-	irq_initialize(&uart->irq);
-	uart->irq.devno = device_assign_devno();
-	uart->irq.inr = interrupt;
-	uart->irq.claim = amdm37x_uart_claim;
-	uart->irq.handler = amdm37x_uart_handler;
-	uart->irq.instance = uart;
-
-	return true;
-}
-
-void amdm37x_uart_input_wire(amdm37x_uart_t *uart, indev_t *indev)
-{
-	ASSERT(uart);
-	/* Set indev */
-	uart->indev = indev;
-	/* Register interrupt. */
-	irq_register(&uart->irq);
-	/* Enable interrupt on receive */
-	uart->regs->ier |= AMDM37x_UART_IER_RHR_IRQ_FLAG;
-}
-
-/**
- * @}
- */
Index: kernel/genarch/src/drivers/omap/uart.c
===================================================================
--- kernel/genarch/src/drivers/omap/uart.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ kernel/genarch/src/drivers/omap/uart.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2012 Jan Vesely
+ * Copyright (c) 2013 Maurizio Lombardi
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/** @addtogroup genarch
+ * @{
+ */
+/**
+ * @file
+ * @brief Texas Instruments OMAP on-chip uart serial line driver.
+ */
+
+#include <genarch/drivers/omap/uart.h>
+#include <ddi/device.h>
+#include <str.h>
+#include <mm/km.h>
+
+static void omap_uart_txb(omap_uart_t *uart, uint8_t b)
+{
+	/* Wait for buffer */
+	while (uart->regs->ssr & OMAP_UART_SSR_TX_FIFO_FULL_FLAG);
+	/* Write to the outgoing fifo */
+	uart->regs->thr = b;
+}
+
+static void omap_uart_putchar(outdev_t *dev, wchar_t ch)
+{
+	omap_uart_t *uart = dev->data;
+	if (!ascii_check(ch)) {
+		omap_uart_txb(uart, U_SPECIAL);
+	} else {
+		if (ch == '\n')
+			omap_uart_txb(uart, '\r');
+		omap_uart_txb(uart, ch);
+	}
+}
+
+static outdev_operations_t omap_uart_ops = {
+	.redraw = NULL,
+	.write = omap_uart_putchar,
+};
+
+static irq_ownership_t omap_uart_claim(irq_t *irq)
+{
+	return IRQ_ACCEPT;
+}
+
+static void omap_uart_handler(irq_t *irq)
+{
+	omap_uart_t *uart = irq->instance;
+	while ((uart->regs->rx_fifo_lvl)) {
+		const uint8_t val = uart->regs->rhr;
+		if (uart->indev && val) {
+			indev_push_character(uart->indev, val);
+		}
+	}
+}
+
+bool omap_uart_init(
+    omap_uart_t *uart, inr_t interrupt, uintptr_t addr, size_t size)
+{
+	ASSERT(uart);
+	uart->regs = (void *)km_map(addr, size, PAGE_NOT_CACHEABLE);
+
+	ASSERT(uart->regs);
+
+	/* Soft reset the port */
+	uart->regs->sysc = OMAP_UART_SYSC_SOFTRESET_FLAG;
+	while (!(uart->regs->syss & OMAP_UART_SYSS_RESETDONE_FLAG));
+
+	/* Disable the UART module */
+	uart->regs->mdr1 |= OMAP_UART_MDR_MS_DISABLE;
+
+	/* Enable access to EFR register */
+	uart->regs->lcr = 0xbf;              /* Sets config mode B */
+
+	/* Enable access to TCL_TLR register */
+	const bool enhanced = uart->regs->efr & OMAP_UART_EFR_ENH_FLAG;
+	uart->regs->efr |= OMAP_UART_EFR_ENH_FLAG; /* Turn on enh. */
+	uart->regs->lcr = 0x80;              /* Config mode A */
+
+	/* Set default (val 0) triggers, disable DMA enable FIFOs */
+	const bool tcl_tlr = uart->regs->mcr & OMAP_UART_MCR_TCR_TLR_FLAG;
+	/* Enable access to tcr and tlr registers */
+	uart->regs->mcr |= OMAP_UART_MCR_TCR_TLR_FLAG;
+
+	/* Enable FIFOs */
+	uart->regs->fcr = OMAP_UART_FCR_FIFO_EN_FLAG;
+
+	/* Enable fine granularity for RX FIFO and set trigger level to 1,
+	 * TX FIFO, trigger level is irrelevant*/
+	uart->regs->lcr = 0xBF;              /* Sets config mode B */
+	uart->regs->scr = OMAP_UART_SCR_RX_TRIG_GRANU1_FLAG;
+	uart->regs->tlr = 1 << OMAP_UART_TLR_RX_FIFO_TRIG_SHIFT;
+
+	/* Sets config mode A */
+	uart->regs->lcr = 0x80;
+	/* Restore tcl_tlr access flag */
+	if (!tcl_tlr)
+		uart->regs->mcr &= ~OMAP_UART_MCR_TCR_TLR_FLAG;
+	/* Sets config mode B */
+	uart->regs->lcr = 0xBF;
+
+	/* Set the divisor value to get a baud rate of 115200 bps */
+	uart->regs->dll = 0x1A;
+	uart->regs->dlh = 0x00;
+
+	/* Restore enhanced */
+	if (!enhanced)
+		uart->regs->efr &= ~OMAP_UART_EFR_ENH_FLAG;
+
+	/* Set the DIV_EN bit to 0 */
+	uart->regs->lcr &= ~OMAP_UART_LCR_DIV_EN_FLAG;
+	/* Set the BREAK_EN bit to 0 */
+	uart->regs->lcr &= ~OMAP_UART_LCR_BREAK_EN_FLAG;
+	/* No parity */
+	uart->regs->lcr &= ~OMAP_UART_LCR_PARITY_EN_FLAG;
+	/* Stop = 1 bit */
+	uart->regs->lcr &= ~OMAP_UART_LCR_NB_STOP_FLAG;
+	/* Char length = 8 bits */
+	uart->regs->lcr |= OMAP_UART_LCR_CHAR_LENGTH_8BITS;
+
+	/* Enable the UART module */
+	uart->regs->mdr1 &= (OMAP_UART_MDR_MS_UART16 &
+	    ~OMAP_UART_MDR_MS_MASK);
+
+	/* Disable interrupts */
+	uart->regs->ier = 0;
+
+	/* Setup outdev */
+	outdev_initialize("omap_uart_dev", &uart->outdev, &omap_uart_ops);
+	uart->outdev.data = uart;
+
+	/* Initialize IRQ */
+	irq_initialize(&uart->irq);
+	uart->irq.devno = device_assign_devno();
+	uart->irq.inr = interrupt;
+	uart->irq.claim = omap_uart_claim;
+	uart->irq.handler = omap_uart_handler;
+	uart->irq.instance = uart;
+
+	return true;
+}
+
+void omap_uart_input_wire(omap_uart_t *uart, indev_t *indev)
+{
+	ASSERT(uart);
+	/* Set indev */
+	uart->indev = indev;
+	/* Register interrupt. */
+	irq_register(&uart->irq);
+	/* Enable interrupt on receive */
+	uart->regs->ier |= OMAP_UART_IER_RHR_IRQ_FLAG;
+}
+
+/**
+ * @}
+ */
+
Index: kernel/genarch/src/fb/fb.c
===================================================================
--- kernel/genarch/src/fb/fb.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/genarch/src/fb/fb.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -35,5 +35,4 @@
 
 #include <genarch/fb/font-8x16.h>
-#include <genarch/fb/logo-196x66.h>
 #include <genarch/fb/fb.h>
 #include <console/chardev.h>
@@ -53,6 +52,6 @@
 #include <byteorder.h>
 
-#define BG_COLOR     0x000080
-#define FG_COLOR     0xffff00
+#define BG_COLOR     0x001620
+#define FG_COLOR     0xf3cf65
 #define INV_COLOR    0xaaaaaa
 
@@ -93,6 +92,4 @@
 	unsigned int yres;
 	
-	unsigned int ylogo;
-	unsigned int ytrim;
 	unsigned int rowtrim;
 	
@@ -213,17 +210,4 @@
 }
 
-/** Hide logo and refresh screen
- *
- */
-static void logo_hide(fb_instance_t *instance)
-{
-	instance->ylogo = 0;
-	instance->ytrim = instance->yres;
-	instance->rowtrim = instance->rows;
-	
-	if ((!instance->parea.mapped) || (console_override))
-		fb_redraw_internal(instance);
-}
-
 /** Draw character at given position
  *
@@ -236,7 +220,4 @@
 	unsigned int yd;
 	
-	if (y >= instance->ytrim)
-		logo_hide(instance);
-	
 	if (!overlay)
 		instance->backbuf[BB_POS(instance, col, row)] = glyph;
@@ -244,5 +225,5 @@
 	if ((!instance->parea.mapped) || (console_override)) {
 		for (yd = 0; yd < FONT_SCANLINES; yd++)
-			memcpy(&instance->addr[FB_POS(instance, x, y + yd + instance->ylogo)],
+			memcpy(&instance->addr[FB_POS(instance, x, y + yd)],
 			    &instance->glyphs[GLYPH_POS(instance, glyph, yd)],
 			    instance->glyphscanline);
@@ -256,9 +237,4 @@
 static void screen_scroll(fb_instance_t *instance)
 {
-	if (instance->ylogo > 0) {
-		logo_hide(instance);
-		return;
-	}
-	
 	if ((!instance->parea.mapped) || (console_override)) {
 		unsigned int row;
@@ -412,22 +388,8 @@
 static void fb_redraw_internal(fb_instance_t *instance)
 {
-	if (instance->ylogo > 0) {
-		unsigned int y;
-		
-		for (y = 0; y < LOGO_HEIGHT; y++) {
-			unsigned int x;
-			
-			for (x = 0; x < instance->xres; x++)
-				instance->rgb_conv(&instance->addr[FB_POS(instance, x, y)],
-				    (x < LOGO_WIDTH) ?
-				    fb_logo[y * LOGO_WIDTH + x] :
-				    LOGO_COLOR);
-		}
-	}
-	
 	unsigned int row;
 	
 	for (row = 0; row < instance->rowtrim; row++) {
-		unsigned int y = instance->ylogo + ROW2Y(row);
+		unsigned int y = ROW2Y(row);
 		unsigned int yd;
 		
@@ -452,14 +414,13 @@
 		    (instance->xres - COL2X(instance->cols)) * instance->pixelbytes;
 		
-		for (y = instance->ylogo; y < instance->yres; y++)
+		for (y = 0; y < instance->yres; y++)
 			memcpy(&instance->addr[FB_POS(instance, COL2X(instance->cols), y)],
 			    instance->bgscan, size);
 	}
 	
-	if (ROW2Y(instance->rowtrim) + instance->ylogo < instance->yres) {
+	if (ROW2Y(instance->rowtrim) < instance->yres) {
 		unsigned int y;
 		
-		for (y = ROW2Y(instance->rowtrim) + instance->ylogo;
-		    y < instance->yres; y++)
+		for (y = ROW2Y(instance->rowtrim); y < instance->yres; y++)
 			memcpy(&instance->addr[FB_POS(instance, 0, y)],
 			    instance->bgscan, instance->bgscanbytes);
@@ -567,15 +528,5 @@
 	instance->rows = Y2ROW(instance->yres);
 	
-	if (instance->yres > LOGO_HEIGHT) {
-		instance->ylogo = LOGO_HEIGHT;
-		instance->rowtrim = instance->rows - Y2ROW(instance->ylogo);
-		if (instance->ylogo % FONT_SCANLINES > 0)
-			instance->rowtrim--;
-		instance->ytrim = ROW2Y(instance->rowtrim);
-	} else {
-		instance->ylogo = 0;
-		instance->ytrim = instance->yres;
-		instance->rowtrim = instance->rows;
-	}
+	instance->rowtrim = instance->rows;
 	
 	instance->glyphscanline = FONT_WIDTH * instance->pixelbytes;
Index: rnel/genarch/src/fb/logo-196x66.c
===================================================================
--- kernel/genarch/src/fb/logo-196x66.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ 	(revision )
@@ -1,13110 +1,0 @@
-/*
- * Copyright (c) 2008 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genarch
- * @{
- */
-/** @file
- */
-
-#include <genarch/fb/logo-196x66.h>
-
-uint32_t fb_logo[LOGO_WIDTH * LOGO_HEIGHT] = {
-
-	/* Scanline 0 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 1 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 2 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 3 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xf9f9f8,
-	0xf5f3f1,
-	0xf3f1ee,
-	0xf3f2ef,
-	0xf7f7f6,
-	0xfbfbfb,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 4 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefd,
-	0xf9f9f8,
-	0xf3f1ed,
-	0xeeeae4,
-	0xece8df,
-	0xebe6de,
-	0xeae5dd,
-	0xeae5dd,
-	0xeae5de,
-	0xeae8e4,
-	0xf1f1f0,
-	0xfbfbfb,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 5 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefd,
-	0xf9f9f8,
-	0xf4f2ef,
-	0xefebe5,
-	0xf0ece5,
-	0xeeeae4,
-	0xe3e0db,
-	0xdfdcd8,
-	0xe2e0db,
-	0xeeebe6,
-	0xeeebe5,
-	0xeae5dd,
-	0xe8e4db,
-	0xe5e1db,
-	0xe9e9e8,
-	0xfafafa,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 6 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefd,
-	0xfaf9f9,
-	0xf4f3ef,
-	0xefece6,
-	0xf0ece5,
-	0xeeebe5,
-	0xdfdcd7,
-	0xc6c4bd,
-	0xbebcb5,
-	0xcfcdc8,
-	0xd3d2cd,
-	0xd1cfca,
-	0xc0beb7,
-	0xcccac3,
-	0xeae7e3,
-	0xe9e5dd,
-	0xe7e3da,
-	0xdedbd8,
-	0xe8e8e7,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 7 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfafafa,
-	0xf5f4f0,
-	0xf1eee8,
-	0xf0ece4,
-	0xf0ede7,
-	0xe1ded9,
-	0xc9c7c1,
-	0xbebcb4,
-	0xd1cfca,
-	0xecebe8,
-	0xf9f9f7,
-	0xfaf9f7,
-	0xf8f6f4,
-	0xf7f5f2,
-	0xf4f3f1,
-	0xdcdad6,
-	0xc2c0b9,
-	0xe6e4de,
-	0xe5e2dc,
-	0xe2ddd8,
-	0xd7d5d4,
-	0xf2f2f1,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 8 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfbfbfb,
-	0xf6f5f2,
-	0xf1eee9,
-	0xf1ede5,
-	0xf1ede6,
-	0xe4e1db,
-	0xcecbc4,
-	0xbebcb5,
-	0xcfcdc8,
-	0xe7e6e4,
-	0xf8f8f6,
-	0xfafaf8,
-	0xf9f7f5,
-	0xf7f5f2,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xd9d7d2,
-	0xc8c5bf,
-	0xe9e5e0,
-	0xe4dfd8,
-	0xd5d2ce,
-	0xe1e1e1,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 9 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfbfbfb,
-	0xf7f6f3,
-	0xf2efea,
-	0xf1ede6,
-	0xf1eee7,
-	0xe5e3de,
-	0xd0cec7,
-	0xbfbdb5,
-	0xcdcbc5,
-	0xe4e3e0,
-	0xf7f7f6,
-	0xfbfaf9,
-	0xf9f8f6,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf1efeb,
-	0xc5c2bb,
-	0xe2dfdb,
-	0xe5e0da,
-	0xded9d3,
-	0xd3d2d1,
-	0xf4f4f4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 10 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfcfcfb,
-	0xf8f6f4,
-	0xf3f0eb,
-	0xf1eee7,
-	0xf2efe8,
-	0xe8e5df,
-	0xd3d1cb,
-	0xc0beb6,
-	0xcbc9c3,
-	0xe1e0dc,
-	0xf5f4f3,
-	0xfbfaf8,
-	0xfaf9f7,
-	0xf8f7f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ec,
-	0xf2efec,
-	0xdbd9d4,
-	0xcdcbc4,
-	0xe8e4de,
-	0xe3ded7,
-	0xd0cecb,
-	0xe7e7e6,
-	0xfdfdfc,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 11 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfcfcfb,
-	0xf8f7f4,
-	0xf4f1ed,
-	0xf2eee8,
-	0xf3efe9,
-	0xeae7e1,
-	0xd6d4cd,
-	0xc3c1b9,
-	0xcac8c2,
-	0xdddcd8,
-	0xf3f2f1,
-	0xfafaf8,
-	0xfbfaf7,
-	0xf9f7f5,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xf2f0ec,
-	0xf1efeb,
-	0xf1eeeb,
-	0xece9e5,
-	0xc3c1ba,
-	0xe5e3de,
-	0xe3ded7,
-	0xd9d5d0,
-	0xd6d5d5,
-	0xf7f7f7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 12 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfcfcfc,
-	0xf9f8f5,
-	0xf5f2ee,
-	0xf3efe8,
-	0xf4f0e9,
-	0xece9e3,
-	0xd9d7d1,
-	0xc4c2bb,
-	0xc8c6c0,
-	0xd9d8d4,
-	0xf1f0ef,
-	0xfaf9f8,
-	0xfbfaf8,
-	0xfaf8f5,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ec,
-	0xf2efec,
-	0xf1eeeb,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xd2cfc9,
-	0xd3d2cc,
-	0xe4e0db,
-	0xded9d3,
-	0xcfccca,
-	0xededec,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 13 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xf9f9f7,
-	0xf5f3f0,
-	0xf3efe8,
-	0xf4f0e9,
-	0xeeeae5,
-	0xdddad4,
-	0xc7c4bd,
-	0xc7c6bf,
-	0xd7d6d1,
-	0xeeedeb,
-	0xf9f9f8,
-	0xfcfbfa,
-	0xfaf9f6,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xf2f0ec,
-	0xf1efeb,
-	0xf1eeeb,
-	0xf1eeea,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xe4e2dd,
-	0xc4c2bb,
-	0xe5e2de,
-	0xdfdad3,
-	0xd3d0cb,
-	0xdbdbdb,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 14 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xfaf9f7,
-	0xf6f4f0,
-	0xf3f0e9,
-	0xf4f0ea,
-	0xefece6,
-	0xdfddd7,
-	0xcbc8c1,
-	0xc7c5be,
-	0xd4d3ce,
-	0xebebe8,
-	0xf8f8f6,
-	0xfcfcfa,
-	0xfbfaf7,
-	0xfaf9f6,
-	0xf9f7f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xf2f0ec,
-	0xf2efec,
-	0xf1eeeb,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xedeae6,
-	0xc8c6bf,
-	0xdcdad5,
-	0xe1dcd6,
-	0xdbd7d0,
-	0xd0cfcd,
-	0xf1f0f0,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 15 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfafaf9,
-	0xf7f5f1,
-	0xf4f1ea,
-	0xf5f1ea,
-	0xf1ede7,
-	0xe2e0da,
-	0xcccac3,
-	0xc6c5be,
-	0xd1cfca,
-	0xe9e8e6,
-	0xf8f7f6,
-	0xfcfcfb,
-	0xfbfaf8,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ed,
-	0xf2f0ec,
-	0xf2efec,
-	0xf1eeeb,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xedeae5,
-	0xdedbd5,
-	0xc7c6bf,
-	0xe5e2dd,
-	0xded9d3,
-	0xcfcdc9,
-	0xe2e2e2,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 16 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xfbfbf9,
-	0xf6f3ed,
-	0xf4f1e9,
-	0xf4f1eb,
-	0xe7e4df,
-	0xcfcdc6,
-	0xc7c5be,
-	0xceccc7,
-	0xe6e5e2,
-	0xf7f6f5,
-	0xfdfcfb,
-	0xfcfbf9,
-	0xfaf9f7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xe0dedb,
-	0xb4b2b1,
-	0xb6b5b4,
-	0xe0dddb,
-	0xf1eeeb,
-	0xf1eeea,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xece9e5,
-	0xece9e4,
-	0xe8e6e1,
-	0xc3c1ba,
-	0xdfddd9,
-	0xddd9d3,
-	0xd6d3cd,
-	0xd3d2d1,
-	0xf5f5f4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 17 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfafaf9,
-	0xf4f0e8,
-	0xf5f1ea,
-	0xf3f1ed,
-	0xcbc9c3,
-	0xcac8c2,
-	0xe3e2df,
-	0xf5f4f3,
-	0xfdfcfb,
-	0xfdfbfa,
-	0xfcfaf8,
-	0xfbf9f7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xe1dedc,
-	0x7f7e7e,
-	0x706f6f,
-	0x757374,
-	0x8c8c8b,
-	0xe1dedb,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xedeae6,
-	0xedeae5,
-	0xece9e4,
-	0xebe9e4,
-	0xeae8e3,
-	0xeae8e3,
-	0xd4d2cb,
-	0xcdcbc5,
-	0xe1ded8,
-	0xdad6cf,
-	0xcdcbc8,
-	0xe8e8e8,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 18 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfc,
-	0xf4f0eb,
-	0xf4f0e7,
-	0xf8f6f3,
-	0xc6c4bd,
-	0xdcdad7,
-	0xfbfbfa,
-	0xfdfcfb,
-	0xfcfaf8,
-	0xfcfaf8,
-	0xfbfaf7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f7f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xb3b1af,
-	0x716f70,
-	0x7c7b7b,
-	0x898989,
-	0x8f8e8e,
-	0xbdbbba,
-	0xeeebe7,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xece9e5,
-	0xece9e4,
-	0xebe8e3,
-	0xeae8e3,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe2e0db,
-	0xc1bfb8,
-	0xe2dfdb,
-	0xdad7d0,
-	0xd2d0cb,
-	0xd7d7d7,
-	0xf8f8f7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 19 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf0f0ef,
-	0xf1ede4,
-	0xf8f6f0,
-	0xdbd9d4,
-	0xd3d2cd,
-	0xfdfcfb,
-	0xfcfbf9,
-	0xfcfaf8,
-	0xfcfaf8,
-	0xfbfaf7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ed,
-	0xf2f0ec,
-	0xaeacab,
-	0x7a7979,
-	0x8f8e8e,
-	0xa3a2a2,
-	0xabaaab,
-	0xafaead,
-	0xe8e5e1,
-	0xeeebe7,
-	0xedeae6,
-	0xece9e4,
-	0xebe8e4,
-	0xeae8e3,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe7e5e0,
-	0xe7e4df,
-	0xcac8c1,
-	0xd4d2cc,
-	0xdcd9d3,
-	0xd6d3ce,
-	0xcdccca,
-	0xeeeeed,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 20 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefd,
-	0xe1e0dd,
-	0xf0ebe2,
-	0xfbfaf7,
-	0xc3c1ba,
-	0xf3f2f0,
-	0xfcfbf9,
-	0xfcfaf8,
-	0xfcfaf8,
-	0xfbf9f7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ec,
-	0xf2f0ec,
-	0xf1eeeb,
-	0xd5d3d1,
-	0x838282,
-	0x9d9c9c,
-	0xb4b3b3,
-	0xbdbcbd,
-	0xb6b5b5,
-	0xd7d4d1,
-	0xedeae6,
-	0xece9e5,
-	0xeae8e3,
-	0xeae8e3,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe7e5e0,
-	0xe7e4df,
-	0xe6e3de,
-	0xe5e2dd,
-	0xdbd8d3,
-	0xc3c0ba,
-	0xe1ded9,
-	0xd8d4ce,
-	0xcdcac6,
-	0xdedddd,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 21 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfc,
-	0xd2d1cd,
-	0xefeae1,
-	0xfcfaf8,
-	0xc3c1ba,
-	0xf9f8f7,
-	0xfcfaf8,
-	0xfcfaf8,
-	0xfbf9f7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f7f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf0eeeb,
-	0xebe9e6,
-	0xf3f1ee,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xf2f0ec,
-	0xf2efec,
-	0xf1eeeb,
-	0xf1eeea,
-	0xefece9,
-	0x9c9b9a,
-	0xa1a0a0,
-	0xb9b7b8,
-	0xc2c0c1,
-	0xbfbdbe,
-	0xc2c1c0,
-	0xe9e6e2,
-	0xeae8e3,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe7e5e0,
-	0xe7e4df,
-	0xe6e3de,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe3dfda,
-	0xc4c1ba,
-	0xdbd9d4,
-	0xd8d5ce,
-	0xd4d0cb,
-	0xcfcecd,
-	0xf2f2f2,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xe3e3e3,
-	0xbbbbbb,
-	0x9d9d9d,
-	0x989898,
-	0xa4a4a4,
-	0xbfbfbf,
-	0xeaeaea,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf1f1f1,
-	0xc4c4c4,
-	0xa6a6a6,
-	0x989898,
-	0xa2a2a2,
-	0xc5c5c5,
-	0xf1f0f0,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 22 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfbfbfb,
-	0xb9b8b6,
-	0xeae5dd,
-	0xf9f6f3,
-	0xc4c2bb,
-	0xf2f2f0,
-	0xfbfaf7,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f5,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xd2d0ce,
-	0x908f8e,
-	0x888686,
-	0xb3b1b0,
-	0xedebe8,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xf2f0ec,
-	0xf2efec,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xc6c4c2,
-	0x9c9b9b,
-	0xb4b3b3,
-	0xc1bfc0,
-	0xc1c0c0,
-	0xbab9b9,
-	0xdeddd9,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe7e5e0,
-	0xe7e4df,
-	0xe7e4df,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e0db,
-	0xe4e0db,
-	0xe3dfda,
-	0xd4d1cb,
-	0xc6c4bd,
-	0xdfdcd7,
-	0xd7d3cc,
-	0xcbc9c6,
-	0xe4e4e4,
-	0xfcfcfc,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xcbcbcb,
-	0x5f5f5f,
-	0x343434,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x363636,
-	0x737272,
-	0xdedede,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf2f1f1,
-	0x8e8e8e,
-	0x3b3b3b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x393939,
-	0x8a8a8a,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 23 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfbfbfb,
-	0xbbbbba,
-	0xc8c4bd,
-	0xf4f1eb,
-	0xd6d4cf,
-	0xdbd9d5,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f4,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf7f5f3,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xe4e2df,
-	0x7f7e7e,
-	0x717071,
-	0x7a7878,
-	0x807f7f,
-	0xbbbab9,
-	0xf3f1ee,
-	0xf2f0ec,
-	0xf2f0ec,
-	0xf1eeeb,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xe7e4e0,
-	0x999897,
-	0xacabab,
-	0xbebcbd,
-	0xc3c1c2,
-	0xbebcbd,
-	0xc9c8c7,
-	0xe7e5e0,
-	0xe7e5e0,
-	0xe7e4df,
-	0xe6e3de,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e0db,
-	0xe3dfda,
-	0xe3dfda,
-	0xe2ded9,
-	0xdedad5,
-	0xc0beb6,
-	0xdedad5,
-	0xd6d2cb,
-	0xd1cec8,
-	0xd2d2d2,
-	0xf6f6f6,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb0afaf,
-	0x383838,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x414141,
-	0xc8c8c8,
-	0xffffff,
-	0xefefef,
-	0x626262,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x575656,
-	0xefefef,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 24 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfc,
-	0xd9d9d9,
-	0x9a9893,
-	0xede9e0,
-	0xefede8,
-	0xc3c1bb,
-	0xf7f6f3,
-	0xfaf9f6,
-	0xf9f8f5,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xcac9c7,
-	0x717071,
-	0x7e7e7e,
-	0x908f8f,
-	0x9a9998,
-	0xa5a4a3,
-	0xebeae6,
-	0xf2efec,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xb5b3b1,
-	0xa2a1a1,
-	0xb8b7b7,
-	0xc2c0c1,
-	0xc1bfc0,
-	0xbcbaba,
-	0xe1dfda,
-	0xe7e4df,
-	0xe6e3de,
-	0xe5e1dc,
-	0xe4e0db,
-	0xe4e0db,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd8,
-	0xe1ddd8,
-	0xe0dbd6,
-	0xcbc8c1,
-	0xceccc7,
-	0xdad7d1,
-	0xd4d0ca,
-	0xcbc9c7,
-	0xeaeae9,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xd6d6d6,
-	0x3b3b3b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x555555,
-	0xececec,
-	0x919191,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x7e7e7e,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 25 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xe9e9e9,
-	0x989694,
-	0xd8d4cc,
-	0xf5f3ed,
-	0xc8c6bf,
-	0xe8e6e2,
-	0xf9f7f5,
-	0xf9f7f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf7f5f3,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xd8d6d4,
-	0x7d7d7c,
-	0x8f8e8e,
-	0xa6a5a6,
-	0xb3b2b3,
-	0xb1b0b0,
-	0xd7d5d2,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xedeae6,
-	0xedeae6,
-	0xece9e5,
-	0xd3d0cd,
-	0x999897,
-	0xb1afb0,
-	0xc0bebf,
-	0xc3c1c2,
-	0xbbbabb,
-	0xd2d0cc,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e0db,
-	0xe3dfda,
-	0xe3dfda,
-	0xe2ded9,
-	0xe1ddd8,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xdfdad5,
-	0xd9d5cf,
-	0xbfbdb6,
-	0xdedcd8,
-	0xd4d0ca,
-	0xcccac6,
-	0xd9d8d8,
-	0xf9f9f9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7a7a7a,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x494949,
-	0x666565,
-	0x3f3f3f,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x939392,
-	0x4e4e4e,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x3f3f3f,
-	0x686868,
-	0x4c4c4c,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x343434,
-	0xe8e7e7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 26 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf5f5f4,
-	0xbcbbba,
-	0xaaa7a2,
-	0xbebcb6,
-	0xa19f9c,
-	0xa5a4a1,
-	0xf4f2f0,
-	0xf8f6f4,
-	0xf8f6f4,
-	0xf8f6f3,
-	0xf7f5f2,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xedebe8,
-	0x9c9b9a,
-	0x999898,
-	0xb3b1b2,
-	0xc0bebf,
-	0xbebcbd,
-	0xc2c0c0,
-	0xefece9,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xedeae6,
-	0xe4e1de,
-	0xc7c5c2,
-	0x9b9a99,
-	0x8d8c8c,
-	0xa9a8a8,
-	0xbdbbbb,
-	0xc3c1c2,
-	0xc0bebe,
-	0xc1bfbe,
-	0xe1ded9,
-	0xe4e0db,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd9,
-	0xe1ddd8,
-	0xe0dbd6,
-	0xe0dbd6,
-	0xdedad5,
-	0xdddad5,
-	0xdcd8d3,
-	0xc4c1bb,
-	0xd5d3ce,
-	0xd6d2cc,
-	0xd2cec9,
-	0xcbcac9,
-	0xefefef,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf6f6f6,
-	0x424242,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x565656,
-	0xebebeb,
-	0xffffff,
-	0xd4d4d4,
-	0x414141,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x414141,
-	0x343434,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x434343,
-	0xe1e1e0,
-	0xffffff,
-	0xf1f1f1,
-	0x575757,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x333333,
-	0xaeaeae,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 27 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfc,
-	0xe0e0e0,
-	0x8e8c89,
-	0x696865,
-	0x343434,
-	0x343434,
-	0xc8c7c7,
-	0xf8f6f4,
-	0xf7f5f3,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xc4c2c1,
-	0x989797,
-	0xb3b1b2,
-	0xc1bfc0,
-	0xc2c0c1,
-	0xbcbabb,
-	0xe1dfdc,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xebe8e4,
-	0xdedbd8,
-	0xb0aeac,
-	0x828181,
-	0x6f6e6f,
-	0x797877,
-	0x8c8c8c,
-	0xa7a6a6,
-	0xbab9ba,
-	0xc3c1c2,
-	0xc2c0c1,
-	0xb9b8b8,
-	0xd7d4d0,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd8,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xdfdad5,
-	0xdedad5,
-	0xddd9d4,
-	0xdbd8d3,
-	0xdad7d2,
-	0xd2cfca,
-	0xc0beb7,
-	0xdddad6,
-	0xd4d0ca,
-	0xcbc8c5,
-	0xdfdfdf,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xdedede,
-	0x3b3b3b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x929291,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0x616161,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x5c5c5c,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0x848484,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x858585,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 28 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xefefef,
-	0xacaaaa,
-	0x83807c,
-	0x403f3f,
-	0x323232,
-	0x7d7c7c,
-	0xf4f2f0,
-	0xf7f5f2,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ed,
-	0xf2f0ec,
-	0xe5e2e0,
-	0x9e9d9d,
-	0xacabab,
-	0xbebcbd,
-	0xc2c1c1,
-	0xbdbcbc,
-	0xcccac8,
-	0xedeae6,
-	0xe8e5e2,
-	0xcdcbc9,
-	0x9b9a98,
-	0x767575,
-	0x717070,
-	0x777676,
-	0x7e7e7d,
-	0x8b8a8a,
-	0x9c9b9b,
-	0xafaeae,
-	0xbdbcbc,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xbebdbd,
-	0xc6c4c2,
-	0xe1ddd9,
-	0xe1dcd7,
-	0xe0dbd6,
-	0xe0dbd6,
-	0xdfdad5,
-	0xddd9d4,
-	0xddd9d4,
-	0xdbd8d3,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd8d5cf,
-	0xc0bdb6,
-	0xdbd9d4,
-	0xd4d0ca,
-	0xd1cdc8,
-	0xcecdcc,
-	0xf3f3f3,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xe0e0e0,
-	0xbfbfbf,
-	0xb4b4b4,
-	0xc0c0c0,
-	0xdfdfdf,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xebebeb,
-	0xc8c8c8,
-	0xb4b4b4,
-	0xbababa,
-	0xd5d4d4,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf1f1f1,
-	0xc7c7c7,
-	0xb4b4b4,
-	0xbfbfbf,
-	0xdddddd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x474747,
-	0xebebeb,
-	0xffffff,
-	0xffffff,
-	0xa3a3a3,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x747474,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 29 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf9f9f9,
-	0xd0d0d0,
-	0x8c8a85,
-	0x595958,
-	0x333333,
-	0x414141,
-	0xe0dfdc,
-	0xf6f4f1,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ed,
-	0xf2f0ec,
-	0xf2efec,
-	0xf1eeeb,
-	0xf0edea,
-	0xb7b5b4,
-	0xa2a1a1,
-	0xb9b8b8,
-	0xc2c0c1,
-	0xc1c0c0,
-	0xbbb9ba,
-	0xcac8c5,
-	0x999797,
-	0x747373,
-	0x737272,
-	0x7a7979,
-	0x848382,
-	0x8f8e8e,
-	0x9a9999,
-	0xa6a5a5,
-	0xb1b0b1,
-	0xbbb9ba,
-	0xc1bfc0,
-	0xc4c2c3,
-	0xc4c2c3,
-	0xc1bfc0,
-	0xbbb9b9,
-	0xdad6d2,
-	0xe0dbd6,
-	0xdfdbd6,
-	0xdedad5,
-	0xddd9d4,
-	0xdcd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xccc9c3,
-	0xc6c4be,
-	0xdbd8d3,
-	0xd4d0ca,
-	0xcac8c5,
-	0xe6e6e6,
-	0xfdfdfc,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfafafa,
-	0xb1b0b0,
-	0x505050,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x333333,
-	0x5c5c5c,
-	0xd1d1d1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xcfcfcf,
-	0x676767,
-	0x363636,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x484847,
-	0xacacac,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xe2e2e2,
-	0x4d4d4d,
-	0x4e4e4e,
-	0xa4a4a4,
-	0xfaf9f9,
-	0x979797,
-	0x3b3b3b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x585857,
-	0xcbcbcb,
-	0xffffff,
-	0xffffff,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x757575,
-	0xf4f4f4,
-	0xffffff,
-	0xf2f2f2,
-	0xe3e3e3,
-	0xe3e3e3,
-	0xe3e3e3,
-	0xe4e4e4,
-	0xebebeb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 30 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xe9e9e9,
-	0x9f9d9a,
-	0x787672,
-	0x393939,
-	0x323232,
-	0xa2a1a0,
-	0xf6f4f1,
-	0xf5f3f0,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf3f1ee,
-	0xf2f0ed,
-	0xf2f0ec,
-	0xf1efec,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0ede9,
-	0xd8d6d3,
-	0x999898,
-	0xb1b0b0,
-	0xbfbebe,
-	0xc2c0c1,
-	0xbbbabb,
-	0xa9a8a8,
-	0x929191,
-	0x868585,
-	0x8a8888,
-	0x939292,
-	0xa09f9f,
-	0xabaaaa,
-	0xb4b2b3,
-	0xbbb9ba,
-	0xc3c1c2,
-	0xceccca,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xbcbbbb,
-	0xcbc8c6,
-	0xdfdad5,
-	0xddd9d4,
-	0xddd9d4,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd5d1cb,
-	0xbdbbb3,
-	0xdcd9d6,
-	0xd4d0ca,
-	0xd0cdc7,
-	0xd3d3d3,
-	0xf7f7f7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xf4f4f4,
-	0x7b7a7a,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x373737,
-	0xbcbcbc,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xa7a7a7,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x343434,
-	0x888888,
-	0xf9f9f9,
-	0xffffff,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x8f8f8f,
-	0x7f7f7f,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x353535,
-	0xc4c4c4,
-	0xffffff,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x424242,
-	0x484848,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x595959,
-	0xc7c7c7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 31 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf4f4f4,
-	0xbdbcbb,
-	0x898782,
-	0x4b4a4a,
-	0x323232,
-	0x5d5d5d,
-	0xebe9e7,
-	0xf4f2ef,
-	0xf3f1ee,
-	0xf2f0ed,
-	0xf2f0ec,
-	0xf1efec,
-	0xf1eeeb,
-	0xf0eeea,
-	0xf0edea,
-	0xf0ede9,
-	0xefece8,
-	0xe9e6e3,
-	0xa7a6a5,
-	0xa7a6a6,
-	0xbcbabb,
-	0xc3c1c2,
-	0xc0bebf,
-	0xb6b4b5,
-	0xa8a7a7,
-	0xa2a0a0,
-	0xa5a5a5,
-	0xafaeae,
-	0xb8b6b6,
-	0xbdbcbc,
-	0xc9c7c6,
-	0xd7d5d2,
-	0xe2deda,
-	0xe3dfda,
-	0xc6c4c3,
-	0xbdbbbc,
-	0xc1bfc0,
-	0xc3c1c2,
-	0xc0bebf,
-	0xbebcbc,
-	0xdad7d2,
-	0xdcd9d4,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d1,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xc4c2ba,
-	0xd0cec8,
-	0xd7d3cd,
-	0xd3cfc9,
-	0xc9c8c6,
-	0xececec,
-	0xfefefd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xfafafa,
-	0x838383,
-	0x323232,
-	0x323232,
-	0x424242,
-	0x9f9f9f,
-	0xdbdbdb,
-	0xe3e3e3,
-	0xcfcfcf,
-	0x858585,
-	0x353535,
-	0x323232,
-	0x3a3a39,
-	0xe3e3e3,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xb6b6b6,
-	0x383838,
-	0x323232,
-	0x363636,
-	0x818181,
-	0xcfcfcf,
-	0xe4e4e4,
-	0xd9d9d9,
-	0xa1a0a0,
-	0x454545,
-	0x323232,
-	0x353535,
-	0xaaaaaa,
-	0xffffff,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x444343,
-	0x323232,
-	0x4b4b4b,
-	0xa9a8a8,
-	0xdedede,
-	0xe3e3e3,
-	0xc3c3c2,
-	0x5d5d5d,
-	0x323232,
-	0x323232,
-	0x525252,
-	0xfafafa,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x4f4f4f,
-	0x6f6f6f,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x353535,
-	0x777777,
-	0xe7e7e7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 32 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfb,
-	0xe0e0e0,
-	0x92908b,
-	0x6a6966,
-	0x353535,
-	0x343434,
-	0xc7c6c6,
-	0xf3f1ee,
-	0xf2f0ed,
-	0xf2f0ec,
-	0xf1efec,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0edea,
-	0xefece9,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xc8c7c4,
-	0x9c9b9b,
-	0xb5b4b4,
-	0xc1bfc0,
-	0xc3c1c2,
-	0xbfbdbe,
-	0xbab8b9,
-	0xb8b6b7,
-	0xbab9ba,
-	0xc1c0c0,
-	0xd0cecc,
-	0xdfdcd8,
-	0xe4e0db,
-	0xe3dfda,
-	0xe3dfda,
-	0xe2deda,
-	0xcfccc9,
-	0xafaeae,
-	0xbab8b9,
-	0xc1c0c0,
-	0xc2c0c1,
-	0xbab9b9,
-	0xcfcdc9,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd2cec8,
-	0xbdbbb3,
-	0xdedbd7,
-	0xd4d0ca,
-	0xcbc9c5,
-	0xdbdbda,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0x515151,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x686868,
-	0x454545,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xc6c6c6,
-	0x363636,
-	0x323232,
-	0x4e4e4e,
-	0xdddddd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xadacad,
-	0x323232,
-	0x323232,
-	0x808080,
-	0xfefefe,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xefefef,
-	0x4c4c4c,
-	0x323232,
-	0x393939,
-	0xb5b5b5,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xd6d6d6,
-	0x464646,
-	0x323232,
-	0x525252,
-	0xeeeeee,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x575757,
-	0xececec,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf3f3f3,
-	0x464646,
-	0x323232,
-	0x323232,
-	0xd5d5d5,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x525252,
-	0xd3d3d3,
-	0x4b4b4b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x3d3d3d,
-	0x9f9f9f,
-	0xfcfcfc,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 33 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xefefef,
-	0xacaba9,
-	0x83807c,
-	0x424141,
-	0x323232,
-	0x7c7c7b,
-	0xf0efec,
-	0xf2f0ec,
-	0xf1eeec,
-	0xf1eeeb,
-	0xf0edea,
-	0xf0edea,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xedeae6,
-	0xedeae6,
-	0xe2e0dc,
-	0x9f9d9d,
-	0xacabab,
-	0xbebcbd,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xc9c7c6,
-	0xd8d6d3,
-	0xe3e0dc,
-	0xe5e2dd,
-	0xe4e0db,
-	0xe3dfda,
-	0xe2deda,
-	0xe2deda,
-	0xe1ddd8,
-	0xdcd8d4,
-	0xa3a1a1,
-	0xadacac,
-	0xbdbcbc,
-	0xc2c0c1,
-	0xbebcbd,
-	0xc1bfbe,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd8d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xc0bdb5,
-	0xd6d4d0,
-	0xd4d0cb,
-	0xd2cfc9,
-	0xcbcac9,
-	0xf1f1f0,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xfbfbfb,
-	0x757575,
-	0x323232,
-	0x3c3c3c,
-	0xc6c6c6,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfbfbfb,
-	0x605f5f,
-	0x323232,
-	0x393938,
-	0xf3f3f3,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xacacac,
-	0x343434,
-	0x323232,
-	0x939393,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x9a9a9a,
-	0x323232,
-	0x353535,
-	0xb8b8b8,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x3a3a3a,
-	0xc6c6c6,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x8a8a8a,
-	0x323232,
-	0x323232,
-	0xb2b2b2,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x525252,
-	0xefefef,
-	0xd4d4d4,
-	0x505050,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x333333,
-	0x6e6e6e,
-	0xf9f9f9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 34 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf8f8f7,
-	0xcecdcd,
-	0x8d8b86,
-	0x5c5b59,
-	0x333333,
-	0x434343,
-	0xdcdbd9,
-	0xf1eeeb,
-	0xf0eeea,
-	0xf0edea,
-	0xefece9,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xece9e5,
-	0xece9e5,
-	0xeae8e3,
-	0xb5b4b2,
-	0xa1a0a0,
-	0xb7b6b7,
-	0xc2c1c1,
-	0xc4c2c3,
-	0xc6c4c5,
-	0xe2dfdb,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe3dfda,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd9,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xe0dbd6,
-	0xb4b2b0,
-	0xa09f9f,
-	0xb7b6b7,
-	0xc2c0c1,
-	0xc1c0c0,
-	0xbbb9b9,
-	0xd3d1cc,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xcdcac3,
-	0xc0beb7,
-	0xdddad5,
-	0xd4d0ca,
-	0xc9c7c4,
-	0xe1e1e1,
-	0xfcfcfc,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xe6e6e6,
-	0x4b4b4b,
-	0x323232,
-	0x5b5b5b,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xa8a8a7,
-	0x323232,
-	0x323232,
-	0xbebebe,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0x707070,
-	0x323232,
-	0x393939,
-	0xdddddd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xdadada,
-	0x3e3e3e,
-	0x323232,
-	0x808080,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x535353,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb0b0b0,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x525252,
-	0xefefef,
-	0xffffff,
-	0xececec,
-	0x7a7a7a,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x333333,
-	0x8b8b8b,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 35 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xe8e7e7,
-	0x9c9a96,
-	0x797873,
-	0x3a3a3a,
-	0x323232,
-	0xa2a1a0,
-	0xf2efec,
-	0xf0edea,
-	0xefece9,
-	0xefece8,
-	0xeeebe7,
-	0xeeebe7,
-	0xedeae6,
-	0xece9e5,
-	0xece9e5,
-	0xebe8e4,
-	0xe9e7e2,
-	0xd6d5d1,
-	0x999898,
-	0xb0afaf,
-	0xbfbebe,
-	0xc4c2c3,
-	0xc3c1c2,
-	0xd6d3d0,
-	0xe4e0db,
-	0xe3dfda,
-	0xe2deda,
-	0xe2deda,
-	0xe1ddd8,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xdfdbd6,
-	0xddd9d4,
-	0xcecbc7,
-	0x999999,
-	0xaeadae,
-	0xbebdbe,
-	0xc3c1c2,
-	0xbcbbbb,
-	0xc9c7c3,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xbdbab3,
-	0xdbd8d4,
-	0xd4d0ca,
-	0xd1cec8,
-	0xcececd,
-	0xf5f4f4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xcbcbcb,
-	0x323232,
-	0x323232,
-	0x878686,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xcacaca,
-	0x323232,
-	0x323232,
-	0x9c9c9b,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xeaeaea,
-	0x454545,
-	0x323232,
-	0x575757,
-	0xf0f0f0,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xeaeaea,
-	0x515151,
-	0x323232,
-	0x5d5d5d,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x777777,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x525252,
-	0xefefef,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xc1c1c1,
-	0x525252,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x343434,
-	0xe1e1e1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 36 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf4f4f3,
-	0xbabab9,
-	0x898782,
-	0x4e4d4c,
-	0x323232,
-	0x5e5e5e,
-	0xe7e5e3,
-	0xefece8,
-	0xefece8,
-	0xeeebe7,
-	0xedeae6,
-	0xedeae6,
-	0xece9e5,
-	0xebe8e4,
-	0xeae8e3,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe4e3de,
-	0xa8a7a5,
-	0xa6a5a5,
-	0xbbb9ba,
-	0xc3c1c2,
-	0xc3c1c2,
-	0xc4c1c1,
-	0xe1ded9,
-	0xe2deda,
-	0xe1ddd9,
-	0xe1ddd8,
-	0xe0dbd6,
-	0xe0dbd6,
-	0xdedad5,
-	0xddd9d4,
-	0xdbd8d3,
-	0xdad7d2,
-	0xa4a3a2,
-	0xa5a4a4,
-	0xbab9b9,
-	0xc2c0c1,
-	0xc0bebf,
-	0xcbc8c6,
-	0xd8d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xc7c5be,
-	0xc9c6c0,
-	0xd9d5d0,
-	0xd4d0ca,
-	0xc9c8c5,
-	0xe8e8e7,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xb3b3b3,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x7e7e7e,
-	0xfefefe,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xd6d6d6,
-	0x404040,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x4e4e4e,
-	0xcecece,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x525252,
-	0xefefef,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf5f5f5,
-	0x949494,
-	0x373737,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x9d9d9d,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 37 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfbfbfb,
-	0xdddddd,
-	0x8f8d8a,
-	0x6c6a68,
-	0x363636,
-	0x363636,
-	0xc5c4c3,
-	0xefece8,
-	0xeeebe7,
-	0xedeae6,
-	0xece9e5,
-	0xece9e5,
-	0xebe8e4,
-	0xeae7e3,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe8e6e1,
-	0xe7e5e0,
-	0xc7c5c2,
-	0x9a9a9a,
-	0xb4b3b3,
-	0xc1bfc0,
-	0xc3c1c2,
-	0xbdbbbc,
-	0xd5d2ce,
-	0xe1ddd9,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xdfdad5,
-	0xdedad5,
-	0xdcd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xc6c3c0,
-	0x9f9d9d,
-	0xb2b1b2,
-	0xc1bfc0,
-	0xc5c3c3,
-	0xd4d0cc,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd1cec7,
-	0xbbb8b1,
-	0xdddad6,
-	0xd4d0ca,
-	0xcfcbc6,
-	0xd4d4d4,
-	0xf8f8f8,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xa5a5a5,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x7a7a7a,
-	0xfefefe,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xcbcbcb,
-	0x3d3d3d,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x4d4d4d,
-	0xcccccc,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x424242,
-	0xa4a4a4,
-	0xb4b4b4,
-	0xb4b4b4,
-	0xb4b4b4,
-	0xdadada,
-	0xffffff,
-	0xfefefe,
-	0xc6c6c6,
-	0x3d3d3d,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x7b7b7b,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 38 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xefeeee,
-	0xaaa8a7,
-	0x827f7b,
-	0x434242,
-	0x323232,
-	0x7d7d7c,
-	0xeeece9,
-	0xedeae6,
-	0xece9e5,
-	0xebe8e4,
-	0xeae8e3,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe8e5e0,
-	0xe7e4df,
-	0xe6e3de,
-	0xdddad6,
-	0x9d9c9b,
-	0xabaaaa,
-	0xbdbcbc,
-	0xc3c1c2,
-	0xbfbdbe,
-	0xc3c1c0,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xdedad5,
-	0xddd9d4,
-	0xdbd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd8d5d0,
-	0xcac8c3,
-	0xc0bebc,
-	0xc9c7c5,
-	0xd4d0cc,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd2cfc8,
-	0xc1beb8,
-	0xc7c4be,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xc3c0b9,
-	0xd3d1cc,
-	0xd6d2cc,
-	0xd3cfca,
-	0xc8c7c6,
-	0xeeeeed,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xa8a8a8,
-	0x323232,
-	0x323232,
-	0x747474,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xe0e0e0,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xcecece,
-	0x3e3e3e,
-	0x323232,
-	0x505050,
-	0xc4c4c4,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xcfcfcf,
-	0xd5d5d5,
-	0xd9d9d9,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xd5d5d5,
-	0x393939,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xb1b1b1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x787878,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x9a9a9a,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0x898988,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x696969,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 39 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf8f8f7,
-	0xcbcbcb,
-	0x8d8a86,
-	0x5e5d5b,
-	0x343433,
-	0x454545,
-	0xd9d8d6,
-	0xece9e5,
-	0xebe8e4,
-	0xe9e7e2,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe8e6e1,
-	0xe7e5e0,
-	0xe6e4df,
-	0xe5e2dd,
-	0xe5e2dd,
-	0xe4e0db,
-	0xb7b5b3,
-	0xa09fa0,
-	0xb7b6b6,
-	0xc2c0c1,
-	0xc1c0c0,
-	0xbab8b8,
-	0xd9d5d1,
-	0xdedad5,
-	0xdcd9d4,
-	0xdbd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xacaaa3,
-	0x817f7b,
-	0x93918e,
-	0xd7d4d0,
-	0xd4d0ca,
-	0xcecac4,
-	0xc3c1ba,
-	0xe1deda,
-	0xd4d0ca,
-	0xcac8c4,
-	0xdcdcdc,
-	0xfafafa,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xc1c1c1,
-	0x323232,
-	0x323232,
-	0x7c7c7c,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xe1e1e1,
-	0x434343,
-	0x323232,
-	0x505050,
-	0xededed,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xdedede,
-	0x3b3b3b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0xa3a3a3,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x6d6d6d,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x9a9a9a,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xa3a3a3,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x696969,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 40 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xe7e7e7,
-	0x9a9896,
-	0x797773,
-	0x3b3b3b,
-	0x323232,
-	0xa2a1a0,
-	0xedeae6,
-	0xe9e7e2,
-	0xe8e6e1,
-	0xe8e6e1,
-	0xe8e5e0,
-	0xe7e4df,
-	0xe6e3de,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e0db,
-	0xe3dfda,
-	0xd3d0cd,
-	0x999898,
-	0xafaeae,
-	0xbfbebe,
-	0xc3c1c2,
-	0xbcbbbb,
-	0xc9c6c4,
-	0xdcd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xdad7d1,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xb5b3ae,
-	0xadaba4,
-	0xd2d0ca,
-	0xe6e4e2,
-	0xd4d0ca,
-	0xd1cdc7,
-	0xc2c0b9,
-	0xe9e6e4,
-	0xd4d0ca,
-	0xd2cfc9,
-	0xcac9c9,
-	0xf3f3f3,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xdfdfdf,
-	0x414141,
-	0x323232,
-	0x535353,
-	0xf8f8f8,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xcfcfcf,
-	0x7d7d7d,
-	0x7d7d7d,
-	0xcacaca,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0x5f5f5f,
-	0x323232,
-	0x353535,
-	0xd7d7d7,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xebebeb,
-	0x898989,
-	0x7d7d7d,
-	0xa2a2a2,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xf6f6f6,
-	0x3e3e3e,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x747474,
-	0xfbfbfb,
-	0xffffff,
-	0xefeeee,
-	0x515151,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x717170,
-	0xffffff,
-	0xffffff,
-	0xfcfcfc,
-	0x7f7f7f,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x828282,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 41 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf4f4f3,
-	0xb9b9b8,
-	0x898781,
-	0x4f4e4d,
-	0x323232,
-	0x5f5f5f,
-	0xe5e3e1,
-	0xe8e6e1,
-	0xe8e6e1,
-	0xe7e5e0,
-	0xe7e4df,
-	0xe6e3de,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e0db,
-	0xe3dfda,
-	0xe2deda,
-	0xdedad7,
-	0xa8a6a5,
-	0xa5a4a4,
-	0xbbb9ba,
-	0xc2c0c1,
-	0xc0bebf,
-	0xc1bfbe,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd6d2cc,
-	0xe5e3e0,
-	0xecebe8,
-	0xdad6d1,
-	0xd4d0ca,
-	0xcbc8c2,
-	0xc7c5bf,
-	0xeae8e6,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xbfbebc,
-	0xeaeaea,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xf8f8f8,
-	0x6a696a,
-	0x323232,
-	0x383838,
-	0xb8b8b8,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfc,
-	0x6c6c6c,
-	0x323232,
-	0x323232,
-	0xe1e1e1,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xa1a0a0,
-	0x333333,
-	0x323232,
-	0x848484,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xa8a8a7,
-	0x323232,
-	0x323232,
-	0xa3a3a3,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xffffff,
-	0x696969,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x373737,
-	0x9b9b9a,
-	0xcccccc,
-	0x878686,
-	0x353535,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x5c5c5c,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x393939,
-	0x969595,
-	0xcecece,
-	0xa4a4a4,
-	0x3b3b3b,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x333333,
-	0xaeaeae,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 42 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfbfbfa,
-	0xdbdbdb,
-	0x918e8b,
-	0x6d6c68,
-	0x363636,
-	0x363636,
-	0xbfbebd,
-	0xe9e7e2,
-	0xe7e5e0,
-	0xe6e4df,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e1dc,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd9,
-	0xe1ddd9,
-	0xe0dcd7,
-	0xc5c2bf,
-	0x9a9999,
-	0xb3b2b3,
-	0xc1bfc0,
-	0xc3c1c2,
-	0xcac8c6,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xbdbbb3,
-	0xdeddd9,
-	0xe3e0dc,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xb5b4b3,
-	0xe4e4e4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xc3c3c3,
-	0x363636,
-	0x323232,
-	0x494949,
-	0xd4d4d4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf8f8f8,
-	0x8f8f8f,
-	0x323232,
-	0x323232,
-	0x767676,
-	0xfefefe,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xececec,
-	0x4b4b4b,
-	0x323232,
-	0x373736,
-	0xacacac,
-	0xfbfbfb,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xbababa,
-	0x414141,
-	0x323232,
-	0x4f4f4f,
-	0xe7e7e7,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xffffff,
-	0xacacac,
-	0x343434,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x3d3d3d,
-	0xa3a3a3,
-	0x3a3a3a,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x3b3b3b,
-	0xefeeee,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 43 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xeeeeee,
-	0xa9a8a7,
-	0x82807b,
-	0x454544,
-	0x323232,
-	0x787877,
-	0xeae8e4,
-	0xe6e3de,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe4e0db,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd9,
-	0xe1dcd8,
-	0xe0dbd6,
-	0xdfdad5,
-	0xdbd7d2,
-	0xb5b3b1,
-	0xadabac,
-	0xbdbcbc,
-	0xc8c6c6,
-	0xd7d4d0,
-	0xdad7d2,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd2cec8,
-	0xc1beb6,
-	0xc5c4bd,
-	0xf4f3f1,
-	0xd7d3cd,
-	0xd4d0ca,
-	0xccc9c3,
-	0xadacac,
-	0xe4e4e4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xfbfbfb,
-	0x8c8c8c,
-	0x323232,
-	0x323232,
-	0x373737,
-	0x777777,
-	0xa9a9a9,
-	0xb3b3b3,
-	0x9b9b9b,
-	0x545454,
-	0x323232,
-	0x323232,
-	0x484848,
-	0xe7e7e7,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xbfbfbf,
-	0x3a3a3a,
-	0x323232,
-	0x323232,
-	0x616161,
-	0x9d9d9d,
-	0xb4b4b4,
-	0xa7a7a7,
-	0x6c6b6b,
-	0x353535,
-	0x323232,
-	0x3b3b3b,
-	0xb6b6b6,
-	0xffffff,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xffffff,
-	0xf3f3f3,
-	0x5c5c5c,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x868586,
-	0xfafafa,
-	0x8a8a8a,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x333333,
-	0xa09f9f,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 44 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf7f7f7,
-	0xcacaca,
-	0x8b8984,
-	0x5f5e5c,
-	0x343434,
-	0x454545,
-	0xd5d4d2,
-	0xe5e2dd,
-	0xe4e1dc,
-	0xe3e0db,
-	0xe3dfda,
-	0xe1ddd9,
-	0xe1ddd9,
-	0xe0dcd7,
-	0xe0dbd6,
-	0xdfdad5,
-	0xddd9d4,
-	0xddd9d4,
-	0xdad7d2,
-	0xd2d0cc,
-	0xd4d2ce,
-	0xd8d6d1,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xcecac3,
-	0xc3c0b8,
-	0xbbb9b1,
-	0xcfcdc7,
-	0xf2f1ef,
-	0xdfdcd8,
-	0xd4d0ca,
-	0xd3cfc9,
-	0x9c9a96,
-	0xb4b3b3,
-	0xeaeae9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7e7e7e,
-	0x323232,
-	0x323232,
-	0xa9a9a9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x7d7d7d,
-	0x323232,
-	0x323232,
-	0xababab,
-	0xffffff,
-	0xffffff,
-	0xf8f8f8,
-	0x919191,
-	0x373737,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x545454,
-	0xe1e1e1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0x565656,
-	0x323232,
-	0x494949,
-	0xf2f2f2,
-	0xffffff,
-	0xffffff,
-	0xbcbbbb,
-	0x444444,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x424242,
-	0xb5b5b5,
-	0xffffff,
-	0xffffff,
-	0xdedede,
-	0x323232,
-	0x323232,
-	0x818181,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xb4b4b4,
-	0x323232,
-	0x323232,
-	0xacacac,
-	0xffffff,
-	0xffffff,
-	0xe6e6e6,
-	0x626262,
-	0x333333,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x343434,
-	0x7f7e7e,
-	0xf4f4f4,
-	0xffffff,
-	0xf7f7f7,
-	0x898989,
-	0x343434,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x323232,
-	0x343434,
-	0x9a9a9a,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 45 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xe7e6e6,
-	0x989795,
-	0x797873,
-	0x3c3c3c,
-	0x323232,
-	0x9c9c9b,
-	0xe8e5e1,
-	0xe3dfda,
-	0xe2deda,
-	0xe1ddd9,
-	0xe1ddd8,
-	0xe0dcd7,
-	0xdfdbd6,
-	0xdedad5,
-	0xddd9d4,
-	0xdcd8d3,
-	0xdbd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xcecbc5,
-	0xc5c3bb,
-	0xbdbab2,
-	0xc2c0ba,
-	0xd7d6d1,
-	0xecebe9,
-	0xeeedea,
-	0xdcd9d4,
-	0xd4d0ca,
-	0xd3cfc9,
-	0x9d9b97,
-	0x6f6f6e,
-	0xc3c2c2,
-	0xf2f2f1,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xbfbfbf,
-	0x989898,
-	0x989898,
-	0xd4d4d4,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xbebebe,
-	0x989898,
-	0x989898,
-	0xd5d5d5,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xd8d8d7,
-	0x868585,
-	0x535353,
-	0x353535,
-	0x333333,
-	0x454545,
-	0x666565,
-	0xadadad,
-	0xf9f9f9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xababab,
-	0x989898,
-	0xa4a4a4,
-	0xf9f9f9,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xebebeb,
-	0x9d9d9d,
-	0x605f5f,
-	0x3b3b3b,
-	0x323232,
-	0x3d3d3d,
-	0x5a5959,
-	0x949494,
-	0xe8e8e8,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xeeeeee,
-	0x989898,
-	0x989898,
-	0xc0c0c0,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xd9d9d9,
-	0x999999,
-	0x989898,
-	0xd5d5d5,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfc,
-	0xc1c1c1,
-	0x7a7a7a,
-	0x555554,
-	0x363636,
-	0x323232,
-	0x3a3a3a,
-	0x595958,
-	0x878787,
-	0xd0d0d0,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xd5d5d5,
-	0x8b8b8b,
-	0x5b5a5a,
-	0x3c3c3c,
-	0x323232,
-	0x383838,
-	0x5b5b5b,
-	0x898989,
-	0xdddddd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 46 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf4f3f3,
-	0xb9b8b8,
-	0x878580,
-	0x51514f,
-	0x323232,
-	0x5c5c5c,
-	0xe2e0dd,
-	0xe2deda,
-	0xe1ddd9,
-	0xe1dcd7,
-	0xe0dbd6,
-	0xdfdad5,
-	0xded9d4,
-	0xddd9d4,
-	0xdcd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd0ccc6,
-	0xc7c4be,
-	0xbcbab2,
-	0xc0bfb8,
-	0xd1d0cb,
-	0xe9e8e6,
-	0xeeedeb,
-	0xe7e5e1,
-	0xdbd8d3,
-	0xd5d1cb,
-	0xd1cdc7,
-	0xb5b2ae,
-	0x7a7978,
-	0x4b4b4b,
-	0x969595,
-	0xd6d6d6,
-	0xf8f8f8,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 47 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfafafa,
-	0xdadada,
-	0x8f8d8a,
-	0x6e6c69,
-	0x373636,
-	0x373737,
-	0xbebdbc,
-	0xe4e0db,
-	0xe0dcd7,
-	0xdfdbd6,
-	0xdedad5,
-	0xddd9d4,
-	0xdcd9d4,
-	0xdbd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd1cdc7,
-	0xcac6c0,
-	0xbfbcb5,
-	0xbebcb5,
-	0xceccc7,
-	0xe5e4e1,
-	0xefeeec,
-	0xeae8e4,
-	0xdddad5,
-	0xd6d2cc,
-	0xd2cec8,
-	0xbdbab4,
-	0x94928f,
-	0x626160,
-	0x424141,
-	0x444343,
-	0x807f7f,
-	0xbcbbbc,
-	0xeaeaea,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 48 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xeeeeee,
-	0xa8a7a5,
-	0x817f7a,
-	0x464544,
-	0x333333,
-	0xa6a5a5,
-	0xe6e3e0,
-	0xdfdbd6,
-	0xded9d4,
-	0xddd9d4,
-	0xdcd8d3,
-	0xdbd8d3,
-	0xdbd8d3,
-	0xdad7d2,
-	0xdad7d2,
-	0xd9d6d1,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d5cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd2cec8,
-	0xcbc8c1,
-	0xc0bdb5,
-	0xbebcb5,
-	0xc9c7c1,
-	0xe2e1de,
-	0xeeedeb,
-	0xeceae8,
-	0xdfdcd8,
-	0xd7d3cd,
-	0xd3cfc9,
-	0xc2beb9,
-	0x9f9d98,
-	0x6b6a67,
-	0x4a4948,
-	0x3b3b3b,
-	0x474746,
-	0x626161,
-	0x8b8a8a,
-	0xb7b6b6,
-	0xe0e0df,
-	0xf8f8f8,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 49 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf7f7f7,
-	0xc9c8c8,
-	0x8b8884,
-	0x5f5f5d,
-	0x5d5c5c,
-	0xd3d2d0,
-	0xe2dfdb,
-	0xddd9d4,
-	0xddd9d4,
-	0xdcd8d3,
-	0xdbd8d3,
-	0xd0cdc8,
-	0xc7c4c0,
-	0xd4d2cd,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d4ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xcdc9c3,
-	0xc2bfb8,
-	0xbdbbb3,
-	0xc5c3bd,
-	0xdddcd8,
-	0xedecea,
-	0xeeedeb,
-	0xe1deda,
-	0xd8d4cf,
-	0xd3d0ca,
-	0xc6c2bd,
-	0xa8a5a1,
-	0x747371,
-	0x4f4f4f,
-	0x3d3d3d,
-	0x444444,
-	0x5b5b5a,
-	0x777777,
-	0x939392,
-	0xababab,
-	0xc8c7c7,
-	0xe4e4e4,
-	0xf7f7f7,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 50 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xe6e6e6,
-	0x989794,
-	0x83817d,
-	0xc4c3c2,
-	0xcbc9c2,
-	0xd5d3ce,
-	0xdfdbd6,
-	0xdbd8d3,
-	0xdbd8d3,
-	0xd5d2cd,
-	0x94928d,
-	0x85837e,
-	0xaaa8a4,
-	0xe1deda,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd3cfc9,
-	0xcfcbc5,
-	0xc5c2ba,
-	0xbebbb3,
-	0xc2c0b9,
-	0xd8d7d3,
-	0xebeae8,
-	0xefeeec,
-	0xe4e1dd,
-	0xd9d6d0,
-	0xd4d0ca,
-	0xcac6c0,
-	0xafaca8,
-	0x807f7c,
-	0x565655,
-	0x3e3e3e,
-	0x444343,
-	0x555454,
-	0x717070,
-	0x8d8b8c,
-	0xa6a5a5,
-	0xbcbbbb,
-	0xd0d0d0,
-	0xe2e2e2,
-	0xf1f1f1,
-	0xfafafa,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 51 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf4f3f3,
-	0xb8b8b7,
-	0x9d9b96,
-	0xd8d5d1,
-	0xd3d0ca,
-	0xc2c0ba,
-	0xe1deda,
-	0xdbd8d3,
-	0xdad7d2,
-	0xd5d3ce,
-	0xa7a5a2,
-	0xc2c0b9,
-	0xd8d7d5,
-	0xe3e1dd,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xcfccc5,
-	0xc7c4be,
-	0xbdbbb3,
-	0xc0beb7,
-	0xd3d2cd,
-	0xe8e8e5,
-	0xf1f0ef,
-	0xe6e4e0,
-	0xdbd8d3,
-	0xd4d1cb,
-	0xccc8c3,
-	0xb8b5b0,
-	0x898785,
-	0x5f5e5c,
-	0x444343,
-	0x444443,
-	0x515151,
-	0x6b6b6a,
-	0x868685,
-	0xa09f9f,
-	0xb6b5b5,
-	0xcccbcb,
-	0xdedede,
-	0xececec,
-	0xf6f6f6,
-	0xfcfcfc,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 52 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfafafa,
-	0xd9d9d9,
-	0x8c8a87,
-	0xbfbcb7,
-	0xd8d4ce,
-	0xc0beb7,
-	0xdcd9d4,
-	0xdbd8d3,
-	0xdad7d2,
-	0xd9d6d0,
-	0xe0ddd9,
-	0xebeae7,
-	0xeae9e6,
-	0xd9d5d0,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd6d2cc,
-	0xd5d1cb,
-	0xd2cec8,
-	0xc9c7c0,
-	0xbebbb4,
-	0xbdbbb4,
-	0xceccc7,
-	0xe6e5e2,
-	0xf1f0ee,
-	0xe9e7e4,
-	0xdcd9d4,
-	0xd5d1cb,
-	0xd0ccc6,
-	0xbdbab4,
-	0x95938f,
-	0x656463,
-	0x474747,
-	0x444443,
-	0x4f4f4e,
-	0x646464,
-	0x807f7e,
-	0x9b9a9a,
-	0xb1b0b0,
-	0xc7c6c6,
-	0xdadada,
-	0xe9e9e9,
-	0xf4f4f4,
-	0xfbfbfb,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 53 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xeeeeed,
-	0x9c9b9a,
-	0x92908d,
-	0xd5d2cc,
-	0xceccc6,
-	0xc4c2bb,
-	0xdcd9d4,
-	0xd9d6d0,
-	0xd9d6d0,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3ce,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd6d2cc,
-	0xd3cfc9,
-	0xcdc9c3,
-	0xc0beb6,
-	0xbdbbb3,
-	0xc9c8c1,
-	0xe2e1de,
-	0xf1f1ef,
-	0xebe9e6,
-	0xdfdcd7,
-	0xd5d1cb,
-	0xd1cdc7,
-	0xc2bfba,
-	0x9d9a96,
-	0x6f6e6b,
-	0x4d4c4b,
-	0x464544,
-	0x4c4c4b,
-	0x60605f,
-	0x7a7a79,
-	0x959595,
-	0xababab,
-	0xc1c1c1,
-	0xd6d5d5,
-	0xe7e7e6,
-	0xf3f2f2,
-	0xfafaf9,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 54 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf7f7f7,
-	0xc7c7c6,
-	0x787775,
-	0xc8c4be,
-	0xd7d4cf,
-	0xc3c1b9,
-	0xc4c2ba,
-	0xd4d1cb,
-	0xd8d5cf,
-	0xd8d4cf,
-	0xd7d3cd,
-	0xd7d3cd,
-	0xd5d1cb,
-	0xcfcbc5,
-	0xc3c0b8,
-	0xbdbbb4,
-	0xc3c1bb,
-	0xdfdedb,
-	0xefeeed,
-	0xefedeb,
-	0xe0deda,
-	0xd7d3cd,
-	0xd2cec8,
-	0xc7c3bd,
-	0xa6a39e,
-	0x757371,
-	0x525150,
-	0x454544,
-	0x4b4a49,
-	0x5c5b5a,
-	0x767575,
-	0x909090,
-	0xa7a6a6,
-	0xbdbdbd,
-	0xd1d1d1,
-	0xe2e2e1,
-	0xf0efef,
-	0xf8f8f8,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 55 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfc,
-	0xe6e6e5,
-	0x848382,
-	0xa5a39e,
-	0xd6d2cc,
-	0xd7d4ce,
-	0xc8c5be,
-	0xbcbab2,
-	0xc4c1ba,
-	0xcbc8c1,
-	0xccc9c2,
-	0xc4c1ba,
-	0xbdbbb3,
-	0xc1bfb8,
-	0xd8d7d3,
-	0xededeb,
-	0xf1f0ee,
-	0xe3e1dd,
-	0xd8d4cf,
-	0xd3cfca,
-	0xcac6c1,
-	0xafaca7,
-	0x7d7b78,
-	0x555452,
-	0x454443,
-	0x494847,
-	0x575555,
-	0x706f6f,
-	0x8a8989,
-	0xa2a1a1,
-	0xb8b7b8,
-	0xcecdcd,
-	0xe0e0df,
-	0xeeeeed,
-	0xf7f7f7,
-	0xfcfcfc,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 56 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf4f3f3,
-	0xb2b2b2,
-	0x797875,
-	0xcdc9c3,
-	0xd6d3cd,
-	0xd9d6d0,
-	0xdcd9d5,
-	0xd8d7d2,
-	0xcfcdc7,
-	0xd0cec9,
-	0xdcdad7,
-	0xeae9e6,
-	0xf3f2f1,
-	0xe6e3e0,
-	0xdad6d0,
-	0xd4d0ca,
-	0xcdc9c3,
-	0xb5b2ad,
-	0x878581,
-	0x5d5c5a,
-	0x464544,
-	0x474645,
-	0x515050,
-	0x696968,
-	0x848483,
-	0x9d9c9c,
-	0xb3b2b2,
-	0xc8c8c8,
-	0xdcdcdc,
-	0xebebeb,
-	0xf6f6f5,
-	0xfbfbfb,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 57 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfafafa,
-	0xd8d8d8,
-	0x71706f,
-	0x92908c,
-	0xd1cec8,
-	0xd6d2cc,
-	0xd7d3cd,
-	0xd8d4ce,
-	0xdfdbd6,
-	0xe2dfdb,
-	0xe1deda,
-	0xdbd7d2,
-	0xd4d0ca,
-	0xcfcbc5,
-	0xbfbcb6,
-	0x8e8c89,
-	0x646260,
-	0x494847,
-	0x494847,
-	0x504f4e,
-	0x646362,
-	0x7e7d7d,
-	0x979696,
-	0xadacac,
-	0xc4c3c3,
-	0xd8d7d7,
-	0xe8e8e8,
-	0xf3f3f3,
-	0xfafafa,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 58 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfefefe,
-	0xeeeeed,
-	0x9f9e9e,
-	0x5a5958,
-	0x878683,
-	0xc6c2bd,
-	0xd3cfc9,
-	0xd5d1cb,
-	0xd5d1cb,
-	0xd4d0ca,
-	0xd1cdc7,
-	0xc4c0bb,
-	0x9a9894,
-	0x6c6b68,
-	0x4d4c4b,
-	0x494847,
-	0x4d4c4b,
-	0x5f5e5d,
-	0x777776,
-	0x929292,
-	0xa8a7a7,
-	0xbebdbe,
-	0xd4d3d2,
-	0xe5e5e5,
-	0xf1f1f1,
-	0xf9f9f9,
-	0xfdfdfd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 59 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xf8f8f7,
-	0xd5d4d4,
-	0x7c7c7b,
-	0x555452,
-	0x5f5e5c,
-	0x82807c,
-	0x989692,
-	0x9a9894,
-	0x92908c,
-	0x747371,
-	0x525251,
-	0x4a4948,
-	0x4e4d4c,
-	0x5a5a59,
-	0x717171,
-	0x8c8b8c,
-	0xa3a2a2,
-	0xb9b9b9,
-	0xd0cfcf,
-	0xe1e1e1,
-	0xeeeeee,
-	0xf7f7f7,
-	0xfcfcfc,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 60 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfdfdfd,
-	0xefefef,
-	0xc5c5c5,
-	0x807f7e,
-	0x585755,
-	0x525150,
-	0x51504f,
-	0x4f4f4e,
-	0x4e4e4d,
-	0x4f4f4e,
-	0x595857,
-	0x6d6c6b,
-	0x878787,
-	0x9e9d9d,
-	0xb4b3b4,
-	0xcacaca,
-	0xdddddd,
-	0xededec,
-	0xf7f7f6,
-	0xfcfcfc,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 61 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfb,
-	0xebebea,
-	0xcacaca,
-	0xa09f9f,
-	0x7b7b7a,
-	0x6b6b6a,
-	0x686868,
-	0x6f6f6e,
-	0x838281,
-	0x9a9999,
-	0xafaeae,
-	0xc5c5c5,
-	0xdadad9,
-	0xe9e9e9,
-	0xf4f4f3,
-	0xfbfbfb,
-	0xfefefe,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 62 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xfcfcfb,
-	0xf0f0f0,
-	0xdcdcdb,
-	0xc7c7c7,
-	0xb8b7b7,
-	0xb2b2b2,
-	0xb6b6b6,
-	0xc4c3c3,
-	0xd5d5d5,
-	0xe6e6e6,
-	0xf3f3f2,
-	0xfafafa,
-	0xfefefd,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 63 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 64 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-	/* Scanline 65 */
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-	0xffffff,
-
-};
-
-/** @}
- */
Index: kernel/generic/include/lib/memfnc.h
===================================================================
--- kernel/generic/include/lib/memfnc.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ kernel/generic/include/lib/memfnc.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -38,6 +38,8 @@
 #include <typedefs.h>
 
-extern void *memset(void *, int, size_t);
-extern void *memcpy(void *, const void *, size_t);
+extern void *memset(void *, int, size_t)
+    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
+extern void *memcpy(void *, const void *, size_t)
+    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
 
 #endif
Index: tools/mkext2.py
===================================================================
--- tools/mkext2.py	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ tools/mkext2.py	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -507,4 +507,9 @@
 		self.pos = align_up(self.pos, bytes)
 	
+	def set_pos(self, pos):
+		"Set the current position"
+		
+		self.pos = pos
+	
 	def pack(self):
 		"Pack the inode structure and return the result"
@@ -581,4 +586,5 @@
 			if self.inode:
 				self.prev_entry.write(self.inode)
+				self.inode.set_pos(self.pos)
 	
 	def add(self, entry):
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -39,4 +39,6 @@
 	app/bnchmark \
 	app/devctl \
+	app/dnscfg \
+	app/dnsres \
 	app/edit \
 	app/getterm \
@@ -85,4 +87,5 @@
 	srv/devman \
 	srv/loader \
+	srv/net/dnsrsrv \
 	srv/net/ethip \
 	srv/net/inetsrv \
Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -117,21 +117,24 @@
 static void waitkey()
 {
-	kbd_event_t ev;
+	cons_event_t ev;
+	kbd_event_t *kev;
 	
 	while (true) {
-		if (!console_get_kbd_event(console, &ev)) {
+		if (!console_get_event(console, &ev)) {
 			return;
 		}
-		if (ev.type == KEY_PRESS) {
-			if (ev.key == KC_ESCAPE || ev.key == KC_Q) {
+		if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
+			kev = &ev.ev.key;
+			
+			if (kev->key == KC_ESCAPE || kev->key == KC_Q) {
 				should_quit = true;
 				return;
 			}
-			if (ev.key == KC_C) {
+			if (kev->key == KC_C) {
 				paging_enabled = false;
 				return;
 			}
-			if (ev.key == KC_ENTER || ev.key == KC_SPACE ||
-			    ev.key == KC_PAGE_DOWN) {
+			if (kev->key == KC_ENTER || kev->key == KC_SPACE ||
+			    kev->key == KC_PAGE_DOWN) {
 				return;
 			}
Index: uspace/app/bdsh/cmds/modules/cmp/cmp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -107,5 +107,5 @@
 
 		if (offset[0] != offset[1] ||
-		    bcmp(buffer[0], buffer[1], offset[0])) {
+		    memcmp(buffer[0], buffer[1], offset[0]) != 0) {
 			rc = 1;
 			goto end;
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -152,13 +152,13 @@
 
 	while (true) {
-		kbd_event_t ev;
+		cons_event_t ev;
 		console_flush(con);
-		console_get_kbd_event(con, &ev);
-		if ((ev.type != KEY_PRESS)
-		    || (ev.mods & (KM_CTRL | KM_ALT)) != 0) {
+		console_get_event(con, &ev);
+		if (ev.type != CEV_KEY || ev.ev.key.type != KEY_PRESS ||
+		    (ev.ev.key.mods & (KM_CTRL | KM_ALT)) != 0) {
 			continue;
 		}
 
-		switch(ev.key) {
+		switch(ev.ev.key.key) {
 		case KC_Y:
 			printf("y\n");
Index: uspace/app/bdsh/cmds/modules/ls/ls.c
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -315,5 +315,5 @@
 {
 	if (stat(path, &de->s)) {
-		cli_error(CL_ENOENT, path);
+		cli_error(CL_ENOENT, "%s", path);
 		return LS_BOGUS;
 	}
Index: uspace/app/bdsh/cmds/modules/sleep/sleep.c
===================================================================
--- uspace/app/bdsh/cmds/modules/sleep/sleep.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/bdsh/cmds/modules/sleep/sleep.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -114,5 +114,5 @@
 	int ret;
 	unsigned int argc;
-	useconds_t duration;
+	useconds_t duration = 0;
 
 	/* Count the arguments */
Index: uspace/app/bnchmark/bnchmark.c
===================================================================
--- uspace/app/bnchmark/bnchmark.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/bnchmark/bnchmark.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -142,5 +142,5 @@
 {
 	int rc;
-	umseconds_t milliseconds_taken;
+	umseconds_t milliseconds_taken = 0;
 	char *path = NULL;
 	measure_func_t fn = NULL;
Index: uspace/app/dnscfg/Makefile
===================================================================
--- uspace/app/dnscfg/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/app/dnscfg/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2013 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../..
+BINARY = dnscfg
+
+SOURCES = \
+	dnscfg.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/dnscfg/dnscfg.c
===================================================================
--- uspace/app/dnscfg/dnscfg.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/app/dnscfg/dnscfg.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnscfg
+ * @{
+ */
+/** @file DNS configuration utility.
+ *
+ * Controls the DNS resolution server (@c dnsrsrv).
+ */
+
+#include <errno.h>
+#include <inet/addr.h>
+#include <inet/dnsr.h>
+#include <ipc/services.h>
+#include <loc.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <str_error.h>
+#include <sys/types.h>
+
+#define NAME "dnscfg"
+
+static void print_syntax(void)
+{
+	printf("syntax:\n");
+	printf("\t" NAME " set-ns <server-addr>\n");
+	printf("\t" NAME " unset-ns\n");
+}
+
+static int dnscfg_set_ns(int argc, char *argv[])
+{
+	char *srv_addr;
+	inet_addr_t addr;
+	int rc;
+
+	if (argc < 1) {
+		printf(NAME ": Missing arguments.\n");
+		print_syntax();
+		return EINVAL;
+	}
+
+	if (argc > 1) {
+		printf(NAME ": Too many arguments.\n");
+		print_syntax();
+		return EINVAL;
+	}
+
+	srv_addr = argv[0];
+
+	rc = inet_addr_parse(srv_addr, &addr);
+	if (rc != EOK) {
+		printf(NAME ": Invalid address format '%s'.\n", srv_addr);
+		return EINVAL;
+	}
+
+	rc = dnsr_set_srvaddr(&addr);
+	if (rc != EOK) {
+		printf(NAME ": Failed setting server address '%s' (%s)\n",
+		    srv_addr, str_error(rc));
+		return EIO;
+	}
+
+	return EOK;
+}
+
+static int dnscfg_unset_ns(int argc, char *argv[])
+{
+	inet_addr_t addr;
+	int rc;
+
+	if (argc > 0) {
+		printf(NAME ": Too many arguments.\n");
+		print_syntax();
+		return EINVAL;
+	}
+
+	addr.ipv4 = 0;
+	rc = dnsr_set_srvaddr(&addr);
+	if (rc != EOK) {
+		printf(NAME ": Failed unsetting server address (%s)\n",
+		    str_error(rc));
+		return EIO;
+	}
+
+	return EOK;
+}
+
+static int dnscfg_print(void)
+{
+	inet_addr_t addr;
+	char *addr_str;
+	int rc;
+
+	rc = dnsr_get_srvaddr(&addr);
+	if (rc != EOK) {
+		printf(NAME ": Failed getting DNS server address.\n");
+		return rc;
+	}
+
+	rc = inet_addr_format(&addr, &addr_str);
+	if (rc != EOK) {
+		printf(NAME ": Out of memory.\n");
+		return rc;
+	}
+
+	printf("Server: %s\n", addr_str);
+	free(addr_str);
+	return EOK;
+}
+
+int main(int argc, char *argv[])
+{
+	int rc;
+
+	if (argc < 2) {
+		rc = dnscfg_print();
+		if (rc != EOK)
+			return 1;
+		return 0;
+	}
+
+	if (str_cmp(argv[1], "set-ns") == 0) {
+		rc = dnscfg_set_ns(argc - 2, argv + 2);
+		if (rc != EOK)
+			return 1;
+	} else if (str_cmp(argv[1], "unset-ns") == 0) {
+		rc = dnscfg_unset_ns(argc - 2, argv + 2);
+		if (rc != EOK)
+			return 1;
+	} else {
+		printf(NAME ": Unknown command '%s'.\n", argv[1]);
+		print_syntax();
+		return 1;
+	}
+
+
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/app/dnsres/Makefile
===================================================================
--- uspace/app/dnsres/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/app/dnsres/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2013 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../..
+BINARY = dnsres
+
+SOURCES = \
+	dnsres.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/dnsres/dnsres.c
===================================================================
--- uspace/app/dnsres/dnsres.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/app/dnsres/dnsres.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/** @file DNS query utility.
+ */
+
+#include <errno.h>
+#include <inet/addr.h>
+#include <inet/dnsr.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define NAME "dnsres"
+
+static void print_syntax(void)
+{
+	printf("syntax: " NAME " <host-name>\n");
+}
+
+int main(int argc, char *argv[])
+{
+	int rc;
+	dnsr_hostinfo_t *hinfo;
+	char *hname;
+	char *saddr;
+
+	if (argc != 2) {
+		print_syntax();
+		return 1;
+	}
+
+	hname = argv[1];
+
+	rc = dnsr_name2host(hname, &hinfo);
+	if (rc != EOK) {
+		printf(NAME ": Error resolving '%s'.\n", argv[1]);
+		return 1;
+	}
+
+	rc = inet_addr_format(&hinfo->addr, &saddr);
+	if (rc != EOK) {
+		dnsr_hostinfo_destroy(hinfo);
+		printf(NAME ": Out of memory.\n");
+		return 1;
+	}
+
+	printf("Host name: %s\n", hname);
+	if (str_cmp(hname, hinfo->cname) != 0)
+		printf("Canonical name: %s\n", hinfo->cname);
+	printf("Address: %s\n", saddr);
+
+	dnsr_hostinfo_destroy(hinfo);
+	free(saddr);
+
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/edit/edit.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -80,4 +80,7 @@
 	tag_t sel_start;
 
+	/** Active keyboard modifiers */
+	keymod_t keymod;
+
 	/** 
 	 * Ideal column where the caret should try to get. This is used
@@ -119,4 +122,5 @@
 static void cursor_setvis(bool visible);
 
+static void key_handle_press(kbd_event_t *ev);
 static void key_handle_unmod(kbd_event_t const *ev);
 static void key_handle_ctrl(kbd_event_t const *ev);
@@ -124,4 +128,6 @@
 static void key_handle_shift_ctrl(kbd_event_t const *ev);
 static void key_handle_movement(unsigned int key, bool shift);
+
+static void pos_handle(pos_event_t *ev);
 
 static int file_save(char const *fname);
@@ -182,5 +188,5 @@
 int main(int argc, char *argv[])
 {
-	kbd_event_t ev;
+	cons_event_t ev;
 	bool new_file;
 	int rc;
@@ -245,24 +251,16 @@
 
 	while (!done) {
-		console_get_kbd_event(con, &ev);
+		console_get_event(con, &ev);
 		pane.rflags = 0;
 
-		if (ev.type == KEY_PRESS) {
-			/* Handle key press. */
-			if (((ev.mods & KM_ALT) == 0) &&
-			    ((ev.mods & KM_SHIFT) == 0) &&
-			     (ev.mods & KM_CTRL) != 0) {
-				key_handle_ctrl(&ev);
-			} else if (((ev.mods & KM_ALT) == 0) &&
-			    ((ev.mods & KM_CTRL) == 0) &&
-			     (ev.mods & KM_SHIFT) != 0) {
-				key_handle_shift(&ev);
-			} else if (((ev.mods & KM_ALT) == 0) &&
-			    ((ev.mods & KM_CTRL) != 0) &&
-			     (ev.mods & KM_SHIFT) != 0) {
-				key_handle_shift_ctrl(&ev);
-			} else if ((ev.mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) {
-				key_handle_unmod(&ev);
-			}
+		switch (ev.type) {
+		case CEV_KEY:
+			pane.keymod = ev.ev.key.mods;
+			if (ev.ev.key.type == KEY_PRESS)
+				key_handle_press(&ev.ev.key);
+			break;
+		case CEV_POS:
+			pos_handle(&ev.ev.pos);
+			break;
 		}
 
@@ -286,4 +284,24 @@
 
 	return 0;
+}
+
+/* Handle key press. */
+static void key_handle_press(kbd_event_t *ev)
+{
+	if (((ev->mods & KM_ALT) == 0) &&
+	    ((ev->mods & KM_SHIFT) == 0) &&
+	     (ev->mods & KM_CTRL) != 0) {
+		key_handle_ctrl(ev);
+	} else if (((ev->mods & KM_ALT) == 0) &&
+	    ((ev->mods & KM_CTRL) == 0) &&
+	     (ev->mods & KM_SHIFT) != 0) {
+		key_handle_shift(ev);
+	} else if (((ev->mods & KM_ALT) == 0) &&
+	    ((ev->mods & KM_CTRL) != 0) &&
+	     (ev->mods & KM_SHIFT) != 0) {
+		key_handle_shift_ctrl(ev);
+	} else if ((ev->mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) {
+		key_handle_unmod(ev);
+	}
 }
 
@@ -462,4 +480,21 @@
 }
 
+static void pos_handle(pos_event_t *ev)
+{
+	coord_t bc;
+	spt_t pt;
+	bool select;
+
+	if (ev->type == POS_PRESS && ev->vpos < (unsigned)pane.rows) {
+		bc.row = pane.sh_row + ev->vpos;
+		bc.column = pane.sh_column + ev->hpos;
+		sheet_get_cell_pt(doc.sh, &bc, dir_before, &pt);
+
+		select = (pane.keymod & KM_SHIFT) != 0;
+
+		caret_move(pt, select, true);
+	}
+}
+
 /** Move caret while preserving or resetting selection. */
 static void caret_move(spt_t new_caret_pt, bool select, bool update_ideal_column)
@@ -592,5 +627,6 @@
 static char *prompt(char const *prompt, char const *init_value)
 {
-	kbd_event_t ev;
+	cons_event_t ev;
+	kbd_event_t *kev;
 	char *str;
 	wchar_t buffer[INFNAME_MAX_LEN + 1];
@@ -612,13 +648,15 @@
 
 	while (!done) {
-		console_get_kbd_event(con, &ev);
-
-		if (ev.type == KEY_PRESS) {
+		console_get_event(con, &ev);
+
+		if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
+			kev = &ev.ev.key;
+
 			/* Handle key press. */
-			if (((ev.mods & KM_ALT) == 0) &&
-			     (ev.mods & KM_CTRL) != 0) {
+			if (((kev->mods & KM_ALT) == 0) &&
+			     (kev->mods & KM_CTRL) != 0) {
 				;
-			} else if ((ev.mods & (KM_CTRL | KM_ALT)) == 0) {
-				switch (ev.key) {
+			} else if ((kev->mods & (KM_CTRL | KM_ALT)) == 0) {
+				switch (kev->key) {
 				case KC_ESCAPE:
 					return NULL;
@@ -634,8 +672,8 @@
 					break;
 				default:
-					if (ev.c >= 32 && nc < max_len) {
-						putchar(ev.c);
+					if (kev->c >= 32 && nc < max_len) {
+						putchar(kev->c);
 						console_flush(con);
-						buffer[nc++] = ev.c;
+						buffer[nc++] = kev->c;
 					}
 					break;
Index: uspace/app/inet/inet.c
===================================================================
--- uspace/app/inet/inet.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/inet/inet.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2012 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -36,4 +36,5 @@
 
 #include <errno.h>
+#include <inet/addr.h>
 #include <inet/inetcfg.h>
 #include <loc.h>
@@ -54,95 +55,4 @@
 }
 
-static int naddr_parse(const char *text, inet_naddr_t *naddr)
-{
-	unsigned long a[4], bits;
-	char *cp = (char *)text;
-	int i;
-
-	for (i = 0; i < 3; i++) {
-		a[i] = strtoul(cp, &cp, 10);
-		if (*cp != '.')
-			return EINVAL;
-		++cp;
-	}
-
-	a[3] = strtoul(cp, &cp, 10);
-	if (*cp != '/')
-		return EINVAL;
-	++cp;
-
-	bits = strtoul(cp, &cp, 10);
-	if (*cp != '\0')
-		return EINVAL;
-
-	naddr->ipv4 = 0;
-	for (i = 0; i < 4; i++) {
-		if (a[i] > 255)
-			return EINVAL;
-		naddr->ipv4 = (naddr->ipv4 << 8) | a[i];
-	}
-
-	if (bits > 31)
-		return EINVAL;
-
-	naddr->bits = bits;
-	return EOK;
-}
-
-static int addr_parse(const char *text, inet_addr_t *addr)
-{
-	unsigned long a[4];
-	char *cp = (char *)text;
-	int i;
-
-	for (i = 0; i < 3; i++) {
-		a[i] = strtoul(cp, &cp, 10);
-		if (*cp != '.')
-			return EINVAL;
-		++cp;
-	}
-
-	a[3] = strtoul(cp, &cp, 10);
-	if (*cp != '\0')
-		return EINVAL;
-
-	addr->ipv4 = 0;
-	for (i = 0; i < 4; i++) {
-		if (a[i] > 255)
-			return EINVAL;
-		addr->ipv4 = (addr->ipv4 << 8) | a[i];
-	}
-
-	return EOK;
-}
-
-static int naddr_format(inet_naddr_t *naddr, char **bufp)
-{
-	int rc;
-
-	rc = asprintf(bufp, "%d.%d.%d.%d/%d", naddr->ipv4 >> 24,
-	    (naddr->ipv4 >> 16) & 0xff, (naddr->ipv4 >> 8) & 0xff,
-	    naddr->ipv4 & 0xff, naddr->bits);
-
-	if (rc < 0)
-		return ENOMEM;
-
-	return EOK;
-}
-
-static int addr_format(inet_addr_t *addr, char **bufp)
-{
-	int rc;
-
-	rc = asprintf(bufp, "%d.%d.%d.%d", addr->ipv4 >> 24,
-	    (addr->ipv4 >> 16) & 0xff, (addr->ipv4 >> 8) & 0xff,
-	    addr->ipv4 & 0xff);
-
-	if (rc < 0)
-		return ENOMEM;
-
-	return EOK;
-}
-
 static int addr_create_static(int argc, char *argv[])
 {
@@ -178,5 +88,5 @@
 	}
 
-	rc = naddr_parse(addr_spec, &naddr);
+	rc = inet_naddr_parse(addr_spec, &naddr);
 	if (rc != EOK) {
 		printf(NAME ": Invalid network address format '%s'.\n",
@@ -267,5 +177,5 @@
 	route_name = argv[2];
 
-	rc = naddr_parse(dest_str, &dest);
+	rc = inet_naddr_parse(dest_str, &dest);
 	if (rc != EOK) {
 		printf(NAME ": Invalid network address format '%s'.\n",
@@ -274,5 +184,5 @@
 	}
 
-	rc = addr_parse(router_str, &router);
+	rc = inet_addr_parse(router_str, &router);
 	if (rc != EOK) {
 		printf(NAME ": Invalid address format '%s'.\n", router_str);
@@ -366,5 +276,5 @@
 		}
 
-		rc = naddr_format(&ainfo.naddr, &astr);
+		rc = inet_naddr_format(&ainfo.naddr, &astr);
 		if (rc != EOK) {
 			printf("Memory allocation failed.\n");
@@ -430,5 +340,5 @@
 		}
 
-		rc = naddr_format(&srinfo.dest, &dest_str);
+		rc = inet_naddr_format(&srinfo.dest, &dest_str);
 		if (rc != EOK) {
 			printf("Memory allocation failed.\n");
@@ -437,5 +347,5 @@
 		}
 
-		rc = addr_format(&srinfo.router, &router_str);
+		rc = inet_addr_format(&srinfo.router, &router_str);
 		if (rc != EOK) {
 			printf("Memory allocation failed.\n");
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/init/init.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -359,4 +359,5 @@
 	srv_start("/srv/tcp");
 	srv_start("/srv/udp");
+	srv_start("/srv/dnsrsrv");
 	
 	srv_start("/srv/clipboard");
Index: uspace/app/mkbd/main.c
===================================================================
--- uspace/app/mkbd/main.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/mkbd/main.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -178,6 +178,6 @@
 
 	while (1) {
-		kbd_event_t ev;
-		bool ok = console_get_kbd_event(con, &ev);
+		cons_event_t ev;
+		bool ok = console_get_event(con, &ev);
 		if (!ok) {
 			printf("Connection with console broken: %s.\n",
@@ -186,5 +186,6 @@
 		}
 
-		if (ev.key == KC_ESCAPE) {
+		if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS &&
+		    ev.ev.key.key == KC_ESCAPE) {
 			break;
 		}
Index: uspace/app/msim/arch_helenos/input.c
===================================================================
--- uspace/app/msim/arch_helenos/input.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/msim/arch_helenos/input.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -91,17 +91,17 @@
 bool stdin_poll(char *key)
 {
-	kbd_event_t ev;
+	cons_event_t ev;
 	suseconds_t timeout = 0;
 	errno = EOK;
 	console_flush(input_prompt->console);
-	bool has_input = console_get_kbd_event_timeout(input_prompt->console, &ev, &timeout);
+	bool has_input = console_get_event_timeout(input_prompt->console, &ev, &timeout);
 	if (!has_input) {
 		return false;
 	}
 
-	if (ev.type != KEY_PRESS)
+	if (ev.type != CEV_KEY || ev.ev.key.type != KEY_PRESS)
 		return false;
 
-	*key = ev.c;
+	*key = ev.ev.key.c;
 
 	return true;
Index: uspace/app/nettest1/nettest1.c
===================================================================
--- uspace/app/nettest1/nettest1.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/nettest1/nettest1.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -46,4 +46,5 @@
 #include <arg_parse.h>
 
+#include <inet/dnsr.h>
 #include <net/in.h>
 #include <net/in6.h>
@@ -75,5 +76,5 @@
 	printf(
 	    "Network Networking test 1 aplication - sockets\n"
-	    "Usage: echo [options] numeric_address\n"
+	    "Usage: nettest1 [options] host\n"
 	    "Where options are:\n"
 	    "-f protocol_family | --family=protocol_family\n"
@@ -290,4 +291,5 @@
 	struct sockaddr_in address_in;
 	struct sockaddr_in6 address_in6;
+	dnsr_hostinfo_t *hinfo;
 	uint8_t *address_start;
 
@@ -319,7 +321,7 @@
 	}
 
-	/* If not before the last argument containing the address */
+	/* If not before the last argument containing the host */
 	if (index >= argc) {
-		printf("Command line error: missing address\n");
+		printf("Command line error: missing host name\n");
 		nettest1_print_help();
 		return EINVAL;
@@ -348,9 +350,15 @@
 	}
 
-	/* Parse the last argument which should contain the address */
+	/* Parse the last argument which should contain the host/address */
 	rc = inet_pton(family, argv[argc - 1], address_start);
 	if (rc != EOK) {
-		fprintf(stderr, "Address parse error %d\n", rc);
-		return rc;
+		/* Try interpreting as a host name */
+		rc = dnsr_name2host(argv[argc - 1], &hinfo);
+		if (rc != EOK) {
+			printf("Error resolving host '%s'.\n", argv[argc - 1]);
+			return rc;
+		}
+
+		address_in.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4);
 	}
 
Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/nettest2/nettest2.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -47,4 +47,5 @@
 #include <stdbool.h>
 
+#include <inet/dnsr.h>
 #include <net/in.h>
 #include <net/in6.h>
@@ -71,5 +72,5 @@
 	printf(
 	    "Network Networking test 2 aplication - UDP transfer\n"
-	    "Usage: echo [options] address\n"
+	    "Usage: nettest2 [options] host\n"
 	    "Where options are:\n"
 	    "-f protocol_family | --family=protocol_family\n"
@@ -227,4 +228,5 @@
 	struct sockaddr_in address_in;
 	struct sockaddr_in6 address_in6;
+	dnsr_hostinfo_t *hinfo;
 	socklen_t addrlen;
 	uint8_t *address_start;
@@ -265,7 +267,7 @@
 	}
 
-	/* If not before the last argument containing the address */
+	/* If not before the last argument containing the host */
 	if (index >= argc) {
-		printf("Command line error: missing address\n");
+		printf("Command line error: missing host name\n");
 		nettest2_print_help();
 		return EINVAL;
@@ -294,9 +296,15 @@
 	}
 
-	/* Parse the last argument which should contain the address. */
+	/* Parse the last argument which should contain the host/address */
 	rc = inet_pton(family, argv[argc - 1], address_start);
 	if (rc != EOK) {
-		fprintf(stderr, "Address parse error %d\n", rc);
-		return rc;
+		/* Try interpreting as a host name */
+		rc = dnsr_name2host(argv[argc - 1], &hinfo);
+		if (rc != EOK) {
+			printf("Error resolving host '%s'.\n", argv[argc - 1]);
+			return rc;
+		}
+
+		address_in.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4);
 	}
 
Index: uspace/app/nettest3/nettest3.c
===================================================================
--- uspace/app/nettest3/nettest3.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/nettest3/nettest3.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -39,4 +39,5 @@
 #include <str.h>
 
+#include <inet/dnsr.h>
 #include <net/in.h>
 #include <net/in6.h>
@@ -60,4 +61,5 @@
 	int fd;
 	char *endptr;
+	dnsr_hostinfo_t *hinfo;
 
 	port = 7;
@@ -75,6 +77,13 @@
 		rc = inet_pton(AF_INET, argv[1], (uint8_t *)&addr.sin_addr.s_addr);
 		if (rc != EOK) {
-			fprintf(stderr, "Error parsing address\n");
-			return 1;
+			/* Try interpreting as a host name */
+			rc = dnsr_name2host(argv[1], &hinfo);
+			if (rc != EOK) {
+				printf("Error resolving host '%s'.\n", argv[1]);
+				return rc;
+			}
+
+			addr.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4);
+			addr.sin_family = AF_INET;
 		}
 		printf("result: rc=%d, family=%d, addr=%x\n", rc,
Index: uspace/app/nterm/conn.c
===================================================================
--- uspace/app/nterm/conn.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/nterm/conn.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -33,7 +33,9 @@
  */
 
+#include <byteorder.h>
 #include <stdbool.h>
 #include <errno.h>
 #include <fibril.h>
+#include <inet/dnsr.h>
 #include <net/socket.h>
 #include <stdio.h>
@@ -74,4 +76,5 @@
 {
 	struct sockaddr_in addr;
+	dnsr_hostinfo_t *hinfo = NULL;
 	int rc;
 	char *endptr;
@@ -81,6 +84,12 @@
 	rc = inet_pton(addr.sin_family, addr_s, (uint8_t *)&addr.sin_addr);
 	if (rc != EOK) {
-		printf("Invalid addres %s\n", addr_s);
-		return EINVAL;
+		/* Try interpreting as a host name */
+		rc = dnsr_name2host(addr_s, &hinfo);
+		if (rc != EOK) {
+			printf("Error resolving host '%s'.\n", addr_s);
+			goto error;
+		}
+
+		addr.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4);
 	}
 
@@ -88,5 +97,5 @@
 	if (*endptr != '\0') {
 		printf("Invalid port number %s\n", port_s);
-		return EINVAL;
+		goto error;
 	}
 
@@ -95,5 +104,5 @@
 		goto error;
 
-	printf("Connecting to address %s port %u\n", addr_s, ntohs(addr.sin_port));
+	printf("Connecting to host %s port %u\n", addr_s, ntohs(addr.sin_port));
 
 	rc = connect(conn_fd, (struct sockaddr *)&addr, sizeof(addr));
Index: uspace/app/nterm/nterm.c
===================================================================
--- uspace/app/nterm/nterm.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/nterm/nterm.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -104,10 +104,10 @@
 static void print_syntax(void)
 {
-	printf("syntax: nterm <ip-address> <port>\n");
+	printf("syntax: nterm <host> <port>\n");
 }
 
 int main(int argc, char *argv[])
 {
-	kbd_event_t ev;
+	cons_event_t ev;
 	int rc;
 
@@ -129,7 +129,7 @@
 	done = false;
 	while (!done) {
-		console_get_kbd_event(con, &ev);
-		if (ev.type == KEY_PRESS)
-			key_handle(&ev);
+		console_get_event(con, &ev);
+		if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS)
+			key_handle(&ev.ev.key);
 	}
 
Index: uspace/app/ping/ping.c
===================================================================
--- uspace/app/ping/ping.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/ping/ping.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2012 Jiri Svoboda
+ * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -37,4 +37,6 @@
 #include <errno.h>
 #include <fibril_synch.h>
+#include <inet/dnsr.h>
+#include <inet/addr.h>
 #include <inet/inetping.h>
 #include <io/console.h>
@@ -68,46 +70,5 @@
 static void print_syntax(void)
 {
-	printf("syntax: " NAME " [-r] <addr>\n");
-}
-
-static int addr_parse(const char *text, inet_addr_t *addr)
-{
-	unsigned long a[4];
-	char *cp = (char *)text;
-	int i;
-
-	for (i = 0; i < 3; i++) {
-		a[i] = strtoul(cp, &cp, 10);
-		if (*cp != '.')
-			return EINVAL;
-		++cp;
-	}
-
-	a[3] = strtoul(cp, &cp, 10);
-	if (*cp != '\0')
-		return EINVAL;
-
-	addr->ipv4 = 0;
-	for (i = 0; i < 4; i++) {
-		if (a[i] > 255)
-			return EINVAL;
-		addr->ipv4 = (addr->ipv4 << 8) | a[i];
-	}
-
-	return EOK;
-}
-
-static int addr_format(inet_addr_t *addr, char **bufp)
-{
-	int rc;
-
-	rc = asprintf(bufp, "%d.%d.%d.%d", addr->ipv4 >> 24,
-	    (addr->ipv4 >> 16) & 0xff, (addr->ipv4 >> 8) & 0xff,
-	    addr->ipv4 & 0xff);
-
-	if (rc < 0)
-		return ENOMEM;
-
-	return EOK;
+	printf("syntax: " NAME " [-r] <host>\n");
 }
 
@@ -125,9 +86,9 @@
 	int rc;
 
-	rc = addr_format(&sdu->src, &asrc);
+	rc = inet_addr_format(&sdu->src, &asrc);
 	if (rc != EOK)
 		return ENOMEM;
 
-	rc = addr_format(&sdu->dest, &adest);
+	rc = inet_addr_format(&sdu->dest, &adest);
 	if (rc != EOK) {
 		free(asrc);
@@ -188,5 +149,5 @@
 {
 	console_ctrl_t *con;
-	kbd_event_t ev;
+	cons_event_t ev;
 
 	con = console_init(stdin, stdout);
@@ -194,11 +155,12 @@
 
 	while (true) {
-		if (!console_get_kbd_event(con, &ev))
+		if (!console_get_event(con, &ev))
 			break;
 
-		if (ev.type == KEY_PRESS && (ev.mods & (KM_ALT | KM_SHIFT)) ==
-		    0 && (ev.mods & KM_CTRL) != 0) {
+		if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS &&
+		    (ev.ev.key.mods & (KM_ALT | KM_SHIFT)) ==
+		    0 && (ev.ev.key.mods & KM_CTRL) != 0) {
 			/* Ctrl+key */
-			if (ev.key == KC_Q) {
+			if (ev.ev.key.key == KC_Q) {
 				ping_signal_done();
 				return 0;
@@ -212,4 +174,8 @@
 int main(int argc, char *argv[])
 {
+	dnsr_hostinfo_t *hinfo = NULL;
+	char *asrc = NULL;
+	char *adest = NULL;
+	char *sdest = NULL;
 	int rc;
 	int argi;
@@ -219,5 +185,5 @@
 		printf(NAME ": Failed connecting to internet ping service "
 		    "(%d).\n", rc);
-		return 1;
+		goto error;
 	}
 
@@ -232,13 +198,18 @@
 	if (argc - argi != 1) {
 		print_syntax();
-		return 1;
+		goto error;
 	}
 
 	/* Parse destination address */
-	rc = addr_parse(argv[argi], &dest_addr);
-	if (rc != EOK) {
-		printf(NAME ": Invalid address format.\n");
-		print_syntax();
-		return 1;
+	rc = inet_addr_parse(argv[argi], &dest_addr);
+	if (rc != EOK) {
+		/* Try interpreting as a host name */
+		rc = dnsr_name2host(argv[argi], &hinfo);
+		if (rc != EOK) {
+			printf(NAME ": Error resolving host '%s'.\n", argv[argi]);
+			goto error;
+		}
+
+		dest_addr = hinfo->addr;
 	}
 
@@ -247,6 +218,32 @@
 	if (rc != EOK) {
 		printf(NAME ": Failed determining source address.\n");
-		return 1;
-	}
+		goto error;
+	}
+
+	rc = inet_addr_format(&src_addr, &asrc);
+	if (rc != EOK) {
+		printf(NAME ": Out of memory.\n");
+		goto error;
+	}
+
+	rc = inet_addr_format(&dest_addr, &adest);
+	if (rc != EOK) {
+		printf(NAME ": Out of memory.\n");
+		goto error;
+	}
+
+	if (hinfo != NULL) {
+		rc = asprintf(&sdest, "%s (%s)", hinfo->cname, adest);
+		if (rc < 0) {
+			printf(NAME ": Out of memory.\n");
+			goto error;
+		}
+	} else {
+		sdest = adest;
+		adest = NULL;
+	}
+
+	printf("Sending ICMP echo request from %s to %s.\n",
+	    asrc, sdest);
 
 	fid_t fid;
@@ -256,5 +253,5 @@
 		if (fid == 0) {
 			printf(NAME ": Failed creating transmit fibril.\n");
-			return 1;
+			goto error;
 		}
 
@@ -264,5 +261,5 @@
 		if (fid == 0) {
 			printf(NAME ": Failed creating input fibril.\n");
-			return 1;
+			goto error;
 		}
 
@@ -282,8 +279,18 @@
 	if (rc == ETIMEOUT) {
 		printf(NAME ": Echo request timed out.\n");
-		return 1;
-	}
-
+		goto error;
+	}
+
+	free(asrc);
+	free(adest);
+	free(sdest);
+	dnsr_hostinfo_destroy(hinfo);
 	return 0;
+error:
+	free(asrc);
+	free(adest);
+	free(sdest);
+	dnsr_hostinfo_destroy(hinfo);
+	return 1;
 }
 
Index: uspace/app/taskdump/symtab.c
===================================================================
--- uspace/app/taskdump/symtab.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/taskdump/symtab.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -267,5 +267,5 @@
 			continue;
 
-		if (best_name == NULL || (saddr <= addr && saddr > best_addr)) {
+		if (saddr <= addr && (best_name == NULL || saddr > best_addr)) {
 			best_name = sname;
 			best_addr = saddr;
Index: uspace/app/tester/ipc/starve.c
===================================================================
--- uspace/app/tester/ipc/starve.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/tester/ipc/starve.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -62,9 +62,9 @@
 			break;
 		
-		kbd_event_t ev;
+		cons_event_t ev;
 		suseconds_t timeout = 0;
-		bool has_event = console_get_kbd_event_timeout(console, &ev, &timeout);
-		if (has_event && (ev.type == KEY_PRESS)) {
-			TPRINTF("Key %d pressed, terminating.\n", ev.key);
+		bool has_event = console_get_event_timeout(console, &ev, &timeout);
+		if (has_event && ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
+			TPRINTF("Key %d pressed, terminating.\n", ev.ev.key.key);
 			break;
 		}
Index: uspace/app/tetris/scores.c
===================================================================
--- uspace/app/tetris/scores.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/tetris/scores.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -125,5 +125,6 @@
 	int j;
 	size_t off;
-	kbd_event_t ev;
+	cons_event_t ev;
+	kbd_event_t *kev;
 	
 	clear_screen();
@@ -141,14 +142,16 @@
 	while (1) {
 		console_flush(console);
-		if (!console_get_kbd_event(console, &ev))
+		if (!console_get_event(console, &ev))
 			exit(1);
 		
-		if (ev.type == KEY_RELEASE)
+		if (ev.type != CEV_KEY || ev.ev.key.type == KEY_RELEASE)
 			continue;
 		
-		if (ev.key == KC_ENTER || ev.key == KC_NENTER)
+		kev = &ev.ev.key;
+		
+		if (kev->key == KC_ENTER || kev->key == KC_NENTER)
 			break;
 		
-		if (ev.key == KC_BACKSPACE) {
+		if (kev->key == KC_BACKSPACE) {
 			if (i > 0) {
 				wchar_t uc;
@@ -166,7 +169,7 @@
 				scores[NUMSPOTS - 1].hs_name[off] = '\0';
 			}
-		} else if (ev.c != '\0') {
+		} else if (kev->c != '\0') {
 			if (i < (MAXLOGNAME - 1)) {
-				if (chr_encode(ev.c, scores[NUMSPOTS - 1].hs_name,
+				if (chr_encode(kev->c, scores[NUMSPOTS - 1].hs_name,
 				    &off, STR_BOUNDS(MAXLOGNAME) + 1) == EOK) {
 					++i;
Index: uspace/app/tetris/screen.c
===================================================================
--- uspace/app/tetris/screen.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/tetris/screen.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -344,7 +344,7 @@
 	
 	while (timeout > 0) {
-		kbd_event_t event;
-		
-		if (!console_get_kbd_event_timeout(console, &event, &timeout))
+		cons_event_t event;
+		
+		if (!console_get_event_timeout(console, &event, &timeout))
 			break;
 	}
@@ -376,13 +376,13 @@
 	
 	while (c == 0) {
-		kbd_event_t event;
-		
-		if (!console_get_kbd_event_timeout(console, &event, &timeleft)) {
+		cons_event_t event;
+		
+		if (!console_get_event_timeout(console, &event, &timeleft)) {
 			timeleft = 0;
 			return -1;
 		}
 		
-		if (event.type == KEY_PRESS)
-			c = event.c;
+		if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
+			c = event.ev.key.c;
 	}
 	
@@ -398,11 +398,11 @@
 	
 	while (c == 0) {
-		kbd_event_t event;
-		
-		if (!console_get_kbd_event(console, &event))
+		cons_event_t event;
+		
+		if (!console_get_event(console, &event))
 			return -1;
 		
-		if (event.type == KEY_PRESS)
-			c = event.c;
+		if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
+			c = event.ev.key.c;
 	}
 	
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/top/screen.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -556,8 +556,8 @@
 	
 	while (c == 0) {
-		kbd_event_t event;
+		cons_event_t event;
 		
 		warning_timeleft -= timeleft;
-		if (!console_get_kbd_event_timeout(console, &event, &timeleft)) {
+		if (!console_get_event_timeout(console, &event, &timeleft)) {
 			timeleft = 0;
 			return -1;
@@ -565,6 +565,6 @@
 		warning_timeleft += timeleft;
 		
-		if (event.type == KEY_PRESS)
-			c = event.c;
+		if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
+			c = event.ev.key.c;
 	}
 	
Index: uspace/app/trace/ipc_desc.c
===================================================================
--- uspace/app/trace/ipc_desc.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/trace/ipc_desc.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -49,8 +49,7 @@
 	{ IPC_M_DATA_READ,        "DATA_READ" },
 	{ IPC_M_DEBUG,            "DEBUG" },
-	
-	/* Terminating entry */
-	{ 0, NULL }
 };
+
+size_t ipc_methods_len = sizeof(ipc_methods) / sizeof(ipc_m_desc_t);
 
 /** @}
Index: uspace/app/trace/ipc_desc.h
===================================================================
--- uspace/app/trace/ipc_desc.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/trace/ipc_desc.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -42,4 +42,5 @@
 
 extern ipc_m_desc_t ipc_methods[];
+extern size_t ipc_methods_len;
 
 #endif
Index: uspace/app/trace/ipcp.c
===================================================================
--- uspace/app/trace/ipcp.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/trace/ipcp.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -140,7 +140,4 @@
 void ipcp_init(void)
 {
-	ipc_m_desc_t *desc;
-	oper_t *oper;
-
 	val_type_t arg_def[OPER_MAX_ARGS] = {
 		V_INTEGER,
@@ -162,11 +159,8 @@
 	proto_system = proto_new("system");
 
-	desc = ipc_methods;
-	while (desc->number != 0) {
-		oper = oper_new(desc->name, OPER_MAX_ARGS, arg_def, V_INTEGER,
-			OPER_MAX_ARGS, arg_def);
-		proto_add_oper(proto_system, desc->number, oper);
-
-		++desc;
+	for (size_t i = 0; i < ipc_methods_len; i++) {
+		oper_t *oper = oper_new(ipc_methods[i].name, OPER_MAX_ARGS,
+		    arg_def, V_INTEGER, OPER_MAX_ARGS, arg_def);
+		proto_add_oper(proto_system, ipc_methods[i].number, oper);
 	}
 
Index: uspace/app/trace/syscalls.c
===================================================================
--- uspace/app/trace/syscalls.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/trace/syscalls.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -46,4 +46,5 @@
 
     [SYS_TASK_GET_ID] = { "task_get_id",		1,	V_ERRNO },
+    [SYS_TASK_SET_NAME] = { "task_set_name", 		2,	V_ERRNO },
     [SYS_FUTEX_SLEEP] = { "futex_sleep_timeout",	3,	V_ERRNO },
     [SYS_FUTEX_WAKEUP] = { "futex_wakeup",		1,	V_ERRNO },
@@ -82,4 +83,6 @@
 };
 
+const size_t syscall_desc_len = (sizeof(syscall_desc) / sizeof(sc_desc_t));
+
 /** @}
  */
Index: uspace/app/trace/syscalls.h
===================================================================
--- uspace/app/trace/syscalls.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/trace/syscalls.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -36,4 +36,7 @@
 #define SYSCALLS_H_
 
+#include <stdbool.h>
+#include <unistd.h>
+
 #include "trace.h"
 
@@ -45,4 +48,10 @@
 
 extern const sc_desc_t syscall_desc[];
+extern const size_t syscall_desc_len;
+
+static inline bool syscall_desc_defined(unsigned sc_id)
+{
+	return (sc_id < syscall_desc_len && syscall_desc[sc_id].name != NULL);
+}
 
 #endif
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/trace/trace.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -136,5 +136,4 @@
 	}
 
-	free(task_ldr);
 	task_ldr = NULL;
 
@@ -348,6 +347,12 @@
 	if ((display_mask & DM_SYSCALL) != 0) {
 		/* Print syscall name and arguments */
-		printf("%s", syscall_desc[sc_id].name);
-		print_sc_args(sc_args, syscall_desc[sc_id].n_args);
+		if (syscall_desc_defined(sc_id)) {
+			printf("%s", syscall_desc[sc_id].name);
+			print_sc_args(sc_args, syscall_desc[sc_id].n_args);
+		}
+		else {
+			printf("unknown_syscall<%d>", sc_id);
+			print_sc_args(sc_args, 6);
+		}
 	}
 }
@@ -372,5 +377,8 @@
 	if ((display_mask & DM_SYSCALL) != 0) {
 		/* Print syscall return value */
-		rv_type = syscall_desc[sc_id].rv_type;
+		if (syscall_desc_defined(sc_id))
+			rv_type = syscall_desc[sc_id].rv_type;
+		else
+			rv_type = V_PTR;
 		print_sc_retval(sc_rc, rv_type);
 	}
@@ -497,5 +505,5 @@
 	ldr = loader_connect();
 	if (ldr == NULL)
-		return 0;
+		return NULL;
 
 	/* Get task ID. */
@@ -557,4 +565,6 @@
 static int cev_fibril(void *arg)
 {
+	cons_event_t event;
+
 	(void) arg;
 	
@@ -567,11 +577,14 @@
 		fibril_mutex_unlock(&state_lock);
 		
-		if (!console_get_kbd_event(console, &cev))
+		if (!console_get_event(console, &event))
 			return -1;
 		
-		fibril_mutex_lock(&state_lock);
-		cev_valid = true;
-		fibril_condvar_broadcast(&state_cv);
-		fibril_mutex_unlock(&state_lock);
+		if (event.type == CEV_KEY) {
+			fibril_mutex_lock(&state_lock);
+			cev = event.ev.key;
+			cev_valid = true;
+			fibril_condvar_broadcast(&state_cv);
+			fibril_mutex_unlock(&state_lock);
+		}
 	}
 }
Index: uspace/app/vdemo/vdemo.c
===================================================================
--- uspace/app/vdemo/vdemo.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/vdemo/vdemo.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -141,8 +141,8 @@
 		    lbl_action->cancel);
 
-		grid->add(grid, &lbl_action->label.widget, 0, 0, 1, 2);
-		grid->add(grid, &btn_confirm->widget, 1, 0, 1, 1);
+		grid->add(grid, &lbl_action->label.widget, 0, 0, 2, 1);
+		grid->add(grid, &btn_confirm->widget, 0, 1, 1, 1);
 		grid->add(grid, &btn_cancel->widget, 1, 1, 1, 1);
-		window_resize(main_window, 200, 70);
+		window_resize(main_window, 200, 76);
 
 		window_exec(main_window);
Index: uspace/app/vlaunch/Makefile
===================================================================
--- uspace/app/vlaunch/Makefile	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/vlaunch/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -35,5 +35,15 @@
 
 SOURCES = \
-	vlaunch.c
+	vlaunch.c \
+	images.c
+
+IMAGES = \
+	gfx/helenos.tga
+
+PRE_DEPEND = images.c images.h
+EXTRA_CLEAN = images.c images.h
 
 include $(USPACE_PREFIX)/Makefile.common
+
+images.c images.h: $(IMAGES)
+	$(ROOT_PATH)/tools/mkarray.py images COMPOSITOR_IMAGES $^
Index: uspace/app/vlaunch/vlaunch.c
===================================================================
--- uspace/app/vlaunch/vlaunch.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/app/vlaunch/vlaunch.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -46,6 +46,17 @@
 #include <button.h>
 #include <label.h>
+#include <canvas.h>
 
-#define NAME "vlaunch"
+#include <surface.h>
+#include <source.h>
+#include <drawctx.h>
+#include <codec/tga.h>
+
+#include "images.h"
+
+#define NAME  "vlaunch"
+
+#define LOGO_WIDTH   196
+#define LOGO_HEIGHT  66
 
 static char *winreg = NULL;
@@ -97,4 +108,10 @@
 	}
 	
+	surface_t *logo = decode_tga((void *) helenos_tga, helenos_tga_size, 0);
+	if (!logo) {
+		printf("Unable to decode logo.\n");
+		return 1;
+	}
+	
 	winreg = argv[1];
 	window_t *main_window = window_open(argv[1], true, true, "vlaunch", 0, 0);
@@ -104,10 +121,12 @@
 	}
 	
-	pixel_t grd_bg = PIXEL(255, 240, 240, 240);
+	pixel_t grd_bg = PIXEL(255, 255, 255, 255);
 	pixel_t btn_bg = PIXEL(255, 0, 0, 0);
 	pixel_t btn_fg = PIXEL(255, 240, 240, 240);
-	pixel_t lbl_bg = PIXEL(255, 240, 240, 240);
+	pixel_t lbl_bg = PIXEL(255, 255, 255, 255);
 	pixel_t lbl_fg = PIXEL(255, 0, 0, 0);
 	
+	canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT,
+	    logo);
 	label_t *lbl_caption = create_label(NULL, "Launch application:", 16,
 	    lbl_bg, lbl_fg);
@@ -118,8 +137,8 @@
 	button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg,
 	    btn_fg);
-	grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg);
+	grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg);
 	
-	if ((!lbl_caption) || (!btn_vterm) || (!btn_vdemo) ||
-	    (!btn_vlaunch) || (!grid)) {
+	if ((!logo_canvas) || (!lbl_caption) || (!btn_vterm) ||
+	    (!btn_vdemo) || (!btn_vlaunch) || (!grid)) {
 		window_close(main_window);
 		printf("Cannot create widgets.\n");
@@ -131,11 +150,13 @@
 	sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch);
 	
-	grid->add(grid, &lbl_caption->widget, 0, 0, 1, 1);
-	grid->add(grid, &btn_vterm->widget, 1, 0, 1, 1);
-	grid->add(grid, &btn_vdemo->widget, 2, 0, 1, 1);
-	grid->add(grid, &btn_vlaunch->widget, 3, 0, 1, 1);
+	grid->add(grid, &logo_canvas->widget, 0, 0, 1, 1);
+	grid->add(grid, &lbl_caption->widget, 0, 1, 1, 1);
+	grid->add(grid, &btn_vterm->widget, 0, 2, 1, 1);
+	grid->add(grid, &btn_vdemo->widget, 0, 3, 1, 1);
+	grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1);
 	
-	window_resize(main_window, 180, 130);
+	window_resize(main_window, 210, 130 + LOGO_HEIGHT);
 	window_exec(main_window);
+	
 	task_retval(0);
 	async_manager();
Index: uspace/dist/src/c/demos/tetris/scores.c
===================================================================
--- uspace/dist/src/c/demos/tetris/scores.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/dist/src/c/demos/tetris/scores.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -125,5 +125,6 @@
 	int j;
 	size_t off;
-	kbd_event_t ev;
+	cons_event_t ev;
+	kbd_event_t *kev;
 	
 	clear_screen();
@@ -141,14 +142,16 @@
 	while (1) {
 		console_flush(console);
-		if (!console_get_kbd_event(console, &ev))
+		if (!console_get_event(console, &ev))
 			exit(1);
 		
-		if (ev.type == KEY_RELEASE)
+		if (ev.type != CEV_KEY || ev.ev.key.type == KEY_RELEASE)
 			continue;
 		
-		if (ev.key == KC_ENTER || ev.key == KC_NENTER)
+		kev = &ev.ev.key;
+		
+		if (kev->key == KC_ENTER || kev->key == KC_NENTER)
 			break;
 		
-		if (ev.key == KC_BACKSPACE) {
+		if (kev->key == KC_BACKSPACE) {
 			if (i > 0) {
 				wchar_t uc;
@@ -166,7 +169,7 @@
 				scores[NUMSPOTS - 1].hs_name[off] = '\0';
 			}
-		} else if (ev.c != '\0') {
+		} else if (kev->c != '\0') {
 			if (i < (MAXLOGNAME - 1)) {
-				if (chr_encode(ev.c, scores[NUMSPOTS - 1].hs_name,
+				if (chr_encode(kev->c, scores[NUMSPOTS - 1].hs_name,
 				    &off, STR_BOUNDS(MAXLOGNAME) + 1) == EOK) {
 					++i;
Index: uspace/dist/src/c/demos/top/screen.c
===================================================================
--- uspace/dist/src/c/demos/top/screen.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/dist/src/c/demos/top/screen.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -553,13 +553,13 @@
 	
 	while (c == 0) {
-		kbd_event_t event;
-		
-		if (!console_get_kbd_event_timeout(console, &event, &timeleft)) {
+		cons_event_t event;
+		
+		if (!console_get_event_timeout(console, &event, &timeleft)) {
 			timeleft = 0;
 			return -1;
 		}
 		
-		if (event.type == KEY_PRESS)
-			c = event.c;
+		if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
+			c = event.ev.key.c;
 	}
 	
Index: uspace/drv/block/ahci/ahci.c
===================================================================
--- uspace/drv/block/ahci/ahci.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/block/ahci/ahci.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -242,5 +242,5 @@
 	}
 	
-	bzero(buf, sata->block_size);
+	memset(buf, 0, sata->block_size);
 	
 	fibril_mutex_lock(&sata->lock);
@@ -444,5 +444,5 @@
 	}
 	
-	bzero(idata, SATA_IDENTIFY_DEVICE_BUFFER_LENGTH);
+	memset(idata, 0, SATA_IDENTIFY_DEVICE_BUFFER_LENGTH);
 	
 	fibril_mutex_lock(&sata->lock);
@@ -637,5 +637,5 @@
 	}
 	
-	bzero(idata, SATA_SET_FEATURE_BUFFER_LENGTH);
+	memset(idata, 0, SATA_SET_FEATURE_BUFFER_LENGTH);
 	
 	fibril_mutex_lock(&sata->lock);
@@ -954,5 +954,5 @@
 		goto error_retfis;
 	
-	bzero(virt_fb, size);
+	memset(virt_fb, 0, size);
 	sata->port->pxfbu = HI(phys);
 	sata->port->pxfb = LO(phys);
@@ -964,5 +964,5 @@
 		goto error_cmd;
 	
-	bzero(virt_cmd, size);
+	memset(virt_cmd, 0, size);
 	sata->port->pxclbu = HI(phys);
 	sata->port->pxclb = LO(phys);
@@ -975,5 +975,5 @@
 		goto error_table;
 	
-	bzero(virt_table, size);
+	memset(virt_table, 0, size);
 	sata->cmd_header->cmdtableu = HI(phys);
 	sata->cmd_header->cmdtable = LO(phys);
@@ -1287,5 +1287,5 @@
 {
 	uint8_t model[40];
-	bzero(model, 40);
+	memset(model, 0, 40);
 	
 	for (unsigned int i = 0; i < 20; i++) {
Index: uspace/drv/bus/pci/pciintel/pci.c
===================================================================
--- uspace/drv/bus/pci/pciintel/pci.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/pci/pciintel/pci.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -327,6 +327,6 @@
 
 	/* Vendor ID & Device ID, length(incl \0) 22 */
-	rc = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/ven=%04x&dev=%04x",
-	    fun->vendor_id, fun->device_id);
+	rc = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/ven=%04"
+	    PRIx16 "&dev=%04" PRIx16, fun->vendor_id, fun->device_id);
 	if (rc < 0) {
 		ddf_msg(LVL_ERROR, "Failed creating match ID str: %s",
@@ -758,4 +758,10 @@
 	fun->vendor_id = pci_conf_read_16(fun, PCI_VENDOR_ID);
 	fun->device_id = pci_conf_read_16(fun, PCI_DEVICE_ID);
+	
+	/* Explicitly enable PCI bus mastering */
+	fun->command = pci_conf_read_16(fun, PCI_COMMAND) |
+	    PCI_COMMAND_MASTER;
+	pci_conf_write_16(fun, PCI_COMMAND, fun->command);
+	
 	fun->class_code = pci_conf_read_8(fun, PCI_BASE_CLASS);
 	fun->subclass_code = pci_conf_read_8(fun, PCI_SUB_CLASS);
Index: uspace/drv/bus/pci/pciintel/pci.h
===================================================================
--- uspace/drv/bus/pci/pciintel/pci.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/pci/pciintel/pci.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -59,6 +59,7 @@
 	int dev;
 	int fn;
-	int vendor_id;
-	int device_id;
+	uint16_t vendor_id;
+	uint16_t device_id;
+	uint16_t command;
 	uint8_t class_code;
 	uint8_t subclass_code;
Index: uspace/drv/bus/pci/pciintel/pci_regs.h
===================================================================
--- uspace/drv/bus/pci/pciintel/pci_regs.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/pci/pciintel/pci_regs.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -95,4 +95,17 @@
 #define PCI_BRIDGE_CTL			0x3E
 
+/* PCI command flags */
+#define PCI_COMMAND_IO            0x001
+#define PCI_COMMAND_MEMORY        0x002
+#define PCI_COMMAND_MASTER        0x004
+#define PCI_COMMAND_SPECIAL       0x008
+#define PCI_COMMAND_INVALIDATE    0x010
+#define PCI_COMMAND_VGA_PALETTE   0x020
+#define PCI_COMMAND_PARITY        0x040
+#define PCI_COMMAND_WAIT          0x080
+#define PCI_COMMAND_SERR          0x100
+#define PCI_COMMAND_FAST_BACK     0x200
+#define PCI_COMMAND_INTX_DISABLE  0x400
+
 #endif
 
Index: uspace/drv/bus/usb/ohci/hc.c
===================================================================
--- uspace/drv/bus/usb/ohci/hc.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/ohci/hc.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -602,5 +602,5 @@
 	assert(instance);
 
-	bzero(&instance->rh, sizeof(instance->rh));
+	memset(&instance->rh, 0, sizeof(instance->rh));
 	/* Init queues */
 	const int ret = hc_init_transfer_lists(instance);
Index: uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -53,5 +53,5 @@
 {
 	assert(instance);
-	bzero(instance, sizeof(ed_t));
+	memset(instance, 0, sizeof(ed_t));
 
 	if (ep == NULL) {
Index: uspace/drv/bus/usb/ohci/hw_struct/hcca.h
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/hcca.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/ohci/hw_struct/hcca.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -68,5 +68,5 @@
 	hcca_t *hcca = memalign(256, sizeof(hcca_t));
 	if (hcca)
-		bzero(hcca, sizeof(hcca_t));
+		memset(hcca, 0, sizeof(hcca_t));
 	return hcca;
 }
Index: uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -58,5 +58,5 @@
 {
 	assert(instance);
-	bzero(instance, sizeof(td_t));
+	memset(instance, 0, sizeof(td_t));
 	/* Set PID and Error code */
 	OHCI_MEM32_WR(instance->status,
Index: uspace/drv/bus/usb/uhci/uhci_batch.c
===================================================================
--- uspace/drv/bus/usb/uhci/uhci_batch.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/uhci/uhci_batch.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -112,5 +112,5 @@
 	CHECK_NULL_DISPOSE_RETURN(uhci_batch->device_buffer,
 	    "Failed to allocate UHCI buffer.\n");
-	bzero(uhci_batch->device_buffer, total_size);
+	memset(uhci_batch->device_buffer, 0, total_size);
 
 	uhci_batch->tds = uhci_batch->device_buffer;
Index: uspace/drv/bus/usb/usbhub/port.c
===================================================================
--- uspace/drv/bus/usb/usbhub/port.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/usbhub/port.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -143,5 +143,5 @@
 	usb_log_debug("Interrupt at port %zu\n", port->port_number);
 
-	usb_port_status_t status;
+	usb_port_status_t status = 0;
 	const int opResult = get_port_status(port, &status);
 	if (opResult != EOK) {
Index: uspace/drv/bus/usb/usbmast/scsi_ms.c
===================================================================
--- uspace/drv/bus/usb/usbmast/scsi_ms.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/bus/usb/usbmast/scsi_ms.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -167,5 +167,5 @@
 	 */
 
-	bzero(inq_res, sizeof(*inq_res));
+	memset(inq_res, 0, sizeof(*inq_res));
 
 	inq_res->device_type = BIT_RANGE_EXTRACT(uint8_t,
Index: uspace/drv/char/i8042/buffer.h
===================================================================
--- uspace/drv/char/i8042/buffer.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/char/i8042/buffer.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -76,5 +76,5 @@
 	buffer->read_head = buffer->buffer;
 	buffer->write_head = buffer->buffer;
-	bzero(buffer->buffer, size);
+	memset(buffer->buffer, 0, size);
 }
 
Index: uspace/drv/char/ns8250/ns8250.c
===================================================================
--- uspace/drv/char/ns8250/ns8250.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/char/ns8250/ns8250.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -160,5 +160,5 @@
 	/** I/O registers **/
 	ns8250_regs_t *regs;
-	/** Is there any client conntected to the device? */
+	/** Is there any client connected to the device? */
 	bool client_connected;
 	/** The irq assigned to this device. */
@@ -168,5 +168,5 @@
 	/** The i/o port used to access the serial ports registers. */
 	ioport8_t *port;
-	/** The buffer for incomming data. */
+	/** The buffer for incoming data. */
 	cyclic_buffer_t input_buffer;
 	/** The fibril mutex for synchronizing the access to the device. */
@@ -190,5 +190,5 @@
 }
 
-/** Find out if there is some incomming data available on the serial port.
+/** Find out if there is some incoming data available on the serial port.
  *
  * @param port		The base address of the serial port device's ports.
Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/nic/e1k/e1k.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -293,5 +293,5 @@
 	assert(info);
 	
-	bzero(info, sizeof(nic_device_info_t));
+	memset(info, 0, sizeof(nic_device_info_t));
 	
 	info->vendor_id = 0x8086;
@@ -1581,5 +1581,5 @@
 		goto error;
 	
-	bzero(e1000->tx_ring_virt,
+	memset(e1000->tx_ring_virt, 0,
 	    E1000_TX_FRAME_COUNT * sizeof(e1000_tx_descriptor_t));
 	
@@ -1872,5 +1872,5 @@
 	}
 	
-	bzero(e1000, sizeof(e1000_t));
+	memset(e1000, 0, sizeof(e1000_t));
 	
 	nic_set_specific(nic, e1000);
Index: uspace/drv/nic/ne2k/dp8390.c
===================================================================
--- uspace/drv/nic/ne2k/dp8390.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/nic/ne2k/dp8390.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -446,5 +446,5 @@
 		return NULL;
 	
-	bzero(frame->data, length);
+	memset(frame->data, 0, length);
 	uint8_t last = page + length / DP_PAGE;
 	
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -1020,5 +1020,5 @@
 	}
 
-	bzero(rtl8139, sizeof(rtl8139_t));
+	memset(rtl8139, 0, sizeof(rtl8139_t));
 
 	rtl8139->nic_data = nic_data;
Index: uspace/lib/bithenge/src/blob.c
===================================================================
--- uspace/lib/bithenge/src/blob.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/bithenge/src/blob.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -477,5 +477,5 @@
 		if (rc != EOK)
 			return rc;
-		if (size_a != size_b || bcmp(buffer_a, buffer_b, size_a)) {
+		if (size_a != size_b || memcmp(buffer_a, buffer_b, size_a) != 0) {
 			*out = false;
 			return EOK;
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -74,4 +74,5 @@
 	generic/device/pci.c \
 	generic/device/ahci.c \
+	generic/dnsr.c \
 	generic/dlfcn.c \
 	generic/elf/elf_load.c \
@@ -91,4 +92,5 @@
 	generic/task.c \
 	generic/futex.c \
+	generic/inet/addr.c \
 	generic/inet.c \
 	generic/inetcfg.c \
Index: uspace/lib/c/arch/ia32/src/setjmp.S
===================================================================
--- uspace/lib/c/arch/ia32/src/setjmp.S	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/arch/ia32/src/setjmp.S	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -35,23 +35,21 @@
 .type setjmp,@function
 setjmp:
-	movl 0(%esp),%eax	# save pc value into eax	
-	movl 4(%esp),%edx	# address of the jmp_buf structure to save context to 
-
-		# save registers to the jmp_buf structure
+	movl 0(%esp),%eax  # save pc value into eax
+	movl 4(%esp),%edx  # address of the jmp_buf structure to save context to
+	
+	# save registers to the jmp_buf structure
 	CONTEXT_SAVE_ARCH_CORE %edx %eax
-
-	xorl %eax,%eax		# set_jmp returns 0
+	
+	xorl %eax,%eax  # set_jmp returns 0
 	ret
 
 .type longjmp,@function
 longjmp:
-
-	movl 4(%esp), %ecx	# put address of jmp_buf into ecx
-	movl 8(%esp), %eax	# put return value into eax	
-
-		# restore registers from the jmp_buf structure
+	movl 4(%esp), %ecx  # put address of jmp_buf into ecx
+	movl 8(%esp), %eax  # put return value into eax
+	
+	# restore registers from the jmp_buf structure
 	CONTEXT_RESTORE_ARCH_CORE %ecx %edx
-
-	movl %edx,0(%esp)	# put saved pc on stack
+	
+	movl %edx,0(%esp)  # put saved pc on stack
 	ret
-
Index: uspace/lib/c/generic/adt/hash_table.c
===================================================================
--- uspace/lib/c/generic/adt/hash_table.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/adt/hash_table.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -81,5 +81,6 @@
  * @param init_size Initial desired number of hash table buckets. Pass zero
  *                 if you want the default initial size. 
- * @param max_keys Maximal number of keys needed to identify an item.
+ * @param max_load The table is resized when the average load per bucket
+ *                 exceeds this number. Pass zero if you want the default.
  * @param op       Hash table operations structure. remove_callback()
  *                 is optional and can be NULL if no action is to be taken
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/async.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -2090,5 +2090,6 @@
  * @param arg   User defined argument.
  * @param flags Storage for the received flags. Can be NULL.
- * @param dst   Destination address space area base. Cannot be NULL.
+ * @param dst   Address of the storage for the destination address space area
+ *              base address. Cannot be NULL.
  *
  * @return Zero on success or a negative error code from errno.h.
@@ -2218,5 +2219,6 @@
  *
  * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
- * @param dst    Destination address space area base address.
+ * @param dst    Address of the storage for the destination address space area
+ *               base address.
  *
  * @return Zero on success or a value from @ref errno.h on failure.
Index: uspace/lib/c/generic/device/hw_res_parsed.c
===================================================================
--- uspace/lib/c/generic/device/hw_res_parsed.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/device/hw_res_parsed.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -221,5 +221,5 @@
 	hw_resource_list_t hw_resources;
 	hw_res_list_parsed_clean(hw_res_parsed);
-	bzero(&hw_resources, sizeof(hw_resource_list_t));
+	memset(&hw_resources, 0, sizeof(hw_resource_list_t));
 	
 	int rc = hw_res_get_resource_list(sess, &hw_resources);
Index: uspace/lib/c/generic/dnsr.c
===================================================================
--- uspace/lib/c/generic/dnsr.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/generic/dnsr.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <async.h>
+#include <assert.h>
+#include <errno.h>
+#include <fibril_synch.h>
+#include <inet/dnsr.h>
+#include <ipc/dnsr.h>
+#include <ipc/services.h>
+#include <loc.h>
+#include <stdlib.h>
+#include <str.h>
+
+static FIBRIL_MUTEX_INITIALIZE(dnsr_sess_mutex);
+
+static async_sess_t *dnsr_sess = NULL;
+
+static async_exch_t *dnsr_exchange_begin(void)
+{
+	async_sess_t *sess;
+	service_id_t dnsr_svc;
+
+	fibril_mutex_lock(&dnsr_sess_mutex);
+
+	if (dnsr_sess == NULL) {
+		(void) loc_service_get_id(SERVICE_NAME_DNSR, &dnsr_svc,
+		    IPC_FLAG_BLOCKING);
+
+		dnsr_sess = loc_service_connect(EXCHANGE_SERIALIZE, dnsr_svc,
+		    IPC_FLAG_BLOCKING);
+	}
+
+	sess = dnsr_sess;
+	fibril_mutex_unlock(&dnsr_sess_mutex);
+
+	return async_exchange_begin(sess);
+}
+
+static void dnsr_exchange_end(async_exch_t *exch)
+{
+	async_exchange_end(exch);
+}
+
+int dnsr_name2host(const char *name, dnsr_hostinfo_t **rinfo)
+{
+	async_exch_t *exch = dnsr_exchange_begin();
+	char cname_buf[DNSR_NAME_MAX_SIZE + 1];
+	ipc_call_t cnreply;
+	size_t act_size;
+	dnsr_hostinfo_t *info;
+
+	ipc_call_t answer;
+	aid_t req = async_send_0(exch, DNSR_NAME2HOST, &answer);
+	sysarg_t retval = async_data_write_start(exch, name, str_size(name));
+	aid_t cnreq = async_data_read(exch, cname_buf, DNSR_NAME_MAX_SIZE,
+	    &cnreply);
+
+	dnsr_exchange_end(exch);
+
+	if (retval != EOK) {
+		async_forget(req);
+		async_forget(cnreq);
+		return retval;
+	}
+
+	async_wait_for(req, &retval);
+	if (retval != EOK) {
+		async_forget(cnreq);
+		return EIO;
+	}
+
+	async_wait_for(cnreq, &retval);
+	if (retval != EOK)
+		return EIO;
+
+	info = calloc(1, sizeof(dnsr_hostinfo_t));
+	if (info == NULL)
+		return ENOMEM;
+
+	act_size = IPC_GET_ARG2(cnreply);
+	assert(act_size <= DNSR_NAME_MAX_SIZE);
+	cname_buf[act_size] = '\0';
+
+	info->cname = str_dup(cname_buf);
+	info->addr.ipv4 = IPC_GET_ARG1(answer);
+
+	*rinfo = info;
+	return EOK;
+}
+
+void dnsr_hostinfo_destroy(dnsr_hostinfo_t *info)
+{
+	if (info == NULL)
+		return;
+
+	free(info->cname);
+	free(info);
+}
+
+int dnsr_get_srvaddr(inet_addr_t *srvaddr)
+{
+	sysarg_t addr;
+	async_exch_t *exch = dnsr_exchange_begin();
+
+	int rc = async_req_0_1(exch, DNSR_GET_SRVADDR, &addr);
+	dnsr_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	srvaddr->ipv4 = addr;
+	return EOK;
+}
+
+int dnsr_set_srvaddr(inet_addr_t *srvaddr)
+{
+	async_exch_t *exch = dnsr_exchange_begin();
+
+	int rc = async_req_1_0(exch, DNSR_SET_SRVADDR, srvaddr->ipv4);
+	dnsr_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/inet/addr.c
===================================================================
--- uspace/lib/c/generic/inet/addr.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/generic/inet/addr.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file Internet address parsing and formatting.
+ */
+
+#include <errno.h>
+#include <inet/addr.h>
+#include <stdio.h>
+
+/** Parse network address.
+ *
+ * @param text	Network address in CIDR notation (a.b.c.d/w)
+ * @param naddr	Place to store network address
+ *
+ * @return 	EOK on success, EINVAL if input is not in valid format
+ */
+int inet_naddr_parse(const char *text, inet_naddr_t *naddr)
+{
+	unsigned long a[4], bits;
+	char *cp = (char *)text;
+	int i;
+
+	for (i = 0; i < 3; i++) {
+		a[i] = strtoul(cp, &cp, 10);
+		if (*cp != '.')
+			return EINVAL;
+		++cp;
+	}
+
+	a[3] = strtoul(cp, &cp, 10);
+	if (*cp != '/')
+		return EINVAL;
+	++cp;
+
+	bits = strtoul(cp, &cp, 10);
+	if (*cp != '\0')
+		return EINVAL;
+
+	naddr->ipv4 = 0;
+	for (i = 0; i < 4; i++) {
+		if (a[i] > 255)
+			return EINVAL;
+		naddr->ipv4 = (naddr->ipv4 << 8) | a[i];
+	}
+
+	if (bits > 31)
+		return EINVAL;
+
+	naddr->bits = bits;
+	return EOK;
+}
+
+/** Parse node address.
+ *
+ * @param text	Network address in dot notation (a.b.c.d)
+ * @param addr	Place to store node address
+ *
+ * @return 	EOK on success, EINVAL if input is not in valid format
+ */
+int inet_addr_parse(const char *text, inet_addr_t *addr)
+{
+	unsigned long a[4];
+	char *cp = (char *)text;
+	int i;
+
+	for (i = 0; i < 3; i++) {
+		a[i] = strtoul(cp, &cp, 10);
+		if (*cp != '.')
+			return EINVAL;
+		++cp;
+	}
+
+	a[3] = strtoul(cp, &cp, 10);
+	if (*cp != '\0')
+		return EINVAL;
+
+	addr->ipv4 = 0;
+	for (i = 0; i < 4; i++) {
+		if (a[i] > 255)
+			return EINVAL;
+		addr->ipv4 = (addr->ipv4 << 8) | a[i];
+	}
+
+	return EOK;
+}
+
+/** Format network address.
+ *
+ * @param naddr	Network address
+ * @param bufp	Place to store pointer to formatted string (CIDR notation)
+ *
+ * @return 	EOK on success, ENOMEM if out of memory.
+ */
+int inet_naddr_format(inet_naddr_t *naddr, char **bufp)
+{
+	int rc;
+
+	rc = asprintf(bufp, "%d.%d.%d.%d/%d", naddr->ipv4 >> 24,
+	    (naddr->ipv4 >> 16) & 0xff, (naddr->ipv4 >> 8) & 0xff,
+	    naddr->ipv4 & 0xff, naddr->bits);
+
+	if (rc < 0)
+		return ENOMEM;
+
+	return EOK;
+}
+
+/** Format node address.
+ *
+ * @param addr	Node address
+ * @param bufp	Place to store pointer to formatted string (dot notation)
+ *
+ * @return 	EOK on success, ENOMEM if out of memory.
+ */
+int inet_addr_format(inet_addr_t *addr, char **bufp)
+{
+	int rc;
+
+	rc = asprintf(bufp, "%d.%d.%d.%d", addr->ipv4 >> 24,
+	    (addr->ipv4 >> 16) & 0xff, (addr->ipv4 >> 8) & 0xff,
+	    addr->ipv4 & 0xff);
+
+	if (rc < 0)
+		return ENOMEM;
+
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/io/con_srv.c
===================================================================
--- uspace/lib/c/generic/io/con_srv.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/io/con_srv.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -35,4 +35,5 @@
  */
 #include <errno.h>
+#include <io/cons_event.h>
 #include <ipc/console.h>
 #include <stdlib.h>
@@ -40,4 +41,28 @@
 
 #include <io/con_srv.h>
+
+static int console_ev_encode(cons_event_t *event, ipc_call_t *call)
+{
+	IPC_SET_ARG1(*call, event->type);
+
+	switch (event->type) {
+	case CEV_KEY:
+		IPC_SET_ARG2(*call, event->ev.key.type);
+		IPC_SET_ARG3(*call, event->ev.key.key);
+		IPC_SET_ARG4(*call, event->ev.key.mods);
+		IPC_SET_ARG5(*call, event->ev.key.c);
+		break;
+	case CEV_POS:
+		IPC_SET_ARG2(*call, (event->ev.pos.pos_id << 16) | (event->ev.pos.type & 0xffff));
+		IPC_SET_ARG3(*call, event->ev.pos.btn_num);
+		IPC_SET_ARG4(*call, event->ev.pos.hpos);
+		IPC_SET_ARG5(*call, event->ev.pos.vpos);
+		break;
+	default:
+		return EIO;
+	}
+
+	return EOK;
+}
 
 static void con_read_srv(con_srv_t *srv, ipc_callid_t callid,
@@ -273,5 +298,6 @@
 {
 	int rc;
-	kbd_event_t event;
+	cons_event_t event;
+	ipc_call_t result;
 
 	if (srv->srvs->ops->get_event == NULL) {
@@ -281,5 +307,17 @@
 
 	rc = srv->srvs->ops->get_event(srv, &event);
-	async_answer_4(callid, rc, event.type, event.key, event.mods, event.c);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	rc = console_ev_encode(&event, &result);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	async_answer_5(callid, rc, IPC_GET_ARG1(result), IPC_GET_ARG2(result),
+	    IPC_GET_ARG3(result), IPC_GET_ARG4(result), IPC_GET_ARG5(result));
 }
 
Index: uspace/lib/c/generic/io/console.c
===================================================================
--- uspace/lib/c/generic/io/console.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/io/console.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -154,15 +154,40 @@
 }
 
-bool console_get_kbd_event(console_ctrl_t *ctrl, kbd_event_t *event)
+static int console_ev_decode(ipc_call_t *call, cons_event_t *event)
+{
+	event->type = IPC_GET_ARG1(*call);
+
+	switch (event->type) {
+	case CEV_KEY:
+		event->ev.key.type = IPC_GET_ARG2(*call);
+		event->ev.key.key = IPC_GET_ARG3(*call);
+		event->ev.key.mods = IPC_GET_ARG4(*call);
+		event->ev.key.c = IPC_GET_ARG5(*call);
+		break;
+	case CEV_POS:
+		event->ev.pos.pos_id = IPC_GET_ARG2(*call) >> 16;
+		event->ev.pos.type = IPC_GET_ARG2(*call) & 0xffff;
+		event->ev.pos.btn_num = IPC_GET_ARG3(*call);
+		event->ev.pos.hpos = IPC_GET_ARG4(*call);
+		event->ev.pos.vpos = IPC_GET_ARG5(*call);
+		break;
+	default:
+		return EIO;
+	}
+
+	return EOK;
+}
+
+bool console_get_event(console_ctrl_t *ctrl, cons_event_t *event)
 {
 	if (ctrl->input_aid == 0) {
-		sysarg_t type;
-		sysarg_t key;
-		sysarg_t mods;
-		sysarg_t c;
+		ipc_call_t result;
 		
 		async_exch_t *exch = async_exchange_begin(ctrl->input_sess);
-		int rc = async_req_0_4(exch, CONSOLE_GET_EVENT, &type, &key, &mods, &c);
+		aid_t aid = async_send_0(exch, CONSOLE_GET_EVENT, &result);
 		async_exchange_end(exch);
+		
+		sysarg_t rc;
+		async_wait_for(aid, &rc);
 		
 		if (rc != EOK) {
@@ -171,8 +196,9 @@
 		}
 		
-		event->type = type;
-		event->key = key;
-		event->mods = mods;
-		event->c = c;
+		rc = console_ev_decode(&result, event);
+		if (rc != EOK) {
+			errno = rc;
+			return false;
+		}
 	} else {
 		sysarg_t retval;
@@ -186,8 +212,9 @@
 		}
 		
-		event->type = IPC_GET_ARG1(ctrl->input_call);
-		event->key = IPC_GET_ARG2(ctrl->input_call);
-		event->mods = IPC_GET_ARG3(ctrl->input_call);
-		event->c = IPC_GET_ARG4(ctrl->input_call);
+		int rc = console_ev_decode(&ctrl->input_call, event);
+		if (rc != EOK) {
+			errno = rc;
+			return false;
+		}
 	}
 	
@@ -195,5 +222,5 @@
 }
 
-bool console_get_kbd_event_timeout(console_ctrl_t *ctrl, kbd_event_t *event,
+bool console_get_event_timeout(console_ctrl_t *ctrl, cons_event_t *event,
     suseconds_t *timeout)
 {
@@ -223,8 +250,9 @@
 	}
 	
-	event->type = IPC_GET_ARG1(ctrl->input_call);
-	event->key = IPC_GET_ARG2(ctrl->input_call);
-	event->mods = IPC_GET_ARG3(ctrl->input_call);
-	event->c = IPC_GET_ARG4(ctrl->input_call);
+	rc = console_ev_decode(&ctrl->input_call, event);
+	if (rc != EOK) {
+		errno = rc;
+		return false;
+	}
 	
 	/* Update timeout */
Index: uspace/lib/c/generic/mem.c
===================================================================
--- uspace/lib/c/generic/mem.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/mem.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -224,19 +224,25 @@
  * @param s1  Pointer to the first area to compare.
  * @param s2  Pointer to the second area to compare.
- * @param len Size of the first area in bytes. Both areas must have
- *            the same length.
- *
- * @return If len is 0, return zero. If the areas match, return
- *         zero. Otherwise return non-zero.
- *
- */
-int bcmp(const void *s1, const void *s2, size_t len)
+ * @param len Size of the areas in bytes.
+ *
+ * @return Zero if areas have the same contents. If they differ,
+ *	   the sign of the result is the same as the sign of the
+ *	   difference of the first pair of different bytes.
+ *
+ */
+int memcmp(const void *s1, const void *s2, size_t len)
 {
 	uint8_t *u1 = (uint8_t *) s1;
 	uint8_t *u2 = (uint8_t *) s2;
-	
-	for (; (len != 0) && (*u1++ == *u2++); len--);
-	
-	return len;
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		if (*u1 != *u2)
+			return (int)(*u1) - (int)(*u2);
+		++u1;
+		++u2;
+	}
+
+	return 0;
 }
 
Index: uspace/lib/c/generic/net/inet.c
===================================================================
--- uspace/lib/c/generic/net/inet.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/net/inet.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -144,5 +144,5 @@
 	/* Erase if no address */
 	if (!address) {
-		bzero(data, count);
+		memset(data, 0, count);
 		return ENOENT;
 	}
@@ -181,5 +181,5 @@
 		} else {
 			/* Erase the rest of the address */
-			bzero(data + index, count - index);
+			memset(data + index, 0, count - index);
 			return EOK;
 		}
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/generic/net/socket_client.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -446,5 +446,5 @@
 		return ENOMEM;
 
-	bzero(socket, sizeof(*socket));
+	memset(socket, 0, sizeof(*socket));
 	fibril_rwlock_write_lock(&socket_globals.lock);
 
@@ -657,5 +657,5 @@
 		return ENOMEM;
 	}
-	bzero(new_socket, sizeof(*new_socket));
+	memset(new_socket, 0, sizeof(*new_socket));
 	socket_id = socket_generate_new_id();
 	if (socket_id <= 0) {
Index: uspace/lib/c/include/device/hw_res_parsed.h
===================================================================
--- uspace/lib/c/include/device/hw_res_parsed.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/device/hw_res_parsed.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -127,5 +127,5 @@
 	free(list->dma_channels.channels);
 	
-	bzero(list, sizeof(hw_res_list_parsed_t));
+	memset(list, 0, sizeof(hw_res_list_parsed_t));
 }
 
@@ -136,5 +136,5 @@
 static inline void hw_res_list_parsed_init(hw_res_list_parsed_t *list)
 {
-	bzero(list, sizeof(hw_res_list_parsed_t));
+	memset(list, 0, sizeof(hw_res_list_parsed_t));
 }
 
Index: uspace/lib/c/include/inet/addr.h
===================================================================
--- uspace/lib/c/include/inet/addr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/include/inet/addr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_ADDR_H_
+#define LIBC_INET_ADDR_H_
+
+#include <stdint.h>
+
+/** Node address */
+typedef struct {
+	uint32_t ipv4;
+} inet_addr_t;
+
+/** Network address */
+typedef struct {
+	/** Address */
+	uint32_t ipv4;
+	/** Number of valid bits in @c ipv4 */
+	int bits;
+} inet_naddr_t;
+
+extern int inet_naddr_parse(const char *, inet_naddr_t *);
+extern int inet_addr_parse(const char *, inet_addr_t *);
+extern int inet_naddr_format(inet_naddr_t *, char **);
+extern int inet_addr_format(inet_addr_t *, char **);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/inet/dnsr.h
===================================================================
--- uspace/lib/c/include/inet/dnsr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/include/inet/dnsr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_INET_DNSRES_H_
+#define LIBC_INET_DNSRES_H_
+
+#include <inet/inet.h>
+
+enum {
+	DNSR_NAME_MAX_SIZE = 255
+};
+
+typedef struct {
+	/** Host canonical name */
+	char *cname;
+	/** Host address */
+	inet_addr_t addr;
+} dnsr_hostinfo_t;
+
+extern int dnsr_init(void);
+extern int dnsr_name2host(const char *, dnsr_hostinfo_t **);
+extern void dnsr_hostinfo_destroy(dnsr_hostinfo_t *);
+extern int dnsr_get_srvaddr(inet_addr_t *);
+extern int dnsr_set_srvaddr(inet_addr_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/inet/inet.h
===================================================================
--- uspace/lib/c/include/inet/inet.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/inet/inet.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -36,11 +36,8 @@
 #define LIBC_INET_INET_H_
 
+#include <inet/addr.h>
 #include <sys/types.h>
 
 #define INET_TTL_MAX 255
-
-typedef struct {
-	uint32_t ipv4;
-} inet_addr_t;
 
 typedef struct {
Index: uspace/lib/c/include/inet/inetcfg.h
===================================================================
--- uspace/lib/c/include/inet/inetcfg.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/inet/inetcfg.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -38,12 +38,4 @@
 #include <inet/inet.h>
 #include <sys/types.h>
-
-/** Network address */
-typedef struct {
-	/** Address */
-	uint32_t ipv4;
-	/** Number of valid bits in @c ipv4 */
-	int bits;
-} inet_naddr_t;
 
 /** Address object info */
Index: uspace/lib/c/include/io/con_srv.h
===================================================================
--- uspace/lib/c/include/io/con_srv.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/io/con_srv.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -41,5 +41,5 @@
 #include <io/color.h>
 #include <io/concaps.h>
-#include <io/kbd_event.h>
+#include <io/cons_event.h>
 #include <io/pixel.h>
 #include <io/style.h>
@@ -82,5 +82,5 @@
 	void (*set_rgb_color)(con_srv_t *, pixel_t, pixel_t);
 	void (*set_cursor_visibility)(con_srv_t *, bool);
-	int (*get_event)(con_srv_t *, kbd_event_t *);
+	int (*get_event)(con_srv_t *, cons_event_t *);
 } con_ops_t;
 
Index: uspace/lib/c/include/io/cons_event.h
===================================================================
--- uspace/lib/c/include/io/cons_event.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/include/io/cons_event.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IO_CONS_EVENT_H_
+#define LIBC_IO_CONS_EVENT_H_
+
+#include <adt/list.h>
+#include <io/kbd_event.h>
+#include <io/pos_event.h>
+
+typedef enum {
+	/** Key event */
+	CEV_KEY,
+	/** Position event */
+	CEV_POS
+} cons_event_type_t;
+
+/** Console event structure. */
+typedef struct {
+	/** List handle */
+	link_t link;
+
+	/** Event type */
+	cons_event_type_t type;
+
+	union {
+		kbd_event_t key;
+		pos_event_t pos;
+	} ev;
+} cons_event_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/console.h
===================================================================
--- uspace/lib/c/include/io/console.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/io/console.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -39,4 +39,5 @@
 #include <io/concaps.h>
 #include <io/kbd_event.h>
+#include <io/cons_event.h>
 #include <io/keycode.h>
 #include <async.h>
@@ -82,6 +83,6 @@
 extern void console_cursor_visibility(console_ctrl_t *, bool);
 extern int console_get_color_cap(console_ctrl_t *, sysarg_t *);
-extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *);
-extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *,
+extern bool console_get_event(console_ctrl_t *, cons_event_t *);
+extern bool console_get_event_timeout(console_ctrl_t *, cons_event_t *,
     suseconds_t *);
 
Index: uspace/lib/c/include/io/pos_event.h
===================================================================
--- uspace/lib/c/include/io/pos_event.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/include/io/pos_event.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2012 Petr Koupy
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IO_POS_EVENT_H_
+#define LIBC_IO_POS_EVENT_H_
+
+#include <sys/types.h>
+
+typedef enum {
+	POS_UPDATE,
+	POS_PRESS,
+	POS_RELEASE
+} pos_event_type_t;
+
+/** Positioning device event */
+typedef struct {
+	sysarg_t pos_id;
+	pos_event_type_t type;
+	sysarg_t btn_num;
+	sysarg_t hpos;
+	sysarg_t vpos;
+} pos_event_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/io/window.h
===================================================================
--- uspace/lib/c/include/io/window.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/io/window.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -40,19 +40,6 @@
 #include <async.h>
 #include <loc.h>
-#include <io/console.h>
-
-typedef enum {
-	POS_UPDATE,
-	POS_PRESS,
-	POS_RELEASE
-} pos_event_type_t;
-
-typedef struct {
-	sysarg_t pos_id;
-	pos_event_type_t type;
-	sysarg_t btn_num;
-	sysarg_t hpos;
-	sysarg_t vpos;
-} pos_event_t;
+#include <io/kbd_event.h>
+#include <io/pos_event.h>
 
 typedef struct {
Index: uspace/lib/c/include/ipc/dnsr.h
===================================================================
--- uspace/lib/c/include/ipc/dnsr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/c/include/ipc/dnsr.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libcipc
+ * @{
+ */
+
+#ifndef LIBC_IPC_DNSR_H_
+#define LIBC_IPC_DNSR_H_
+
+#include <ipc/common.h>
+
+typedef enum {
+	DNSR_NAME2HOST = IPC_FIRST_USER_METHOD,
+	DNSR_GET_SRVADDR,
+	DNSR_SET_SRVADDR
+} dnsr_request_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/ipc/services.h
===================================================================
--- uspace/lib/c/include/ipc/services.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/ipc/services.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -53,4 +53,5 @@
 } services_t;
 
+#define SERVICE_NAME_DNSR     "net/dnsr"
 #define SERVICE_NAME_INET     "net/inet"
 #define SERVICE_NAME_INETCFG  "net/inetcfg"
Index: uspace/lib/c/include/mem.h
===================================================================
--- uspace/lib/c/include/mem.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/mem.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -38,11 +38,10 @@
 #include <sys/types.h>
 
-#define bzero(ptr, len)  memset((ptr), 0, (len))
-
-extern void *memset(void *, int, size_t);
-extern void *memcpy(void *, const void *, size_t);
+extern void *memset(void *, int, size_t)
+    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
+extern void *memcpy(void *, const void *, size_t)
+    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
 extern void *memmove(void *, const void *, size_t);
-
-extern int bcmp(const void *, const void *, size_t);
+extern int memcmp(const void *, const void *, size_t);
 
 #endif
Index: uspace/lib/c/include/setjmp.h
===================================================================
--- uspace/lib/c/include/setjmp.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/setjmp.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -38,5 +38,5 @@
 #include <libarch/fibril.h>
 
-typedef context_t jmp_buf;
+typedef context_t jmp_buf[1];
 
 extern int setjmp(jmp_buf env);
@@ -47,3 +47,2 @@
 /** @}
  */
-
Index: uspace/lib/c/include/sys/types.h
===================================================================
--- uspace/lib/c/include/sys/types.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/c/include/sys/types.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -50,4 +50,12 @@
 typedef volatile uint32_t ioport32_t;
 
+typedef int16_t unaligned_int16_t __attribute__ ((aligned(1)));
+typedef int32_t unaligned_int32_t __attribute__ ((aligned(1)));
+typedef int64_t unaligned_int64_t __attribute__ ((aligned(1)));
+
+typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
+typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
+typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
+
 #endif
 
Index: uspace/lib/clui/tinput.c
===================================================================
--- uspace/lib/clui/tinput.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/clui/tinput.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -45,4 +45,5 @@
 #define LIN_TO_COL(ti, lpos) ((lpos) % ((ti)->con_cols))
 #define LIN_TO_ROW(ti, lpos) ((lpos) / ((ti)->con_cols))
+#define LIN_POS(ti, col, row) ((col) + (row) * (ti)->con_cols)
 
 /** Seek direction */
@@ -383,4 +384,21 @@
 }
 
+static void tinput_seek_scrpos(tinput_t *ti, int col, int line, bool shift_held)
+{
+	unsigned lpos;
+	tinput_pre_seek(ti, shift_held);
+
+	lpos = LIN_POS(ti, col, line);
+
+	if (lpos > ti->text_coord)
+		ti->pos = lpos -  ti->text_coord;
+	else
+		ti->pos = 0;
+	if (ti->pos > ti->nc)
+		ti->pos = ti->nc;
+
+	tinput_post_seek(ti, shift_held);
+}
+
 static void tinput_seek_max(tinput_t *ti, seek_dir_t dir, bool shift_held)
 {
@@ -787,4 +805,52 @@
 }
 
+/** Handle key press event. */
+static void tinput_key_press(tinput_t *ti, kbd_event_t *kev)
+{
+	if (kev->key == KC_LSHIFT)
+		ti->lshift_held = true;
+	if (kev->key == KC_RSHIFT)
+		ti->rshift_held = true;
+
+	if (((kev->mods & KM_CTRL) != 0) &&
+	    ((kev->mods & (KM_ALT | KM_SHIFT)) == 0))
+		tinput_key_ctrl(ti, kev);
+	
+	if (((kev->mods & KM_SHIFT) != 0) &&
+	    ((kev->mods & (KM_CTRL | KM_ALT)) == 0))
+		tinput_key_shift(ti, kev);
+	
+	if (((kev->mods & KM_CTRL) != 0) &&
+	    ((kev->mods & KM_SHIFT) != 0) &&
+	    ((kev->mods & KM_ALT) == 0))
+		tinput_key_ctrl_shift(ti, kev);
+	
+	if ((kev->mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0)
+		tinput_key_unmod(ti, kev);
+	
+	if (kev->c >= ' ') {
+		tinput_sel_delete(ti);
+		tinput_insert_char(ti, kev->c);
+	}
+}
+
+/** Handle key release event. */
+static void tinput_key_release(tinput_t *ti, kbd_event_t *kev)
+{
+	if (kev->key == KC_LSHIFT)
+		ti->lshift_held = false;
+	if (kev->key == KC_RSHIFT)
+		ti->rshift_held = false;
+}
+
+/** Position event */
+static void tinput_pos(tinput_t *ti, pos_event_t *ev)
+{
+	if (ev->type == POS_PRESS) {
+		tinput_seek_scrpos(ti, ev->hpos, ev->vpos,
+		    ti->lshift_held || ti->rshift_held);
+	}
+}
+
 /** Read in one line of input.
  *
@@ -816,30 +882,18 @@
 		console_flush(ti->console);
 		
-		kbd_event_t ev;
-		if (!console_get_kbd_event(ti->console, &ev))
+		cons_event_t ev;
+		if (!console_get_event(ti->console, &ev))
 			return EIO;
 		
-		if (ev.type != KEY_PRESS)
-			continue;
-		
-		if (((ev.mods & KM_CTRL) != 0) &&
-		    ((ev.mods & (KM_ALT | KM_SHIFT)) == 0))
-			tinput_key_ctrl(ti, &ev);
-		
-		if (((ev.mods & KM_SHIFT) != 0) &&
-		    ((ev.mods & (KM_CTRL | KM_ALT)) == 0))
-			tinput_key_shift(ti, &ev);
-		
-		if (((ev.mods & KM_CTRL) != 0) &&
-		    ((ev.mods & KM_SHIFT) != 0) &&
-		    ((ev.mods & KM_ALT) == 0))
-			tinput_key_ctrl_shift(ti, &ev);
-		
-		if ((ev.mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0)
-			tinput_key_unmod(ti, &ev);
-		
-		if (ev.c >= ' ') {
-			tinput_sel_delete(ti);
-			tinput_insert_char(ti, ev.c);
+		switch (ev.type) {
+		case CEV_KEY:
+			if (ev.ev.key.type == KEY_PRESS)
+				tinput_key_press(ti, &ev.ev.key);
+			else
+				tinput_key_release(ti, &ev.ev.key);
+			break;
+		case CEV_POS:
+			tinput_pos(ti, &ev.ev.pos);
+			break;
 		}
 	}
Index: uspace/lib/clui/tinput.h
===================================================================
--- uspace/lib/clui/tinput.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/clui/tinput.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -146,4 +146,10 @@
 	/** @c true if user requested to abort interactive loop */
 	bool exit_clui;
+
+	/** @c true if left shift key is currently held */
+	bool lshift_held;
+
+	/** @c true if right shift key is currently held */
+	bool rshift_held;
 } tinput_t;
 
Index: uspace/lib/drv/generic/remote_nic.c
===================================================================
--- uspace/lib/drv/generic/remote_nic.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/drv/generic/remote_nic.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -104,5 +104,5 @@
 	
 	nic_address_t address;
-	bzero(&address, sizeof(nic_address_t));
+	memset(&address, 0, sizeof(nic_address_t));
 	
 	int rc = nic_iface->get_address(dev, &address);
@@ -173,5 +173,5 @@
 	
 	nic_device_stats_t stats;
-	bzero(&stats, sizeof(nic_device_stats_t));
+	memset(&stats, 0, sizeof(nic_device_stats_t));
 	
 	int rc = nic_iface->get_stats(dev, &stats);
@@ -208,5 +208,5 @@
 	
 	nic_device_info_t info;
-	bzero(&info, sizeof(nic_device_info_t));
+	memset(&info, 0, sizeof(nic_device_info_t));
 	
 	int rc = nic_iface->get_device_info(dev, &info);
@@ -399,5 +399,5 @@
 	}
 	
-	bzero(address_list, max_count * sizeof(nic_address_t));
+	memset(address_list, 0, max_count * sizeof(nic_address_t));
 	nic_unicast_mode_t mode = NIC_UNICAST_DEFAULT;
 	size_t address_count = 0;
@@ -503,5 +503,5 @@
 	}
 	
-	bzero(address_list, max_count * sizeof(nic_address_t));
+	memset(address_list, 0, max_count * sizeof(nic_address_t));
 	nic_multicast_mode_t mode = NIC_MULTICAST_BLOCKED;
 	size_t address_count = 0;
@@ -667,5 +667,5 @@
 	}
 	
-	bzero(address_list, max_count * sizeof(nic_address_t));
+	memset(address_list, 0, max_count * sizeof(nic_address_t));
 	size_t address_count = 0;
 	
@@ -759,5 +759,5 @@
 	
 	nic_vlan_mask_t vlan_mask;
-	bzero(&vlan_mask, sizeof(nic_vlan_mask_t));
+	memset(&vlan_mask, 0, sizeof(nic_vlan_mask_t));
 	
 	int rc = nic_iface->vlan_get_mask(dev, &vlan_mask);
@@ -932,5 +932,5 @@
 	}
 	
-	bzero(data, max_length);
+	memset(data, 0, max_length);
 	
 	int rc = nic_iface->wol_virtue_probe(dev, id, &type, max_length,
@@ -982,5 +982,5 @@
 	}
 	
-	bzero(id_list, max_count * sizeof (nic_wv_id_t));
+	memset(id_list, 0, max_count * sizeof (nic_wv_id_t));
 	
 	int rc = nic_iface->wol_virtue_list(dev, type, max_count, id_list,
@@ -1047,5 +1047,5 @@
 	}
 	
-	bzero(data, max_length);
+	memset(data, 0, max_length);
 	
 	int rc = nic_iface->wol_load_info(dev, &type, max_length, data,
Index: uspace/lib/ext4/libext4_directory.c
===================================================================
--- uspace/lib/ext4/libext4_directory.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/ext4/libext4_directory.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -725,5 +725,5 @@
 			    name_len) {
 				/* Compare names */
-				if (bcmp((uint8_t *) name, dentry->name, name_len) == 0) {
+				if (memcmp((uint8_t *) name, dentry->name, name_len) == 0) {
 					*res_entry = dentry;
 					return EOK;
Index: uspace/lib/gui/Makefile
===================================================================
--- uspace/lib/gui/Makefile	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/gui/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -35,4 +35,5 @@
 SOURCES = \
 	button.c \
+	canvas.c \
 	connection.c \
 	grid.c \
Index: uspace/lib/gui/canvas.c
===================================================================
--- uspace/lib/gui/canvas.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/gui/canvas.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2013 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup gui
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <malloc.h>
+#include <transform.h>
+#include <source.h>
+#include <surface.h>
+#include <drawctx.h>
+#include "window.h"
+#include "canvas.h"
+
+static void paint_internal(widget_t *widget)
+{
+	canvas_t *canvas = (canvas_t *) widget;
+	
+	surface_t *surface = window_claim(canvas->widget.window);
+	if (!surface) {
+		window_yield(canvas->widget.window);
+	}
+	
+	transform_t transform;
+	transform_identity(&transform);
+	transform_translate(&transform, widget->hpos, widget->vpos);
+	
+	source_t source;
+	source_init(&source);
+	source_set_transform(&source, transform);
+	source_set_texture(&source, canvas->surface, false);
+	
+	drawctx_t drawctx;
+	drawctx_init(&drawctx, surface);
+	
+	drawctx_set_source(&drawctx, &source);
+	drawctx_transfer(&drawctx, widget->hpos, widget->vpos, widget->width,
+	    widget->height);
+	
+	window_yield(canvas->widget.window);
+}
+
+void deinit_canvas(canvas_t *canvas)
+{
+	widget_deinit(&canvas->widget);
+}
+
+static void canvas_destroy(widget_t *widget)
+{
+	canvas_t *canvas = (canvas_t *) widget;
+	
+	deinit_canvas(canvas);
+	free(canvas);
+}
+
+static void canvas_reconfigure(widget_t *widget)
+{
+	/* No-op */
+}
+
+static void canvas_rearrange(widget_t *widget, sysarg_t hpos, sysarg_t vpos,
+    sysarg_t width, sysarg_t height)
+{
+	canvas_t *canvas = (canvas_t *) widget;
+	
+	widget_modify(widget, hpos, vpos, canvas->width, canvas->height);
+	paint_internal(widget);
+}
+
+static void canvas_repaint(widget_t *widget)
+{
+	paint_internal(widget);
+	window_damage(widget->window);
+}
+
+static void canvas_handle_keyboard_event(widget_t *widget, kbd_event_t event)
+{
+	/* No-op */
+}
+
+static void canvas_handle_position_event(widget_t *widget, pos_event_t event)
+{
+	/* No-op */
+}
+
+bool init_canvas(canvas_t *canvas, widget_t *parent, sysarg_t width,
+    sysarg_t height, surface_t *surface)
+{
+	widget_init(&canvas->widget, parent);
+	
+	canvas->widget.width = width;
+	canvas->widget.height = height;
+	
+	canvas->widget.width_min = width;
+	canvas->widget.height_min = height;
+	canvas->widget.width_ideal = width;
+	canvas->widget.height_ideal = height;
+	canvas->widget.width_max = width;
+	canvas->widget.height_max = height;
+	
+	canvas->widget.destroy = canvas_destroy;
+	canvas->widget.reconfigure = canvas_reconfigure;
+	canvas->widget.rearrange = canvas_rearrange;
+	canvas->widget.repaint = canvas_repaint;
+	canvas->widget.handle_keyboard_event = canvas_handle_keyboard_event;
+	canvas->widget.handle_position_event = canvas_handle_position_event;
+	
+	canvas->width = width;
+	canvas->height = height;
+	canvas->surface = surface;
+	
+	return true;
+}
+
+canvas_t *create_canvas(widget_t *parent, sysarg_t width, sysarg_t height,
+    surface_t *surface)
+{
+	canvas_t *canvas = (canvas_t *) malloc(sizeof(canvas_t));
+	if (!canvas)
+		return NULL;
+	
+	if (init_canvas(canvas, parent, width, height, surface))
+		return canvas;
+	
+	free(canvas);
+	return NULL;
+}
+
+/** @}
+ */
Index: uspace/lib/gui/canvas.h
===================================================================
--- uspace/lib/gui/canvas.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/lib/gui/canvas.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup gui
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef GUI_CANVAS_H_
+#define GUI_CANVAS_H_
+
+#include <stdbool.h>
+#include <sys/types.h>
+#include <io/pixel.h>
+#include <surface.h>
+#include "widget.h"
+
+typedef struct {
+	widget_t widget;
+	sysarg_t width;
+	sysarg_t height;
+	surface_t *surface;
+} canvas_t;
+
+extern bool init_canvas(canvas_t *, widget_t *, sysarg_t, sysarg_t,
+    surface_t *);
+extern canvas_t *create_canvas(widget_t *, sysarg_t, sysarg_t, surface_t *);
+extern void deinit_canvas(canvas_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/gui/grid.c
===================================================================
--- uspace/lib/gui/grid.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/gui/grid.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2012 Petr Koupy
+ * Copyright (c) 2013 Martin Decky
  * All rights reserved.
  *
@@ -38,33 +39,58 @@
 #include <malloc.h>
 #include <surface.h>
-
 #include "window.h"
 #include "grid.h"
 
-static void paint_internal(widget_t *w)
-{
-	grid_t *grid = (grid_t *) w;
-
+typedef struct {
+	sysarg_t min;
+	sysarg_t max;
+	sysarg_t val;
+} constraints_t;
+
+static void paint_internal(widget_t *widget)
+{
+	grid_t *grid = (grid_t *) widget;
+	
 	surface_t *surface = window_claim(grid->widget.window);
 	if (!surface) {
 		window_yield(grid->widget.window);
-	}
-
-	for (sysarg_t y = w->vpos; y <  w->vpos + w->height; ++y) {
-		for (sysarg_t x = w->hpos; x < w->hpos + w->width; ++x) {
+		return;
+	}
+	
+	// FIXME: Replace with (accelerated) rectangle fill
+	for (sysarg_t y = widget->vpos; y < widget->vpos + widget->height; y++) {
+		for (sysarg_t x = widget->hpos; x < widget->hpos + widget->width; x++)
 			surface_put_pixel(surface, x, y, grid->background);
-		}
-	}
-
+	}
+	
 	window_yield(grid->widget.window);
 }
 
-static widget_t **widget_at(grid_t *grid, size_t row, size_t col)
-{
-	if (row < grid->rows && col < grid->cols) {
+static grid_cell_t *grid_cell_at(grid_t *grid, size_t col, size_t row)
+{
+	if ((col < grid->cols) && (row < grid->rows))
 		return grid->layout + (row * grid->cols + col);
-	} else {
-		return NULL;
-	}
+	
+	return NULL;
+}
+
+static grid_cell_t *grid_coords_at(grid_t *grid, sysarg_t hpos, sysarg_t vpos)
+{
+	for (size_t c = 0; c < grid->cols; c++) {
+		for (size_t r = 0; r < grid->rows; r++) {
+			grid_cell_t *cell = grid_cell_at(grid, c, r);
+			if (cell) {
+				widget_t *widget = cell->widget;
+				
+				if ((widget) && (hpos >= widget->hpos) &&
+				    (vpos >= widget->vpos) &&
+				    (hpos < widget->hpos + widget->width) &&
+				    (vpos < widget->vpos + widget->height))
+					return cell;
+			}
+		}
+	}
+	
+	return NULL;
 }
 
@@ -78,7 +104,6 @@
 {
 	grid_t *grid = (grid_t *) widget;
-
+	
 	deinit_grid(grid);
-
 	free(grid);
 }
@@ -86,5 +111,69 @@
 static void grid_reconfigure(widget_t *widget)
 {
-	/* no-op */
+	/* No-op */
+}
+
+static void adjust_constraints(constraints_t *cons, size_t run,
+    sysarg_t dim_min, sysarg_t dim_max)
+{
+	assert(run > 0);
+	
+	sysarg_t dim_min_part = dim_min / run;
+	sysarg_t dim_min_rem = dim_min % run;
+	
+	sysarg_t dim_max_part = dim_max / run;
+	sysarg_t dim_max_rem = dim_max % run;
+	
+	for (size_t i = 0; i < run; i++) {
+		sysarg_t dim_min_cur = dim_min_part;
+		sysarg_t dim_max_cur = dim_max_part;
+		
+		if (i == run - 1) {
+			dim_min_cur += dim_min_rem;
+			dim_max_cur += dim_max_rem;
+		}
+		
+		/*
+		 * We want the strongest constraint
+		 * for the minimum.
+		 */
+		if (cons[i].min < dim_min_cur)
+			cons[i].min = dim_min_cur;
+		
+		/*
+		 * The comparison is correct, we want
+		 * the weakest constraint for the
+		 * maximum.
+		 */
+		if (cons[i].max < dim_max_cur)
+			cons[i].max = dim_max_cur;
+	}
+}
+
+static void solve_constraints(constraints_t *cons, size_t run, sysarg_t sum)
+{
+	/* Initial solution */
+	sysarg_t cur_sum = 0;
+	
+	for (size_t i = 0; i < run; i++) {
+		cons[i].val = cons[i].min;
+		cur_sum += cons[i].val;
+	}
+	
+	/* Iterative improvement */
+	while (cur_sum < sum) {
+		sysarg_t delta = (sum - cur_sum) / run;
+		if (delta == 0)
+			break;
+		
+		cur_sum = 0;
+		
+		for (size_t i = 0; i < run; i++) {
+			if (cons[i].val + delta < cons[i].max)
+				cons[i].val += delta;
+			
+			cur_sum += cons[i].val;
+		}
+	}
 }
 
@@ -93,61 +182,114 @@
 {
 	grid_t *grid = (grid_t *) widget;
-
+	
 	widget_modify(widget, hpos, vpos, width, height);
 	paint_internal(widget);
-
-	sysarg_t cell_width = width / grid->cols;
-	sysarg_t cell_height = height / grid->rows;
-
-	list_foreach(widget->children, link) {
-		widget_t *child = list_get_instance(link, widget_t, link);
-
-		sysarg_t widget_hpos = 0;
-		sysarg_t widget_vpos = 0;
-		sysarg_t widget_width = 0;
-		sysarg_t widget_height = 0;
-
-		size_t r = 0;
-		size_t c = 0;
-		for (r = 0; r < grid->rows; ++r) {
-			bool found = false;
-			for (c = 0; c < grid->cols; ++c) {
-				widget_t **cell = widget_at(grid, r, c);
-				if (cell && *cell == child) {
-					found = true;
-					break;
+	
+	/* Compute column widths */
+	constraints_t *widths =
+	    (constraints_t *) calloc(grid->cols, sizeof(constraints_t));
+	if (widths) {
+		/* Constrain widths */
+		for (size_t c = 0; c < grid->cols; c++) {
+			widths[c].min = 0;
+			
+			for (size_t r = 0; r < grid->rows; r++) {
+				grid_cell_t *cell = grid_cell_at(grid, c, r);
+				if (!cell)
+					continue;
+				
+				widget_t *widget = cell->widget;
+				if (widget)
+					adjust_constraints(&widths[c], cell->cols,
+					    widget->width_min, widget->width_max);
+			}
+		}
+		
+		solve_constraints(widths, grid->cols, width);
+	}
+	
+	/* Compute row heights */
+	constraints_t *heights =
+	    (constraints_t *) calloc(grid->rows, sizeof(constraints_t));
+	if (heights) {
+		/* Constrain heights */
+		for (size_t r = 0; r < grid->rows; r++) {
+			heights[r].min = 0;
+			
+			for (size_t c = 0; c < grid->cols; c++) {
+				grid_cell_t *cell = grid_cell_at(grid, c, r);
+				if (!cell)
+					continue;
+				
+				widget_t *widget = cell->widget;
+				if (widget) {
+					adjust_constraints(&heights[r], cell->rows,
+					    widget->height_min, widget->height_max);
 				}
 			}
-			if (found) {
-				break;
+		}
+		
+		solve_constraints(heights, grid->rows, height);
+	}
+	
+	/* Rearrange widgets */
+	if ((widths) && (heights)) {
+		sysarg_t cur_vpos = vpos;
+		
+		for (size_t r = 0; r < grid->rows; r++) {
+			sysarg_t cur_hpos = hpos;
+			
+			for (size_t c = 0; c < grid->cols; c++) {
+				grid_cell_t *cell = grid_cell_at(grid, c, r);
+				if (!cell)
+					continue;
+				
+				widget_t *widget = cell->widget;
+				if (widget) {
+					sysarg_t cur_width = 0;
+					sysarg_t cur_height = 0;
+					
+					for (size_t cd = 0; cd < cell->cols; cd++)
+						cur_width += widths[c + cd].val;
+					
+					for (size_t rd = 0; rd < cell->rows; rd++)
+						cur_height += heights[r + rd].val;
+					
+					if ((cur_width > 0) && (cur_height > 0)) {
+						sysarg_t wwidth = cur_width;
+						sysarg_t wheight = cur_height;
+						
+						/*
+						 * Make sure the widget is respects its
+						 * maximal constrains.
+						 */
+						
+						if ((widget->width_max > 0) &&
+						    (wwidth > widget->width_max))
+							wwidth = widget->width_max;
+						
+						if ((widget->height_max > 0) &&
+						    (wheight > widget->height_max))
+							wheight = widget->height_max;
+						
+						widget->rearrange(widget, cur_hpos, cur_vpos,
+						    wwidth, wheight);
+					}
+					
+					
+				}
+				
+				cur_hpos += widths[c].val;
 			}
-		}
-
-		widget_hpos = cell_width * c + hpos;
-		widget_vpos = cell_height * r + vpos;
-
-		for (size_t _c = c; _c < grid->cols; ++_c) {
-			widget_t **cell = widget_at(grid, r, _c);
-			if (cell && *cell == child) {
-				widget_width += cell_width;
-			} else {
-				break;
-			}
-		}
-
-		for (size_t _r = r; _r < grid->rows; ++_r) {
-			widget_t **cell = widget_at(grid, _r, c);
-			if (cell && *cell == child) {
-				widget_height += cell_height;
-			} else {
-				break;
-			}
-		}
-
-		if (widget_width > 0 && widget_height > 0) {
-			child->rearrange(child,
-			    widget_hpos, widget_vpos, widget_width, widget_height);
-		}
-	}
+			
+			cur_vpos += heights[r].val;
+		}
+	}
+	
+	if (widths)
+		free(widths);
+	
+	if (heights)
+		free(heights);
 }
 
@@ -155,8 +297,10 @@
 {
 	paint_internal(widget);
+	
 	list_foreach(widget->children, link) {
 		widget_t *child = list_get_instance(link, widget_t, link);
 		child->repaint(child);
 	}
+	
 	window_damage(widget->window);
 }
@@ -164,5 +308,5 @@
 static void grid_handle_keyboard_event(widget_t *widget, kbd_event_t event)
 {
-	/* no-op */
+	/* No-op */
 }
 
@@ -170,55 +314,69 @@
 {
 	grid_t *grid = (grid_t *) widget;
-
-	if ((widget->height / grid->rows) == 0) {
-		return;
-	}
-	if ((widget->width / grid->cols) == 0) {
-		return;
-	}
-
-	sysarg_t row = (event.vpos - widget->vpos) / (widget->height / grid->rows);
-	sysarg_t col = (event.hpos - widget->hpos) / (widget->width / grid->cols);
-
-	widget_t **cell = widget_at(grid, row, col);
-	if (cell && *cell) {
-		(*cell)->handle_position_event(*cell, event);
-	}
-}
-
-static void grid_add(grid_t *grid, widget_t *widget,
-    size_t row, size_t col, size_t rows, size_t cols)
-{
-	assert(row + rows <= grid->rows);
-	assert(col + cols <= grid->cols);
-
+	
+	grid_cell_t *cell = grid_coords_at(grid, event.hpos, event.vpos);
+	if ((cell) && (cell->widget))
+		cell->widget->handle_position_event(cell->widget, event);
+}
+
+static bool grid_add(struct grid *grid, widget_t *widget, size_t col,
+    size_t row, size_t cols, size_t rows)
+{
+	if ((cols == 0) || (rows == 0) || (col + cols > grid->cols) ||
+	    (row + rows > grid->rows))
+		return false;
+	
+	grid_cell_t *cell = grid_cell_at(grid, col, row);
+	if (!cell)
+		return false;
+	
+	/*
+	 * Check whether the cell is not occupied by an
+	 * extension of a different cell.
+	 */
+	if ((!cell->widget) && (cell->cols > 0) && (cell->rows > 0))
+		return false;
+	
 	widget->parent = (widget_t *) grid;
+	
 	list_append(&widget->link, &grid->widget.children);
 	widget->window = grid->widget.window;
-
-	for (size_t r = row; r < row + rows; ++r) {
-		for (size_t c = col; c < col + cols; ++c) {
-			widget_t **cell = widget_at(grid, r, c);
-			if (cell) {
-				*cell = widget;
+	
+	/* Mark cells in layout */
+	for (size_t r = row; r < row + rows; r++) {
+		for (size_t c = col; c < col + cols; c++) {
+			if ((r == row) && (c == col)) {
+				cell->widget = widget;
+				cell->cols = cols;
+				cell->rows = rows;
+			} else {
+				grid_cell_t *extension = grid_cell_at(grid, c, r);
+				if (extension) {
+					extension->widget = NULL;
+					extension->cols = 1;
+					extension->rows = 1;
+				}
 			}
 		}
 	}
-}
-
-bool init_grid(grid_t *grid,
-    widget_t *parent, size_t rows, size_t cols, pixel_t background)
-{
-	assert(rows > 0);
-	assert(cols > 0);
-
-	widget_t **layout = (widget_t **) malloc(rows * cols * sizeof(widget_t *));
-	if (!layout) {
+	
+	return true;
+}
+
+bool init_grid(grid_t *grid, widget_t *parent, size_t cols, size_t rows,
+    pixel_t background)
+{
+	if ((cols == 0) || (rows == 0))
 		return false;
-	}
-	memset(layout, 0, rows * cols * sizeof(widget_t *));
-
+	
+	grid->layout =
+	    (grid_cell_t *) calloc(cols * rows, sizeof(grid_cell_t));
+	if (!grid->layout)
+		return false;
+	
+	memset(grid->layout, 0, cols * rows * sizeof(grid_cell_t));
+	
 	widget_init(&grid->widget, parent);
-
+	
 	grid->widget.destroy = grid_destroy;
 	grid->widget.reconfigure = grid_reconfigure;
@@ -227,27 +385,24 @@
 	grid->widget.handle_keyboard_event = grid_handle_keyboard_event;
 	grid->widget.handle_position_event = grid_handle_position_event;
-
+	
 	grid->add = grid_add;
 	grid->background = background;
+	grid->cols = cols;
 	grid->rows = rows;
-	grid->cols = cols;
-	grid->layout = layout;
-
+	
 	return true;
 }
 
-grid_t *create_grid(widget_t *parent, size_t rows, size_t cols, pixel_t background)
+grid_t *create_grid(widget_t *parent, size_t cols, size_t rows, pixel_t background)
 {
 	grid_t *grid = (grid_t *) malloc(sizeof(grid_t));
-	if (!grid) {
+	if (!grid)
 		return NULL;
-	}
-
-	if (init_grid(grid, parent, rows, cols, background)) {
+	
+	if (init_grid(grid, parent, cols, rows, background))
 		return grid;
-	} else {
-		free(grid);
-		return NULL;
-	}
+	
+	free(grid);
+	return NULL;
 }
 
Index: uspace/lib/gui/grid.h
===================================================================
--- uspace/lib/gui/grid.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/gui/grid.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -39,17 +39,19 @@
 #include <sys/types.h>
 #include <io/pixel.h>
-
 #include "widget.h"
 
-struct grid;
-typedef struct grid grid_t;
+typedef struct {
+	widget_t *widget;
+	size_t cols;
+	size_t rows;
+} grid_cell_t;
 
 typedef struct grid {
 	widget_t widget;
 	pixel_t background;
+	size_t cols;
 	size_t rows;
-	size_t cols;
-	widget_t **layout;
-	void (*add)(grid_t *, widget_t *, size_t, size_t, size_t, size_t);
+	grid_cell_t *layout;
+	bool (*add)(struct grid *, widget_t *, size_t, size_t, size_t, size_t);
 } grid_t;
 
Index: uspace/lib/gui/terminal.c
===================================================================
--- uspace/lib/gui/terminal.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/gui/terminal.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -77,5 +77,5 @@
 static void term_set_rgb_color(con_srv_t *, pixel_t, pixel_t);
 static void term_set_cursor_visibility(con_srv_t *, bool);
-static int term_get_event(con_srv_t *, kbd_event_t *);
+static int term_get_event(con_srv_t *, cons_event_t *);
 
 static con_ops_t con_ops = {
@@ -420,10 +420,11 @@
 		if (pos < size) {
 			link_t *link = prodcons_consume(&term->input_pc);
-			kbd_event_t *event = list_get_instance(link, kbd_event_t, link);
+			cons_event_t *event = list_get_instance(link, cons_event_t, link);
 			
 			/* Accept key presses of printable chars only. */
-			if ((event->type == KEY_PRESS) && (event->c != 0)) {
+			if (event->type == CEV_KEY && event->ev.key.type == KEY_PRESS &&
+			    event->ev.key.c != 0) {
 				wchar_t tmp[2] = {
-					event->c,
+					event->ev.key.c,
 					0
 				};
@@ -579,12 +580,12 @@
 }
 
-static int term_get_event(con_srv_t *srv, kbd_event_t *event)
+static int term_get_event(con_srv_t *srv, cons_event_t *event)
 {
 	terminal_t *term = srv_to_terminal(srv);
 	link_t *link = prodcons_consume(&term->input_pc);
-	kbd_event_t *kevent = list_get_instance(link, kbd_event_t, link);
-	
-	*event = *kevent;
-	free(kevent);
+	cons_event_t *ev = list_get_instance(link, cons_event_t, link);
+	
+	*event = *ev;
+	free(ev);
 	return EOK;
 }
@@ -634,30 +635,48 @@
 }
 
+static void terminal_queue_cons_event(terminal_t *term, cons_event_t *ev)
+{
+	/* Got key press/release event */
+	cons_event_t *event =
+	    (cons_event_t *) malloc(sizeof(cons_event_t));
+	if (event == NULL)
+		return;
+	
+	*event = *ev;
+	link_initialize(&event->link);
+	
+	prodcons_produce(&term->input_pc, &event->link);
+}
+
+/* Got key press/release event */
 static void terminal_handle_keyboard_event(widget_t *widget,
     kbd_event_t kbd_event)
 {
 	terminal_t *term = (terminal_t *) widget;
-	
-	/* Got key press/release event */
-	kbd_event_t *event =
-	    (kbd_event_t *) malloc(sizeof(kbd_event_t));
-	if (event == NULL)
-		return;
-	
-	link_initialize(&event->link);
-	event->type = kbd_event.type;
-	event->key = kbd_event.key;
-	event->mods = kbd_event.mods;
-	event->c = kbd_event.c;
-	
-	prodcons_produce(&term->input_pc, &event->link);
-}
-
-static void terminal_handle_position_event(widget_t *widget, pos_event_t event)
-{
-	/*
-	 * Mouse events are ignored so far.
-	 * There is no consumer for it.
-	 */
+	cons_event_t event;
+	
+	event.type = CEV_KEY;
+	event.ev.key = kbd_event;
+	
+	terminal_queue_cons_event(term, &event);
+}
+
+static void terminal_handle_position_event(widget_t *widget, pos_event_t pos_event)
+{
+	cons_event_t event;
+	terminal_t *term = (terminal_t *) widget;
+	sysarg_t sx = term->widget.hpos;
+	sysarg_t sy = term->widget.vpos;
+
+	if (pos_event.type == POS_PRESS) {
+		event.type = CEV_POS;
+		event.ev.pos.type = pos_event.type;
+		event.ev.pos.pos_id = pos_event.pos_id;
+		event.ev.pos.btn_num = pos_event.btn_num;
+
+		event.ev.pos.hpos = (pos_event.hpos - sx) / FONT_WIDTH;
+		event.ev.pos.vpos = (pos_event.vpos - sy) / FONT_SCANLINES;
+		terminal_queue_cons_event(term, &event);
+	}
 }
 
Index: uspace/lib/gui/window.c
===================================================================
--- uspace/lib/gui/window.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/gui/window.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -424,5 +424,7 @@
 
 	while (!list_empty(&win->events.list)) {
-		list_remove(list_first(&win->events.list));
+		window_event_t *event = (window_event_t *) list_first(&win->events.list);
+		list_remove(&event->link);
+		free(event);
 	}
 
Index: uspace/lib/nic/src/nic_addr_db.c
===================================================================
--- uspace/lib/nic/src/nic_addr_db.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/nic/src/nic_addr_db.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -70,5 +70,5 @@
 	nic_addr_entry_t *entry = member_to_inst(item, nic_addr_entry_t, link);
 	
-	return 0 == bcmp(entry->addr, key->addr, entry->len);
+	return memcmp(entry->addr, key->addr, entry->len) == 0;
 }
 
Index: uspace/lib/nic/src/nic_driver.c
===================================================================
--- uspace/lib/nic/src/nic_driver.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/nic/src/nic_driver.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -682,7 +682,7 @@
 	fibril_rwlock_initialize(&nic_data->wv_lock);
 	
-	bzero(&nic_data->mac, sizeof(nic_address_t));
-	bzero(&nic_data->default_mac, sizeof(nic_address_t));
-	bzero(&nic_data->stats, sizeof(nic_device_stats_t));
+	memset(&nic_data->mac, 0, sizeof(nic_address_t));
+	memset(&nic_data->default_mac, 0, sizeof(nic_address_t));
+	memset(&nic_data->stats, 0, sizeof(nic_device_stats_t));
 	
 	return nic_data;
Index: uspace/lib/nic/src/nic_impl.c
===================================================================
--- uspace/lib/nic/src/nic_impl.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/nic/src/nic_impl.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -129,5 +129,5 @@
 
 		fibril_rwlock_write_lock(&nic_data->stats_lock);
-		bzero(&nic_data->stats, sizeof (nic_device_stats_t));
+		memset(&nic_data->stats, 0, sizeof(nic_device_stats_t));
 		fibril_rwlock_write_unlock(&nic_data->stats_lock);
 
@@ -535,5 +535,5 @@
 		return ENOMEM;
 	}
-	bzero(virtue, sizeof (nic_wol_virtue_t));
+	memset(virtue, 0, sizeof(nic_wol_virtue_t));
 	if (length != 0) {
 		virtue->data = malloc(length);
Index: uspace/lib/nic/src/nic_rx_control.c
===================================================================
--- uspace/lib/nic/src/nic_rx_control.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/nic/src/nic_rx_control.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -55,5 +55,5 @@
 int nic_rxc_init(nic_rxc_t *rxc)
 {
-	bzero(rxc, sizeof (nic_rxc_t));
+	memset(rxc, 0, sizeof(nic_rxc_t));
 	int rc;
 	rc = nic_addr_db_init(&rxc->blocked_sources, ETH_ADDR);
Index: uspace/lib/nic/src/nic_wol_virtues.c
===================================================================
--- uspace/lib/nic/src/nic_wol_virtues.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/nic/src/nic_wol_virtues.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -73,5 +73,5 @@
 int nic_wol_virtues_init(nic_wol_virtues_t *wvs)
 {
-	bzero(wvs, sizeof(nic_wol_virtues_t));
+	memset(wvs, 0, sizeof(nic_wol_virtues_t));
 	wvs->table_operations.hash = nic_wv_hash;
 	wvs->table_operations.key_hash = nic_wv_key_hash;
Index: uspace/lib/posix/include/posix/fcntl.h
===================================================================
--- uspace/lib/posix/include/posix/fcntl.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/include/posix/fcntl.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -44,4 +44,8 @@
 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
 
+/* Dummy compatibility flag */
+#undef O_NOCTTY
+#define O_NOCTTY 0
+
 /* fcntl commands */
 #undef F_DUPFD
Index: uspace/lib/posix/include/posix/float.h
===================================================================
--- uspace/lib/posix/include/posix/float.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/include/posix/float.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -36,5 +36,30 @@
 #define POSIX_FLOAT_H_
 
-/* Empty. Just to satisfy preprocessor. */
+/* Rouding direction -1 - unknown */
+#define FLT_ROUNDS (-1)
+
+/* define some standard C constants in terms of GCC built-ins */
+#ifdef __GNUC__
+	#undef DBL_MANT_DIG
+	#define DBL_MANT_DIG __DBL_MANT_DIG__
+	#undef DBL_MIN_EXP
+	#define DBL_MIN_EXP __DBL_MIN_EXP__
+	#undef DBL_MAX_EXP
+	#define DBL_MAX_EXP __DBL_MAX_EXP__
+	#undef DBL_MAX
+	#define DBL_MAX __DBL_MAX__
+	#undef DBL_MAX_10_EXP
+	#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
+	#undef DBL_MIN_10_EXP
+	#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
+	#undef DBL_MIN
+	#define DBL_MIN __DBL_MIN__
+	#undef DBL_DIG
+	#define DBL_DIG __DBL_DIG__
+	#undef DBL_EPSILON
+	#define DBL_EPSILON __DBL_EPSILON__
+	#undef FLT_RADIX
+	#define FLT_RADIX __FLT_RADIX__
+#endif
 
 #endif /* POSIX_FLOAT_H_ */
Index: uspace/lib/posix/include/posix/limits.h
===================================================================
--- uspace/lib/posix/include/posix/limits.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/include/posix/limits.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -49,4 +49,8 @@
 #define PATH_MAX 256
 
+/* it's probably a safe assumption */
+#undef CHAR_BIT
+#define CHAR_BIT 8
+
 #endif /* POSIX_LIMITS_H_ */
 
Index: uspace/lib/posix/include/posix/math.h
===================================================================
--- uspace/lib/posix/include/posix/math.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/include/posix/math.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -36,11 +36,39 @@
 #define POSIX_MATH_H_
 
+#ifdef __GNUC__
+	#define HUGE_VAL (__builtin_huge_val())
+#endif
+
 /* Normalization Functions */
 extern double posix_ldexp(double x, int exp);
 extern double posix_frexp(double num, int *exp);
 
+double posix_fabs(double x);
+double posix_floor(double x);
+double posix_modf(double x, double *iptr);
+double posix_fmod(double x, double y);
+double posix_pow(double x, double y);
+double posix_exp(double x);
+double posix_sqrt(double x);
+double posix_log(double x);
+double posix_sin(double x);
+double posix_cos(double x);
+double posix_atan2(double y, double x);
+
 #ifndef LIBPOSIX_INTERNAL
 	#define ldexp posix_ldexp
 	#define frexp posix_frexp
+
+	#define fabs posix_fabs
+	#define floor posix_floor
+	#define modf posix_modf
+	#define fmod posix_fmod
+	#define pow posix_pow
+	#define exp posix_exp
+	#define sqrt posix_sqrt
+	#define log posix_log
+	#define sin posix_sin
+	#define cos posix_cos
+	#define atan2 posix_atan2
 #endif
 
Index: uspace/lib/posix/include/posix/stdio.h
===================================================================
--- uspace/lib/posix/include/posix/stdio.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/include/posix/stdio.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -61,4 +61,15 @@
 
 typedef struct _IO_FILE FILE;
+
+#ifndef LIBPOSIX_INTERNAL
+	enum _buffer_type {
+		/** No buffering */
+		_IONBF,
+		/** Line buffering */
+		_IOLBF,
+		/** Full buffering */
+		_IOFBF
+	};
+#endif
 
 extern FILE *stdin;
Index: uspace/lib/posix/source/math.c
===================================================================
--- uspace/lib/posix/source/math.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/source/math.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -62,4 +62,129 @@
 }
 
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_cos(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @param y
+ * @return
+ */
+double posix_pow(double x, double y)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_floor(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_fabs(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @param iptr
+ * @return
+ */
+double posix_modf(double x, double *iptr)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @param y
+ * @return
+ */
+double posix_fmod(double x, double y)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_log(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @param y
+ * @return
+ */
+double posix_atan2(double y, double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_sin(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_exp(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
+/**
+ * 
+ * @param x
+ * @return
+ */
+double posix_sqrt(double x)
+{
+	// TODO: Python dependency
+	not_implemented();
+}
+
 /** @}
  */
Index: uspace/lib/posix/source/strings.c
===================================================================
--- uspace/lib/posix/source/strings.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/posix/source/strings.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -131,5 +131,5 @@
 int posix_bcmp(const void *mem1, const void *mem2, size_t n)
 {
-	return bcmp(mem1, mem2, n);
+	return memcmp(mem1, mem2, n);
 }
 
@@ -155,5 +155,5 @@
 void posix_bzero(void *mem, size_t n)
 {
-	bzero(mem, n);
+	memset(mem, 0, n);
 }
 
Index: uspace/lib/usb/src/debug.c
===================================================================
--- uspace/lib/usb/src/debug.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/lib/usb/src/debug.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -84,5 +84,5 @@
 	 * Remove previous string.
 	 */
-	bzero(buffer_dump[buffer_dump_index], BUFFER_DUMP_LEN);
+	memset(buffer_dump[buffer_dump_index], 0, BUFFER_DUMP_LEN);
 
 	/* Do the actual dump. */
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/devman/main.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -735,5 +735,5 @@
 {
 	client_t *client;
-	driver_t *driver;
+	driver_t *driver = NULL;
 	
 	/* Accept the connection. */
Index: uspace/srv/fs/cdfs/cdfs_ops.c
===================================================================
--- uspace/srv/fs/cdfs/cdfs_ops.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/cdfs/cdfs_ops.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -660,5 +660,5 @@
 	 */
 	if ((vol_desc->type != VOL_DESC_PRIMARY) ||
-	    (bcmp(vol_desc->standard_ident, CDFS_STANDARD_IDENT, 5) != 0) ||
+	    (memcmp(vol_desc->standard_ident, CDFS_STANDARD_IDENT, 5) != 0) ||
 	    (vol_desc->version != 1)) {
 		block_put(block);
Index: uspace/srv/fs/fat/fat_dentry.c
===================================================================
--- uspace/srv/fs/fat/fat_dentry.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/fat/fat_dentry.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -44,4 +44,5 @@
 #include <assert.h>
 #include <unistd.h>
+#include <sys/types.h>
 
 /** Compare path component with the name read from the dentry.
@@ -232,5 +233,6 @@
 /** Get number of bytes in a string with size limit.
  *
- * @param str  NULL-terminated (or not) string.
+ * @param str  NULL-terminated (or not) string. The pointer comes from a packed
+ *             structure and as such is expected to be unaligned. 
  * @param size Maximum number of bytes to consider.
  *
@@ -238,5 +240,5 @@
  *
  */
-size_t fat_lfn_str_nlength(const uint16_t *str, size_t size)
+size_t fat_lfn_str_nlength(const unaligned_uint16_t *str, size_t size)
 {
 	size_t offset = 0;
Index: uspace/srv/fs/fat/fat_dentry.h
===================================================================
--- uspace/srv/fs/fat/fat_dentry.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/fat/fat_dentry.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -37,4 +37,5 @@
 #include <stdint.h>
 #include <stdbool.h>
+#include <sys/types.h>
 
 #define IS_D_CHAR(ch) (isalnum(ch) || ch == '_')
@@ -132,5 +133,4 @@
 } __attribute__ ((packed)) fat_dentry_t;
 
-
 extern int fat_dentry_namecmp(char *, const char *);
 extern void fat_dentry_name_get(const fat_dentry_t *, char *);
@@ -139,5 +139,5 @@
 extern uint8_t fat_dentry_chksum(uint8_t *);
 
-extern size_t fat_lfn_str_nlength(const uint16_t *, size_t);
+extern size_t fat_lfn_str_nlength(const unaligned_uint16_t *, size_t);
 extern size_t fat_lfn_size(const fat_dentry_t *);
 extern size_t fat_lfn_get_entry(const fat_dentry_t *, uint16_t *, size_t *);
Index: uspace/srv/fs/fat/fat_directory.c
===================================================================
--- uspace/srv/fs/fat/fat_directory.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/fat/fat_directory.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -516,6 +516,6 @@
 			return false;
 		case FAT_DENTRY_VALID:
-			if (bcmp(de->name, d->name,
-			    FAT_NAME_LEN + FAT_EXT_LEN)==0)
+			if (memcmp(de->name, d->name,
+			    FAT_NAME_LEN + FAT_EXT_LEN) == 0)
 				return true;
 			break;
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -651,5 +651,5 @@
 		d = (fat_dentry_t *) b->data;
 		if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) ||
-		    (bcmp(d->name, FAT_NAME_DOT, FAT_NAME_LEN)) == 0) {
+		    (memcmp(d->name, FAT_NAME_DOT, FAT_NAME_LEN)) == 0) {
 			memset(d, 0, sizeof(fat_dentry_t));
 			memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN);
@@ -661,5 +661,5 @@
 		d++;
 		if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) ||
-		    (bcmp(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN) == 0)) {
+		    (memcmp(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN) == 0)) {
 			memset(d, 0, sizeof(fat_dentry_t));
 			memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN);
@@ -1042,7 +1042,7 @@
 	info = (fat32_fsinfo_t *) b->data;
 
-	if (bcmp(info->sig1, FAT32_FSINFO_SIG1, sizeof(info->sig1)) ||
-	    bcmp(info->sig2, FAT32_FSINFO_SIG2, sizeof(info->sig2)) ||
-	    bcmp(info->sig3, FAT32_FSINFO_SIG3, sizeof(info->sig3))) {
+	if (memcmp(info->sig1, FAT32_FSINFO_SIG1, sizeof(info->sig1)) != 0 ||
+	    memcmp(info->sig2, FAT32_FSINFO_SIG2, sizeof(info->sig2)) != 0 ||
+	    memcmp(info->sig3, FAT32_FSINFO_SIG3, sizeof(info->sig3)) != 0) {
 		(void) block_put(b);
 		return EINVAL;
Index: uspace/srv/fs/mfs/mfs_dentry.c
===================================================================
--- uspace/srv/fs/mfs/mfs_dentry.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/mfs/mfs_dentry.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -178,5 +178,5 @@
 
 		if (name_len == d_name_len &&
-		    !bcmp(d_info.d_name, d_name, name_len)) {
+		    memcmp(d_info.d_name, d_name, name_len) == 0) {
 
 			d_info.d_inum = 0;
Index: uspace/srv/fs/mfs/mfs_ops.c
===================================================================
--- uspace/srv/fs/mfs/mfs_ops.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/mfs/mfs_ops.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -452,5 +452,5 @@
 
 		if (comp_size == dentry_name_size &&
-		    !bcmp(component, d_info.d_name, dentry_name_size)) {
+		    memcmp(component, d_info.d_name, dentry_name_size) == 0) {
 			/* Hit! */
 			mfs_node_core_get(rfn, mnode->instance,
Index: uspace/srv/fs/udf/udf_volume.c
===================================================================
--- uspace/srv/fs/udf/udf_volume.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/fs/udf/udf_volume.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -262,9 +262,9 @@
 		 * and Descriptor char set field.
 		 */
-		if ((bcmp((uint8_t *) pvd[i].volume_id,
+		if ((memcmp((uint8_t *) pvd[i].volume_id,
 		    (uint8_t *) desc->volume_id, 32) == 0) &&
-		    (bcmp((uint8_t *) pvd[i].volume_set_id,
+		    (memcmp((uint8_t *) pvd[i].volume_set_id,
 		    (uint8_t *) desc->volume_set_id, 128) == 0) &&
-		    (bcmp((uint8_t *) &pvd[i].descriptor_charset,
+		    (memcmp((uint8_t *) &pvd[i].descriptor_charset,
 		    (uint8_t *) &desc->descriptor_charset, 64) == 0) &&
 		    (FLE32(desc->sequence_number) > FLE32(pvd[i].sequence_number))) {
@@ -301,7 +301,7 @@
 		 * Logic Volume Identifier and Descriptor char set field.
 		 */
-		if ((bcmp((uint8_t *) lvd[i].logical_volume_id,
+		if ((memcmp((uint8_t *) lvd[i].logical_volume_id,
 		    (uint8_t *) desc->logical_volume_id, 128) == 0) &&
-		    (bcmp((uint8_t *) &lvd[i].charset,
+		    (memcmp((uint8_t *) &lvd[i].charset,
 		    (uint8_t *) &desc->charset, 64) == 0) &&
 		    (FLE32(desc->sequence_number) > FLE32(lvd[i].sequence_number))) {
Index: uspace/srv/hid/compositor/Makefile
===================================================================
--- uspace/srv/hid/compositor/Makefile	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/hid/compositor/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -38,5 +38,4 @@
 
 IMAGES = \
-	gfx/helenos.tga \
 	gfx/nameic.tga
 
Index: uspace/srv/hid/compositor/compositor.c
===================================================================
--- uspace/srv/hid/compositor/compositor.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/hid/compositor/compositor.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -90,4 +90,5 @@
 typedef struct {
 	link_t link;
+	atomic_t ref_cnt;
 	service_id_t in_dsid;
 	service_id_t out_dsid;
@@ -138,4 +139,5 @@
 } viewport_t;
 
+static desktop_rect_t viewport_bound_rect;
 static FIBRIL_MUTEX_INITIALIZE(viewport_list_mtx);
 static LIST_INITIALIZE(viewport_list);
@@ -215,4 +217,5 @@
 
 	link_initialize(&win->link);
+	atomic_set(&win->ref_cnt, 0);
 	prodcons_initialize(&win->queue);
 	transform_identity(&win->transform);
@@ -232,5 +235,11 @@
 static void window_destroy(window_t *win)
 {
-	if (win) {
+	if (win && atomic_get(&win->ref_cnt) == 0) {
+		while (!list_empty(&win->queue.list)) {
+			window_event_t *event = (window_event_t *) list_first(&win->queue.list);
+			list_remove(&event->link);
+			free(event);
+		}
+
 		if (win->surface) {
 			surface_destroy(win->surface);
@@ -310,4 +319,52 @@
 }
 
+static void comp_restrict_pointers(void)
+{
+	fibril_mutex_lock(&viewport_list_mtx);
+
+	sysarg_t x_res = coord_origin;
+	sysarg_t y_res = coord_origin;
+	sysarg_t w_res = 0;
+	sysarg_t h_res = 0;
+
+	if (!list_empty(&viewport_list)) {
+		viewport_t *vp = (viewport_t *) list_first(&viewport_list);
+		x_res = vp->pos.x;
+		y_res = vp->pos.y;
+		surface_get_resolution(vp->surface, &w_res, &h_res);
+	}
+
+	list_foreach(viewport_list, link) {
+		viewport_t *vp = list_get_instance(link, viewport_t, link);
+		sysarg_t w_vp, h_vp;
+		surface_get_resolution(vp->surface, &w_vp, &h_vp);
+		rectangle_union(
+		    x_res, y_res, w_res, h_res,
+		    vp->pos.x, vp->pos.y, w_vp, h_vp,
+		    &x_res, &y_res, &w_res, &h_res);
+	}
+
+	viewport_bound_rect.x = x_res;
+	viewport_bound_rect.y = y_res;
+	viewport_bound_rect.w = w_res;
+	viewport_bound_rect.h = h_res;
+
+	fibril_mutex_unlock(&viewport_list_mtx);
+
+	fibril_mutex_lock(&pointer_list_mtx);
+
+	list_foreach(pointer_list, link) {
+		pointer_t *ptr = list_get_instance(link, pointer_t, link);
+		ptr->pos.x = ptr->pos.x > viewport_bound_rect.x ? ptr->pos.x : viewport_bound_rect.x;
+		ptr->pos.y = ptr->pos.y > viewport_bound_rect.y ? ptr->pos.y : viewport_bound_rect.y;
+		ptr->pos.x = ptr->pos.x < viewport_bound_rect.x + viewport_bound_rect.w ?
+		    ptr->pos.x : viewport_bound_rect.x + viewport_bound_rect.w;
+		ptr->pos.y = ptr->pos.y < viewport_bound_rect.y + viewport_bound_rect.h ?
+		    ptr->pos.y : viewport_bound_rect.y + viewport_bound_rect.h;
+	}
+
+	fibril_mutex_unlock(&pointer_list_mtx);
+}
+
 static void comp_damage(sysarg_t x_dmg_glob, sysarg_t y_dmg_glob,
     sysarg_t w_dmg_glob, sysarg_t h_dmg_glob)
@@ -695,4 +752,15 @@
 	}
 
+	loc_service_unregister(win->in_dsid);
+	loc_service_unregister(win->out_dsid);
+
+	/* In case the client was killed, input fibril of the window might be
+	 * still blocked on the condition within comp_window_get_event. */
+	window_event_t *event_dummy = (window_event_t *) malloc(sizeof(window_event_t));
+	if (event_dummy) {
+		link_initialize(&event_dummy->link);
+		prodcons_produce(&win->queue, &event_dummy->link);
+	}
+
 	/* Calculate damage. */
 	sysarg_t x = 0;
@@ -706,12 +774,4 @@
 	}
 
-	/* Release window resources. */
-	loc_service_unregister(win->in_dsid);
-	loc_service_unregister(win->out_dsid);
-	while (!list_empty(&win->queue.list)) {
-		list_remove(list_first(&win->queue.list));
-	}
-	window_destroy(win);
-
 	comp_damage(x, y, width, height);
 
@@ -813,4 +873,5 @@
 
 	if (win) {
+		atomic_inc(&win->ref_cnt);
 		async_answer_0(iid, EOK);
 	} else {
@@ -825,5 +886,7 @@
 
 			if (!IPC_GET_IMETHOD(call)) {
-				async_answer_0(callid, EINVAL);
+				async_answer_0(callid, EOK);
+				atomic_dec(&win->ref_cnt);
+				window_destroy(win);
 				return;
 			}
@@ -842,5 +905,7 @@
 
 			if (!IPC_GET_IMETHOD(call)) {
-				async_answer_0(callid, EINVAL);
+				comp_window_close(win, callid, &call);
+				atomic_dec(&win->ref_cnt);
+				window_destroy(win);
 				return;
 			}
@@ -857,5 +922,7 @@
 				break;
 			case WINDOW_CLOSE:
-				comp_window_close(win, callid, &call);
+				/* Postpone the closing until the phone is hung up to cover
+				 * the case when the client is killed abruptly. */
+				async_answer_0(callid, EOK);
 				break;
 			case WINDOW_CLOSE_REQUEST:
@@ -911,4 +978,5 @@
 	async_answer_0(iid, EOK);
 
+	comp_restrict_pointers();
 	comp_damage(0, 0, UINT32_MAX, UINT32_MAX);
 }
@@ -956,4 +1024,7 @@
 		fibril_mutex_unlock(&viewport_list_mtx);
 		async_answer_0(iid, EOK);
+
+		comp_restrict_pointers();
+		comp_damage(0, 0, UINT32_MAX, UINT32_MAX);
 	}
 }
@@ -1391,4 +1462,16 @@
 	surface_get_resolution(pointer->cursor.states[pointer->state], 
 	     &cursor_width, &cursor_height);
+	if (pointer->pos.x + dx < viewport_bound_rect.x) {
+		dx = -1 * (pointer->pos.x - viewport_bound_rect.x);
+	}
+	if (pointer->pos.y + dy < viewport_bound_rect.y) {
+		dy = -1 * (pointer->pos.y - viewport_bound_rect.y);
+	}
+	if (pointer->pos.x + dx > viewport_bound_rect.x + viewport_bound_rect.w) {
+		dx = (viewport_bound_rect.x + viewport_bound_rect.w - pointer->pos.x);
+	}
+	if (pointer->pos.y + dy > viewport_bound_rect.y + viewport_bound_rect.h) {
+		dy = (viewport_bound_rect.y + viewport_bound_rect.h - pointer->pos.y);
+	}
 	pointer->pos.x += dx;
 	pointer->pos.y += dy;
@@ -1910,4 +1993,5 @@
 			fibril_mutex_unlock(&viewport_list_mtx);
 
+			comp_restrict_pointers();
 			comp_damage(x, y, width, height);
 		} else {
@@ -1962,9 +2046,5 @@
 		}
 		list_prepend(&blue_win->link, &window_list);
-
-		window_t *helenos_win = window_create(0, 0);
-		helenos_win->surface = decode_tga((void *) helenos_tga, helenos_tga_size, 0);
-		list_prepend(&helenos_win->link, &window_list);
-
+		
 		window_t *nameic_win = window_create(0, 0);
 		nameic_win->surface = decode_tga((void *) nameic_tga, nameic_tga_size, 0);
@@ -2131,5 +2211,6 @@
 		return -1;
 	}
-	
+
+	comp_restrict_pointers();
 	comp_damage(0, 0, UINT32_MAX, UINT32_MAX);
 	
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/hid/console/console.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -129,5 +129,5 @@
 static void cons_set_rgb_color(con_srv_t *, pixel_t, pixel_t);
 static void cons_set_cursor_visibility(con_srv_t *, bool);
-static int cons_get_event(con_srv_t *, kbd_event_t *);
+static int cons_get_event(con_srv_t *, cons_event_t *);
 
 static con_ops_t con_ops = {
@@ -490,5 +490,5 @@
 }
 
-static int cons_get_event(con_srv_t *srv, kbd_event_t *event)
+static int cons_get_event(con_srv_t *srv, cons_event_t *event)
 {
 	console_t *cons = srv_to_console(srv);
@@ -496,5 +496,6 @@
 	kbd_event_t *kevent = list_get_instance(link, kbd_event_t, link);
 	
-	*event = *kevent;
+	event->type = CEV_KEY;
+	event->ev.key = *kevent;
 	free(kevent);
 	return EOK;
Index: uspace/srv/hid/remcons/remcons.c
===================================================================
--- uspace/srv/hid/remcons/remcons.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/hid/remcons/remcons.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -80,5 +80,5 @@
 static int remcons_get_size(con_srv_t *, sysarg_t *, sysarg_t *);
 static int remcons_get_color_cap(con_srv_t *, console_caps_t *);
-static int remcons_get_event(con_srv_t *, kbd_event_t *);
+static int remcons_get_event(con_srv_t *, cons_event_t *);
 
 static con_ops_t con_ops = {
@@ -185,10 +185,11 @@
 }
 
-static int remcons_get_event(con_srv_t *srv, kbd_event_t *event)
-{
-	telnet_user_t *user = srv_to_user(srv);
+static int remcons_get_event(con_srv_t *srv, cons_event_t *event)
+{
+	telnet_user_t *user = srv_to_user(srv);
+	kbd_event_t kevent;
 	int rc;
 
-	rc = telnet_user_get_next_keyboard_event(user, event);
+	rc = telnet_user_get_next_keyboard_event(user, &kevent);
 	if (rc != EOK) {
 		/* XXX What? */
@@ -196,4 +197,7 @@
 		return EOK;
 	}
+
+	event->type = CEV_KEY;
+	event->ev.key = kevent;
 
 	return EOK;
Index: uspace/srv/net/dnsrsrv/Makefile
===================================================================
--- uspace/srv/net/dnsrsrv/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/Makefile	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2012 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../../..
+BINARY = dnsrsrv
+
+SOURCES = \
+	dns_msg.c \
+	dnsrsrv.c \
+	query.c \
+	transport.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/srv/net/dnsrsrv/dns_msg.c
===================================================================
--- uspace/srv/net/dnsrsrv/dns_msg.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/dns_msg.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,698 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <bitops.h>
+#include <byteorder.h>
+#include <errno.h>
+#include <io/log.h>
+#include <macros.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <str.h>
+
+#include "dns_msg.h"
+#include "dns_std.h"
+
+#define NAME  "dnsres"
+
+static uint16_t dns_uint16_t_decode(uint8_t *, size_t);
+
+/** Extend dynamically allocated string with suffix.
+ *
+ * @a *dstr points to a dynamically alocated buffer containing a string.
+ * Reallocate this buffer so that concatenation of @a *dstr and @a suff can
+ * fit in and append @a suff.
+ */
+static int dns_dstr_ext(char **dstr, const char *suff)
+{
+	size_t s1, s2;
+	size_t nsize;
+	char *nstr;
+
+	if (*dstr == NULL) {
+		*dstr = str_dup(suff);
+		if (*dstr == NULL)
+			return ENOMEM;
+		return EOK;
+	}
+
+	s1 = str_size(*dstr);
+	s2 = str_size(suff);
+	nsize = s1 + s2 + 1;
+
+	nstr = realloc(*dstr, nsize);
+	if (nstr == NULL)
+		return ENOMEM;
+
+	str_cpy((*dstr) + s1, nsize - s1, suff);
+
+	*dstr = nstr;
+	return EOK;
+}
+
+/** Encode DNS name.
+ *
+ * Encode DNS name or measure the size of encoded name (with @a buf NULL,
+ * and @a buf_size 0).
+ *
+ * @param name		String to encode
+ * @param buf		Buffer or NULL
+ * @param buf_size      Buffer size or 0 if @a buf is NULL
+ * @param act_size	Place to store actual encoded size
+ */
+static int dns_name_encode(char *name, uint8_t *buf, size_t buf_size,
+    size_t *act_size)
+{
+	size_t off;
+	wchar_t c;
+	size_t lsize;
+	size_t pi, di;
+
+	pi = 0;
+	di = 1;
+	off = 0;
+
+	lsize = 0;
+	while (true) {
+		c = str_decode(name, &off, STR_NO_LIMIT);
+		if (c >= 127) {
+			/* Non-ASCII character */
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "Non-ascii character");
+			return EINVAL;
+		}
+
+		if (c == '.' || c == '\0') {
+			/* Empty string, starting with period or two consecutive periods. */
+			if (lsize == 0) {
+				log_msg(LOG_DEFAULT, LVL_DEBUG, "Empty token");
+				return EINVAL;
+			}
+
+			if (lsize > DNS_LABEL_MAX_SIZE) {
+				/* Label too long */
+				log_msg(LOG_DEFAULT, LVL_DEBUG, "Label too long");
+				return EINVAL;
+			}
+
+			if (buf != NULL && pi < buf_size)
+				buf[pi] = (uint8_t)lsize;
+
+			lsize = 0;
+			pi = di;
+			++di;
+
+			if (c == '\0')
+				break;
+		} else {
+			if (buf != NULL && di < buf_size)
+				buf[di] = c;
+			++di;
+			++lsize;
+		}
+	}
+
+	if (buf != NULL && pi < buf_size)
+		buf[pi] = 0;
+
+	*act_size = di;
+	return EOK;
+}
+
+/** Decode DNS name.
+ *
+ * @param pdu	PDU from which we are decoding
+ * @param boff	Starting offset within PDU
+ * @param rname	Place to return dynamically allocated string
+ * @param eoff	Place to store end offset (offset after last decoded byte)
+ */
+int dns_name_decode(dns_pdu_t *pdu, size_t boff, char **rname,
+    size_t *eoff)
+{
+	uint8_t *bp;
+	size_t bsize;
+	size_t lsize;
+	size_t i;
+	size_t ptr;
+	size_t eptr;
+	char *name;
+	char dbuf[2];
+	int rc;
+	bool first;
+
+	name = NULL;
+
+	if (boff > pdu->size)
+		return EINVAL;
+
+	bp = pdu->data + boff;
+	bsize = min(pdu->size - boff, DNS_NAME_MAX_SIZE);
+	first = true;
+	*eoff = 0;
+
+	while (true) {
+		if (bsize == 0) {
+			rc = EINVAL;
+			goto error;
+		}
+
+		lsize = *bp;
+		++bp;
+		--bsize;
+
+		if (lsize == 0)
+			break;
+
+		if (!first) {
+			rc = dns_dstr_ext(&name, ".");
+			if (rc != EOK) {
+				rc = ENOMEM;
+				goto error;
+			}
+		}
+
+		if ((lsize & 0xc0) == 0xc0) {
+			/* Pointer */
+			if (bsize < 1) {
+				log_msg(LOG_DEFAULT, LVL_DEBUG, "Pointer- bsize < 1");
+				rc = EINVAL;
+				goto error;
+			}
+
+			ptr = dns_uint16_t_decode(bp - 1, bsize) & 0x3fff;
+			++bp;
+			--bsize;
+
+			if (ptr >= (size_t)(bp - pdu->data)) {
+				log_msg(LOG_DEFAULT, LVL_DEBUG,
+				    "Pointer- forward ref %zu, pos=%zu",
+				    ptr, (size_t)(bp - pdu->data));
+				/* Forward reference */
+				rc = EINVAL;
+				goto error;
+			}
+
+			/*
+			 * Make sure we will not decode any byte twice.
+			 * XXX Is assumption correct?
+			 */
+			eptr = bp - pdu->data;
+			/*
+			 * This is where encoded name ends in terms where
+			 * the message continues
+			 */
+			*eoff = eptr;
+
+			bp = pdu->data + ptr;
+			bsize = eptr - ptr;
+			continue;
+		}
+
+		if (lsize > bsize) {
+			rc = EINVAL;
+			goto error;
+		}
+
+		for (i = 0; i < lsize; i++) {
+			if (*bp < 32 || *bp >= 127) {
+				rc = EINVAL;
+				goto error;
+			}
+
+			dbuf[0] = *bp;
+			dbuf[1] = '\0';
+
+			rc = dns_dstr_ext(&name, dbuf);
+			if (rc != EOK) {
+				rc = ENOMEM;
+				goto error;
+			}
+			++bp;
+			--bsize;
+		}
+
+		first = false;
+	}
+
+	*rname = name;
+	if (*eoff == 0)
+		*eoff = bp - pdu->data;
+	return EOK;
+error:
+	free(name);
+	return rc;
+}
+
+/** Decode unaligned big-endian 16-bit integer */
+static uint16_t dns_uint16_t_decode(uint8_t *buf, size_t buf_size)
+{
+	assert(buf_size >= 2);
+
+	return ((uint16_t)buf[0] << 8) + buf[1];
+}
+
+/** Encode unaligned big-endian 16-bit integer */
+static void dns_uint16_t_encode(uint16_t w, uint8_t *buf, size_t buf_size)
+{
+	if (buf != NULL && buf_size >= 1)
+		buf[0] = w >> 8;
+
+	if (buf != NULL && buf_size >= 2)
+		buf[1] = w & 0xff;
+}
+
+/** Decode unaligned big-endian 32-bit integer */
+uint32_t dns_uint32_t_decode(uint8_t *buf, size_t buf_size)
+{
+	uint32_t w;
+	assert(buf_size >= 4);
+
+	w = ((uint32_t)buf[0] << 24) +
+	    ((uint32_t)buf[1] << 16) +
+	    ((uint32_t)buf[2] << 8) +
+	    buf[3];
+
+	return w;
+}
+
+/** Encode DNS question.
+ *
+ * Encode DNS question or measure the size of encoded question (with @a buf NULL,
+ * and @a buf_size 0).
+ *
+ * @param question	Question to encode
+ * @param buf		Buffer or NULL
+ * @param buf_size      Buffer size or 0 if @a buf is NULL
+ * @param act_size	Place to store actual encoded size
+ */
+static int dns_question_encode(dns_question_t *question, uint8_t *buf,
+    size_t buf_size, size_t *act_size)
+{
+	size_t name_size;
+	size_t di;
+	int rc;
+
+	rc = dns_name_encode(question->qname, buf, buf_size, &name_size);
+	if (rc != EOK)
+		return rc;
+
+	*act_size = name_size + sizeof(uint16_t) + sizeof(uint16_t);
+	if (buf == NULL)
+		return EOK;
+
+	di = name_size;
+
+	dns_uint16_t_encode(question->qtype, buf + di, buf_size - di);
+	di += sizeof(uint16_t);
+
+	dns_uint16_t_encode(question->qclass, buf + di, buf_size - di);
+	di += sizeof(uint16_t);
+
+	return EOK;
+}
+
+/** Decode DNS question.
+ *
+ * @param pdu		PDU from which we are decoding
+ * @param boff		Starting offset within PDU
+ * @param rquestion	Place to return dynamically allocated question
+ * @param eoff		Place to store end offset (offset after last decoded byte)
+ */
+static int dns_question_decode(dns_pdu_t *pdu, size_t boff,
+    dns_question_t **rquestion, size_t *eoff)
+{
+	dns_question_t *question;
+	size_t name_eoff;
+	int rc;
+
+	question = calloc(1, sizeof (dns_question_t));
+	if (question == NULL)
+		return ENOMEM;
+
+	rc = dns_name_decode(pdu, boff, &question->qname, &name_eoff);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_DEBUG, "Error decoding name");
+		free(question);
+		return ENOMEM;
+	}
+
+	if (name_eoff + 2 * sizeof(uint16_t) > pdu->size) {
+		free(question);
+		return EINVAL;
+	}
+
+	question->qtype = dns_uint16_t_decode(pdu->data + name_eoff,
+	    pdu->size - name_eoff);
+	question->qclass = dns_uint16_t_decode(pdu->data + sizeof(uint16_t)
+	    + name_eoff, pdu->size - sizeof(uint16_t) - name_eoff);
+	*eoff = name_eoff + 2 * sizeof(uint16_t);
+
+	*rquestion = question;
+	return EOK;
+}
+
+/** Decode DNS resource record.
+ *
+ * @param pdu		PDU from which we are decoding
+ * @param boff		Starting offset within PDU
+ * @param retrr		Place to return dynamically allocated resource record
+ * @param eoff		Place to store end offset (offset after last decoded byte)
+ */
+static int dns_rr_decode(dns_pdu_t *pdu, size_t boff, dns_rr_t **retrr,
+    size_t *eoff)
+{
+	dns_rr_t *rr;
+	size_t name_eoff;
+	uint8_t *bp;
+	size_t bsz;
+	size_t rdlength;
+	int rc;
+
+	rr = calloc(1, sizeof (dns_rr_t));
+	if (rr == NULL)
+		return ENOMEM;
+
+	rc = dns_name_decode(pdu, boff, &rr->name, &name_eoff);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_DEBUG, "Error decoding name");
+		free(rr);
+		return ENOMEM;
+	}
+
+	if (name_eoff + 2 * sizeof(uint16_t) > pdu->size) {
+		free(rr->name);
+		free(rr);
+		return EINVAL;
+	}
+
+	bp = pdu->data + name_eoff;
+	bsz = pdu->size - name_eoff;
+
+	if (bsz < 3 * sizeof(uint16_t) + sizeof(uint32_t)) {
+		free(rr->name);
+		free(rr);
+		return EINVAL;
+	}
+
+	rr->rtype = dns_uint16_t_decode(bp, bsz);
+	bp += sizeof(uint16_t); bsz -= sizeof(uint16_t);
+
+	rr->rclass = dns_uint16_t_decode(bp, bsz);
+	bp += sizeof(uint16_t); bsz -= sizeof(uint16_t);
+
+	rr->ttl = dns_uint32_t_decode(bp, bsz);
+	bp += sizeof(uint32_t); bsz -= sizeof(uint32_t);
+
+	rdlength = dns_uint16_t_decode(bp, bsz);
+	bp += sizeof(uint16_t); bsz -= sizeof(uint16_t);
+
+	if (rdlength > bsz) {
+		free(rr->name);
+		free(rr);
+		return EINVAL;
+	}
+
+	rr->rdata_size = rdlength;
+	rr->rdata = calloc(1, sizeof(rdlength));
+	if (rr->rdata == NULL) {
+		free(rr->name);
+		free(rr);
+		return ENOMEM;
+	}
+
+	memcpy(rr->rdata, bp, rdlength);
+	rr->roff = bp - pdu->data;
+	bp += rdlength;
+	bsz -= rdlength;
+
+	*eoff = bp - pdu->data;
+	*retrr = rr;
+	return EOK;
+}
+
+/** Encode DNS message.
+ *
+ * @param msg	Message
+ * @param rdata	Place to store encoded data pointer
+ * @param rsize	Place to store encoded data size
+ *
+ * @return 	EOK on success, EINVAL if message contains invalid data,
+ *		ENOMEM if out of memory
+ */
+int dns_message_encode(dns_message_t *msg, void **rdata, size_t *rsize)
+{
+	uint8_t *data;
+	size_t size;
+	dns_header_t hdr;
+	size_t q_size;
+	size_t di;
+	int rc;
+
+	hdr.id = host2uint16_t_be(msg->id);
+
+	hdr.opbits = host2uint16_t_be(
+	    (msg->qr << OPB_QR) |
+	    (msg->opcode << OPB_OPCODE_l) |
+	    (msg->aa ? BIT_V(uint16_t, OPB_AA) : 0) |
+	    (msg->tc ? BIT_V(uint16_t, OPB_TC) : 0) |
+	    (msg->rd ? BIT_V(uint16_t, OPB_RD) : 0) |
+	    (msg->ra ? BIT_V(uint16_t, OPB_RA) : 0) |
+	    msg->rcode
+	);
+
+	hdr.qd_count = host2uint16_t_be(list_count(&msg->question));
+	hdr.an_count = 0;
+	hdr.ns_count = 0;
+	hdr.ar_count = 0;
+
+	size = sizeof(dns_header_t);
+
+	list_foreach(msg->question, link) {
+		dns_question_t *q = list_get_instance(link, dns_question_t, msg);
+		rc = dns_question_encode(q, NULL, 0, &q_size);
+		if (rc != EOK)
+			return rc;
+
+		size += q_size;
+	}
+
+	data = calloc(1, size);
+	if (data == NULL)
+		return ENOMEM;
+
+	memcpy(data, &hdr, sizeof(dns_header_t));
+	di = sizeof(dns_header_t);
+
+	list_foreach(msg->question, link) {
+		dns_question_t *q = list_get_instance(link, dns_question_t, msg);
+		rc = dns_question_encode(q, data + di, size - di, &q_size);
+		if (rc != EOK) {
+			assert(rc == ENOMEM || rc == EINVAL);
+			free(data);
+			return rc;
+		}
+
+		di += q_size;
+	}
+
+	*rdata = data;
+	*rsize = size;
+	return EOK;
+}
+
+/** Decode DNS message.
+ *
+ * @param data	Encoded PDU data
+ * @param size	Encoded PDU size
+ * @param rmsg	Place to store pointer to decoded message
+ *
+ * @return	EOK on success, EINVAL if message contains invalid data,
+ * 		ENOMEM if out of memory
+ */
+int dns_message_decode(void *data, size_t size, dns_message_t **rmsg)
+{
+	dns_message_t *msg;
+	dns_header_t *hdr;
+	size_t doff;
+	size_t field_eoff;
+	dns_question_t *question;
+	dns_rr_t *rr;
+	size_t qd_count;
+	size_t an_count;
+	size_t i;
+	int rc;
+
+	msg = dns_message_new();
+	if (msg == NULL)
+		return ENOMEM;
+
+	if (size < sizeof(dns_header_t)) {
+		rc = EINVAL;
+		goto error;
+	}
+
+	/* Store a copy of raw message data for string decompression */
+
+	msg->pdu.data = malloc(size);
+	if (msg->pdu.data == NULL) {
+		rc = ENOMEM;
+		goto error;
+	}
+
+	memcpy(msg->pdu.data, data, size);
+	msg->pdu.size = size;
+	log_msg(LOG_DEFAULT, LVL_NOTE, "dns_message_decode: pdu->data = %p, "
+	    "pdu->size=%zu", msg->pdu.data, msg->pdu.size);
+
+	hdr = data;
+
+	msg->id = uint16_t_be2host(hdr->id);
+	msg->qr = BIT_RANGE_EXTRACT(uint16_t, OPB_QR, OPB_QR, hdr->opbits);
+	msg->opcode = BIT_RANGE_EXTRACT(uint16_t, OPB_OPCODE_h, OPB_OPCODE_l,
+	    hdr->opbits);
+	msg->aa = BIT_RANGE_EXTRACT(uint16_t, OPB_AA, OPB_AA, hdr->opbits);
+	msg->tc = BIT_RANGE_EXTRACT(uint16_t, OPB_TC, OPB_TC, hdr->opbits);
+	msg->rd = BIT_RANGE_EXTRACT(uint16_t, OPB_RD, OPB_RD, hdr->opbits);
+	msg->ra = BIT_RANGE_EXTRACT(uint16_t, OPB_RA, OPB_RA, hdr->opbits);
+	msg->rcode = BIT_RANGE_EXTRACT(uint16_t, OPB_RCODE_h, OPB_RCODE_l,
+	    hdr->opbits);
+
+	doff = sizeof(dns_header_t);
+
+	qd_count = uint16_t_be2host(hdr->qd_count);
+
+	for (i = 0; i < qd_count; i++) {
+		rc = dns_question_decode(&msg->pdu, doff, &question, &field_eoff);
+		if (rc != EOK) {
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "error decoding question");
+			goto error;
+		}
+
+		list_append(&question->msg, &msg->question);
+		doff = field_eoff;
+	}
+
+	an_count = uint16_t_be2host(hdr->an_count);
+
+	for (i = 0; i < an_count; i++) {
+		rc = dns_rr_decode(&msg->pdu, doff, &rr, &field_eoff);
+		if (rc != EOK) {
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "Error decoding answer");
+			goto error;
+		}
+
+		list_append(&rr->msg, &msg->answer);
+		doff = field_eoff;
+	}
+
+	*rmsg = msg;
+	return EOK;
+error:
+	dns_message_destroy(msg);
+	return rc;
+}
+
+/** Destroy question. */
+static void dns_question_destroy(dns_question_t *question)
+{
+	free(question->qname);
+	free(question);
+}
+
+/** Destroy resource record. */
+static void dns_rr_destroy(dns_rr_t *rr)
+{
+	free(rr->name);
+	free(rr->rdata);
+	free(rr);
+}
+
+/** Create new empty message. */
+dns_message_t *dns_message_new(void)
+{
+	dns_message_t *msg;
+
+	msg = calloc(1, sizeof(dns_message_t));
+	if (msg == NULL)
+		return NULL;
+
+	list_initialize(&msg->question);
+	list_initialize(&msg->answer);
+	list_initialize(&msg->authority);
+	list_initialize(&msg->additional);
+
+	return msg;
+}
+
+/** Destroy message. */
+void dns_message_destroy(dns_message_t *msg)
+{
+	link_t *link;
+	dns_question_t *question;
+	dns_rr_t *rr;
+
+	while (!list_empty(&msg->question)) {
+		link = list_first(&msg->question);
+		question = list_get_instance(link, dns_question_t, msg);
+		list_remove(&question->msg);
+		dns_question_destroy(question);
+	}
+
+	while (!list_empty(&msg->answer)) {
+		link = list_first(&msg->answer);
+		rr = list_get_instance(link, dns_rr_t, msg);
+		list_remove(&rr->msg);
+		dns_rr_destroy(rr);
+	}
+
+	while (!list_empty(&msg->authority)) {
+		link = list_first(&msg->authority);
+		rr = list_get_instance(link, dns_rr_t, msg);
+		list_remove(&rr->msg);
+		dns_rr_destroy(rr);
+	}
+
+	while (!list_empty(&msg->additional)) {
+		link = list_first(&msg->additional);
+		rr = list_get_instance(link, dns_rr_t, msg);
+		list_remove(&rr->msg);
+		dns_rr_destroy(rr);
+	}
+
+	free(msg->pdu.data);
+	free(msg);
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/dns_msg.h
===================================================================
--- uspace/srv/net/dnsrsrv/dns_msg.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/dns_msg.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DNS_MSG_H
+#define DNS_MSG_H
+
+#include <adt/list.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include "dns_std.h"
+#include "dns_type.h"
+
+extern int dns_message_encode(dns_message_t *, void **, size_t *);
+extern int dns_message_decode(void *, size_t, dns_message_t **);
+extern dns_message_t *dns_message_new(void);
+extern void dns_message_destroy(dns_message_t *);
+extern int dns_name_decode(dns_pdu_t *, size_t, char **, size_t *);
+extern uint32_t dns_uint32_t_decode(uint8_t *, size_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/dns_std.h
===================================================================
--- uspace/srv/net/dnsrsrv/dns_std.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/dns_std.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file DNS Standard definitions.
+ *
+ * From RFC 1035 Domain Names - Implementation and Specification
+ */
+
+#ifndef DNS_STD_H
+#define DNS_STD_H
+
+#include <stdint.h>
+
+/** From 2.3.4. Size Limits */
+enum dns_limits {
+	DNS_LABEL_MAX_SIZE	= 63,
+	DNS_NAME_MAX_SIZE	= 255,
+	DNS_UDP_MSG_MAX_SIZE	= 512
+};
+
+typedef enum dns_qtype {
+	DTYPE_A		= 1,
+	DTYPE_NS	= 2,
+	DTYPE_MD	= 3,
+	DTYPE_MF	= 4,
+	DTYPE_CNAME	= 5,
+	DTYPE_SOA	= 6,
+	DTYPE_MB	= 7,
+	DTYPE_MG	= 8,
+	DTYPE_MR	= 9,
+	DTYPE_NULL	= 10,
+	DTYPE_WKS	= 11,
+	DTYPE_PTR	= 12,
+	DTYPE_HINFO	= 13,
+	DTYPE_MINFO	= 14,
+	DTYPE_MX	= 15,
+	DTYPE_TXT	= 16,
+	DQTYPE_AXFR	= 252,
+	DQTYPE_MAILB	= 253,
+	DQTYPE_MAILA	= 254,
+	DQTYPE_ALL	= 255
+} dns_type_t, dns_qtype_t;
+
+typedef enum dns_qclass {
+	/** Internet */
+	DC_IN		= 1,
+	/** CSNET */
+	DC_CS		= 2,
+	/** CHAOS */
+	DC_CH		= 3,
+	/** Hesiod */
+	DC_HS		= 4,
+	/** Any class */
+	DQC_ANY		= 255
+} dns_class_t, dns_qclass_t;
+
+typedef struct {
+	/** Identifier assigned by the query originator */
+	uint16_t id;
+	/** QR, Opcode, AA, TC,RD, RA, Z, Rcode */
+	uint16_t opbits;
+	/** Number of entries in query section */
+	uint16_t qd_count;
+	/** Number of RRs in the answer section */
+	uint16_t an_count;
+	/** Number of name server RRs in the authority records section */
+	uint16_t ns_count;
+	/** Number of RRs in the additional records section */
+	uint16_t ar_count;
+} dns_header_t;
+
+/** Bits in dns_header_t.opbits.
+ *
+ * Note that bit numbers in RFC 1035 are reversed (0 is the most significant)
+ * but we use the standard notation (0 is the least significant).
+ */
+enum dns_opbits {
+	OPB_QR 		= 15,
+	OPB_OPCODE_h	= 14,
+	OPB_OPCODE_l	= 11,
+	OPB_AA		= 10,
+	OPB_TC		= 9,
+	OPB_RD		= 8,
+	OPB_RA		= 7,
+	OPB_Z_h		= 6,
+	OPB_Z_l		= 4,
+	OPB_RCODE_h	= 3,
+	OPB_RCODE_l	= 0
+};
+
+typedef enum dns_query_response {
+	QR_QUERY	= 0,
+	QR_RESPONSE	= 1
+} dns_query_response_t;
+
+typedef enum dns_opcode {
+	OPC_QUERY	= 0,
+	OPC_IQUERY	= 1,
+	OPC_STATUS	= 2
+} dns_opcode_t;
+
+typedef enum dns_rcode {
+	RC_OK		= 0,
+	RC_FMT_ERR	= 1,
+	RC_SRV_FAIL	= 2,
+	RC_NAME_ERR	= 3,
+	RC_NOT_IMPL	= 4,
+	RC_REFUSED	= 5
+} dns_rcode_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/dns_type.h
===================================================================
--- uspace/srv/net/dnsrsrv/dns_type.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/dns_type.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef DNS_TYPE_H
+#define DNS_TYPE_H
+
+#include <adt/list.h>
+#include <inet/inet.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include "dns_std.h"
+
+/** Encoded DNS PDU */
+typedef struct {
+	/** Encoded PDU data */
+	uint8_t *data;
+	/** Encoded PDU size */
+	size_t size;
+} dns_pdu_t;
+
+/** DNS message */
+typedef struct {
+	/* Encoded PDU */
+	dns_pdu_t pdu;
+
+	/** Identifier */
+	uint16_t id;
+	/** Query or Response */
+	dns_query_response_t qr;
+	/** Opcode */
+	dns_opcode_t opcode;
+	/** Authoritative Answer */
+	bool aa;
+	/** TrunCation */
+	bool tc;
+	/** Recursion Desired */
+	bool rd;
+	/** Recursion Available */
+	bool ra;
+	/** Response Code */
+	dns_rcode_t rcode;
+
+	list_t question; /* of dns_question_t */
+	list_t answer; /* of dns_rr_t */
+	list_t authority; /* of dns_rr_t */
+	list_t additional; /* of dns_rr_t */
+} dns_message_t;
+
+/** Unencoded DNS message question section */
+typedef struct {
+	link_t msg;
+	/** Domain name in text format (dot notation) */
+	char *qname;
+	/** Query type */
+	dns_qtype_t qtype;
+	/** Query class */
+	dns_qclass_t qclass;
+} dns_question_t;
+
+/** Unencoded DNS resource record */
+typedef struct {
+	link_t msg;
+	/** Domain name */
+	char *name;
+	/** RR type */
+	dns_type_t rtype;
+	/** Class of data */
+	dns_class_t rclass;
+	/** Time to live */
+	uint32_t ttl;
+
+	/** Resource data */
+	void *rdata;
+	/** Number of bytes in @c *rdata */
+	size_t rdata_size;
+	/** Offset in the raw message */
+	size_t roff;
+} dns_rr_t;
+
+/** Host information */
+typedef struct {
+	/** Host name */
+	char *cname;
+	/** Host address */
+	inet_addr_t addr;
+} dns_host_info_t;
+
+typedef struct {
+} dnsr_client_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/dnsrsrv.c
===================================================================
--- uspace/srv/net/dnsrsrv/dnsrsrv.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/dnsrsrv.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <async.h>
+#include <errno.h>
+#include <io/log.h>
+#include <ipc/dnsr.h>
+#include <ipc/services.h>
+#include <loc.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <task.h>
+
+#include "dns_msg.h"
+#include "dns_std.h"
+#include "query.h"
+#include "transport.h"
+
+#define NAME  "dnsres"
+
+static void dnsr_client_conn(ipc_callid_t, ipc_call_t *, void *);
+
+static int dnsr_init(void)
+{
+	int rc;
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "dnsr_init()");
+
+	rc = transport_init();
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed initializing tarnsport.");
+		return EIO;
+	}
+
+	async_set_client_connection(dnsr_client_conn);
+
+	rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server (%d).", rc);
+		transport_fini();
+		return EEXIST;
+	}
+
+	service_id_t sid;
+	rc = loc_service_register(SERVICE_NAME_DNSR, &sid);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service (%d).", rc);
+		transport_fini();
+		return EEXIST;
+	}
+
+	return EOK;
+}
+
+static void dnsr_name2host_srv(dnsr_client_t *client, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	char *name;
+	dns_host_info_t *hinfo;
+	ipc_callid_t rcallid;
+	size_t size;
+	sysarg_t retval;
+	size_t act_size;
+	int rc;
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srvaddr_srv()");
+
+	rc = async_data_write_accept((void **) &name, true, 0,
+	    DNS_NAME_MAX_SIZE, 0, NULL);
+	if (rc != EOK) {
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	if (!async_data_read_receive(&rcallid, &size)) {
+		async_answer_0(rcallid, EREFUSED);
+		async_answer_0(callid, EREFUSED);
+		return;
+	}
+
+	rc = dns_name2host(name, &hinfo);
+	if (rc != EOK) {
+		async_answer_0(rcallid, rc);
+		async_answer_0(callid, rc);
+		return;
+	}
+
+	act_size = str_size(hinfo->cname);
+	if (act_size > size) {
+		async_answer_0(rcallid, EOVERFLOW);
+		async_answer_0(callid, EOVERFLOW);
+		return;
+	}
+
+	retval = async_data_read_finalize(rcallid, hinfo->cname, act_size);
+	async_answer_1(callid, retval, hinfo->addr.ipv4);
+
+	dns_hostinfo_destroy(hinfo);
+}
+
+static void dnsr_get_srvaddr_srv(dnsr_client_t *client, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_get_srvaddr_srv()");
+	async_answer_1(callid, EOK, dns_server_addr.ipv4);
+}
+
+static void dnsr_set_srvaddr_srv(dnsr_client_t *client, ipc_callid_t callid,
+    ipc_call_t *call)
+{
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "dnsr_set_srvaddr_srv()");
+
+	dns_server_addr.ipv4 = IPC_GET_ARG1(*call);
+
+	async_answer_0(callid, EOK);
+}
+
+static void dnsr_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
+{
+	dnsr_client_t client;
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "dnsr_conn()");
+
+	/* Accept the connection */
+	async_answer_0(iid, EOK);
+
+	while (true) {
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+		sysarg_t method = IPC_GET_IMETHOD(call);
+
+		if (!method) {
+			/* The other side has hung up */
+			async_answer_0(callid, EOK);
+			return;
+		}
+
+		switch (method) {
+		case DNSR_NAME2HOST:
+			dnsr_name2host_srv(&client, callid, &call);
+			break;
+		case DNSR_GET_SRVADDR:
+			dnsr_get_srvaddr_srv(&client, callid, &call);
+			break;
+		case DNSR_SET_SRVADDR:
+			dnsr_set_srvaddr_srv(&client, callid, &call);
+			break;
+		default:
+			async_answer_0(callid, EINVAL);
+		}
+	}
+}
+
+int main(int argc, char *argv[])
+{
+	int rc;
+
+	printf("%s: DNS Resolution Service\n", NAME);
+
+	if (log_init(NAME) != EOK) {
+		printf(NAME ": Failed to initialize logging.\n");
+		return 1;
+	}
+
+	rc = dnsr_init();
+	if (rc != EOK)
+		return 1;
+
+	printf(NAME ": Accepting connections.\n");
+	task_retval(0);
+	async_manager();
+
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/query.c
===================================================================
--- uspace/srv/net/dnsrsrv/query.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/query.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <errno.h>
+#include <io/log.h>
+#include <mem.h>
+#include <stdlib.h>
+#include <str.h>
+
+#include "dns_msg.h"
+#include "dns_std.h"
+#include "dns_type.h"
+#include "query.h"
+#include "transport.h"
+
+static uint16_t msg_id;
+
+int dns_name2host(const char *name, dns_host_info_t **rinfo)
+{
+	dns_message_t *msg;
+	dns_message_t *amsg;
+	dns_question_t *question;
+	dns_host_info_t *info;
+	char *sname, *cname;
+	size_t eoff;
+	int rc;
+
+	question = calloc(1, sizeof(dns_question_t));
+	if (question == NULL)
+		return ENOMEM;
+
+	question->qname = (char *)name;
+	question->qtype = DTYPE_A;
+	question->qclass = DC_IN;
+
+	msg = dns_message_new();
+	if (msg == NULL)
+		return ENOMEM;
+
+	list_append(&question->msg, &msg->question);
+
+	msg->id = msg_id++;
+	msg->qr = QR_QUERY;
+	msg->opcode = OPC_QUERY;
+	msg->aa = false;
+	msg->tc = false;
+	msg->rd = true;
+	msg->ra = false;
+
+	rc = dns_request(msg, &amsg);
+	if (rc != EOK) {
+		return rc;
+	}
+
+	/* Start with the caller-provided name */
+	sname = str_dup(name);
+
+	list_foreach(amsg->answer, link) {
+		dns_rr_t *rr = list_get_instance(link, dns_rr_t, msg);
+
+		log_msg(LOG_DEFAULT, LVL_DEBUG, " - '%s' %u/%u, dsize %zu",
+			rr->name, rr->rtype, rr->rclass, rr->rdata_size);
+
+		if (rr->rtype == DTYPE_CNAME && rr->rclass == DC_IN &&
+		    str_cmp(rr->name, sname) == 0) {
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "decode cname (%p, %zu, %zu)",
+			    amsg->pdu.data, amsg->pdu.size, rr->roff);
+			rc = dns_name_decode(&amsg->pdu, rr->roff, &cname, &eoff);
+			if (rc != EOK) {
+				log_msg(LOG_DEFAULT, LVL_DEBUG,
+				    "error decoding cname");
+				assert(rc == EINVAL || rc == ENOMEM);
+				dns_message_destroy(msg);
+				dns_message_destroy(amsg);
+				return rc;
+			}
+
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "name = '%s' "
+			    "cname = '%s'", sname, cname);
+
+			free(sname);
+			/* Continue looking for the more canonical name */
+			sname = cname;
+		}
+
+		if (rr->rtype == DTYPE_A && rr->rclass == DC_IN &&
+			rr->rdata_size == sizeof(uint32_t) &&
+			    str_cmp(rr->name, sname) == 0) {
+
+			info = calloc(1, sizeof(dns_host_info_t));
+			if (info == NULL) {
+				dns_message_destroy(msg);
+				dns_message_destroy(amsg);
+				return ENOMEM;
+			}
+
+			info->cname = str_dup(rr->name);
+			info->addr.ipv4 = dns_uint32_t_decode(rr->rdata, rr->rdata_size);
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "info->name = '%s' "
+			    "info->addr = %x", info->cname, info->addr.ipv4);
+
+			dns_message_destroy(msg);
+			dns_message_destroy(amsg);
+			*rinfo = info;
+			return EOK;
+		}
+	}
+
+	dns_message_destroy(msg);
+	dns_message_destroy(amsg);
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "'%s' not resolved, fail", sname);
+
+	return EIO;
+}
+
+void dns_hostinfo_destroy(dns_host_info_t *info)
+{
+	free(info->cname);
+	free(info);
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/query.h
===================================================================
--- uspace/srv/net/dnsrsrv/query.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/query.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef QUERY_H
+#define QUERY_H
+
+#include "dns_type.h"
+
+extern int dns_name2host(const char *, dns_host_info_t **);
+extern void dns_hostinfo_destroy(dns_host_info_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/transport.c
===================================================================
--- uspace/srv/net/dnsrsrv/transport.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/transport.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2013 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <adt/list.h>
+#include <errno.h>
+#include <fibril_synch.h>
+#include <io/log.h>
+#include <net/in.h>
+#include <net/inet.h>
+#include <net/socket.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+#include "dns_msg.h"
+#include "dns_type.h"
+#include "transport.h"
+
+#define RECV_BUF_SIZE 4096
+#define DNS_SERVER_PORT 53
+
+/** Request timeout (microseconds) */
+#define REQ_TIMEOUT (5*1000*1000)
+
+/** Maximum number of retries */
+#define REQ_RETRY_MAX 3
+
+typedef struct {
+	link_t lreq;
+	dns_message_t *req;
+	dns_message_t *resp;
+
+	bool done;
+	fibril_condvar_t done_cv;
+	fibril_mutex_t done_lock;
+
+	int status;
+} trans_req_t;
+
+static uint8_t recv_buf[RECV_BUF_SIZE];
+static fid_t recv_fid;
+static int transport_fd = -1;
+inet_addr_t dns_server_addr;
+
+/** Outstanding requests */
+static LIST_INITIALIZE(treq_list);
+static FIBRIL_MUTEX_INITIALIZE(treq_lock);
+
+static int transport_recv_fibril(void *arg);
+
+int transport_init(void)
+{
+	struct sockaddr_in laddr;
+	int fd;
+	fid_t fid;
+	int rc;
+
+	laddr.sin_family = AF_INET;
+	laddr.sin_port = htons(12345);
+	laddr.sin_addr.s_addr = INADDR_ANY;
+
+	fd = -1;
+
+	fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
+	if (fd < 0) {
+		rc = EIO;
+		goto error;
+	}
+
+	rc = bind(fd, (struct sockaddr *)&laddr, sizeof(laddr));
+	if (rc != EOK)
+		goto error;
+
+	transport_fd = fd;
+
+	fid = fibril_create(transport_recv_fibril, NULL);
+	if (fid == 0)
+		goto error;
+
+	fibril_add_ready(fid);
+	recv_fid = fid;
+	return EOK;
+error:
+	log_msg(LOG_DEFAULT, LVL_ERROR, "Failed initializing network socket.");
+	if (fd >= 0)
+		closesocket(fd);
+	return rc;
+}
+
+void transport_fini(void)
+{
+	if (transport_fd >= 0)
+		closesocket(transport_fd);
+}
+
+static trans_req_t *treq_create(dns_message_t *req)
+{
+	trans_req_t *treq;
+
+	treq = calloc(1, sizeof(trans_req_t));
+	if (treq == NULL)
+		return NULL;
+
+	treq->req = req;
+	treq->resp = NULL;
+	treq->done = false;
+	fibril_condvar_initialize(&treq->done_cv);
+	fibril_mutex_initialize(&treq->done_lock);
+
+	fibril_mutex_lock(&treq_lock);
+	list_append(&treq->lreq, &treq_list);
+	fibril_mutex_unlock(&treq_lock);
+
+	return treq;
+}
+
+static void treq_destroy(trans_req_t *treq)
+{
+	if (link_in_use(&treq->lreq))
+		list_remove(&treq->lreq);
+	free(treq);
+}
+
+static trans_req_t *treq_match_resp(dns_message_t *resp)
+{
+	assert(fibril_mutex_is_locked(&treq_lock));
+
+	list_foreach(treq_list, link) {
+		trans_req_t *treq = list_get_instance(link, trans_req_t, lreq);
+
+		if (treq->req->id == resp->id) {
+			/* Match */
+			return treq;
+		}
+	}
+
+	return NULL;
+}
+
+static void treq_complete(trans_req_t *treq, dns_message_t *resp)
+{
+	fibril_mutex_lock(&treq->done_lock);
+	treq->done = true;
+	treq->status = EOK;
+	treq->resp = resp;
+	fibril_mutex_unlock(&treq->done_lock);
+
+	fibril_condvar_broadcast(&treq->done_cv);
+}
+
+int dns_request(dns_message_t *req, dns_message_t **rresp)
+{
+	int rc;
+	void *req_data;
+	size_t req_size;
+	struct sockaddr_in addr;
+	trans_req_t *treq;
+	int ntry;
+
+	req_data = NULL;
+	treq = NULL;
+
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(DNS_SERVER_PORT);
+	addr.sin_addr.s_addr = host2uint32_t_be(dns_server_addr.ipv4);
+
+	rc = dns_message_encode(req, &req_data, &req_size);
+	if (rc != EOK)
+		goto error;
+
+	ntry = 0;
+
+	while (ntry < REQ_RETRY_MAX) {
+		rc = sendto(transport_fd, req_data, req_size, 0,
+		    (struct sockaddr *)&addr, sizeof(addr));
+		if (rc != EOK)
+			goto error;
+
+		treq = treq_create(req);
+		if (treq == NULL) {
+			rc = ENOMEM;
+			goto error;
+		}
+
+
+		fibril_mutex_lock(&treq->done_lock);
+		while (treq->done != true) {
+			rc = fibril_condvar_wait_timeout(&treq->done_cv, &treq->done_lock,
+			    REQ_TIMEOUT);
+			if (rc == ETIMEOUT) {
+				++ntry;
+				break;
+			}
+		}
+
+		fibril_mutex_unlock(&treq->done_lock);
+
+		if (rc != ETIMEOUT)
+			break;
+	}
+
+	if (ntry >= REQ_RETRY_MAX) {
+		rc = EIO;
+		goto error;
+	}
+
+	if (treq->status != EOK) {
+		rc = treq->status;
+		goto error;
+	}
+
+	*rresp = treq->resp;
+	treq_destroy(treq);
+	free(req_data);
+	return EOK;
+error:
+	if (treq != NULL)
+		treq_destroy(treq);
+	free(req_data);
+	return rc;
+}
+
+static int transport_recv_msg(dns_message_t **rresp)
+{
+	struct sockaddr_in src_addr;
+	socklen_t src_addr_size;
+	size_t recv_size;
+	dns_message_t *resp;
+	int rc;
+
+	src_addr_size = sizeof(src_addr);
+	rc = recvfrom(transport_fd, recv_buf, RECV_BUF_SIZE, 0,
+	    (struct sockaddr *)&src_addr, &src_addr_size);
+	if (rc < 0) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "recvfrom returns error - %d", rc);
+		goto error;
+	}
+
+	recv_size = (size_t)rc;
+
+	rc = dns_message_decode(recv_buf, recv_size, &resp);
+	if (rc != EOK) {
+		rc = EIO;
+		goto error;
+	}
+
+	*rresp = resp;
+	return EOK;
+
+error:
+	return rc;
+}
+
+static int transport_recv_fibril(void *arg)
+{
+	dns_message_t *resp;
+	trans_req_t *treq;
+	int rc;
+
+	while (true) {
+		rc = transport_recv_msg(&resp);
+		if (rc != EOK)
+			continue;
+
+		fibril_mutex_lock(&treq_lock);
+		treq = treq_match_resp(resp);
+		if (treq == NULL) {
+			fibril_mutex_unlock(&treq_lock);
+			continue;
+		}
+
+		list_remove(&treq->lreq);
+		fibril_mutex_unlock(&treq_lock);
+
+		treq_complete(treq, resp);
+	}
+
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/srv/net/dnsrsrv/transport.h
===================================================================
--- uspace/srv/net/dnsrsrv/transport.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
+++ uspace/srv/net/dnsrsrv/transport.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2012 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup dnsres
+ * @{
+ */
+/**
+ * @file
+ */
+
+#ifndef TRANSPORT_H
+#define TRANSPORT_H
+
+#include <inet/addr.h>
+#include "dns_type.h"
+
+extern int transport_init(void);
+extern void transport_fini(void);
+extern int dns_request(dns_message_t *, dns_message_t **);
+
+extern inet_addr_t dns_server_addr;
+
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/net/ethip/ethip.c
===================================================================
--- uspace/srv/net/ethip/ethip.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/ethip/ethip.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -221,6 +221,6 @@
 	case ETYPE_IP:
 		log_msg(LOG_DEFAULT, LVL_DEBUG, " - construct SDU");
-		sdu.lsrc.ipv4 = (192 << 24) | (168 << 16) | (0 << 8) | 1;
-		sdu.ldest.ipv4 = (192 << 24) | (168 << 16) | (0 << 8) | 4;
+		sdu.lsrc.ipv4 = 0;
+		sdu.ldest.ipv4 = 0;
 		sdu.data = frame.data;
 		sdu.size = frame.size;
Index: uspace/srv/net/inetsrv/addrobj.c
===================================================================
--- uspace/srv/net/inetsrv/addrobj.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/inetsrv/addrobj.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -221,5 +221,5 @@
 
 	lsrc_addr.ipv4 = addr->naddr.ipv4;
-	ldest_addr = &dgram->dest;
+	ldest_addr = ldest;
 
 	return inet_link_send_dgram(addr->ilink, &lsrc_addr, ldest_addr, dgram,
Index: uspace/srv/net/inetsrv/inet_link.c
===================================================================
--- uspace/srv/net/inetsrv/inet_link.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/inetsrv/inet_link.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -196,5 +196,5 @@
 
 	static int first = 1;
-	/* XXX For testing: set static IP address 192.168.0.4/24 */
+	/* XXX For testing: set static IP address 10.0.2.15/24 */
 	addr = inet_addrobj_new();
 	if (first) {
@@ -202,5 +202,5 @@
 		first = 0;
 	} else {
-		addr->naddr.ipv4 = (192 << 24) + (168 << 16) + (0 << 8) + 4;
+		addr->naddr.ipv4 = (10 << 24) + (0 << 16) + (2 << 8) + 15;
 	}
 	addr->naddr.bits = 24;
Index: uspace/srv/net/inetsrv/inetsrv.c
===================================================================
--- uspace/srv/net/inetsrv/inetsrv.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/inetsrv/inetsrv.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -98,5 +98,17 @@
 	}
 	
-	rc = inet_link_discovery_start();
+	inet_sroute_t *sroute = inet_sroute_new();
+	if (sroute == NULL) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed creating default route (%d).", rc);
+		return ENOMEM;
+	}
+
+	sroute->dest.ipv4 = 0;
+	sroute->dest.bits = 0;
+	sroute->router.ipv4 = (10 << 24) | (0 << 16) | (2 << 8) | 2;
+	sroute->name = str_dup("default");
+	inet_sroute_add(sroute);
+
+       	rc = inet_link_discovery_start();
 	if (rc != EOK)
 		return EEXIST;
Index: uspace/srv/net/inetsrv/inetsrv.h
===================================================================
--- uspace/srv/net/inetsrv/inetsrv.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/inetsrv/inetsrv.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -40,4 +40,5 @@
 #include <adt/list.h>
 #include <stdbool.h>
+#include <inet/addr.h>
 #include <inet/iplink.h>
 #include <ipc/loc.h>
@@ -61,17 +62,4 @@
 	link_t client_list;
 } inetping_client_t;
-
-/** Host address */
-typedef struct {
-	uint32_t ipv4;
-} inet_addr_t;
-
-/** Network address */
-typedef struct {
-	/** Address */
-	uint32_t ipv4;
-	/** Number of valid bits in @c ipv4 */
-	int bits;
-} inet_naddr_t;
 
 /** Address object info */
Index: uspace/srv/net/udp/assoc.c
===================================================================
--- uspace/srv/net/udp/assoc.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/udp/assoc.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -279,7 +279,13 @@
 
 	fibril_mutex_lock(&assoc->lock);
-	while (list_empty(&assoc->rcv_queue)) {
+	while (list_empty(&assoc->rcv_queue) && !assoc->reset) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - waiting");
 		fibril_condvar_wait(&assoc->rcv_queue_cv, &assoc->lock);
+	}
+
+	if (assoc->reset) {
+		log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - association was reset");
+		fibril_mutex_unlock(&assoc->lock);
+		return ECONNABORTED;
 	}
 
@@ -323,4 +329,17 @@
 }
 
+/** Reset association.
+ *
+ * This causes any pendingreceive operations to return immediately with
+ * UDP_ERESET.
+ */
+void udp_assoc_reset(udp_assoc_t *assoc)
+{
+	fibril_mutex_lock(&assoc->lock);
+	assoc->reset = true;
+	fibril_condvar_broadcast(&assoc->rcv_queue_cv);
+	fibril_mutex_unlock(&assoc->lock);
+}
+
 static int udp_assoc_queue_msg(udp_assoc_t *assoc, udp_sockpair_t *sp,
     udp_msg_t *msg)
Index: uspace/srv/net/udp/assoc.h
===================================================================
--- uspace/srv/net/udp/assoc.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/udp/assoc.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -51,5 +51,5 @@
 extern int udp_assoc_recv(udp_assoc_t *, udp_msg_t **, udp_sock_t *);
 extern void udp_assoc_received(udp_sockpair_t *, udp_msg_t *);
-
+extern void udp_assoc_reset(udp_assoc_t *);
 
 #endif
Index: uspace/srv/net/udp/sock.c
===================================================================
--- uspace/srv/net/udp/sock.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/udp/sock.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -537,24 +537,40 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close()");
 	int socket_id = SOCKET_GET_SOCKET_ID(call);
-	
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close() - find core");
 	socket_core_t *sock_core =
 	    socket_cores_find(&client->sockets, socket_id);
 	if (sock_core == NULL) {
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close() - core not found");
 		async_answer_0(callid, ENOTSOCK);
 		return;
 	}
-	
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close() - spec data");
 	udp_sockdata_t *socket =
 	    (udp_sockdata_t *) sock_core->specific_data;
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close() - lock socket");
 	fibril_mutex_lock(&socket->lock);
-	
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close() - lock socket buffer");
+	fibril_mutex_lock(&socket->recv_buffer_lock);
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_close - set socket->sock_core = NULL");
+	socket->sock_core = NULL;
+	fibril_mutex_unlock(&socket->recv_buffer_lock);
+
+	udp_uc_reset(socket->assoc);
+
 	int rc = socket_destroy(NULL, socket_id, &client->sockets, &gsock,
 	    udp_free_sock_data);
 	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_close - socket_destroy failed");
 		fibril_mutex_unlock(&socket->lock);
 		async_answer_0(callid, rc);
 		return;
 	}
-	
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_close - broadcast recv_buffer_cv");
+	fibril_condvar_broadcast(&socket->recv_buffer_cv);
+
 	fibril_mutex_unlock(&socket->lock);
 	async_answer_0(callid, EOK);
@@ -582,33 +598,43 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril()");
 
+	fibril_mutex_lock(&sock->recv_buffer_lock);
+
 	while (true) {
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "[] wait for rcv buffer empty()");
-		fibril_mutex_lock(&sock->recv_buffer_lock);
-		while (sock->recv_buffer_used != 0) {
+		while (sock->recv_buffer_used != 0 && sock->sock_core != NULL) {
 			fibril_condvar_wait(&sock->recv_buffer_cv,
 			    &sock->recv_buffer_lock);
 		}
-		
+
+		fibril_mutex_unlock(&sock->recv_buffer_lock);
+
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "[] call udp_uc_receive()");
 		urc = udp_uc_receive(sock->assoc, sock->recv_buffer,
 		    UDP_FRAGMENT_SIZE, &rcvd, &xflags, &sock->recv_fsock);
+		fibril_mutex_lock(&sock->recv_buffer_lock);
 		sock->recv_error = urc;
-		
-		udp_sock_notify_data(sock->sock_core);
-		
+
+		log_msg(LOG_DEFAULT, LVL_DEBUG, "[] udp_uc_receive -> %d", urc);
+
+		if (sock->sock_core != NULL)
+			udp_sock_notify_data(sock->sock_core);
+
 		if (urc != UDP_EOK) {
+			log_msg(LOG_DEFAULT, LVL_DEBUG, "[] urc != UDP_EOK, break");
 			fibril_condvar_broadcast(&sock->recv_buffer_cv);
-			fibril_mutex_unlock(&sock->recv_buffer_lock);
-			break;
-		}
-		
+			break;
+		}
+
 		log_msg(LOG_DEFAULT, LVL_DEBUG, "[] got data - broadcast recv_buffer_cv");
-		
+
 		sock->recv_buffer_used = rcvd;
-		fibril_mutex_unlock(&sock->recv_buffer_lock);
 		fibril_condvar_broadcast(&sock->recv_buffer_cv);
 	}
 
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril() exited loop");
+	fibril_mutex_unlock(&sock->recv_buffer_lock);
 	udp_uc_destroy(sock->assoc);
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril() terminated");
 
 	return 0;
Index: uspace/srv/net/udp/ucall.c
===================================================================
--- uspace/srv/net/udp/ucall.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/udp/ucall.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -113,5 +113,12 @@
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_uc_receive()", assoc->name);
 	rc = udp_assoc_recv(assoc, &msg, fsock);
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv -> %d", rc);
 	switch (rc) {
+	case EOK:
+		break;
+	case ECONNABORTED:
+		return UDP_ERESET;
+	default:
+		assert(false);
 	}
 
@@ -133,6 +140,12 @@
 {
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_destroy()");
+	udp_assoc_reset(assoc);
 	udp_assoc_remove(assoc);
 	udp_assoc_delete(assoc);
+}
+
+void udp_uc_reset(udp_assoc_t *assoc)
+{
+	udp_assoc_reset(assoc);
 }
 
Index: uspace/srv/net/udp/ucall.h
===================================================================
--- uspace/srv/net/udp/ucall.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/udp/ucall.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -49,4 +49,5 @@
 extern void udp_uc_status(udp_assoc_t *, udp_assoc_status_t *);
 extern void udp_uc_destroy(udp_assoc_t *);
+extern void udp_uc_reset(udp_assoc_t *);
 
 #endif
Index: uspace/srv/net/udp/udp_type.h
===================================================================
--- uspace/srv/net/udp/udp_type.h	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/net/udp/udp_type.h	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -51,5 +51,7 @@
 	UDP_EUNSPEC,
 	/* No route to destination */
-	UDP_ENOROUTE
+	UDP_ENOROUTE,
+	/** Association reset by user */
+	UDP_ERESET
 } udp_error_t;
 
@@ -119,4 +121,7 @@
 	udp_sockpair_t ident;
 
+	/** True if association was reset by user */
+	bool reset;
+
 	/** True if association was deleted by user */
 	bool deleted;
Index: uspace/srv/ns/task.c
===================================================================
--- uspace/srv/ns/task.c	(revision d120133ee86d737fdfb6746d53beb5cfd4d4c243)
+++ uspace/srv/ns/task.c	(revision 192565bb8d97d3d2b9c03b06e4ed08402ecbbccf)
@@ -208,4 +208,5 @@
 	sysarg_t retval;
 	task_exit_t texit;
+	bool remove = false;
 	
 	ht_link_t *link = hash_table_find(&task_hash_table, &id);
@@ -235,5 +236,5 @@
 	}
 	
-	hash_table_remove_item(&task_hash_table, link);
+	remove = true;
 	retval = EOK;
 	
@@ -243,4 +244,6 @@
 		ipc_answer_2(callid, retval, texit, ht->retval);
 	}
+	if (remove)
+		hash_table_remove_item(&task_hash_table, link);
 }
 
