Skip to content

Commit

Permalink
some of Ray Chason's MSDOS and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nhmall committed Mar 5, 2016
1 parent ef9cd17 commit 7885796
Show file tree
Hide file tree
Showing 22 changed files with 1,484 additions and 201 deletions.
10 changes: 10 additions & 0 deletions doc/fixes36.1
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,16 @@ X11: status display split into three columns to accomodate Stone/Deaf/Lev/&c;
NetHack Community Patches (or Variation) Included
-------------------------------------------------
Malcolm Ryan's improved tin opener
Ray Chason's keyboard may stop responding after locking or unlocking a door when
using altkeyhandler=nhraykey.dll
Ray Chason's fix: window interfaces that support transparency may give away unseen
parts of the map
Ray Chason's xprname should honor iflags.menu_tab_sep
Ray Chason's punctuation for "That foo is really a mimic."
Ray Chason's proper background tiles for lava and water
Ray Chason's MS-DOS port restored to functionality with credit to Reddit user
b_helyer for the fix to sys/share/pcmain.c
Ray Chason's MSDOS port support for some VESA modes


Code Cleanup and Reorganization
Expand Down
4 changes: 3 additions & 1 deletion include/flag.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.6 flag.h $NHDT-Date: 1451683047 2016/01/01 21:17:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.93 $ */
/* NetHack 3.6 flag.h $NHDT-Date: 1457207000 2016/03/05 19:43:20 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.101 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -261,6 +261,8 @@ struct instance_flags {
#ifdef MSDOS
boolean hasvga; /* has a vga adapter */
boolean usevga; /* use the vga adapter */
boolean hasvesa; /* has a VESA-capable VGA adapter */
boolean usevesa; /* use the VESA-capable VGA adapter */
boolean grmode; /* currently in graphics mode */
#endif
#ifdef LAN_FEATURES
Expand Down
7 changes: 4 additions & 3 deletions include/pcconf.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.6 pcconf.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */
/* NetHack 3.6 pcconf.h $NHDT-Date: 1457207019 2016/03/05 19:43:39 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.19 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -79,13 +79,15 @@
#if (defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST)) && !defined(PC9800)
#ifdef USE_TILES
#define SCREEN_VGA /* Include VGA graphics routines in the build */
#define SCREEN_VESA
#endif
#endif
#else
#undef NO_TERMS
#undef SCREEN_BIOS
#undef SCREEN_DJGPPFAST
#undef SCREEN_VGA
#undef SCREEN_VESA
#undef TERMLIB
#define ANSI_DEFAULT
#endif
Expand Down Expand Up @@ -310,9 +312,8 @@
#endif
/* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead
*/
#if defined(SCREEN_8514) || defined(SCREEN_VESA)
#if defined(SCREEN_8514)
#undef SCREEN_8514
#undef SCREEN_VESA
#define SCREEN_VGA
#endif
/* Graphical tile sanity checks */
Expand Down
43 changes: 43 additions & 0 deletions include/tileset.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* NetHack 3.6 tileset.h $NHDT-Date: 1457207052 2016/03/05 19:44:12 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.0 $ */
/* Copyright (c) Ray Chason, 2016. */
/* NetHack may be freely redistributed. See license for details. */

#ifndef TILESET_H
#define TILESET_H

struct Pixel {
unsigned char r, g, b, a;
};

struct TileImage {
/* Image data */
unsigned width, height;
struct Pixel *pixels; /* for direct color */
unsigned char *indexes; /* for paletted images */
};

boolean FDECL(read_tiles, (const char *filename, BOOLEAN_P true_color));
const struct Pixel *NDECL(get_palette);
void NDECL(free_tiles);
const struct TileImage *FDECL(get_tile, (unsigned tile_index));

/* Used internally by the tile set code */
struct TileSetImage {
/* Image data */
unsigned width, height;
struct Pixel *pixels; /* for direct color */
unsigned char *indexes; /* for paletted images */
struct Pixel palette[256];

/* Image description from the file */
char *image_desc;

/* Tile dimensions */
unsigned tile_width, tile_height;
};

boolean FDECL(read_bmp_tiles, (const char *filename, struct TileSetImage *image));
boolean FDECL(read_gif_tiles, (const char *filename, struct TileSetImage *image));
boolean FDECL(read_png_tiles, (const char *filename, struct TileSetImage *image));

#endif
4 changes: 2 additions & 2 deletions src/apply.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1456528594 2016/02/26 23:16:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.222 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1457207021 2016/03/05 19:43:41 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.223 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -395,7 +395,7 @@ register struct obj *obj;
break;
}
seemimic(mtmp);
pline("That %s is really %s", what, mnm);
pline("That %s is really %s.", what, mnm);
} else if (flags.verbose && !canspotmon(mtmp)) {
There("is %s there.", mnm);
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1452660189 2016/01/13 04:43:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.219 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1457207033 2016/03/05 19:43:53 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.220 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -355,7 +355,7 @@ doextlist(VOID_ARGS)
return 0;
}

#ifdef TTY_GRAPHICS
#if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS)
#define MAX_EXT_CMD 50 /* Change if we ever have > 50 ext cmds */

/*
Expand Down
12 changes: 10 additions & 2 deletions src/display.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1446808439 2015/11/06 11:13:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.77 $ */
/* NetHack 3.6 display.c $NHDT-Date: 1457207034 2016/03/05 19:43:54 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.82 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
Expand Down Expand Up @@ -1748,7 +1748,8 @@ xchar x, y;
int idx, bkglyph = NO_GLYPH;
struct rm *lev = &levl[x][y];

if (iflags.use_background_glyph) {
if (iflags.use_background_glyph && lev->seenv != 0
&& gbuf[y][x].glyph != cmap_to_glyph(S_stone)) {
switch (lev->typ) {
case SCORR:
case STONE:
Expand All @@ -1769,9 +1770,16 @@ xchar x, y;
case CLOUD:
idx = S_cloud;
break;
case POOL:
case MOAT:
idx = S_pool;
break;
case WATER:
idx = S_water;
break;
case LAVAPOOL:
idx = S_lava;
break;
default:
idx = S_room;
break;
Expand Down
6 changes: 4 additions & 2 deletions src/invent.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.6 invent.c $NHDT-Date: 1456907837 2016/03/02 08:37:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.196 $ */
/* NetHack 3.6 invent.c $NHDT-Date: 1457207035 2016/03/05 19:43:55 $ $NHDT-Branch: chasonr $:$NHDT-Revision: 1.197 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -1935,7 +1935,9 @@ long quan; /* if non-0, print this quantity, not obj->quan */
*/
if (cost != 0 || let == '*') {
/* if dot is true, we're doing Iu, otherwise Ix */
Sprintf(li, "%c - %-45s %6ld %s",
Sprintf(li,
iflags.menu_tab_sep ? "%c - %s\t%6ld %s"
: "%c - %-45s %6ld %s",
(dot && use_invlet ? obj->invlet : let),
(txt ? txt : doname(obj)), cost, currency(cost));
} else {
Expand Down
Loading

0 comments on commit 7885796

Please sign in to comment.