/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
#include "common/file.h"
#ifndef GLK_AGT_INTERP
#define GLK_AGT_INTERP
namespace Glk {
namespace AGT {
/* This file contains variables and data structures used
by the interpreter but not read in from the gamefile.
For the rest of the data structures, see agility.h and
agtdata.c */
#ifndef global
#define uagt_defined_global
#define global extern
#endif
/* -------------------------------------------------------------------- */
/* The following are debugging and diagnostic flags. */
/* They are mainly intended for debugging the interpreter, but */
/* they could concievable be used for debugging games under the */
/* interpreter */
/* -------------------------------------------------------------------- */
global rbool stable_random;
/* --Force random numbers to be repeatable. */
global rbool DEBUG_MEM; /* prints out information on memory allocation */
global rbool debug_parse; /* Prints out long parse diagnostic information
after the sentence has been parse but before
disambiguation */
global rbool DEBUG_EXEC_VERB; /* This prints out a line indicating each command
that exec_verb() is asked to run */
global rbool DEBUG_DISAMBIG; /* Print out dismabiguation debugging info */
global rbool DEBUG_SMSG; /* Print out STANDARD message info */
#define DEBUG_AGT_CMD flag[0] /* This sends metacommand execution information
to either the screen or debugfile, depending on
whether DEBUG_OUT is true or false. */
global rbool debug_disambig, debug_any;
/* These determine if metacommands are traced during disambiguation
or during the scanning of ANY commands */
global rbool DEBUG_OUT; /* True if debugging output is redirected somewhere
other than the screen */
global Common::DumpFile *debugfile; /* Where debugging output should be sent */
#define def_DEBUG_MEM 1 /* parser.c */
/* -------------------------------------------------------------------- */
/* The following are AGT 'purity' flags; they turn off features of */
/* my interpreter that are not fully consistent with the original AGT.*/
/* More are defined in agility.h, and you should look there for general */
/* notes */
/* -------------------------------------------------------------------- */
/* The following are defined (and described) in agil.c */
extern rbool PURE_INPUT, PURE_TONE;
#define PURE_WEAR 1 /* If this is cleared, then things taken off
still stay in the player's inventory.
The support for this isn't quite complete yet
(there are one or two checks that need to be done
but aren't) and so right now this should be 1. */
global rbool PURE_DOT; /* Treats period as a letter-character and not
as punctuation. This should be set automatically
during initialization based on whether any words
in the dictionary have dots. */
#define FORCE_PURE_DOT 0 /* This forces the period to be treated as a letter
even if there are no words in the dictionary
containing periods. The only reason to set
this was if you were concerned that knowledge
about the presence or absence of periods in the
dictionary would give puzzles away. */
#define MEM_MARGIN (16*1024) /* 16K should be enough (SOGGY, the largest AGT
game, uses around 12K) */
#define PICT_SUPPORT 0 /* Graphics not supported */
#define TAB_SIZE 3 /* Number of spaces in a tab */
/* -------------------------------------------------------------------- */
/* Variables and Flags related to Metaverbs */
/* -------------------------------------------------------------------- */
global rbool notify_flag, listexit_flag, menu_mode;
global rbool cmd_saveable; /* set indicates that this command can be repeated
with AGAIN. */
global rbool can_undo; /* Can we UNDO the last turn? */
global uchar *restart_state, *undo_state; /* Store old game states for
RESTART and UNDO */
global char doing_restore; /* Have we been asked to RESTORE? */
global rbool do_look; /* True if we should print a room description */
global rbool do_autoverb; /* True if we should run the autoexec verb
for the current room */
/* The following are used for scripting and logging */
global rbool script_on;
global genfile scriptfile;
global signed char logflag; /* 1=logging, 2=replaying, 0=neither, 3=both */
global int logdelay; /* -1=wait for keypress, >=0 is numerical delay */
global genfile log_in, log_out;
global rbool fast_replay; /* If true, don't print MORE prompts. */
global rbool sound_on; /* Manipulated by music_cmd; can be used by interface
to determine if a tone should be made */
global integer *pictable; /* Used to decode picture numbers */
global fc_type hold_fc; /* Needed to print instructions on demand */
global unsigned short compass_rose; /* Used to pass compass info to
the os layer */
/* -------------------------------------------------------------------- */
/* Game State */
/* -------------------------------------------------------------------- */
global rbool quitflag, deadflag, winflag, endflag;
global rbool first_visit_flag, newlife_flag, room_firstdesc;
global rbool start_of_turn; /* True if running the command on the first
noun in the list */
global rbool end_of_turn; /* True if running command on last noun in
the list. */
global rbool actor_in_scope; /* Used to determine if the actor was in
scope when the command was originally
given */
global integer loc; /* Player's location */
global integer player_contents, player_worn; /* Worn and carried objects*/
global long totwt, totsize; /* Size and wt player is carrying around */
global integer curr_lives; /* Number of lives left. */
global long tscore, old_score; /* Total score */
global long objscore; /* Portion of tscore that comes from the POINTS
field of nouns and creatures. */
global integer turncnt; /* Number of turns that have passed */
global integer curr_time; /* The time in the game; in the format
1243==12:43 */
global rbool *flag; /* AGT Flags */
global short *agt_counter; /* AGT counters */
#ifdef AGT_16BIT
global short *agt_var; /*AGT variables */
#else
global long *agt_var;
#endif
global long agt_number; /* The number entered by the player */
global rbool agt_answer; /* Did the player get the answer to the last question
right? */
global tline l_stat, r_stat; /* Left and right parts of status line */
/* If r_stat is the empty string, l_stat should be
centered to create a Trinity-like status line */
global rbool nomatch_aware; /* Does the game use the nomatch extension
to the metacommand format?
(which allow and ANY to be
distingused) */
global rbool smart_look; /* If true, then LOOK