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



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
.



Relevant Pages

  • Re: Win32.RegistryKey BUG?????
    ... "If the second parameter in SetValue is an Int32 value, ... the value is stored as a string with the REG_SZ registry value type. ... this a BUG or there is a logical explenation for that??? ...
    (microsoft.public.dotnet.languages.vc)
  • Re: strchr function fails to work properly on Windows 2003 Server
    ... The second parameter of strchr is supposed to be a character, ... a pointer. ...
    (microsoft.public.vc.language)
  • Re: rfind bug ?
    ... No. Don't you think someone would have found such an obvious bug by ... That is, the second parameter to .rfind, namely `start`, is relative ... to the *left* end of the string, ... The difference is what it signifies: start of search, ...
    (comp.lang.python)
  • Re: LOBS
    ... It gives me like, only 1 character, which is not even the first ... If you would look in documentation more carefully, you may notice, that semantics of dbms_lob.substr differs from the semantics of substr function. ... The second parameter is amount and the third - offset. ...
    (comp.databases.oracle.server)
  • Re: rfind bug ?
    ... No. Don't you think someone would have found such an obvious bug by now? ... That is, the second parameter to .rfind, namely `start`, is relative ... to the *left* end of the string, ... my misinterpretation of the OP's misinterpretation ...
    (comp.lang.python)