shithub: choc

Download patch

ref: 5859134e1c81d15e49cab4c1971ed2bce5781845
parent: 3b2481de03e50f07ba89d5e6284a58c09582a1e1
author: Simon Howard <[email protected]>
date: Mon May 4 20:00:53 EDT 2009

Better ASCII chart.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1509

--- a/textscreen/txt_desktop.c
+++ b/textscreen/txt_desktop.c
@@ -158,10 +158,13 @@
 
 void TXT_DrawASCIITable(void)
 {
+    unsigned char *screendata;
     char buf[10];
     int x, y;
     int n;
 
+    screendata = TXT_GetScreenData();
+
     TXT_FGColor(TXT_COLOR_BRIGHT_WHITE);
     TXT_BGColor(TXT_COLOR_BLACK, 0);
 
@@ -172,11 +175,15 @@
             n = y * 16 + x;
 
             TXT_GotoXY(x * 5, y);
-            sprintf(buf, "%02x %c ", n, n);
+            sprintf(buf, "%02x   ", n);
             TXT_Puts(buf);
+
+            // Write the character directly to the screen memory buffer:
+
+            screendata[(y * TXT_SCREEN_W + x * 5 + 3) * 2] = n;
         }
     }
-    
+
     TXT_UpdateScreen();
 }