Index: texteff.c
===================================================================
--- texteff.c	(revision 566)
+++ texteff.c	(working copy)
@@ -126,13 +126,17 @@
 // Draw the textmessage-box
 void DrawTextMessage()
 {
+	/* 60 is the maximum length and I'd say M is the widest char. --pasky */
+	const char max_width[61] = "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM";
+	static int _textmessage_width;
 	int i, j, w;
 
 	// First undraw if needed
 	UndrawTextMessage();
 
 	// Calculate the max-width
-	_textmessage_width = 0;
+	if (!_textmessage_width)
+		_textmessage_width = GetStringWidth(max_width) + 9;
 
 	for (i=0;i<10;i++) {
 		if (_text_message_list[i].message[0] == '\0') break;
@@ -155,11 +159,16 @@
 	j = 0;
 	// Paint the messages
 	for (i=9;i>=0;i--) {
+		int color;
 		if (_text_message_list[i].message[0] == '\0') continue;
 		j++;
-		w = GetStringWidth(_text_message_list[i].message) + 6;
-		GfxFillRect(_textmessage_box_left, _screen.height-_textmessage_box_bottom-j*13-2, _textmessage_box_left+w, _screen.height-_textmessage_box_bottom-j*13+11, 0);
-		DoDrawString(_text_message_list[i].message, _textmessage_box_left + 3, _screen.height-_textmessage_box_bottom-j*13, _text_message_list[i].color);
+		GfxFillRect(_textmessage_box_left, _screen.height-_textmessage_box_bottom-j*13-2, _textmessage_box_left+_textmessage_width - 1, _screen.height-_textmessage_box_bottom-j*13+10, /* black, but with some alpha */ 0x4322);
+
+		color = _text_message_list[i].color;
+		/* XXX: Fix unreadable colors. */
+		if ((color & 0xFF) == 0xC9) color = 0x1CA;
+
+		DoDrawString(_text_message_list[i].message, _textmessage_box_left + 3, _screen.height-_textmessage_box_bottom-j*13, color);
 	}
 
 	// Make sure the data is updated next flush
