Index: uspace/lib/congfx/src/console.c
===================================================================
--- uspace/lib/congfx/src/console.c	(revision 211fd689737d35925504cec0c8fb09d1af3bd74d)
+++ uspace/lib/congfx/src/console.c	(revision 7470d97aaec04abd08ce2ad450cda9e6ff912bd4)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2024 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -57,7 +57,4 @@
 static errno_t console_gc_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
 static errno_t console_gc_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
-static errno_t console_gc_cursor_get_pos(void *, gfx_coord2_t *);
-static errno_t console_gc_cursor_set_pos(void *, gfx_coord2_t *);
-static errno_t console_gc_cursor_set_visible(void *, bool);
 
 gfx_context_ops_t console_gc_ops = {
@@ -69,46 +66,6 @@
 	.bitmap_destroy = console_gc_bitmap_destroy,
 	.bitmap_render = console_gc_bitmap_render,
-	.bitmap_get_alloc = console_gc_bitmap_get_alloc,
-	.cursor_get_pos = console_gc_cursor_get_pos,
-	.cursor_set_pos = console_gc_cursor_set_pos,
-	.cursor_set_visible = console_gc_cursor_set_visible
+	.bitmap_get_alloc = console_gc_bitmap_get_alloc
 };
-
-/** Convert pixel value to charfield.
- *
- * On the bottom of this function lies a big big hack. In the absence
- * of support for different color formats (FIX ME!), here's a single
- * format that can represent both 3x8bit RGB and 24-bit characters
- * with 8-bit EGA attributes (i.e. we can specify the foreground and
- * background colors individually).
- *
- * A    R   G   B
- * 0    red grn blu  24-bit color
- * attr c2  c1  c0   attribute + 24-bit character
- */
-static void console_gc_pix_to_charfield(pixel_t clr, charfield_t *ch)
-{
-	uint8_t attr;
-
-	if ((clr >> 24) == 0xff) {
-		/* RGB (no text) */
-		ch->ch = 0;
-		ch->flags = CHAR_FLAG_DIRTY;
-		ch->attrs.type = CHAR_ATTR_RGB;
-		ch->attrs.val.rgb.fgcolor = clr;
-		ch->attrs.val.rgb.bgcolor = clr;
-	} else {
-		/* EGA attributes (with text) */
-		attr = clr >> 24;
-		ch->ch = clr & 0xffffff;
-		ch->flags = CHAR_FLAG_DIRTY;
-		ch->attrs.type = CHAR_ATTR_INDEX;
-		ch->attrs.val.index.fgcolor = attr & 0x7;
-		ch->attrs.val.index.bgcolor = (attr >> 4) & 0x7;
-		ch->attrs.val.index.attr =
-		    ((attr & 0x8) ? CATTR_BRIGHT : 0) +
-		    ((attr & 0x80) ? CATTR_BLINK : 0);
-	}
-}
 
 /** Set clipping rectangle on console GC.
@@ -144,5 +101,5 @@
 	console_gc_t *cgc = (console_gc_t *) arg;
 
-	cgc->clr = PIXEL(color->attr, color->r >> 8, color->g >> 8, color->b >> 8);
+	cgc->clr = PIXEL(0, color->r >> 8, color->g >> 8, color->b >> 8);
 	return EOK;
 }
@@ -168,5 +125,9 @@
 	cols = cgc->rect.p1.x - cgc->rect.p0.x;
 
-	console_gc_pix_to_charfield(cgc->clr, &ch);
+	ch.ch = cgc->clr >> 24;
+	ch.flags = CHAR_FLAG_DIRTY;
+	ch.attrs.type = CHAR_ATTR_RGB;
+	ch.attrs.val.rgb.fgcolor = cgc->clr ^ 0xffffff;
+	ch.attrs.val.rgb.bgcolor = cgc->clr;
 
 	for (y = crect.p0.y; y < crect.p1.y; y++) {
@@ -278,37 +239,4 @@
 
 	free(cgc);
-	return EOK;
-}
-
-/** Free up console for other users, suspending GC operation.
- *
- * @param cgc Console GC
- * @return EOK on success or an error code
- */
-errno_t console_gc_suspend(console_gc_t *cgc)
-{
-	console_unmap(cgc->con, cgc->buf);
-	cgc->buf = NULL;
-
-	console_clear(cgc->con);
-	console_cursor_visibility(cgc->con, true);
-	return EOK;
-}
-
-/** Resume GC operation after suspend.
- *
- * @param cgc Console GC
- * @return EOK on success or an error code
- */
-errno_t console_gc_resume(console_gc_t *cgc)
-{
-	errno_t rc;
-
-	console_clear(cgc->con);
-
-	rc = console_map(cgc->con, cgc->rect.p1.x, cgc->rect.p1.y, &cgc->buf);
-	if (rc != EOK)
-		return rc;
-
 	return EOK;
 }
@@ -440,5 +368,10 @@
 				    y - offs.y - cbm->rect.p0.y);
 
-				console_gc_pix_to_charfield(clr, &ch);
+				ch.ch = clr >> 24;
+				ch.flags = CHAR_FLAG_DIRTY;
+				ch.attrs.type = CHAR_ATTR_RGB;
+				ch.attrs.val.rgb.fgcolor = clr ^ 0xffffff;
+				ch.attrs.val.rgb.bgcolor = clr;
+
 				cbm->cgc->buf[y * cols + x] = ch;
 			}
@@ -453,5 +386,9 @@
 				    y - offs.y - cbm->rect.p0.y);
 
-				console_gc_pix_to_charfield(clr, &ch);
+				ch.ch = clr >> 24;
+				ch.flags = CHAR_FLAG_DIRTY;
+				ch.attrs.type = CHAR_ATTR_RGB;
+				ch.attrs.val.rgb.fgcolor = clr ^ 0xffffff;
+				ch.attrs.val.rgb.bgcolor = clr;
 
 				if (clr != cbm->key_color)
@@ -461,5 +398,9 @@
 	} else {
 		/* Color key & colorize */
-		console_gc_pix_to_charfield(cbm->cgc->clr, &ch);
+		ch.ch = 0;
+		ch.flags = CHAR_FLAG_DIRTY;
+		ch.attrs.type = CHAR_ATTR_RGB;
+		ch.attrs.val.rgb.fgcolor = cbm->cgc->clr;
+		ch.attrs.val.rgb.bgcolor = cbm->cgc->clr;
 
 		for (y = crect.p0.y; y < crect.p1.y; y++) {
@@ -494,57 +435,4 @@
 }
 
-/** Get cursor position on console GC.
- *
- * @param arg Console GC
- * @param pos Place to store position
- *
- * @return EOK on success or an error code
- */
-static errno_t console_gc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
-{
-	console_gc_t *cgc = (console_gc_t *) arg;
-	sysarg_t col;
-	sysarg_t row;
-	errno_t rc;
-
-	rc = console_get_pos(cgc->con, &col, &row);
-	if (rc != EOK)
-		return rc;
-
-	pos->x = col;
-	pos->y = row;
-	return EOK;
-}
-
-/** Set cursor position on console GC.
- *
- * @param arg Console GC
- * @param pos New cursor position
- *
- * @return EOK on success or an error code
- */
-static errno_t console_gc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
-{
-	console_gc_t *cgc = (console_gc_t *) arg;
-
-	console_set_pos(cgc->con, pos->x, pos->y);
-	return EOK;
-}
-
-/** Set cursor visibility on console GC.
- *
- * @param arg Console GC
- * @param visible @c true iff cursor should be made visible
- *
- * @return EOK on success or an error code
- */
-static errno_t console_gc_cursor_set_visible(void *arg, bool visible)
-{
-	console_gc_t *cgc = (console_gc_t *) arg;
-
-	console_cursor_visibility(cgc->con, visible);
-	return EOK;
-}
-
 /** @}
  */
