1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-05-09 00:35:19 +01:00
Commit graph

17 commits

Author SHA1 Message Date
fc123cdd1a
Unconditionally enable UTF8_GLYPHS
You can just disable UTF8graphics at runtime if you don't want it.
2024-05-12 11:31:47 +01:00
378f50efd6
Always enable TEXTCOLOR and STATUS_COLORS and require terminfo
Always enabled: TERMLIB ASCIIGRAPH TERMINFO TEXTCOLOR STATUS_COLORS

Removed: NO_TERMS
2024-05-06 18:48:53 +01:00
5b11a4159a
Remove LINT
Terrible things were done in the name of pacifying some ancient LINT
program: undo all that.

NitroHack commit 5de56436e4ec278b5b30ffd4b74482815c3aaff5

Also clean up some weird formatting caused by cproto in src/hacklib.c.
2024-05-06 13:24:42 +01:00
34aaaf57e1
Replace FDECL, NDECL, VDECL, and E macros with their definitions
E as in the alias for extern, not the completely different E that's an
alias for EXPLOSION used in objects.c.
2024-05-06 00:28:05 +01:00
8583c380bb
Replace genericptr compatibility macro with its definition
Also genericptr_t, which is the same thing but a typedef instead of a macro.
2024-05-05 15:48:55 +01:00
bd8b743c9a
Convert all declarations from K&R style to ANSI style
Now compiles with gcc -Werror=old-style-definition.  It should also be
valid C23, although I haven't tried compiling with -std=c2x yet -
there might be something else making it invalid.

This also allows getting rid of (UN)WIDENED_PROTOTYPES and _P defines.
I kept OBJ_P, MONST_P, and DLB_P for now.

Done mostly by running

cproto -Iinclude -C"int\nf(\n\ta,\n\tb)" -F"int\nf(a, b)" -pa

then

sed -i 's/^\(\(static \)\?[a-zA-Z]\+\) $/\1/'

on each file, with some manual corrections/adjustments done after and
anything cproto can't handle manually converted.  The sed is to remove
the extra space that cproto adds at the end of the line with the
return type name.

"register" is inconsistently sometimes removed - generally, I removed
it when I did it manually but cproto didn't.  GCC ignores register
anyway so this shouldn't matter much.
2024-05-05 01:18:53 +01:00
8fad6a1255
Drop support for SCO UNIX, A/UX, IRIX, and no signed/void/const
Also clean up some extra whitespace caused by coan2.
2024-05-03 21:57:59 +01:00
9547b5c209
Remove most UNIX-variant-specific ifdefs
Always enabled:
SYSV, LINUX, POSIX_TYPES

Removed:

LATTICE, BSD, ULTRIX, ultrix, ULTRIX_PROTO, AIX_31, _BULL_SOURCE,
_AIX32, NeXT, SUNOS4, BOS, GENIX, HISX, UNIXPC, CYGWIN32, HPUX, SVR4,
PCMUSIC, DGUX, AMIX, LSC, DLBRSRC, OPTION_LISTS_ONLY

(Some of these, specifically PCMUSIC, DLBRSRC, and OPTION_LISTS_ONLY
are not UNIX-related.  I just forgot to remove them earlier.)

Also:

Fix a "#ifdef GOLDotmp" in artifact.c (this exists in dNetHack,
presumably a bad find/replace for obj -> otmp).

Clean up system.h by including header files where possible.
Unfortunately, we can't include term.h since some of the macro
names (like bell) conflict.
2024-05-01 22:01:27 +01:00
774c4d5dca
Remove most system-specific ifdefs (except for UNIX and variants)
Always enabled:
DLBLIB, CHDIR

Removed:
UMAC, PYRAMID_BUG, MAC_GRAPHICS_ENV, AMIGA, TOS, AMII_GRAPHICS,
GEM_GRAPHICS, BEOS_GRAPHICS, __BEOS__, QT_GRAPHICS, GNOME_GRAPHICS,
MSWIN_GRAPHICS, X11_GRAPHICS, WIN32, WIN_CE, WIN32CON, VMS, MICRO,
MFLOPPY, __EMX__, __DJGPP__, __MWERKS__, __MSDOS__, MSDOS, OS2_HPFS,
GNUDOS, AMIGA_WBENCH, OS2, apollo, _WIN32, __SASC_60, mac, macintosh,
WIN32_GRAPHICS, __GO32__, __BORLANDC__, ANCIENT_VAXC, __TURBOC__,
__SASC, AMIGA_INTUITION, AZTEC, AZTEC_C, AZTEC_50, AZTEC_36, PC9800,
_DCC, DCC30_BUG, MICROPORT_BUG, GCC_BUG, MICROPORT_BUG, BSD_43_BUG,
MICROPORT_286_BUG, AMIFLUSH, THINKC4, SCREEN_VGA, SCREEN_DJGPPFAST,
SCREEN_8514, __DECC, THINK_C, __SC__, PC_LOCKING, STUPID, VIDEOSHADES,
_MSC_VER, OS2_CSET2, OS2_CSET2_VER_1, OS2_CSET2_VER_2, DUMB,
AIXPS2_BUG, UNIX386MUSIC, VPIX_MUSIC

Also remove include/winami.h because I forgot to earlier.

coan2 doesn't remove unnecessary empty lines around where the ifdef
used to be.  I removed them manually in some places, but there are
probably still lots left.  Also, the indentation of preprocessor
directives in some places is probably wrong.
2024-05-01 20:28:55 +01:00
1f5f3dab6d
VA_DECL/VA_END usage (from NetHack 3.6)
Based on vanilla commit fabf9cd9017ce13e31f47e364cd15a2daff9f75a:

VA_DECL/VA_END usage

Make the variadic functions look more like ordinary code rather than
have the function opening brace be hidden inside the VA_DECL() macro.
That brace is still there, but VA_DECL() now needs to be followed by
a visible brace (which introduces a nested block rather than the
start of the funciton).  VA_END() now provides a hidden closing brace
to end the nested block, and the existing closing brace still matches
the one in VA_DECL().

Sample usage:
void foo VA_DECL(int, arg)  --macro expansion has a hidden opening brace
{  --new, explicit opening brace (actually introduces a nested block)
  VA_START(bar);
  ...code for foo...
  VA_END();  --expansion now provides a closing brace for the nested block
}  --existing closing brace, still pairs with the hidden one in VA_DECL()

This should help if/when another round of reformatting ever takes place,
and also with editors or other tools that do brace/bracket/parenthesis
matching.

I had forgotten that there were variadic functions in sys/* and ended
up modifying a lot more files than intended.  The majority of changes
to those just inserted a new '{' line so that revised VA_END()'s '}'
won't introduce a syntax error.  A couple of them needed VA_END() moved
so that local variables wouldn't go out of scope too soon.  Only the
Unix ones have been tested.
2024-04-29 18:16:19 +01:00
e9a1856489
Remove unused files
For unsupported systems (anything but unix) and unsupported
windowports (anything but curses and tty).

Fixes https://github.com/Chris-plus-alphanumericgibberish/dNAO/issues/2051
2024-04-29 18:07:30 +01:00
e17b47ea1e Support UTF8graphics and IBMgraphics on curses
IBMgraphics support is implemented by translating to UTF-8, so it
requires a UTF-8 supporting terminal, but not code page 437.

Also:
-Enable HAVE_SETLOCALE by default (it is part of standard C and
 required for curses UTF8graphics support).
-Use a new check for UTF-8 support (taken from UnNetHack).  It is
 slower (it works by writing two non-breaking spaces and checking the
 cursor position), but should be better at detecting UTF-8 support than
 the old one.
--A side-effect of these changes is that UTF8graphics is now default
  with many configurations: this was always supposed to be the
  case (there is code for detecting support for various symsets and
  setting them if applicable as the default), but the check for
  UTF8graphics only happened if HAVE_SETLOCALE was set (which was
  disabled by default).  The new check for UTF8graphics does not use
  setlocale and HAVE_SETLOCALE is default now anyway.
-Remove default angel symbol overrides from IBMgraphics because they
 were broken: they didn't work if you started the game with IBMgraphics
 and the "monsters" option set (but did if you switched to IBMgraphics
 later), and weren't reset when you switched away from IBMgraphics,
 resulting in broken symbols until you restarted the game.  I'm not
 sure what the proper solution for this is: the game shouldn't override
 the player's settings, but the "monsters" option doesn't support
 UTF-8, and changing some other monster symbols shouldn't make it
 impossible to use the fancy angel symbols.
-Fix some curses memory leaks.

Based on the following commits from UnNetHack:

f6e3f519e: Support UTF8graphics on curses
4931c6d2d: Support IBMgraphics on curses
fb551d4d1: Default to UTF8graphics on supporting terminals
d19886aae: Fix memory leaks in curses port

As well as several commits fixing bugs in the previously listed commits:

704efb5be: UTF-8 detection: re-read current terminal settings before disabling read timeout
2db4b9dba: More careful setting the terminal into raw mode
ec0a68fb5: Remove unnecessary utf8 initialization code
2024-03-23 19:03:45 -04:00
demogorgon22
c20f5786c2 Implement a 3.4.3 compatible version paxed's fuzzer from vanilla. 2019-09-22 17:42:01 -04:00
NeroOneTrueKing
72ff38e5e3 Add basic rooms to non-special maze levels
Funnily enough, this only affects the maze levels between the Challenge and the Castle.
Literally every level of Gehennom is a special level (or is the invocation level).
2018-12-23 17:22:11 -08:00
Chris-plus-alphanumericgibberish
5901b7c7ca Uploading current NAO sources
Thanks, kerio!
2013-10-15 16:49:44 -04:00
Chris-plus-alphanumericgibberish
8c319709b5 Deleting nonfunctional NAO sourcs 2013-10-15 16:48:40 -04:00
Chris-plus-alphanumericgibberish
e6bcb76bf4 Initial Commit
Uploading NAO sources
2013-10-15 16:26:51 -04:00