pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

doomlegacy-devel: Add patch for exit text



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <micha%NetBSD.org@localhost>
Pushed By:	micha
Date:		Wed Apr 29 18:55:41 2020 +0200
Changeset:	8e6811ae1fbe039878e0c6e3d8f37f39cf063bd9

Modified Files:
	doomlegacy-devel/TODO
	doomlegacy-devel/distinfo
	doomlegacy-devel/files/doomlegacy.6.in
	doomlegacy-devel/patches/patch-src_sdl_endtxt.c

Log Message:
doomlegacy-devel: Add patch for exit text

man page updated.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8e6811ae1fbe039878e0c6e3d8f37f39cf063bd9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 doomlegacy-devel/TODO                           |  14 +-
 doomlegacy-devel/distinfo                       |   2 +-
 doomlegacy-devel/files/doomlegacy.6.in          |   8 +-
 doomlegacy-devel/patches/patch-src_sdl_endtxt.c | 316 +++++++++++++++++++-----
 4 files changed, 273 insertions(+), 67 deletions(-)

diffs:
diff --git a/doomlegacy-devel/TODO b/doomlegacy-devel/TODO
index 2a95670bd1..745168d923 100644
--- a/doomlegacy-devel/TODO
+++ b/doomlegacy-devel/TODO
@@ -98,6 +98,13 @@ On some maps the rendering is broken (only in parts of the map).
 Part 5 finished.
 
 
+Part 6: Import final release
+============================
+
+[ ] Import version 1.48.2
+    Not released yet
+
+
 Part 7: Support for extended nodes
 ==================================
 [X] Add patch to support DeeP and ZDoom extended nodes
@@ -112,11 +119,4 @@ Part 8: Fix output of ENDOOM lump to terminal
 [X] Add patch to convert text from IBM437 codepage to Unicode
 
 
-Part 6: Import final release
-============================
-
-[ ] Import version 1.48.2
-    Not released yet
-
-
 EOF
diff --git a/doomlegacy-devel/distinfo b/doomlegacy-devel/distinfo
index 5c47002aa4..47336f4a1d 100644
--- a/doomlegacy-devel/distinfo
+++ b/doomlegacy-devel/distinfo
@@ -9,4 +9,4 @@ SHA1 (patch-src_am__map.c) = 8d7d17d29c0934c92ca933e8976a5ecc692e465d
 SHA1 (patch-src_doomdata.h) = 662d580457440fff338c683a76581b6d8973f8e5
 SHA1 (patch-src_p__setup.c) = 9bdd3c882871cf3d49e2f8ef99d92715d1afe64b
 SHA1 (patch-src_r__defs.h) = bd3846096127cfd7f99f541e0e94b79b5ca8229a
-SHA1 (patch-src_sdl_endtxt.c) = c48c58b002f893940b5716fd491b0a499610f913
+SHA1 (patch-src_sdl_endtxt.c) = 3bc4f5dc0d78583f94a09cee067c00c6f00e9991
diff --git a/doomlegacy-devel/files/doomlegacy.6.in b/doomlegacy-devel/files/doomlegacy.6.in
index 2799f574e0..04947f8390 100644
--- a/doomlegacy-devel/files/doomlegacy.6.in
+++ b/doomlegacy-devel/files/doomlegacy.6.in
@@ -1,10 +1,10 @@
 .\"=============================================================================
 .\" Header
 .\"
-.\" Copyright (c) 2019 by Michael Baeuerle.
+.\" Copyright (c) 2019-2020 by Michael Baeuerle.
 .\" License: GNU Free Documentation License (GFDL)
 .\"
-.TH $NAME 6 2019-06-16 Unix "$NAME $VERSION manual"
+.TH $NAME 6 2020-04-29 Unix "$NAME $VERSION manual"
 .\"
 .\"
 .\"=============================================================================
@@ -82,6 +82,10 @@ Set the configfile to use.
 .br
 Default: config.cfg
 .TP
+.BI -deh " file [file ...]
+Load one or more DEH (DeHackEd) files or BEX files, which can change monster
+abilities and game text.
+.TP
 .BI -file " file [file ...]
 Set PWAD (Patch WAD) files to use.
 .TP
diff --git a/doomlegacy-devel/patches/patch-src_sdl_endtxt.c b/doomlegacy-devel/patches/patch-src_sdl_endtxt.c
index 209d8d3634..4cfb9133f3 100644
--- a/doomlegacy-devel/patches/patch-src_sdl_endtxt.c
+++ b/doomlegacy-devel/patches/patch-src_sdl_endtxt.c
@@ -1,24 +1,28 @@
 $NetBSD$
 
-Fix endianess for interpretation of ENDOOM lump.
+Fix printing of exit text from ENDOOM lump.
+This works only if the terminal uses an Unicode locale and can handle
+ANSI control sequences.
 
-The MSB of the attributes is not part of the bg color field, interpret
-as blinking flag according to unofficial Doom specs (section 8-3):
-<http://www.gamers.org/dhs/helpdocs/dmsp1666.html>
-
-Convert text encoding from IBM437 codepage to Unicode.
-
---- src/sdl/endtxt.c.orig	2020-04-27 14:36:13.000000000 +0000
+--- src/sdl/endtxt.c.orig	2020-04-29 12:06:57.000000000 +0000
 +++ src/sdl/endtxt.c
-@@ -28,6 +28,20 @@
+@@ -28,13 +28,35 @@
  #include "w_wad.h"
  #include "z_zone.h"
  #include "m_argv.h"
 +#include "m_swap.h"
 +
-+// [MB] 2020-04-26: Added UTF-8 sequences for upper half of codepage IBM437
-+static const char *cp437[128] =
++// [MB] 2020-04-28: Added UTF-8 sequences for IBM437 codepage
++static const char *cp437[256] =
 +{
++    " ", "\xE2\x98\xBA", "\xE2\x98\xBB", "\xE2\x99\xA5", "\xE2\x99\xA6", "\xE2\x99\xA3", "\xE2\x99\xA0", "\xE2\x80\xA2", "\xE2\x97\x98", "\xE2\x97\x8B", "\xE2\x97\x99", "\xE2\x99\x82", "\xE2\x99\x80", "\xE2\x99\xAA", "\xE2\x99\xAB", "\xE2\x98\xBC",
++    "\xE2\x96\xBA", "\xE2\x97\x84", "\xE2\x86\x95", "\xE2\x80\xBC", "\xC2\xB6", "\xC2\xA7", "\xE2\x96\xAC", "\xE2\x86\xA8", "\xE2\x86\x91", "\xE2\x86\x93", "\xE2\x86\x92", "\xE2\x86\x90", "\xE2\x88\x9F", "\xE2\x86\x94", "\xE2\x96\xB2", "\xE2\x96\xBC",
++    " ", "!", "\x22", "#", "$", "%", "&", "\x27", "(", ")", "*", "+", ",", "-", ".", "/",
++    "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?",
++    "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
++    "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\x5C", "]", "^", "_",
++    "\x60", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
++    "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "\xC2\xA6", "}", "~", "\xE2\x8C\x82",
 +    "\xC3\x87", "\xC3\xBC", "\xC3\xA9", "\xC3\xA2", "\xC3\xA4", "\xC3\xA0", "\xC3\xA5", "\xC3\xA7", "\xC3\xAA", "\xC3\xAB", "\xC3\xA8", "\xC3\xAF", "\xC3\xAE", "\xC3\xAC", "\xC3\x84", "\xC3\x85",
 +    "\xC3\x89", "\xC3\xA6", "\xC3\x86", "\xC3\xB4", "\xC3\xB6", "\xC3\xB2", "\xC3\xBB", "\xC3\xB9", "\xC3\xBF", "\xC3\x96", "\xC3\x9C", "\xC2\xA2", "\xC2\xA3", "\xC2\xA5", "\xE2\x82\xA7", "\xC6\x92",
 +    "\xC3\xA1", "\xC3\xAD", "\xC3\xB3", "\xC3\xBA", "\xC3\xB1", "\xC3\x91", "\xC2\xAA", "\xC2\xBA", "\xC2\xBF", "\xE2\x8C\x90", "\xC2\xAC", "\xC2\xBD", "\xC2\xBC", "\xC2\xA1", "\xC2\xAB", "\xC2\xBB",
@@ -26,69 +30,267 @@ Convert text encoding from IBM437 codepage to Unicode.
 +    "\xE2\x94\x94", "\xE2\x94\xB4", "\xE2\x94\xAC", "\xE2\x94\x9C", "\xE2\x94\x80", "\xE2\x94\xBC", "\xE2\x95\x9E", "\xE2\x95\x9F", "\xE2\x95\x9A", "\xE2\x95\x94", "\xE2\x95\xA9", "\xE2\x95\xA6", "\xE2\x95\xA0", "\xE2\x95\x90", "\xE2\x95\xAC", "\xE2\x95\xA7",
 +    "\xE2\x95\xA8", "\xE2\x95\xA4", "\xE2\x95\xA5", "\xE2\x95\x99", "\xE2\x95\x98", "\xE2\x95\x92", "\xE2\x95\x93", "\xE2\x95\xAB", "\xE2\x95\xAA", "\xE2\x94\x98", "\xE2\x94\x8C", "\xE2\x96\x88", "\xE2\x96\x84", "\xE2\x96\x8C", "\xE2\x96\x90", "\xE2\x96\x80",
 +    "\xCE\xB1", "\xC3\x9F", "\xCE\x93", "\xCF\x80", "\xCE\xA3", "\xCF\x83", "\xC2\xB5", "\xCF\x84", "\xCE\xA6", "\xCE\x98", "\xCE\xA9", "\xCE\xB4", "\xE2\x88\x9E", "\xCF\x86", "\xCE\xB5", "\xE2\x88\xA9",
-+    "\xE2\x89\xA1", "\xC2\xB1", "\xE2\x89\xA5", "\xE2\x89\xA4", "\xE2\x8C\xA0", "\xE2\x8C\xA1", "\xC3\xB7", "\xE2\x89\x88", "\xC2\xB0", "\xE2\x88\x99", "\xC2\xB7", "\xE2\x88\x9A", "\xE2\x81\xBF", "\xC2\xB2", "\xE2\x96\xA0", "\xC2\xA0"
++    "\xE2\x89\xA1", "\xC2\xB1", "\xE2\x89\xA5", "\xE2\x89\xA4", "\xE2\x8C\xA0", "\xE2\x8C\xA1", "\xC3\xB7", "\xE2\x89\x88", "\xC2\xB0", "\xE2\x88\x99", "\xC2\xB7", "\xE2\x88\x9A", "\xE2\x81\xBF", "\xC2\xB2", "\xE2\x96\xA0", " "
 +};
  
  // [WDJ] Changed to public interface name.
  // Original name was ShowEndText.
-@@ -59,9 +73,12 @@ void I_Show_EndText( uint16_t * text )
+ void I_Show_EndText( uint16_t * text )
+ {
+-	int i, j;
+-	int att = 0;
++	int i;
++	int c, att, bg, fg;
+ 	int nlflag = 1;
+ #if 0
+ 	unsigned short *text;
+@@ -59,127 +81,137 @@ void I_Show_EndText( uint16_t * text )
  
  	/* print 80x25 text and deal with the attributes too */
  	for (i=1; i<=80*25; i++) {
-+		// [MB] 2020-04-26: Reset blinking
-+		printf("\033[25m");
++		// [MB] 2020-04-26: Reset color configuration
++		printf("\033[0m");
  		/* attribute first */
- 		/* attribute changed? */
+-		/* attribute changed? */
 -		if ((j = *text >> 8) != att) {
-+		// [MB] 2020-04-26: Fixed endianess
-+		if ((j = ((uint16_t)LE_SWAP16(*text)) >> 8) != att) {
- 			/* save current attribute */
- 			att = j;
- 			/* set new attribute, forground color first */
-@@ -117,9 +134,16 @@ void I_Show_EndText( uint16_t * text )
- 				break;
- 			}
- 			printf("m");
-+			// [MB] 2020-04-26: Add support for blinking
-+			printf("\033[");
-+			if((j >> 4) & 0x08)
-+				printf("5m");
-+			else
-+				printf("25m");
- 			/* now background color */
- 			printf("\033[");
+-			/* save current attribute */
+-			att = j;
+-			/* set new attribute, forground color first */
+-			printf("\033[");
+-			switch (j & 0x0f) {
+-			case 0:		/* black */
+-				printf("30");
+-				break;
+-			case 1:		/* blue */
+-				printf("34");
+-				break;
+-			case 2:		/* green */
+-				printf("32");
+-				break;
+-			case 3:		/* cyan */
+-				printf("36");
+-				break;
+-			case 4:		/* red */
+-				printf("31");
+-				break;
+-			case 5:		/* magenta */
+-				printf("35");
+-				break;
+-			case 6:		/* brown */
+-				printf("33");
+-				break;
+-			case 7:		/* bright grey */
+-				printf("37");
+-				break;
+-			case 8:		/* dark grey */
+-				printf("1;30");
+-				break;
+-			case 9:		/* bright blue */
+-				printf("1;34");
+-				break;
+-			case 10:	/* bright green */
+-				printf("1;32");
+-				break;
+-			case 11:	/* bright cyan */
+-				printf("1;36");
+-				break;
+-			case 12:	/* bright red */
+-				printf("1;31");
+-				break;
+-			case 13:	/* bright magenta */
+-				printf("1;35");
+-				break;
+-			case 14:	/* yellow */
+-				printf("1;33");
+-				break;
+-			case 15:	/* white */
+-				printf("1;37");
+-				break;
+-			}
+-			printf("m");
+-			/* now background color */
+-			printf("\033[");
 -			switch((j >> 4) & 0x0f) {
-+			// [MB] 2020-04-26: Mask for bg color bits fixed
-+			switch((j >> 4) & 0x07) {
- 			case 0:		/* black */
- 				printf("40");
- 				break;
-@@ -144,6 +168,7 @@ void I_Show_EndText( uint16_t * text )
- 			case 7:		/* bright grey */
- 				printf("47");
- 				break;
+-			case 0:		/* black */
+-				printf("40");
+-				break;
+-			case 1:		/* blue */
+-				printf("44");
+-				break;
+-			case 2:		/* green */
+-				printf("42");
+-				break;
+-			case 3:		/* cyan */
+-				printf("46");
+-				break;
+-			case 4:		/* red */
+-				printf("41");
+-				break;
+-			case 5:		/* magenta */
+-				printf("45");
+-				break;
+-			case 6:		/* brown */
+-				printf("43");
+-				break;
+-			case 7:		/* bright grey */
+-				printf("47");
+-				break;
+-			case 8:		/* dark grey */
+-				printf("1;40");
+-				break;
+-			case 9:		/* bright blue */
+-				printf("1;44");
+-				break;
+-			case 10:	/* bright green */
+-				printf("1;42");
+-				break;
+-			case 11:	/* bright cyan */
+-				printf("1;46");
+-				break;
+-			case 12:	/* bright red */
+-				printf("1;41");
+-				break;
+-			case 13:	/* bright magenta */
+-				printf("1;45");
+-				break;
+-			case 14:	/* yellow */
+-				printf("1;43");
+-				break;
+-			case 15:	/* white */
+-				printf("1;47");
+-				break;
+-			}
+-			printf("m");
++		// [MB] 2020-04-26: Fixed endianess
++		att = ((uint16_t)LE_SWAP16(*text)) >> 8;
++#if 0  // [MB] 2020-04-26: Blink support does not work correctly
++		if(att & 0x80)
++			printf("\033[5m");
++#endif
++		/* set new attribute, forground color first */
++		fg = att & 0x0f;
++		printf("\033[");
++		switch (fg) {
++		case 0:		/* black */
++			printf("30");
++			break;
++		case 1:		/* blue */
++			printf("34");
++			break;
++		case 2:		/* green */
++			printf("32");
++			break;
++		case 3:		/* cyan */
++			printf("36");
++			break;
++		case 4:		/* red */
++			printf("31");
++			break;
++		case 5:		/* magenta */
++			printf("35");
++			break;
++		case 6:		/* brown */
++			printf("33");
++			break;
++		case 7:		/* bright grey */
++			printf("37");
++			break;
++		case 8:		/* dark grey */
++			printf("1;30");
++			break;
++		case 9:		/* bright blue */
++			printf("1;34");
++			break;
++		case 10:	/* bright green */
++			printf("1;32");
++			break;
++		case 11:	/* bright cyan */
++			printf("1;36");
++			break;
++		case 12:	/* bright red */
++			printf("1;31");
++			break;
++		case 13:	/* bright magenta */
++			printf("1;35");
++			break;
++		case 14:	/* yellow */
++			printf("1;33");
++			break;
++		case 15:	/* white */
++			printf("1;37");
++			break;
++		}
++		printf("m");
++		/* now background color */
++		bg = (att >> 4) & 0x0f;
++		printf("\033[");
++		// [MB] 2020-04-26: Mask only bg color bits here
++		switch(bg & 0x07) {
++		case 0:		/* black */
++			printf("40");
++			break;
++		case 1:		/* blue */
++			printf("44");
++			break;
++		case 2:		/* green */
++			printf("42");
++			break;
++		case 3:		/* cyan */
++			printf("46");
++			break;
++		case 4:		/* red */
++			printf("41");
++			break;
++		case 5:		/* magenta */
++			printf("45");
++			break;
++		case 6:		/* brown */
++			printf("43");
++			break;
++		case 7:		/* bright grey */
++			printf("47");
++			break;
 +#if 0  // [MB] 2020-04-26: Not available for bg color (MSB is the blink flag)
- 			case 8:		/* dark grey */
- 				printf("1;40");
- 				break;
-@@ -168,12 +193,19 @@ void I_Show_EndText( uint16_t * text )
- 			case 15:	/* white */
- 				printf("1;47");
- 				break;
++		case 8:		/* dark grey */
++			printf("1;40");
++			break;
++		case 9:		/* bright blue */
++			printf("1;44");
++			break;
++		case 10:	/* bright green */
++			printf("1;42");
++			break;
++		case 11:	/* bright cyan */
++			printf("1;46");
++			break;
++		case 12:	/* bright red */
++			printf("1;41");
++			break;
++		case 13:	/* bright magenta */
++			printf("1;45");
++			break;
++		case 14:	/* yellow */
++			printf("1;43");
++			break;
++		case 15:	/* white */
++			printf("1;47");
++			break;
 +#endif
- 			}
- 			printf("m");
  		}
++		printf("m");
  
  		/* now the text */
 -		putchar(*text++ & 0xff);
 +		// [MB] 2020-04-26: Fixed endianess
-+		j = (uint16_t)LE_SWAP16(*text++) & 0xff;
-+		// [MB] 2020-04-26: Convert data to Unicode before printing
-+		if (128 > j)
-+			putchar(j);
-+		else
-+			printf(cp437[j - 128]);
++		c = (uint16_t)LE_SWAP16(*text++) & 0xff;
++		// [MB] 2020-04-26: Convert data to Unicode and print as UTF-8
++		printf(cp437[c]);
  
  		/* do we need a nl? */
  		if (nlflag) {
+ 			if (!(i % 80)) {
+ 				printf("\033[0m");
+-				att = 0;
+ 				printf("\n");
+ 			}
+ 		}


Home | Main Index | Thread Index | Old Index