A-code game command line options

A-code game executables (other than Windows Glk-instrumented ones) can take a number of command line arguments:

-j invert the default wrap/justify setting of the game.
In wrap mode, text is simply broken into lines according to the screen width (see the -s keyword). With justification turned on, each line is right-justified. All of this pre-suppose a fixed font being in use. For variable font devices, which tend to do their own wrapping, the default screen width should be set to zero, meaning "infinite", and the margin should be specified as zero too. This keyword is suppressed if the GLK symbol is defined and in games written in the "old style" A-code (i.e. in adv550).
-b invert the default setting for blank lines around the '?' prompt line.
In old-style A-code, which does not distinguish between replies to queries and general commands, this only affects presence/absence of a blank line after the prompt line, and never before it.
-s <W>x<H>[-<M>]   set screen size (width in fixed font characters, height in lines, and margin in fixed font blanks).
The default screen dimension is 80x24-1, the margin being set to 1 character. The -s keyword allows a different screen size (and optionally margin) to be specified. Screen width of zero means "infinite" width. Note that the line length cannot be set to less than 16 characters and the minimal number of lines per screen is 5. This keyword is suppressed if the GLK symbol is defined.
-o [<baudrate>]   set the output speed as specified by the argument. Meaningfule only in the "dumb" console mode and only if C sources compiled without the NO_SLOW symbol. Baud rate is specified in bits per second, and taking into the account control and parity bits, the output speed in characters per second is simply the baud rate divided by 10. The game coerces the specified baud rate to the nearest lower standard value (one of 110, 300, 600, 1200, 2400, 4800 and 9600), except that anything below 110 (the speed of a teletype) is also treated as 110. The default value is 300 - the speed of a DECwriter. Note, however, that under DOS and Windows any baud rate above 600 results in no slowdown at all.
-p pause on exit.
Requests that after printing the final exit message the game prompts the player for a <CR>, before exiting. This feature is intended for players who wich to play console version of the game, in a window which closes as soon as the game exits.
-d <dbsdir> if using a data file, specify its directory.
By default, the game data file is assumed to live in the same directory as the executable. The -d keyword allows a separate location to be specified. The program will attempt to work out the separator which should follow the directory name, but if in doubt as to the appropriate one for the given platform, the dbs name will be simply concatenated with the supplied pathname -- hence if it doesn't work, try adding the trailing separator to the pathname.
[-r] <dumpfile> restore game from dump.
The -r keyword is optional in that any command line argument which is not a keyword and is not associated with a preceding keyword, will be taken as the name of the dumpfile to restore on invocation. It only works if the game actively supports this feature.
-c <cominfile> replay game from log.
This is a debugging tool, which allows a game to be replayed from a log file (see below). If the logfile contains more than one session log, only the first session will be replayed. The log contains the value of the random seed used in the session, thereby ensuring that the game is replayed exactly, despite any randomisation. [NB, this will only work if the log was created by exactly the same version of the game.]
-l <logfile> log the game (non-Glk executables)
Specifies the file into which a session log is to be written. The log is human-readable, but has some additional features allowing it to be used subsequently for replaying the session. If the nominated logfile already exists, it gets appended to. If no logile is specified the name of the game is used, suffixed with .log.
-log <logfile> log the game (non-Windows Glk executables).
As -l above (because the Glk interface quietly removes -l <logfile> from the command line).
-u {on|off|forbid}   set the initial state of undo-history collection.
The "forbid" state implies "off" and disallows the undo history. being subsequently switched on from within the game. The default state is "on" for games which define the verb UNDO, and "forbid" otherwise.
-h print command line usage summary.

The functionality of the -s, -u and -j keywords is also provided via kernel hooks (see procedure special() in advkern.c or adv00.c), so that the game may -- at author's discretion -- offer the player commands for toggling the justification switch, switching on and off the change history, and altering screen size and margin.

Any unknown or suppressed keywords are quietly ignored.


Back to A-code page
Back to main page
Mike Arnautov, Tuesday, 01-Jan-2008 05:17:33 MST