more win32tty clean-up
This brings things much closer to correct operation (I hope). - The shift to only moving the cursor on input (<Someone>'s changes) had a lot of complications, among them was that sometimes, there is no more input. When the program was exiting, or bombing the cursor synch never got done, so the final messages could end up strewn any place the cursor happened to be dwelling. - There were two competing output systems in use: the wintty stuff for the game, and the msmsg and error stuff used by the sys/share/pcsys, sys/share/pctty, and sys/share/pcunix routines. Those were meant to mimic output to stdout, where stuff just got sent to a sequential display. Over time, there were calls mixed in that depended on the cursor tracked stuff from the core game, so you really couldn't be sure where things were going to display. It wasn't as much of an issue before, because the cursor really did get moved around as expected. Everything now ends up in the same output system. - I even found a use of the real putchar() because sys/share/pcunix didn't #include wintty.h the same as the other files, and the macro never got defined. Who knows where that character was being put - the game certainly couldn't track it. While everything I knew to be wrong yesterday is now working, there may be some other glitches lurking that I haven't discovered yet. Please: test, test, test.
This commit is contained in:
+14
-9
@@ -17,7 +17,9 @@
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include "win32api.h"
|
||||
|
||||
#ifdef WIN32CON
|
||||
#include "wintty.h"
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
|
||||
|
||||
@@ -195,21 +197,22 @@ return &szFullPath[0];
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
#ifndef WIN32CON
|
||||
/* fatal error */
|
||||
/*VARARGS1*/
|
||||
void
|
||||
error VA_DECL(const char *,s)
|
||||
char buf[BUFSZ];
|
||||
VA_START(s);
|
||||
VA_INIT(s, const char *);
|
||||
/* error() may get called before tty is initialized */
|
||||
if (iflags.window_inited) end_screen();
|
||||
if (!strncmpi(windowprocs.name, "tty", 3)) {
|
||||
putchar('\n');
|
||||
Vprintf(s,VA_ARGS);
|
||||
putchar('\n');
|
||||
buf[0] = '\n';
|
||||
(void) vsprintf(&buf[1], s, VA_ARGS);
|
||||
Strcat(buf, "\n");
|
||||
msmsg(buf);
|
||||
} else {
|
||||
char buf[BUFSZ];
|
||||
(void) vsprintf(buf, s, VA_ARGS);
|
||||
Strcat(buf, "\n");
|
||||
raw_printf(buf);
|
||||
@@ -217,6 +220,8 @@ error VA_DECL(const char *,s)
|
||||
VA_END();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
void Delay(int ms)
|
||||
{
|
||||
(void)Sleep(ms);
|
||||
@@ -292,9 +297,9 @@ genericptr_t ptr2;
|
||||
strstri(datadir, "TEMP") ||
|
||||
(tempdir && strstri(datadir, tempdir))) {
|
||||
(void)strncpy(interjection_buf[INTERJECT_PANIC],
|
||||
"\nThe nature of the error seems to indicate that you may\n"
|
||||
"be attempting to execute the game by double-clicking on \n"
|
||||
"it from within the download distribution zip file.\n\n"
|
||||
"\nOne common cause of this error is attempting to execute\n"
|
||||
"the game by double-clicking on it while it is displayed\n"
|
||||
"inside an unzip utility.\n\n"
|
||||
"You have to unzip the contents of the zip file into a\n"
|
||||
"folder on your system, and then run \"NetHack.exe\" or \n"
|
||||
"\"NetHackW.exe\" from there.\n\n"
|
||||
|
||||
Reference in New Issue
Block a user