Wikia

Wikihack

IBMgraphics

2,032pages on
this wiki
Talk8

A user has suggested improving this page or section as follows:

"How is IBMgraphics related to DECgraphics? Strategy: Which one is better?"

IBMgraphics is an option that displays walls as continuous lines rather than as broken dashes, which is the best that plain ASCII can do. It also displays certain dungeon features with distinct symbols, and on some systems makes the Rogue level look more like the Epyx version of Rogue.

IBMgraphics requires a display device that displays code page 437, or a compatible code page. Many users of Microsoft Windows outside the United States have their terminals set to another code page, often code page 850, and this can affect the appearance of some symbols.

The complete symbol list Edit

Normal dungeon Edit

The complete symbol list for the normal dungeon is found in the array ibm_graphics in drawing.c.[1] The corresponding ASCII symbols are in defsyms.[2] Those symbols affected by IBMgraphics are listed here.

Code pointUsageAppearanceASCII
0xB3Vertical wall, beam, explosion|
0xC4Horizontal wall or beam-
0xDATop left corner-
0xBFTop right corner-
0xC0Bottom left corner-
0xD9Bottom right corner-
0xC5Cross wall-
0xC1T-up wall-
0xC2T-down wall-
0xB4T-left wall|
0xC3T-right wall|
0xB0Dark corridor#
0xB1Lit corridor#
0xF0Iron bars#
0xF1Tree±#
0xF4Fountain{
0xF7Lava, pool, water}
0xFARoom, doorway, ice, open drawbridge·.
0xFEOpen door| or -

Rogue level Edit

Certain objects have their appearance changed in the Rogue level; the array IBM_r_oc_syms governs this.[3] The exact changes are different on Linux than on MS-DOS and its descendants. The list here shows the more complete list used on MS-DOS.

A number of map symbols are also changed[4] and all creatures otherwise appearing as @ instead appear as ☺.[5]

Code pointUsageAppearanceASCII
0xBAVertical wall|
0xCDHorizontal wall-
0xC9Top left corner-
0xBBTop right corner-
0xC8Bottom left corner-
0xBCBottom right corner-
0xCECross wall, doors- or +
0xCAT-up wall-
0xCBT-down wall-
0xB9T-left wall|
0xCCT-right wall|
0x01Human, elf@
0x04Trap, web^ or "
0x05Food:
0x0CAmulet,
0x0EScroll?
0x0FGold, gems*
0x18Weapon)
0x5BArmor[]
0xADPotion¡!
0xB1Dark corridor#
0xB2Lit corridor#
0xE7Wandτ/
0xF0Stairs%
0xFARoom·.

Code page compatibility Edit

There are code pages other than 437 that will also display IBMgraphics correctly, because they differ only at code points that are not currently used by NetHack. These include 860 (Portuguese), 861 (Icelandic), 862 (Hebrew), and 865 (Nordic), and can be useful when code page 437 is unavailable.

Some other code pages will not quite display IBMgraphics perfectly, but are close enough to be usable when none of the above code pages are available. Some of these are shown in the table below.

For code page 858, use the column for code page 850.

Other known code pages have few of the necessary symbols and are completely unsuitable for IBMgraphics.

Code pointCP437CP737CP775CP850CP852CP855CP857CP863CP866CP869
0xAD¡φŁ¡şГ¡¾нΙ
0xE7τύńþšуnoneτчν
0xF0Ώ-----Ё-
0xF1±±±±˝ы±±ё±
0xF4Ϊ˘ЗЇχ
0xF7¸¸э¸ў΅
0xFA····˙Щ···ω

Configuring Code Page 437 Edit

On many platforms, it is possible to set the display device to display code page 437 instead of the default code page. This will enable NetHack to display the IBMgraphics as the DevTeam intended.

MS-DOS and Windows 95, 98, and Me Edit

Make sure CONFIG.SYS contains a line similar to this:

C:\WINDOWS\COMMAND\display.sys con=(ega,,1)

and AUTOEXEC.BAT contains lines similar to these:

mode con codepage prepare=((437) C:\WINDOWS\COMMAND\ega.cpi)
mode con codepage select=437

For MS-DOS substitute C:\DOS for C:\WINDOWS\COMMAND in both places.

Windows NT, 2000, XP, and Vista Edit

This section may also apply to Windows 2003 Server, but is untested on this version.

If code page 437 is not the default, it will be necessary either to configure the console window to use the Lucida Console font, or to run full screen (press Alt-Enter). With bitmap fonts in a window, only the characters for the default code page are loaded, and others do not display correctly. Bug W343-3 is also a problem for this configuration.

Once either Lucida Console is set, or the console window is in full screen mode, it is sufficient to type

chcp 437

and possibly for full-screen mode

mode con lines=25

and then start NetHack.

PuTTY Edit

On the PuTTY Configuration window (this appears when you first start PuTTY), select "Translation" under the "Window" configuration in the pane on the left. Then, in the pulldown menu marked "Received data assumed to be in which character set", select "CP437". You can then log in to the server as usual. You may also change this setting and then 'save' the session. The characater set (as well as other display settings, e.g., the color blue) will be used in your session from the on.

Linux Console Edit

If your system uses a unicode console, disable it (for the current session) with:

unicode_stop

Then re-load the default text font with one of the two following commands:

Debian-based systems:

consolechars -m cp437 -f default8x16

Redhat-based systems, others:

setfont default8x16

Finally, you may need to load the CP437 translation mode:

setfont -m cp437

If any of these commands fails, try running it as root by preceding each command with "sudo " (e.g., "sudo unicode_stop").

FreeBSD Console Edit

Load the CP437 console font with:

vidcontrol -f 8x16 cp437-8x16

Or add this to /etc/rc.conf to make it permanent:

font8x16="cp437-8x16"

X11 Edit

While most terminal programs for X11 readily support DECgraphics, they need additional setup for IBMgraphics. The usual way is to set the encoding to code page 437. The exact procedure to do this depends on the terminal program.

You also need a font that provides the necessary characters. X11 already provides at least one such font: the "fixed" font. It is already the default font for xterm. To preview it or to check that you have it, use one of these xfd commands:

# to preview it as a core font
xfd -fn -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1

# to preview it as an Xft font
xfd -fa Fixed-10

If you choose a font like Bitstream Vera Sans Mono, then X11 may substitute another font for some characters, causing graphical glitches if the two fonts have different monospace metrics.

Using konwert or filterm (any terminal) Edit

If your terminal supports UTF-8, but not code page 437, you can use konwert or filterm to transcode NetHack's output into something your terminal understands. Invoke one of them as follows:

# local play
nethack | konwert cp437-utf8

filterm ascii-ascii cp437-utf8 nethack

# remote play
telnet nethack.alt.org | konwert cp437-utf8

filterm ascii-ascii cp437-utf8 telnet nethack.alt.org

You will probably need to install these programs before they can be used.

xterm Edit

The current xterm does not provide an encoding for code page 437, but it does provide a charset "CP 437" which represents the upper half of (0x80 - 0xff) of CP 437. We can invoke luit manually to set up a Extended Unix Code that maps 0x00 - 0x7f to ASCII and 0x80 - 0xff to CP 437.

Xterm-ibm-oracle

An xterm using CP 437, showing IBMgraphics on the Oracle level.

To open an xterm using CP 437:

  • Use uxterm -fg gray -bg black to open an xterm using UTF-8, with a gray-on-black color scheme that works well with IBMgraphics.
    • The default font (fixed) looks nice, but you can set it explicitly with either -fn fixed or -fa Fixed-10.
  • Inside that xterm, invoke luit -g2 'CP 437'
    • You might need luit -gr g2 -g2 'CP 437' if your current locale defaults to -gr g1

When you invoke luit, it starts a new shell (from where you may start NetHack). When you exit your CP 437 shell, luit exits and you return to your UTF-8 shell.

Xterm-ibm-rogue

Oops, xterm with CP 437 has serious glitches on the Rogue level. Click image for details.

Unfortunately, your xterm will have serious graphical glitches at the Rogue level, because unlike a real IBM PC, luit does not map ASCII control characters to graphical characters (such as 0x01 to a smiley face adventurer). You may need to disable IBMgraphics while playing the Rogue level.

You can also install a CP437 or "VGA" font. There are several of these floating around the net; a nice one is included with bochs-2.0.

Konsole (KDE) Edit

KDE does not have an encoding for code page 437, or any similar encoding.

In menu Settings -> Encoding, if you select "Cyrillic (ibm866)" or "Western European (ibm850)", then the encoding will the walls, floors, doors and corridors for IBMgraphics, but fountains and moats will look strange. A better option is to select "Unicode (utf8)", then invoke luit as you would in an xterm.

Konsole-ibm

Konsole can do IBMgraphics, with some help from luit.

To configure Konsole for IBMgraphics:

  • Use Settings -> Font -> Select... to pick a good font, such as "Fixed [Misc]" size "10" (or any size).
    • Optionally, use Settings -> Size to resize your terminal for the new font.
  • Select Settings -> Schema -> Linux Colors for a good gray-on-black look.
  • Select Settings -> Encoding -> Unicode (utf8). Alternatively, start Konsole in a UTF-8 locale, so that the Default encoding is also UTF-8.
    • Optionally, now use Settings -> Save Sessions Profile... and call the profile something like "ibm".
  • At the command line, invoke luit -g2 'CP 437'

When you invoke luit, it starts a new shell (from where you may start NetHack). When you exit your CP 437 shell, luit exits and you return to your UTF-8 shell.

If you saved an "ibm" profile, then konsole -profile ibm will start a Konsole with the same settings. You still need to invoke luit -g2 'CP 437' before you start NetHack with IBMgraphics. If you add a "Terminal Sessions" applet to your KDE panel, you can also access your profile with Terminal Sessions -> New Session Using Profile -> ibm.

Unfortunately, your Konsole will have serious graphical glitches at the Rogue level. This happens if you set Konsole to utf-8 and use luit, or if you set Konsole to ibm850 or ibm866 and do not use luit. Either way, the software will not map ASCII control characters to graphical characters. You may need to disable IBMgraphics while playing the Rogue level.

gnome-terminal Edit

The current gnome-terminal does not have a setting for code page 437, but it does support other code pages that are equivalent for NetHack's purposes, such as 862 (Hebrew).

To set code page 862 on gnome-terminal:

  • Select Terminal, Set Character Encoding, and then Add or Remove.
  • In the pane on the left, select the line with description Hebrew and encoding IBM862.
  • Click the right-pointing arrow between the two panes.
  • Click Close.

The above steps only need to be done once for the lifetime of the Gnome installation. Once done, it is sufficient to:

  • Select Terminal, Set Character Encoding, and then Hebrew (IBM862).

It should be noted that the current default gnome-terminal font in Ubuntu Jaunty fully supports DECgraphics as long as eight_bit_tty is set to false.

Custom Map Symbols Edit

Some users may prefer to set their own symbols, either because they don't like the existing ones, or because it's easier than setting code page 437 just to play NetHack. See Custom map symbols for further details.

UTF-8 support Edit

A user has posted an experimental patch to RGRN (here's what it changes) allowing display of the IBMgraphics characters using UTF-8, rather than a special code page. Compatible terminals include the Linux console for kernels since 1.2.1, any Unix-like platform running a recent version of X11, and PuTTY for Windows users accessing public servers. The original is a patch against NetHack 3.4.0; Stephen Anthony Uy has adapted it for 3.4.3.

References Edit

  1. drawing.c, line 317
  2. drawing.c, line 206
  3. drawing.c, line 741
  4. drawing.c, line 808
  5. drawing.c, line 797

Around Wikia's network

Random Wiki