1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef GLK_HUGO_DEFINES 24 #define GLK_HUGO_DEFINES 25 26 #include "common/scummsys.h" 27 28 namespace Glk { 29 namespace Hugo { 30 31 #define HEVERSION 3 32 #define HEREVISION 3 33 #define HEINTERIM ".0" 34 35 #define GLK 36 #define GRAPHICS_SUPPORTED 37 #define SOUND_SUPPORTED 38 #define SETTITLE_SUPPORTED 39 #define SAVEGAMEDATA_REPLACED 40 #define RESTOREGAMEDATA_REPLACED 41 42 // There's a bunch of debugging code in the original Hugo sources behind DEBUGGER defines, 43 // but doesn't actually have any implementation of them. I've put in some stub methods, 44 // with the idea that debugger code could eventually be hooked up to the ScummVM debugger. 45 // So for now the debugger defined is commented out, since with debugger enabled the games 46 // don't work properly 47 //#define DEBUGGER 1 48 49 50 #define MAXOBJLIST 32 51 #define MAX_CONTEXT_COMMANDS 32 52 #define MAX_EVAL_ELEMENTS 256 53 #define MAX_GAME_TITLE 64 54 #define MAX_DEBUG_LINE 256 55 #define MAX_OBJECT 999 56 #define MAX_PROPERTY 999 57 #define MAX_MOBJ 16 /* maximum number of matchable object words */ 58 #define MAXBUFFER 255 59 #define MAXUNDO 1024 60 #define MAXCALLS 99 61 #define MAXBREAKPOINTS 99 62 #define MAX_CODE_HISTORY 99 63 #define MAX_RES_PATH 255 64 #define MAXRES 1024 65 #define CHARWIDTH 1 66 67 #define HUGO_FILE strid_t 68 #define MAXPATH 256 69 #define MAXFILENAME 256 70 #define MAXDRIVE 256 71 #define MAXDIR 256 72 #define MAXEXT 256 73 74 #define DEF_PRN "" 75 #define DEF_FCOLOR 0 76 #define DEF_BGCOLOR 15 77 #define DEF_SLFCOLOR 15 78 #define DEF_SLBGCOLOR 1 79 80 /* These static values are not changeable--they depend largely on internals of the Engine. */ 81 #define MAXATTRIBUTES 128 82 #define MAXGLOBALS 240 83 #define MAXLOCALS 16 84 #define MAXPOBJECTS 256 /* contenders for disambiguation */ 85 #define MAXWORDS 32 /* in an input line */ 86 #define MAXSTACKDEPTH 256 /* for nesting {...} */ 87 88 89 /* The positions of various data in the header: */ 90 #define H_GAMEVERSION 0x00 91 #define H_ID 0x01 92 #define H_SERIAL 0x03 93 #define H_CODESTART 0x0B 94 95 #define H_OBJTABLE 0x0D /* data tables */ 96 #define H_PROPTABLE 0x0F 97 #define H_EVENTTABLE 0x11 98 #define H_ARRAYTABLE 0x13 99 #define H_DICTTABLE 0x15 100 #define H_SYNTABLE 0x17 101 102 #define H_INIT 0x19 /* junction routines */ 103 #define H_MAIN 0x1B 104 #define H_PARSE 0x1D 105 #define H_PARSEERROR 0x1F 106 #define H_FINDOBJECT 0x21 107 #define H_ENDGAME 0x23 108 #define H_SPEAKTO 0x25 109 #define H_PERFORM 0x27 110 111 #define H_TEXTBANK 0x29 112 113 /* additional debugger header information */ 114 #define H_DEBUGGABLE 0x3A 115 #define H_DEBUGDATA 0x3B 116 #define H_DEBUGWORKSPACE 0x3E 117 118 /* Printing control codes--embedded in strings printed by AP(). */ 119 #define FONT_CHANGE 1 120 #define COLOR_CHANGE 2 121 #define NO_CONTROLCHAR 3 122 #define NO_NEWLINE 30 123 #define FORCED_SPACE 31 /* Can't be <= # colors/font codes + 1 124 (See AP() for the reason) */ 125 126 /* Font control codes--these bitmasks follow FONT_CHANGE codes. */ 127 #define NORMAL_FONT 0 128 #define BOLD_FONT 1 129 #define ITALIC_FONT 2 130 #define UNDERLINE_FONT 4 131 #define PROP_FONT 8 132 133 /* CHAR_TRANSLATION is simply a value that is added to an ASCII character 134 in order to encode the text, i.e., make it unreadable to casual 135 browsing. 136 */ 137 #define CHAR_TRANSLATION 0x14 138 139 /* Passed to GetWord() */ 140 #define PARSE_STRING_VAL 0xFFF0 141 #define SERIAL_STRING_VAL 0xFFF1 142 143 /* Returned by FindWord() */ 144 #define UNKNOWN_WORD 0xFFFF 145 146 /* Bitmasks for certain qualities of properties */ 147 #define ADDITIVE_FLAG 1 148 #define COMPLEX_FLAG 2 149 150 /* Property-table indicators */ 151 #define PROP_END 255 152 #define PROP_ROUTINE 255 153 154 #define MEM(addr) (mem[addr]) 155 #define SETMEM(addr, n) (mem[addr] = n) 156 #define GETMEMADDR(addr) (&mem[addr]) 157 #define HUGO_PTR 158 159 #define RESET_STACK_DEPTH (-1) 160 161 #define RUNROUTINE_BLOCK 1 162 #define CONDITIONAL_BLOCK 2 163 #define DOWHILE_BLOCK 3 164 165 #define TAIL_RECURSION_ROUTINE (-1) 166 #define TAIL_RECURSION_PROPERTY (-2) 167 168 /* For system_status: */ 169 #define STAT_UNAVAILABLE ((short)-1) 170 #define STAT_NOFILE 101 171 #define STAT_NORESOURCE 102 172 #define STAT_LOADERROR 103 173 174 #define PRINTFATALERROR(a) error("%s", a) 175 176 #define PIC 0 177 #define SND 1 178 179 #if defined (DEBUGGER) 180 #define VIEW_CALLS 0 181 #define VIEW_LOCALS 1 182 #define CODE_WINDOW 2 183 #define VIEW_BREAKPOINTS 3 184 #define VIEW_WATCH 4 185 186 #define FORCE_REDRAW 1 187 188 #endif 189 190 } // End of namespace Hugo 191 } // End of namespace Glk 192 193 #endif 194