Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] Fix for bug W343-3, part 4: Description of the patch

6 views
Skip to first unread message

Ray Chason

unread,
Nov 5, 2005, 6:53:38 AM11/5/05
to
Bug W343-3 really consists of two distinct and unrelated bugs. This post is
the fourth of a four part series, and contains a description of the patch
presented in the third part.

The changes that fix the console output bug are the addition of
iflags.unicode to include/flags.h and all of the changes to
sys/winnt/nttty.c . All the rest implement the reduced IBMgraphics.

Changes to include/extern.h:
* The function switch_graphics now takes two parameters. If the first
parameter is IBM_GRAPHICS, the second parameter specifies the level;
if the level is 0, ASCII_GRAPHICS is set instead. If the first
parameter is not IBM_GRAPHICS, the second parameter is ignored.

Changes to include/flag.h:
* iflags.IBMgraphics, formerly a boolean, becomes an unsigned so it can
specify the graphics level.
* iflags.unicode is added. This is set in the Win32 console mode to
indicate that the Unicode API should be used for text output.

Changes to src/drawing.c:
* The change @@ -314,6 +314,209 @@ adds the reduced IBMgraphics
character sets for the normal dungeon. These differ from the
original in that disallowed characters are replaced by the
corresponding ASCII character.
* The changes @@ -652,12 +855,17 @@ and @@ -672,9 +880,16 @@ modify
switch_graphics to set IBMgraphics according to the given level.
* The change @@ -773,6 +988,42 @@ adds the IBMgraphics level 2 character
set for Rogue level objects. This differs from the original in that
the characters for the potion and the wand are set to the
corresponding ASCII character.
* The changes @@ -783,6 +1034,7 @@ through @@ -837,49 +1086,59 @@ modify
assign_rogue_graphics to implement IBMgraphics levels 1 and 2 for the
Rogue level.

Changes to src/options.c:
* The change @@ -101,11 +101,6 @@ removes IBMgraphics from the list of
binary options.
* The change @@ -245,6 +240,10 @@ adds IBMgraphics to the list of
composite options.
* The change @@ -540,7 +539,7 @@, @@ -551,7 +550,7 @@, and
@@ -563,13 +562,13 @@ provide the now-needed second parameter to
switch_graphics.
* The change @@ -1911,6 +1910,35 @@ parses IBMgraphics as a composite
option. For backward compatibility, it may still be specified in the
configuration file as a binary: true is equivalent to level 3, and
false to 0.
* The changes @@ -2154,9 +2182,6 @@ and @@ -2169,17 +2194,12 @@ remove
checks for IBMgraphics as a binary option.
* The change @@ -2974,6 +2994,8 @@ provides the setting of IBMgraphics
to the user-visible list of composite options.

Changes to sys/msdos/vidvga.c:
* Adjustment to comments.

Changes to sys/share/pcmain.c:
* Parse an IBMgraphics option to accept a level from 0 to 3.
* Add the needed second parameter to switch_graphics.

Changes to sys/share/unixtty.c:
* Pass level 3 to switch_graphics. Note that I have no way to be sure
that this works -- it's specific to SCO Unix, and I'm not about to
contribute to Darl McBride's frivolous lawsuit fund to test it.

Changes to sys/unix/unixmain.c:
* Parse an IBMgraphics option to accept a level from 0 to 3.
* Add the needed second parameter to switch_graphics.

Changes to sys/vms/vmsmain.c:
* Parse an IBMgraphics option to accept a level from 0 to 3. Note that
I have no direct way to know if this works.
* Add the needed second parameter to switch_graphics.

Changes to sys/winnt/nttty.c:
* Changes @@ -8,6 +8,7 @@ and @@ -37,6 +38,7 @@ are adjustments to
comments.
* Change @@ -166,6 +168,7 @@ checks for the presence of the Unicode
APIs. If GetVersion() returns the 31st bit set, NetHack is running on
a 95-based version of Windows. The Unicode APIs are not available and
NetHack will revert to the pre-patch behavior. This fix isn't needed
on 95-based Windows anyway.
* Change @@ -429,8 +432,22 @@ fixes console output for text strings.
The character is converted according to the user's configured IEM code
page and passed to the Unicode version of WriteConsoleOutputCharacter.
* Change @@ -471,12 +488,51 @@ fixes console output for map symbols.
The character is converted according to a fixed mapping containing
code page 437 plus the symbols in the space from 00 to 1F. A fixed
table is used so that a player using Lucida Console can get full
IBMgraphics (original set, i.e. level 3) regardless of the code page.
A table is used instead of MultiByteToWideChar so that the space from
00 to 1F will be converted correctly; this is necessary for correct
display of the Rogue level.

--
--------------===============<[ Ray Chason ]>===============--------------
The War on Terra is not meant to be won.
Delendae sunt RIAA, MPAA et Windoze

Kent Paul Dolan

unread,
Nov 5, 2005, 3:37:01 PM11/5/05
to
"Ray Chason" <johnn...@southland.smart.net.SPAMMEN.VERBOTEN> wrote:

> The changes that fix the console output bug

Does this fix modify the characters sent when in tiles mode? If so, very
likely that will need mending as well.

xanthian.


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

Ray Chason

unread,
Nov 5, 2005, 1:24:39 PM11/5/05
to
Kent Paul Dolan wrote:

> "Ray Chason" <johnn...@southland.smart.net.SPAMMEN.VERBOTEN> wrote:
>
>> The changes that fix the console output bug
>
> Does this fix modify the characters sent when in tiles mode? If so, very
> likely that will need mending as well.

The console output issue reported by Mariusz what-his-name affects the
console mode only. The fix is to use a different API. That fix does not
affect the tile mode.

The character set issue does affect the tile mode. The reduced IBMgraphics
can be used in any version of NetHack. If you don't want it, set
IBMgraphics:3, or just IBMgraphics as you do without the patch. You don't
get the reduced character set unless you specifically configure it, as
IBMgraphics:1 or IBMgraphics:2.

0 new messages