Commit Graph

455 Commits

Author SHA1 Message Date
nethack.allison
93ee252e87 More MS Visual Studio 2010 Express stuff 2012-01-07 22:57:39 +00:00
keni
9c1268d581 H2344 fix backout (trunk only)
Undo the win/tty/wintty.c bands of the H2344 fix until the fix is fixed.  I
didn't take out the type changes to hopefully avoid putting people through
a full recompile.
2011-12-11 21:58:29 +00:00
nethack.rankin
77593aa294 tty_getlin cleanup (trunk only)
The presence of conditional code for both UNICODE_WIDEWINPORT and
NEWAUTOCOMP in hooked_tty_getlin() was making it be pretty hard to read.
This simplifies the UNICODE_WIDEWINPORT parts similar to what was done in
topl.c a year or two back.  The NEWAUTOCOMP parts are still cluttered.

     This compiles successfully with UNICODE_WIDEWINPORT enabled but that
configuration is otherwise untested.
2011-12-11 01:54:56 +00:00
keni
eef41ba4a8 fix H2488 - wide and/or tall screens don't work
Make windows with more than 255 rows or columns work.  Touches
some very old magic involving the constant 10.
2011-12-04 20:06:00 +00:00
keni
2402f43776 mac term packaging code (trunk only)
: Modified Files:
: 	sys/unix/hints/macosx.sh sys/unix/hints/macosx10.5
: 	win/macosx/NetHackRecover.applescript win/macosx/recover.pl
: Added Files:
: 	win/macosx/NetHackGuidebook.applescript
: 	win/macosx/NetHackTerm.applescript
2011-10-17 01:29:20 +00:00
keni
4e5e720334 display version and build info at startup (trunk only)
Tested on the unix port; I've updated as many other ports as I can figure
out but they're not tested.  See window.doc for info on the changed banner
lines.  Also adds the ability to override the generic "Unix" port - used now to get
"MacOSX" into the version line instead of "Unix" (so we don't scare people who don't
know what's going on).
2011-10-11 02:37:31 +00:00
nethack.rankin
ddf5aced48 fix W343-7 - strange topten output on Windows
Move the toptenwin option from flags to iflags to keep it out of
save files, thus preventing odd behavior from win32 (nethackW.exe) when
restoring and finishing games started and saved with tty (nethack.exe).
[See cvs log entry for flag.h for more complete explanation.]
2011-09-19 03:10:01 +00:00
nethack.allison
aac052f0f0 Clean up the visual studio express build further
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/
2010-09-05 14:22:20 +00:00
nethack.allison
0823f48b7d Enable build under current MS Visual Studio Express 2010 tools
Since the current suite is freely downloadable, remove the older VS files.

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/
2010-08-30 12:34:10 +00:00
keni
cbd2a516e1 First batch of changes from FailSafeC
This is all tiny stuff - allow overriding WIDENED_PROTOTYPES from the hints
file, missing NO_SIGNAL conditionals, remove a GCC-ism, conditional indentation,
void return in a non-void function.
2010-02-10 16:08:51 +00:00
keni
f6e40b8bf8 have core ask windowport if suspend is ok
PORTS: Please make sure I've done the right thing for/to your code.
This patch adds a new winproc that lets the window port approve or cancel
the suspend request - this should take care of the Mac Qt lockup issue.
In addition, Unix suspend is restricted to accounts that can use the shell
if SYSCF is defined.
2010-01-15 17:51:28 +00:00
keni
9509a94c5b Mac recover bits
add headers, typo fix
2009-10-29 00:24:05 +00:00
keni
97509efaaf bits to allow GUI to run recover under MacOS X
Will require additional work for 3.5 (shouldn't blindly remove perm_lock
without asking the user; update comments; add standard headers) but I don't
want to lose this code.
2009-10-27 01:12:57 +00:00
nethack.allison
0c4c3beb9a remove build warning
win/tty/topl.c(516) : warning C4101: 'ln' : unreferenced local variable
2009-10-10 17:43:19 +00:00
nethack.rankin
71f3fb7024 UNICODE_WIDEWINPORT in tty/topl.c (trunk only)
Hide most of the Unicode support in tty's top line manipulation.
The new code is somewhat fragile, but the clutter from the many instances
of #if UNICODE_WIDEWINPORT was making it difficult to work on some other
changes.
2009-06-11 03:17:25 +00:00
nethack.allison
ebac3eee16 Address a build warning and a complaint
topl.c
..\win\tty\topl.c(595) : warning C4101: 'ln' : unreferenced local variable
2009-05-06 21:59:42 +00:00
keni
665dedc3de Add RCS version lines 2009-05-06 11:00:43 +00:00
keni
4036a6727c Add RCS version lines 2009-05-06 10:55:43 +00:00
nethack.rankin
a86187b398 summary text for block messages (trunk only)
[Make use of recent message history changes.]

     Add support to makedefs and the core for including a line of summary
text with quest messages that don't use pline() delivery.  The multi-line
record structure of quest.txt begins each entry with %C and ends with %E.
makedefs now examines the %E lines looking for "[anything]" and adds that
to quest.dat where deliver_by_window() can find it.  The square brackets
are required in the input and intentionally carried along to the output.
putmsghistory() is used to put the summary text into the message history
buffer for use by ^P, without being displayed first.  (So this is a no-op
for interfaces which haven't implemented putmsghistory yet.  Maybe
genl_putmsghistory() should pass such text to pline() as a quick hack?)

     This adds a few summary lines to quest.txt so that the feature can
be tested.  Most of them were written by <Someone> nearly three years
ago.  I'm planning to add a couple of new control codes that'll allow some
of them to expand into shorter text.  (The one where the Archeologist
leader tells you that the nemesis stole the artifact so your mission is
to find the goal level, defeat the nemesis, and return with the artifact
ends up being roughly 160 characters long.)
2009-04-06 02:50:41 +00:00
nethack.rankin
f468865494 putmsghistory() (trunk only)
[Third of three message history patches.]

     Add another argument to putmsghistory() so that it can tell whether
it's processing multiple messages for restore (which should be treated as
being older than any current messages) or a single message to stuff into
history (which should be treated as the most recent message even though
it hasn't been displayed in the message window).
2009-04-06 01:43:01 +00:00
nethack.rankin
47dad80337 tty messge history restore (trunk only) 2009-04-06 01:06:26 +00:00
nethack.rankin
b8b8a65dfb role selection typo (trunk only)
tty's role confirmation menu was always showing "dwarven" as the
chosen race.  I don't know how many times I saw it without ever realizing.
``races[FACE]'' in the code eventually stood out enough to be noticed.  :-)
2009-03-24 00:31:01 +00:00
nethack.rankin
44cc716fe4 enhanced interactive role selection (trunk only)
[See cvs log for src/role.c for a much longer description.]

     When picking role, race, and so forth, new menu entries allow you to
pick any of the other items before the one currently being handled.  After
picking all four of race, role, gender, and alignment (or if you answered
'y' to "shall I pick for you?"), there is a followup prompt to confirm the
choices.  It's a menu which also provides a chance to rename the character.

     This has only been implemented in win/tty's player_selection(), with
some support code in the core that might be useful to other interfaces.
And so far, the chance to rename is only presented as a menu choice if
you've given an answer to "who are you?" prompt earlier during startup.
Also, ports that use pcmain.c aren't able to perform hero renaming yet.
2009-03-22 00:23:57 +00:00
nethack.allison
76350a5348 Fix a few build issues seen by various compilers
that I have on my system but haven't used for a while
(a couple of warnings and a couple of errors)
2008-12-30 22:02:31 +00:00
keni
6f0e178368 more SYSCF and related bits - cleanup and features
infrastructure for "system options" - things currently specified at build
 time that should be changeable at install time or run time but not really
 under user control
generalize contact info so it can be localized and it doesn't have to be
 an email address
move recently introduced WIZARDS into sysopt
drop bogus OPTIONS=wizards possibility
new function build_english_list() to comma-ize and add 'or' from a whitespace separated list: A.  A or B.  A, B, or C.
syscf file now handles: WIZARDS SUPPORT RECOVER
 SUPPORT specifies local support information
 RECOVER will eventually supply port-specific and/or localized info on how
  to run recover (or get it run for you).
Note: in sys/msdos I changed sys.o (generated from pcsys.c) to pcsys.o
Note: sys/msdos/Makefile.GCC has 2 rules for sys.o (now pcsys.o)
2008-01-31 00:56:59 +00:00
keni
59e64a1d40 First pass at a hints-based build system to augment (not replace) the existing
build system.

Anyone who wants to do a build from sys/unix and doesn't want to figure this
out just needs to do:
	sh setup.sh hints/unix
instead of:
	sh setup.sh
and then continue on as usual.

New files:
sys/unix/NewInstall.unx - the new directions
sys/unix/hints/* - the hints files.  There will be more later.
sys/unix/mkmkfile.sh - helper for setup.sh

Summary of changes:
see NewInstall.unx for info on the new build system
introduction of various preprocessor symbols to turn options off that
 are defaulted on historically
comment out nethackrc (and similar) entries that still use the old symbol
 syntax.
commenting out of Makefile.* lines that now come from hints/unix
GAMEDIR is replaced with HACKDIR so the Makefiles and the C source agree.
  Note that I have NOT changed the docs and/or Makefiles for be, msdos, os2,
  vms, or winnt.  If port maintainers don't then I will, but I can't test
  those ports.
nethack.sh now handles the font path automatically
2007-12-13 20:17:11 +00:00
cohrs
57d55b8e12 H264 - FreeBSD compilation bit
I cannot currently verify this myself, but it seems likely to be correct.
2007-03-15 04:20:12 +00:00
cohrs
33fde404e7 gcc compilation warning bits 2007-02-10 17:37:17 +00:00
nethack.rankin
13b1aa6bc2 hangup followup (trunk only)
The hangup check added to xwaitforspace() (which gets tty user's
response to --More-- and "Press Return to continue: ") wouldn't be good
enough if hangup occurred while that routine's input loop was executing.
2007-02-02 02:45:37 +00:00
nethack.rankin
fdbc2c9e86 several hangup tweaks (trunk only)
NOSAVEONHANGUP isn't documented anywhere.  I don't see why it should
wipe out recoverable level files just because it doesn't want to build a
save file out of them during the hangup.  Leave them intact if checkpoint
is active.  If someone really wants to make them always go away, they'll
need to disable INSURANCE as well as enable NOSAVEONHANGUP.

     tty's getret() -> xwaitforspace() could get stuck in a loop after
hangup, depending upon the state of terminal shutdown (accepting EOF or
ESC cares about cbreak mode?).  Make xwaitforspace() become a no-op during
hangup processing.

     vms's call to hangup() from an exit handler took place after the
terminal has been reset (the exit handler for the latter is registered
later so executes sooner).  Then exit_nhwindows() resulted in a second tty
reset attempt and settty() -> setctty() encountered an error (which it
reported, triggeting a getret() call).  Make the vms code correctly guard
against multiple resets.
2007-02-01 06:15:04 +00:00
nethack.rankin
15122d269c gold in menus fix (tty; GOLDOBJ for branch, both GOLDOBJ/!GOLDOBJ for trunk)
A recent change to force gold in inventory (during multi-item Drop or
applying/looting containers) to have '$' for its inventory letter for the
!GOLDOBJ configuration has revealed a bug which 3.4.3 has for the GOLDOBJ
configuration.  Specifying a count followed by '$' to use a subset of
carried gold didn't work under tty; the $ was treated as a group accelator
and overrode the count, so full stack was always used.  (The code a few
lines above this which counts the occurrences of group accelators already
includes this same fix:  ignore an item's group accelator when it matches
the selector.)

     I wouldn't be surprised if other interfaces are subject to the same
problem; since I can't test those I'm not attempting to fix them blindly.
2007-01-06 04:39:49 +00:00
nethack.rankin
f16db6f5f6 tty_askname() fix [#if UNIX || VMS]
Typing a response at the "Who are you?" prompt didn't allow digits in
the character's name under Unix and VMS; something like "arc15" came out
as "arc__".  This allows them to be used anywhere except for the first
character.  "arc15" now works; "15arc" ends up as "_5arc" so that there
still won't be a leading digit abutting the uid value when they're joined
to form the save file name.
2006-12-12 05:15:07 +00:00
nethack.rankin
0db19f1c96 restore_menu (trunk only)
Move the code to use a nethack menu for restoring a saved game.  It
was inline in tty_askname() but is now a separate routine, restore_menu()
in restore.c.  There was no port-specific code and only a small amount of
tty-specific code; it should be useable by anyone (but Qt doesn't have to
switch over if it doesn't want to).

     The original behaved strangely if there were exactly 26 saved chars;
the "start new game" menu entry ended up using "{" as selection character.
There wasn't any comparable problem at 52; it was limiting the menu to 51
games.  Now it will allow 52 (with "start a new game" bumped into "#" if
there are that many), and adds an explicit quit entry (unless there are
52 or more games so that # is already used by new-game, then quit remains
implicit rather than resort to some other none-of-the-above character).
2006-12-12 04:52:39 +00:00
nethack.rankin
ff41104bd0 saved-games menu for vms (2 of 2) (trunk only)
First cut at implementing SELECTSAVED for VMS.
2006-12-10 04:47:53 +00:00
nethack.allison
3cc5a682c9 comment bit (trunk only)
A comment needed updating following Pat's patch.
2006-10-22 18:22:04 +00:00
nethack.rankin
054a74d378 yn_function (trunk only)
Explicitly truncate the query prompt string to QBUFSZ-1 characters.
For tty and Amiga, no longer include the choices and default within that
length limit; use a bigger buffer to hold them along with the prompt.
[See cvs log for doc/window.doc for more details.]
2006-10-22 05:59:26 +00:00
nethack.allison
4169a3a308 Remove win32 mapi mail from distribution (trunk only) 2006-10-19 13:26:54 +00:00
nethack.allison
600697fadf unicode follow up
attr value was only getting one byte allocated instead
of 1 * sizeof(nhwchar), so add required paranthesis.
2006-10-18 03:51:54 +00:00
nethack.allison
7f0f43e6f9 add some unicode support (trunk only)
This patch attempts to add some levels of unicode support
to NetHack.

The master on/off switch for any Unicode support is
defining UNICODE_SUPPORT in config.h. Currently
there is code support for two subsets of unicode support:

UNICODE_DRAWING

If UNICODE_DRAWING is defined, then the data
structures used to house drawing symbols are expanded
to the size of wchar_t, big enough to hold unicode characters.
A typdef called `nhsym' is involved and if UNICODE_DRAWING
is defined, it is wchar_t, otherwise it is uchar.

UNICODE_WIDEWINPORT

If UNICODE_WIDEWINPORT is defined, then the data
structures inside the window port are expanded to the size of
wchar_t, big enough to hold unicode characters.  Both map
symbols and text within the window port are expanded, in order
for potential support for displaying multinational characters some
day, but this patch only provides viewing of map symbols.
A typdef called `nhwchar' is involved and if UNICODE_WIDEWINPORT
is defined, it is wchar_t, otherwise it is char.

The only window port with code support for UNICODE_WIDEWINPORT
currently is the TTY port.  Don't enable UNICODE_WIDEWINPORT
unless:
- it is a TTY port
- the underlying platform specific routines can
handle the larger data structures.

Don't enable UNICODE_SUPPORT unless:
- your compiler can handle wchar_t.
- your compiler can accept L'a' characters.
- your compiler can accept L"wide" strings.

Note that if your compiler can handle the above, you could
enable the larger data structures (currently if TTY) even if your
platform can't actually display unicode or UTF-8, by messing
with u_putch() in win/tty/wintty.c to only deal regular chars.
That should be the only function that actually pushes wide characters
out to the display.

If you enable UNICODE_SUPPORT, and your platform is capable
you will need to turn on the unicode run-time option to be able to
load unicode character sets from the symbol file, to be able to
push unicode characters to the display. You'll also want to load
a unicode symbol set once the unicode option is toggled on. In
a config file you would do that via these two lines:
OPTIONS=unicode
OPTIONS=symset:Unicode_non_US

The repository was stamped with NETHACK_PRE_UNICODE
prior to applying this patch, and stamped with
NETHACK_POST_UNICODE afterwards. The code differences
between those two tagged versions are this patch.
2006-10-17 23:55:42 +00:00
nethack.allison
8fc01eb6b1 window port change - putmixed() (trunk only)
Add putmixed() to the window port. It allows map symbols to
be included in the string by encoding them in a unique fashion.
This was done because Unicode symbols, for instance, could be
longer than the size of a char.

The encoding of the map symbols in this patch is done by
prefixing a glyph value with \GXXXX, where XXXX is a
random value for the current game. The reason for the random
prefix is to minimize the possibility that a player can trigger
the escape sequence processing within text under their control
(dog names, etc.) the way they could if the sequence was fixed
in the source code. The random prefix remains the same throughout
the lifetime of a game because message window strings are
saved in the save file.

(There was actually a bug present because of the embedded
character even before the recent symbol changes, because if
someone was using a  different set of characters between games,
the saved messages would reflect the original characters, rather
than the current. That bug was introduced with the ability to
save messages to the savefile.)

A window port does not have to supply an XXX_putmixed() routine,
it can use genl_putmixed() which uses the old behavior of
embedding the sequence as a character within the string
and calling putstr(). genl_putmixed() takes care of the decoding
of the escape sequence.

This also #ifdef's out code in pager.c for converting a glyph
to a character, and uses mapglyph() to do that instead. Does
anyone see a problem with doing that through mapglyph instead
of repeating similar code within pager.c?
2006-10-17 23:06:31 +00:00
nethack.allison
a0986b1e30 statue patch (trunk only)
Pat wrote:
> <Someone> has a patch (we've added a couple of
> his earlier ones) which changes the statue display from a single
> one size fits all "`" to a gray monster symbol instead.
> But I think the idea is a good one, and along with the
> bouldersym option could make the fairly hard to
> distinguish back-tick character go away.

Sources tagged before applying NETHACK_PRE_STATUE,
and afterwards with NETHACK_POST_STATUE for easy
rollback.
2006-10-01 21:17:38 +00:00
nethack.allison
374e9fbbb4 more symbol stuff (trunk only)
- reduce the number of symbol tables for each graphics
set {PRIMARY, ROGUESET} from three {map, oc, mon}
tables for each of the display symbols, the loadable symbols,
and the rogue symbols, to one continguous table for
each:
showsyms: the current display symbols
l_syms: the loaded, alterable symbols
r_syms: the rogue symbols

- Modify mapglyph so that the index into the symbolt table is
available as a return value (it was a void function), rather than
just the char converted from the glyph.
- That makes it possible for a window port to use the same
index value to extract from another table (perhaps a unicode
table) for a different set of display symbols. The  index
is much more useful than trying to convert the character
into another type of symbol, as some contributed patches
have done.
- It is much easier to load a single alternative flat table to
make substitutions, since the corresponding value just
has to get placed into the same index offset in the
alternative table.

This also fixes a bug I found in botl.c, where you could
go to the rogue level, and the bottom line gold symbol
was not being updated with the new character as it should.
The reason was because the gold value had not changed,
only the field symbol used had changed.

This updates multiple ports to place a (void) cast on
the mapglyph call, now that it returns a value, so this
is going to generate a lot of diff e-mails.
2006-10-01 19:30:08 +00:00
nethack.allison
72011cb75f more followup (trunk only)
make the handling recognition use an int instead of string.
2006-09-21 05:53:08 +00:00
nethack.allison
253bf359af drawing overhaul (trunk only)
This is an overhaul to the NetHack drawing mechanism.

- eliminates the need to have separate lists in drawing.c
for the things and their associated explanations by grouping
those thing together on the same inializer in a struct.

- replaces all of these options: IBMgraphics, DECgraphics, MACgraphics,
graphics, monsters, objects, boulder, traps, effects

- drawing.c contains only the set of NetHack standard symbols for
the main game and a set of NetHack standard symbols for the
roguelevel.

- introduces a symbols file that contains named sets of
symbols that can be loaded at run time making it extensible
for situations like multinational code pages like those reported
by <Someone>, without hardcoding additional sets into the game code.

- symbols file uses names for the symbols, so offsets will not break
when new things are introduced into the game, the way the older
config file uchar load routines did.

- symbols file only contains exceptions to the standard NetHack
set, not entire sets so they are much less verbose than all of
the g_FILLER() entries that were previously in drawing.c

- 'symset' and 'roguesymset' config file options for
preselecting a symbol set from the file called 'symbols'
at startup time. The name of the symbols file is not under the
users control, only the symbol set name desired from within the
symbols file is.

- 'symset' config file option loads a desired symbol set for
everything but the rogue level.

- 'roguesymset' config file option loads a desired symbol set
for the rogue level.

- 'SYMBOLS' config file option allows the user to specify replacement
symbols on a per symbol basis. You can specify as many or as few symbols
as you wish. The symbols are identified by a name:value pair, and line
continuation is supported. Multiple symbol assignments can be made on
the same line if each name:value pair is separated by a comma.
For example:
SYMBOLS = S_bars:\xf0, S_tree: \xf1, S_room:\xfa \
	  S_fountain:\xf4 \
	  S_boulder:0

- 'symbols' file has the following structure:
start: DECgraphics
	Handling: DEC
	S_vwall: \xf8			# meta-x, vertical rule
	S_hwall: \xf1			# meta-q, horizontal rule
finish
start: IBMgraphics
	Handling: IBM
	S_vwall: \xb3			# meta-3, vertical rule
	S_hwall: \xc4			# meta-D, horizontal rule
finish

- 'symbols' file added to the source tree in the dat directory

- Port Makefiles/scripts will need to be adjusted to move them into
HACKDIR destination
2006-09-21 01:46:15 +00:00
nethack.allison
999424aecc more zeroany (trunk only) 2006-07-09 17:39:43 +00:00
nethack.allison
7ea8507d26 remove duplication
Janet pointed out that I must have just hought I was seeing double :-)
2006-06-27 00:17:35 +00:00
nethack.allison
174b985267 Allow makefile build with VC2005 (trunk only) 2006-06-25 22:40:58 +00:00
nethack.allison
8fc541006b win32 embedded version info
I noticed that the NetHack version being reported in the
system's event log was old:
Faulting application nethackw.exe, version 3.4.2.0,
faulting module nethackw.exe, version 3.4.2.0, fault address 0x001648eb.
2006-06-14 10:48:09 +00:00
nethack.allison
3e2f7f946d fix W343-1 open win32 bug from known bugs page
W343-1 Redirecting score output through a pipe doesn't work.
2006-04-25 01:16:54 +00:00
nethack.rankin
2c0a072ef1 main() reorganization (trunk only)
Move some internals-related code out of port-specific main so that
it isn't duplicated a bunch of times.  One minor side-effect of this
change is that if you auto-pickup something at the very start of a game,
it will happen after any full moon/new moon/Friday 13th message rather
than before.  There's a second change for some:  the shared main() used
by several of the micro ports had a small difference in game play--if you
saved a game while on an engraving, it would automatically be read when
you resume--that will now occur for everybody [Elbereth weenies rejoice!].
pcmain() was also calling update_inventory() at start of play.  That's
unnecessary for new games, where inventory initialization triggers a call
to it for each item added to your pack; but I wasn't sure about restored
games, so everybody gets it there now.

     The Mac and BeOS ports evidently haven't been touched it some time;
they still referenced flags.move which got replaced by context.move quite
a while back.  The Windows GUI code has a declaration for mswin_moveloop()
which appears to be non-existant, but I left it alone.  I assume that the
Qt interface uses the existing main() routines; at least I couldn't find
any start of game code specific to it.  vmsmain's revised main() is the
only one which has been tested.
2006-04-02 07:35:30 +00:00