Difference between revisions of "Portability issues"

From RogueBasin
Jump to navigation Jump to search
(Escape key is tricky)
Line 8: Line 8:
** Extensions to ASCII are not portable.  Unicode is portable, though, plus it includes all the old IBM DOS characters, though not necessarily at the same code points.
** Extensions to ASCII are not portable.  Unicode is portable, though, plus it includes all the old IBM DOS characters, though not necessarily at the same code points.


* Some OSs (such as any derive from or copy Unix, or follow the POSIX standards) are case-sensitive as far as filenames are concerned.  Others (like DOS or Windows) aren't.  Still others (like Mac OS X) are inconsistent in their case-sensitivity or preservation.  So, don't rely on any one case behavior for maximum portability.
* Some [[Operating Systems]] (such as any derive from or copy [[Unix]], or follow the [[POSIX]] standards) are case-sensitive as far as filenames are concerned.  Others (like [[DOS]] or [[Windows]]) aren't.  Still others (like [[Mac OS X]]) are inconsistent in their case-sensitivity or preservation.  So, one shouldn't rely on any one case behavior for maximum portability.
** There are [[Operating Systems]] that forbide using certain characters in the file names.
** [[Operating Systems]] also can restrict the length of the filename or the total length of absolute path of file.


* Which characters are used to indicate the end of a line in text files is OS-specific. So be careful when parsing text files.
* Which characters are used to indicate the end of a line in text files is [[OS-specific]]. One has to be careful when [[parsing text files]].


== Input ==
== Input ==


* Use of the Escape key should be avoided, because escape is a special character for many of the terminals that roguelikes are traditionally played on.  These terminals sometimes must hold up an escape key to see if it should be processed or passed on, and that causes annoying delays in a user interface that uses Escape.
* Use of the Escape key should be avoided, because escape is a [[special character]] for many of the terminals that roguelikes are traditionally played on.  These terminals sometimes must hold up an escape key to see if it should be processed or passed on, and that causes annoying delays in a user interface that uses Escape.


== Mac OS X ==
== Mac OS X ==


* The current version of the standard OS X terminal (Terminal.app) only supports 8 colors. Early versions of MacOS X curses did not support color at all.
* The current version of the standard [[Mac OS X]] terminal (Terminal.app) only supports 8 colors. Early versions of MacOS X curses did not support color at all.


== DOS ==
== DOS ==


* Filenames are limited to 8 characters + a 3 characters extension. Additionally filenames must not contain whitespace or special characters.
* Filenames are limited to 8 characters + a 3 characters extension. Additionally filenames must not contain whitespace or [[DOS special characters]].


* Memory on the systems that traditionally ran DOS is also tight and inconveniently segmented.  Later models had a variety of schemes available for accessing "expanded" or "extended" memory, but being maximally portable to this platform means using less than 640KB of RAM.
* Memory on the systems that traditionally ran [[DOS]] is also tight and inconveniently segmented.  Later models had a variety of schemes available for accessing [[expanded memory]] or [[extended memory]], but being maximally portable to this platform means using less than 640KB of RAM.

Revision as of 11:37, 3 February 2005

Portability Issues

The purpose of this article is to collect portability issues often encountered by roguelike programmers as well as possible solutions for these problems.

General

  • Only the characters of the basic (7bit) ASCII character set are reasonable portable. Using characters from extended character sets (like the solid blocks from the IBM DOS character set) or characters which aren't classified as printable by the ASCII standard (like the smileys from IBM DOS) will probably cause problems.
    • Extensions to ASCII are not portable. Unicode is portable, though, plus it includes all the old IBM DOS characters, though not necessarily at the same code points.
  • Some Operating Systems (such as any derive from or copy Unix, or follow the POSIX standards) are case-sensitive as far as filenames are concerned. Others (like DOS or Windows) aren't. Still others (like Mac OS X) are inconsistent in their case-sensitivity or preservation. So, one shouldn't rely on any one case behavior for maximum portability.
    • There are Operating Systems that forbide using certain characters in the file names.
    • Operating Systems also can restrict the length of the filename or the total length of absolute path of file.

Input

  • Use of the Escape key should be avoided, because escape is a special character for many of the terminals that roguelikes are traditionally played on. These terminals sometimes must hold up an escape key to see if it should be processed or passed on, and that causes annoying delays in a user interface that uses Escape.

Mac OS X

  • The current version of the standard Mac OS X terminal (Terminal.app) only supports 8 colors. Early versions of MacOS X curses did not support color at all.

DOS

  • Filenames are limited to 8 characters + a 3 characters extension. Additionally filenames must not contain whitespace or DOS special characters.
  • Memory on the systems that traditionally ran DOS is also tight and inconveniently segmented. Later models had a variety of schemes available for accessing expanded memory or extended memory, but being maximally portable to this platform means using less than 640KB of RAM.