[Pkg-nethack-devel] nethack/win/tty termcap.c,1.1.1.1,1.2 topl.c,1.1.1.1,1.2 wintty.c,1.1.1.1,1.2

Joshua Kwan joshk-guest@quantz.debian.org
Tue, 09 Dec 2003 16:14:49 +0000


Update of /cvsroot/pkg-nethack/nethack/win/tty
In directory quantz:/tmp/cvs-serv9687/win/tty

Modified Files:
	termcap.c topl.c wintty.c 
Log Message:
Merge Nethack 3.4.3 upstream source.


Index: termcap.c
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/win/tty/termcap.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- termcap.c	7 Oct 2003 19:00:43 -0000	1.1.1.1
+++ termcap.c	9 Dec 2003 16:14:46 -0000	1.2
@@ -1072,6 +1072,9 @@
 		    if(nh_US) return nh_US;
 	    case ATR_BOLD:
 	    case ATR_BLINK:
+#if defined(TERMLIB) && defined(TEXTCOLOR)
+		    if (MD) return MD;
+#endif
 		    return nh_HI;
 	    case ATR_INVERSE:
 		    return MR;

Index: topl.c
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/win/tty/topl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- topl.c	7 Oct 2003 19:00:43 -0000	1.1.1.1
+++ topl.c	9 Dec 2003 16:14:46 -0000	1.2
@@ -280,15 +280,23 @@
 	ttyDisplay->curx = 0;
 	ttyDisplay->cury++;
 	cw->cury = ttyDisplay->cury;
+#ifdef WIN32CON
+    (void) putchar(c);
+#endif
 	break;
     default:
 	if(ttyDisplay->curx == CO-1)
 	    topl_putsym('\n'); /* 1 <= curx <= CO; avoid CO */
+#ifdef WIN32CON
+    (void) putchar(c);
+#endif
 	ttyDisplay->curx++;
     }
     cw->curx = ttyDisplay->curx;
     if(cw->curx == 0) cl_end();
+#ifndef WIN32CON
     (void) putchar(c);
+#endif
 }
 
 void

Index: wintty.c
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/win/tty/wintty.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- wintty.c	7 Oct 2003 19:00:44 -0000	1.1.1.1
+++ wintty.c	9 Dec 2003 16:14:46 -0000	1.2
@@ -145,8 +145,8 @@
 boolean HE_resets_AS;	/* see termcap.c */
 #endif
 
-#ifdef MICRO
-static char to_continue[] = "to continue";
+#if defined(MICRO) || defined(WIN32CON)
+static const char to_continue[] = "to continue";
 #define getret() getreturn(to_continue)
 #else
 STATIC_DCL void NDECL(getret);
@@ -686,6 +686,9 @@
 		if (c == '\b' || c == '\177') {
 			if(ct) {
 				ct--;
+#ifdef WIN32CON
+				ttyDisplay->curx--;
+#endif
 #if defined(MICRO) || defined(WIN32CON)
 # if defined(WIN32CON) || defined(MSDOS)
 				backsp();       /* \b is visible on NT */
@@ -718,6 +721,9 @@
 			(void) putchar(c);
 #endif
 			plname[ct++] = c;
+#ifdef WIN32CON
+			ttyDisplay->curx++;
+#endif
 		}
 	}
 	plname[ct] = 0;
@@ -733,7 +739,7 @@
     return;
 }
 
-#ifndef MICRO
+#if !defined(MICRO) && !defined(WIN32CON)
 STATIC_OVL void
 getret()
 {
@@ -783,7 +789,7 @@
 #endif
 	    wins[i] = 0;
 	}
-#ifndef NO_TERMS	/*(until this gets added to the window interface)*/
+#ifndef NO_TERMS		/*(until this gets added to the window interface)*/
     tty_shutdown();		/* cleanup termcap/terminfo/whatever */
 #endif
     iflags.window_inited = 0;
@@ -1132,12 +1138,12 @@
     int n, curr_page, page_lines;
     boolean finished, counting, reset_count;
     char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ],
-	 *msave, morestr[QBUFSZ];
+	 *msave, *morestr;
 
     curr_page = page_lines = 0;
     page_start = page_end = 0;
     msave = cw->morestr;	/* save the morestr */
-    cw->morestr = morestr;
+    cw->morestr = morestr = (char*) alloc((unsigned) QBUFSZ);
     counting = FALSE;
     count = 0L;
     reset_count = TRUE;
@@ -1215,8 +1221,13 @@
 		     */
 		    term_start_attr(curr->attr);
 		    for (n = 0, cp = curr->str;
+#ifndef WIN32CON
 			  *cp && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols;
 			  cp++, n++)
+#else
+			  *cp && (int) ttyDisplay->curx < (int) ttyDisplay->cols;
+			  cp++, n++, ttyDisplay->curx++)
+#endif
 			if (n == 2 && curr->identifier.a_void != 0 &&
 							curr->selected) {
 			    if (curr->count == -1L)
@@ -1416,6 +1427,7 @@
 
     } /* while */
     cw->morestr = msave;
+    free((genericptr_t)morestr);
 }
 
 STATIC_OVL void
@@ -1451,8 +1463,13 @@
 	    }
 	    term_start_attr(attr);
 	    for (cp = &cw->data[i][1];
+#ifndef WIN32CON
 		    *cp && (int) ++ttyDisplay->curx < (int) ttyDisplay->cols;
 		    cp++)
+#else
+		    *cp && (int) ttyDisplay->curx < (int) ttyDisplay->cols;
+		    cp++, ttyDisplay->curx++)
+#endif
 		(void) putchar(*cp);
 	    term_end_attr(attr);
 	}