2002-03-20 17:51:07 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2005-01-01 16:09:25 +00:00
|
|
|
* Copyright (C) 2001-2005 The ScummVM project
|
2002-03-20 17:51:07 +00:00
|
|
|
*
|
|
|
|
* 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 2
|
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
#include "stdafx.h"
|
2004-09-20 22:04:06 +00:00
|
|
|
#include "common/config-manager.h"
|
2003-10-03 18:33:57 +00:00
|
|
|
#include "scumm/scumm.h"
|
|
|
|
#include "scumm/intern.h"
|
2004-09-20 22:04:06 +00:00
|
|
|
#include "sound/mididrv.h"
|
2003-10-03 18:33:57 +00:00
|
|
|
|
|
|
|
namespace Scumm {
|
2002-02-23 23:23:28 +00:00
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
void ScummEngine::setupScummVars() {
|
2002-12-21 12:34:17 +00:00
|
|
|
VAR_KEYPRESS = 0;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_EGO = 1;
|
|
|
|
VAR_CAMERA_POS_X = 2;
|
|
|
|
VAR_HAVE_MSG = 3;
|
|
|
|
VAR_ROOM = 4;
|
|
|
|
VAR_OVERRIDE = 5;
|
|
|
|
VAR_MACHINE_SPEED = 6;
|
|
|
|
VAR_ME = 7;
|
|
|
|
VAR_NUM_ACTOR = 8;
|
2004-09-10 11:01:17 +00:00
|
|
|
VAR_CURRENTDRIVE = 10;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_TMR_1 = 11;
|
|
|
|
VAR_TMR_2 = 12;
|
|
|
|
VAR_TMR_3 = 13;
|
2003-05-01 00:04:05 +00:00
|
|
|
VAR_MUSIC_TIMER = 14;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_ACTOR_RANGE_MIN = 15;
|
|
|
|
VAR_ACTOR_RANGE_MAX = 16;
|
|
|
|
VAR_CAMERA_MIN_X = 17;
|
|
|
|
VAR_CAMERA_MAX_X = 18;
|
|
|
|
VAR_TIMER_NEXT = 19;
|
|
|
|
VAR_VIRT_MOUSE_X = 20;
|
|
|
|
VAR_VIRT_MOUSE_Y = 21;
|
|
|
|
VAR_ROOM_RESOURCE = 22;
|
|
|
|
VAR_LAST_SOUND = 23;
|
|
|
|
VAR_CUTSCENEEXIT_KEY = 24;
|
|
|
|
VAR_TALK_ACTOR = 25;
|
2004-02-11 15:59:25 +00:00
|
|
|
VAR_CAMERA_FAST_X = 26;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_ENTRY_SCRIPT = 28;
|
|
|
|
VAR_ENTRY_SCRIPT2 = 29;
|
|
|
|
VAR_EXIT_SCRIPT = 30;
|
|
|
|
VAR_EXIT_SCRIPT2 = 31;
|
|
|
|
VAR_VERB_SCRIPT = 32;
|
|
|
|
VAR_SENTENCE_SCRIPT = 33;
|
2003-06-14 12:23:30 +00:00
|
|
|
VAR_INVENTORY_SCRIPT = 34;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_CUTSCENE_START_SCRIPT = 35;
|
|
|
|
VAR_CUTSCENE_END_SCRIPT = 36;
|
|
|
|
VAR_CHARINC = 37;
|
|
|
|
VAR_WALKTO_OBJ = 38;
|
2004-07-24 02:18:05 +00:00
|
|
|
VAR_HEAPSPACE = 40;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_RESTART_KEY = 42;
|
|
|
|
VAR_PAUSE_KEY = 43;
|
|
|
|
VAR_MOUSE_X = 44;
|
|
|
|
VAR_MOUSE_Y = 45;
|
|
|
|
VAR_TIMER = 46;
|
|
|
|
VAR_TMR_4 = 47;
|
|
|
|
VAR_SOUNDCARD = 48;
|
|
|
|
VAR_VIDEOMODE = 49;
|
2004-07-22 04:28:31 +00:00
|
|
|
|
2004-07-22 04:13:46 +00:00
|
|
|
if (_version >= 4) {
|
|
|
|
VAR_SCROLL_SCRIPT = 27;
|
|
|
|
VAR_DEBUGMODE = 39;
|
|
|
|
VAR_MAINMENU_KEY = 50;
|
|
|
|
VAR_FIXEDDISK = 51;
|
|
|
|
VAR_CURSORSTATE = 52;
|
|
|
|
VAR_USERPUT = 53;
|
2005-03-19 02:40:42 +00:00
|
|
|
}
|
2004-07-22 04:13:46 +00:00
|
|
|
|
2005-03-19 02:40:42 +00:00
|
|
|
if (_gameId == GID_LOOM256 || _version >= 5) {
|
|
|
|
VAR_NOSUBTITLES = 60;
|
2004-07-22 04:13:46 +00:00
|
|
|
VAR_SOUNDPARAM = 64;
|
|
|
|
VAR_SOUNDPARAM2 = 65;
|
|
|
|
VAR_SOUNDPARAM3 = 66;
|
|
|
|
}
|
|
|
|
if (_version >= 5) {
|
2005-03-19 02:40:42 +00:00
|
|
|
VAR_SOUNDRESULT = 56;
|
|
|
|
VAR_TALKSTOP_KEY = 57;
|
2004-07-24 04:36:54 +00:00
|
|
|
VAR_FADE_DELAY = 59;
|
2004-07-22 04:13:46 +00:00
|
|
|
VAR_MOUSEPRESENT = 67;
|
2004-07-24 11:15:59 +00:00
|
|
|
VAR_MEMORY_PERFORMANCE = 68;
|
2005-03-19 02:40:42 +00:00
|
|
|
VAR_VIDEO_PERFORMANCE = 69;
|
|
|
|
VAR_ROOM_FLAG = 70;
|
|
|
|
VAR_GAME_LOADED = 71;
|
|
|
|
VAR_NEW_ROOM = 72;
|
2003-05-08 15:48:50 +00:00
|
|
|
}
|
|
|
|
}
|
2002-02-23 23:23:28 +00:00
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
void ScummEngine_v2::setupScummVars() {
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_EGO = 0;
|
|
|
|
VAR_CAMERA_POS_X = 2;
|
|
|
|
VAR_HAVE_MSG = 3;
|
|
|
|
VAR_ROOM = 4;
|
|
|
|
VAR_OVERRIDE = 5;
|
|
|
|
VAR_MACHINE_SPEED = 6;
|
2003-05-14 13:30:52 +00:00
|
|
|
VAR_CHARCOUNT = 7;
|
2003-05-17 06:04:22 +00:00
|
|
|
VAR_ACTIVE_VERB = 8;
|
|
|
|
VAR_ACTIVE_OBJECT1 = 9;
|
|
|
|
VAR_ACTIVE_OBJECT2 = 10;
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_NUM_ACTOR = 11;
|
|
|
|
VAR_CURRENT_LIGHTS = 12;
|
|
|
|
VAR_CURRENTDRIVE = 13;
|
|
|
|
VAR_MUSIC_TIMER = 17;
|
2003-05-17 18:42:31 +00:00
|
|
|
VAR_VERB_ALLOWED = 18;
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_ACTOR_RANGE_MIN = 19;
|
|
|
|
VAR_ACTOR_RANGE_MAX = 20;
|
2003-05-21 14:00:19 +00:00
|
|
|
VAR_CURSORSTATE = 21;
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_CAMERA_MIN_X = 23;
|
|
|
|
VAR_CAMERA_MAX_X = 24;
|
|
|
|
VAR_TIMER_NEXT = 25;
|
2003-05-16 22:11:49 +00:00
|
|
|
VAR_SENTENCE_VERB = 26;
|
|
|
|
VAR_SENTENCE_OBJECT1 = 27;
|
|
|
|
VAR_SENTENCE_OBJECT2 = 28;
|
2003-05-22 14:10:20 +00:00
|
|
|
VAR_SENTENCE_PREPOSITION = 29;
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_VIRT_MOUSE_X = 30;
|
|
|
|
VAR_VIRT_MOUSE_Y = 31;
|
2003-05-17 06:14:08 +00:00
|
|
|
VAR_CLICK_AREA = 32;
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_ROOM_RESOURCE = 36;
|
|
|
|
VAR_LAST_SOUND = 37;
|
2003-05-18 12:52:27 +00:00
|
|
|
VAR_BACKUP_VERB = 38;
|
2003-05-08 15:48:50 +00:00
|
|
|
VAR_KEYPRESS = 39;
|
|
|
|
VAR_CUTSCENEEXIT_KEY = 40;
|
|
|
|
VAR_TALK_ACTOR = 41;
|
2003-05-01 00:04:05 +00:00
|
|
|
}
|
|
|
|
|
2004-01-09 13:14:59 +00:00
|
|
|
void ScummEngine_v5::setupScummVars() {
|
|
|
|
// Many vars are the same as in V5 & V6 games, so just call the inherited method first
|
|
|
|
ScummEngine::setupScummVars();
|
|
|
|
|
|
|
|
VAR_CURRENT_LIGHTS = 9;
|
2004-07-22 04:28:31 +00:00
|
|
|
|
|
|
|
if (_version >= 4)
|
|
|
|
VAR_V5_TALK_STRING_Y = 54;
|
2004-01-09 13:14:59 +00:00
|
|
|
}
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
void ScummEngine_v6::setupScummVars() {
|
2004-01-09 13:14:59 +00:00
|
|
|
// Many vars are the same as in V5 & V6 games, so just call the inherited method first
|
2003-10-02 22:42:03 +00:00
|
|
|
ScummEngine::setupScummVars();
|
2002-02-23 23:23:28 +00:00
|
|
|
|
2004-10-04 14:28:43 +00:00
|
|
|
VAR_ROOM_WIDTH = 41;
|
|
|
|
VAR_ROOM_HEIGHT = 54;
|
2004-07-03 09:59:05 +00:00
|
|
|
|
2004-09-17 02:59:38 +00:00
|
|
|
VAR_LEFTBTN_HOLD = 74;
|
|
|
|
VAR_RIGHTBTN_HOLD = 75;
|
|
|
|
|
2005-04-20 01:33:44 +00:00
|
|
|
if (_heversion == 0) {
|
2004-07-03 09:59:05 +00:00
|
|
|
VAR_SAVELOAD_SCRIPT = 61;
|
|
|
|
VAR_SAVELOAD_SCRIPT2 = 62;
|
|
|
|
}
|
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_V6_EMSSPACE = 76;
|
2004-01-19 19:47:47 +00:00
|
|
|
VAR_RANDOM_NR = 118;
|
2003-02-18 01:51:05 +00:00
|
|
|
|
2004-09-10 10:39:10 +00:00
|
|
|
if (_heversion >= 70) {
|
2004-09-05 09:36:51 +00:00
|
|
|
VAR_NUM_SOUND_CHANNELS = 9;
|
2004-09-10 10:39:10 +00:00
|
|
|
VAR_SOUND_CHANNEL = 10;
|
|
|
|
VAR_MUSIC_CHANNEL = 14;
|
|
|
|
} else {
|
2004-09-05 09:36:51 +00:00
|
|
|
VAR_V6_SOUNDMODE = 9;
|
2004-09-10 10:39:10 +00:00
|
|
|
}
|
2002-09-16 08:22:05 +00:00
|
|
|
|
2003-02-18 00:13:24 +00:00
|
|
|
VAR_TIMEDATE_YEAR = 119;
|
|
|
|
VAR_TIMEDATE_MONTH = 129;
|
|
|
|
VAR_TIMEDATE_DAY = 128;
|
|
|
|
VAR_TIMEDATE_HOUR = 125;
|
|
|
|
VAR_TIMEDATE_MINUTE = 126;
|
2004-07-02 06:40:08 +00:00
|
|
|
|
|
|
|
// Sam & Max specific
|
|
|
|
VAR_CHARSET_MASK = 123;
|
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
}
|
|
|
|
|
2004-08-23 10:46:00 +00:00
|
|
|
void ScummEngine_v72he::setupScummVars() {
|
2004-03-01 06:25:01 +00:00
|
|
|
// TODO Not complete
|
|
|
|
VAR_KEYPRESS = 0;
|
|
|
|
VAR_DEBUGMODE = 1;
|
|
|
|
VAR_TIMER_NEXT = 2;
|
|
|
|
VAR_OVERRIDE = 3;
|
|
|
|
VAR_WALKTO_OBJ = 4;
|
|
|
|
VAR_RANDOM_NR = 5;
|
|
|
|
|
|
|
|
VAR_GAME_LOADED = 8;
|
|
|
|
VAR_EGO = 9;
|
|
|
|
VAR_NUM_ACTOR = 10;
|
|
|
|
|
|
|
|
VAR_VIRT_MOUSE_X = 13;
|
|
|
|
VAR_VIRT_MOUSE_Y = 14;
|
|
|
|
VAR_MOUSE_X = 15;
|
|
|
|
VAR_MOUSE_Y = 16;
|
2004-09-17 02:59:38 +00:00
|
|
|
VAR_LEFTBTN_HOLD = 17;
|
|
|
|
VAR_RIGHTBTN_HOLD = 18;
|
2004-03-01 06:25:01 +00:00
|
|
|
|
|
|
|
VAR_CURSORSTATE = 19;
|
|
|
|
VAR_USERPUT = 20;
|
|
|
|
VAR_ROOM = 21;
|
2004-10-04 14:28:43 +00:00
|
|
|
VAR_ROOM_WIDTH = 22;
|
|
|
|
VAR_ROOM_HEIGHT = 23;
|
2004-03-01 06:25:01 +00:00
|
|
|
VAR_CAMERA_POS_X = 24;
|
|
|
|
VAR_CAMERA_MIN_X = 25;
|
|
|
|
VAR_CAMERA_MAX_X = 26;
|
|
|
|
VAR_ROOM_RESOURCE = 27;
|
|
|
|
VAR_SCROLL_SCRIPT = 28;
|
|
|
|
VAR_ENTRY_SCRIPT = 29;
|
|
|
|
VAR_ENTRY_SCRIPT2 = 30;
|
|
|
|
VAR_EXIT_SCRIPT = 31;
|
|
|
|
VAR_EXIT_SCRIPT2 = 32;
|
|
|
|
VAR_VERB_SCRIPT = 33;
|
|
|
|
VAR_SENTENCE_SCRIPT = 34;
|
|
|
|
VAR_INVENTORY_SCRIPT = 35;
|
|
|
|
VAR_CUTSCENE_START_SCRIPT = 36;
|
|
|
|
VAR_CUTSCENE_END_SCRIPT = 37;
|
|
|
|
|
2004-08-24 11:24:51 +00:00
|
|
|
VAR_RESTART_KEY = 42;
|
2004-03-01 06:25:01 +00:00
|
|
|
VAR_PAUSE_KEY = 43;
|
|
|
|
VAR_CUTSCENEEXIT_KEY = 44;
|
|
|
|
VAR_TALKSTOP_KEY = 45;
|
|
|
|
VAR_HAVE_MSG = 46;
|
|
|
|
VAR_NOSUBTITLES = 47;
|
|
|
|
VAR_CHARINC = 48;
|
|
|
|
VAR_TALK_ACTOR = 49;
|
|
|
|
VAR_LAST_SOUND = 50;
|
2004-09-10 10:39:10 +00:00
|
|
|
VAR_SOUND_CHANNEL = 51;
|
|
|
|
VAR_MUSIC_CHANNEL = 52;
|
2004-03-01 06:25:01 +00:00
|
|
|
|
2004-09-05 09:36:51 +00:00
|
|
|
VAR_NUM_SOUND_CHANNELS = 56;
|
2004-07-24 11:15:59 +00:00
|
|
|
VAR_MEMORY_PERFORMANCE = 57;
|
|
|
|
VAR_VIDEO_PERFORMANCE = 58;
|
2004-03-01 06:25:01 +00:00
|
|
|
VAR_NEW_ROOM = 59;
|
|
|
|
VAR_TMR_1 = 60;
|
|
|
|
VAR_TMR_2 = 61;
|
|
|
|
VAR_TMR_3 = 62;
|
|
|
|
VAR_TIMEDATE_HOUR = 63;
|
|
|
|
VAR_TIMEDATE_MINUTE = 64;
|
|
|
|
VAR_TIMEDATE_DAY = 65;
|
|
|
|
VAR_TIMEDATE_MONTH = 66;
|
|
|
|
VAR_TIMEDATE_YEAR = 67;
|
|
|
|
|
2004-09-04 23:35:14 +00:00
|
|
|
VAR_NUM_ROOMS = 68;
|
|
|
|
VAR_NUM_SCRIPTS = 69;
|
|
|
|
VAR_NUM_SOUNDS = 70;
|
|
|
|
VAR_NUM_COSTUMES = 71;
|
|
|
|
VAR_NUM_IMAGES = 72;
|
|
|
|
VAR_NUM_CHARSETS = 73;
|
|
|
|
VAR_NUM_GLOBAL_OBJS = 74;
|
2005-04-16 14:59:15 +00:00
|
|
|
VAR_MOUSE_STATE = 75;
|
2004-09-14 15:06:02 +00:00
|
|
|
VAR_POLYGONS_ONLY = 76;
|
2004-09-04 23:35:14 +00:00
|
|
|
|
2004-09-20 18:27:13 +00:00
|
|
|
if (_heversion >= 80)
|
2004-09-05 09:36:51 +00:00
|
|
|
VAR_WINDOWS_VERSION = 79;
|
2004-10-18 06:40:36 +00:00
|
|
|
VAR_KEY_STATE = 86;
|
2005-03-02 23:14:06 +00:00
|
|
|
VAR_NUM_ACTIVE_SOUND_CHANNELS = 88;
|
2005-04-16 15:21:19 +00:00
|
|
|
if (_heversion >= 90) {
|
2005-02-28 13:23:10 +00:00
|
|
|
VAR_SCRIPT_CYCLE = 103;
|
|
|
|
VAR_NUM_SCRIPT_CYCLES = 104;
|
2005-04-19 03:32:08 +00:00
|
|
|
}
|
|
|
|
if (_heversion >= 95) {
|
2005-03-02 23:14:06 +00:00
|
|
|
VAR_NUM_SPRITE_GROUPS = 105;
|
2004-09-20 18:27:13 +00:00
|
|
|
VAR_NUM_SPRITES = 106;
|
2004-09-19 23:21:09 +00:00
|
|
|
VAR_WIZ_TCOLOR = 117;
|
|
|
|
}
|
2004-10-04 02:23:02 +00:00
|
|
|
if (_heversion >= 99) {
|
|
|
|
VAR_NUM_PALETTES = 130;
|
|
|
|
VAR_NUM_UNK = 131;
|
|
|
|
}
|
2004-03-01 06:25:01 +00:00
|
|
|
}
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
void ScummEngine_v7::setupScummVars() {
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_MOUSE_X = 1;
|
|
|
|
VAR_MOUSE_Y = 2;
|
|
|
|
VAR_VIRT_MOUSE_X = 3;
|
|
|
|
VAR_VIRT_MOUSE_Y = 4;
|
2004-10-04 14:28:43 +00:00
|
|
|
VAR_ROOM_WIDTH = 5;
|
|
|
|
VAR_ROOM_HEIGHT = 6;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_CAMERA_POS_X = 7;
|
|
|
|
VAR_CAMERA_POS_Y = 8;
|
|
|
|
VAR_OVERRIDE = 9;
|
|
|
|
VAR_ROOM = 10;
|
|
|
|
VAR_ROOM_RESOURCE = 11;
|
|
|
|
VAR_TALK_ACTOR = 12;
|
|
|
|
VAR_HAVE_MSG = 13;
|
|
|
|
VAR_TIMER = 14;
|
|
|
|
VAR_TMR_4 = 15;
|
2004-02-20 15:46:11 +00:00
|
|
|
|
|
|
|
VAR_TIMEDATE_YEAR = 16;
|
|
|
|
VAR_TIMEDATE_MONTH = 17;
|
|
|
|
VAR_TIMEDATE_DAY = 18;
|
|
|
|
VAR_TIMEDATE_HOUR = 19;
|
|
|
|
VAR_TIMEDATE_MINUTE = 20;
|
|
|
|
VAR_TIMEDATE_SECOND = 21;
|
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_LEFTBTN_DOWN = 22;
|
|
|
|
VAR_RIGHTBTN_DOWN = 23;
|
|
|
|
VAR_LEFTBTN_HOLD = 24;
|
|
|
|
VAR_RIGHTBTN_HOLD = 25;
|
|
|
|
|
2004-07-24 11:15:59 +00:00
|
|
|
VAR_MEMORY_PERFORMANCE = 26;
|
|
|
|
VAR_VIDEO_PERFORMANCE = 27;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_GAME_LOADED = 29;
|
2003-05-01 00:04:05 +00:00
|
|
|
VAR_V6_EMSSPACE = 32;
|
2004-02-22 03:08:18 +00:00
|
|
|
VAR_VOICE_MODE = 33; // 0 is voice, 1 is voice+text, 2 is text only
|
2004-01-19 19:47:47 +00:00
|
|
|
VAR_RANDOM_NR = 34;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_NEW_ROOM = 35;
|
|
|
|
VAR_WALKTO_OBJ = 36;
|
|
|
|
|
2004-07-03 23:58:30 +00:00
|
|
|
VAR_NUM_GLOBAL_OBJS = 37;
|
2004-07-02 06:40:08 +00:00
|
|
|
|
2002-04-23 23:58:31 +00:00
|
|
|
VAR_CAMERA_DEST_X = 38;
|
|
|
|
VAR_CAMERA_DEST_Y = 39;
|
|
|
|
VAR_CAMERA_FOLLOWED_ACTOR = 40;
|
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_SCROLL_SCRIPT = 50;
|
|
|
|
VAR_ENTRY_SCRIPT = 51;
|
|
|
|
VAR_ENTRY_SCRIPT2 = 52;
|
|
|
|
VAR_EXIT_SCRIPT = 53;
|
|
|
|
VAR_EXIT_SCRIPT2 = 54;
|
|
|
|
VAR_VERB_SCRIPT = 55;
|
|
|
|
VAR_SENTENCE_SCRIPT = 56;
|
2003-06-14 12:23:30 +00:00
|
|
|
VAR_INVENTORY_SCRIPT = 57;
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_CUTSCENE_START_SCRIPT = 58;
|
|
|
|
VAR_CUTSCENE_END_SCRIPT = 59;
|
2003-05-13 17:51:56 +00:00
|
|
|
VAR_SAVELOAD_SCRIPT = 60;
|
|
|
|
VAR_SAVELOAD_SCRIPT2 = 61;
|
2002-04-11 17:19:16 +00:00
|
|
|
|
2002-03-06 10:04:28 +00:00
|
|
|
VAR_CUTSCENEEXIT_KEY = 62;
|
2004-02-20 15:46:11 +00:00
|
|
|
VAR_RESTART_KEY = 63;
|
2002-12-15 20:16:43 +00:00
|
|
|
VAR_PAUSE_KEY = 64;
|
2004-02-20 15:46:11 +00:00
|
|
|
VAR_MAINMENU_KEY = 65;
|
2004-07-22 04:13:46 +00:00
|
|
|
VAR_VERSION_KEY = 66;
|
2003-08-05 12:23:26 +00:00
|
|
|
VAR_TALKSTOP_KEY = 67;
|
2003-04-24 11:35:46 +00:00
|
|
|
VAR_KEYPRESS = 118;
|
2002-02-23 23:23:28 +00:00
|
|
|
|
|
|
|
VAR_TIMER_NEXT = 97;
|
|
|
|
VAR_TMR_1 = 98;
|
|
|
|
VAR_TMR_2 = 99;
|
|
|
|
VAR_TMR_3 = 100;
|
|
|
|
|
|
|
|
VAR_CAMERA_MIN_X = 101;
|
|
|
|
VAR_CAMERA_MAX_X = 102;
|
|
|
|
VAR_CAMERA_MIN_Y = 103;
|
|
|
|
VAR_CAMERA_MAX_Y = 104;
|
|
|
|
VAR_CAMERA_THRESHOLD_X = 105;
|
|
|
|
VAR_CAMERA_THRESHOLD_Y = 106;
|
|
|
|
VAR_CAMERA_SPEED_X = 107;
|
|
|
|
VAR_CAMERA_SPEED_Y = 108;
|
|
|
|
VAR_CAMERA_ACCEL_X = 109;
|
|
|
|
VAR_CAMERA_ACCEL_Y = 110;
|
2002-04-11 17:19:16 +00:00
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_EGO = 111;
|
|
|
|
|
|
|
|
VAR_CURSORSTATE = 112;
|
|
|
|
VAR_USERPUT = 113;
|
|
|
|
VAR_DEFAULT_TALK_DELAY = 114;
|
|
|
|
VAR_CHARINC = 115;
|
|
|
|
VAR_DEBUGMODE = 116;
|
2004-07-24 04:36:54 +00:00
|
|
|
VAR_FADE_DELAY = 117;
|
2002-02-23 23:23:28 +00:00
|
|
|
|
2004-09-21 12:44:34 +00:00
|
|
|
// Full Throttle specific
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_CHARSET_MASK = 119;
|
2004-07-02 06:40:08 +00:00
|
|
|
|
2002-12-15 20:16:43 +00:00
|
|
|
VAR_VIDEONAME = 123;
|
2002-04-21 19:38:00 +00:00
|
|
|
|
2002-02-23 23:23:28 +00:00
|
|
|
VAR_STRING2DRAW = 130;
|
2004-10-04 14:58:37 +00:00
|
|
|
VAR_CUSTOMSCALETABLE = 131;
|
|
|
|
|
|
|
|
VAR_BLAST_ABOVE_TEXT = 133;
|
2004-07-02 06:40:08 +00:00
|
|
|
|
2004-07-04 06:14:18 +00:00
|
|
|
VAR_MUSIC_BUNDLE_LOADED = 135;
|
|
|
|
VAR_VOICE_BUNDLE_LOADED = 136;
|
2004-07-02 06:40:08 +00:00
|
|
|
|
2002-03-06 10:04:28 +00:00
|
|
|
}
|
2002-12-23 15:46:53 +00:00
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
void ScummEngine_v8::setupScummVars() {
|
2004-10-04 14:28:43 +00:00
|
|
|
VAR_ROOM_WIDTH = 1;
|
|
|
|
VAR_ROOM_HEIGHT = 2;
|
2002-12-29 14:56:25 +00:00
|
|
|
|
2002-12-23 15:46:53 +00:00
|
|
|
VAR_MOUSE_X = 3;
|
|
|
|
VAR_MOUSE_Y = 4;
|
|
|
|
VAR_VIRT_MOUSE_X = 5;
|
|
|
|
VAR_VIRT_MOUSE_Y = 6;
|
|
|
|
|
2002-12-23 18:30:12 +00:00
|
|
|
VAR_CURSORSTATE = 7;
|
|
|
|
VAR_USERPUT = 8;
|
|
|
|
|
2002-12-23 15:46:53 +00:00
|
|
|
VAR_CAMERA_POS_X = 9;
|
|
|
|
VAR_CAMERA_POS_Y = 10;
|
|
|
|
VAR_CAMERA_DEST_X = 11;
|
|
|
|
VAR_CAMERA_DEST_Y = 12;
|
2002-12-27 18:05:15 +00:00
|
|
|
VAR_CAMERA_FOLLOWED_ACTOR = 13;
|
|
|
|
|
2002-12-27 23:30:34 +00:00
|
|
|
VAR_TALK_ACTOR = 14;
|
|
|
|
VAR_HAVE_MSG = 15;
|
2002-12-29 15:06:44 +00:00
|
|
|
VAR_MOUSE_BUTTONS = 16;
|
2003-01-17 07:20:54 +00:00
|
|
|
VAR_RIGHTBTN_HOLD = 17; // TODO: Guess (used in room 10 script 2004, and ship-to-ship combat)
|
2003-01-01 02:56:22 +00:00
|
|
|
VAR_MOUSE_HOLD = 18;
|
2002-12-26 01:44:24 +00:00
|
|
|
|
2002-12-31 17:28:51 +00:00
|
|
|
VAR_TIMEDATE_YEAR = 24;
|
|
|
|
VAR_TIMEDATE_MONTH = 25;
|
|
|
|
VAR_TIMEDATE_DAY = 26;
|
|
|
|
VAR_TIMEDATE_HOUR = 27;
|
|
|
|
VAR_TIMEDATE_MINUTE = 28;
|
|
|
|
VAR_TIMEDATE_SECOND = 29;
|
2002-12-29 14:56:25 +00:00
|
|
|
|
2003-01-01 17:57:14 +00:00
|
|
|
VAR_OVERRIDE = 30;
|
2002-12-23 15:46:53 +00:00
|
|
|
VAR_ROOM = 31;
|
2004-02-21 12:53:59 +00:00
|
|
|
VAR_NEW_ROOM = 32;
|
2004-02-21 13:10:44 +00:00
|
|
|
VAR_WALKTO_OBJ = 33;
|
2004-07-11 01:30:21 +00:00
|
|
|
VAR_TIMER = 34;
|
2002-12-29 14:56:25 +00:00
|
|
|
|
2004-02-22 03:08:18 +00:00
|
|
|
VAR_VOICE_MODE = 39; // 0 is voice, 1 is voice+text, 2 is text only
|
2003-01-02 08:39:33 +00:00
|
|
|
VAR_GAME_LOADED = 40;
|
2003-01-29 12:22:24 +00:00
|
|
|
VAR_LANGUAGE = 41;
|
2003-01-29 04:16:14 +00:00
|
|
|
|
2002-12-26 01:15:25 +00:00
|
|
|
VAR_CURRENTDISK = 42;
|
2004-07-04 06:14:18 +00:00
|
|
|
VAR_MUSIC_BUNDLE_LOADED = 45;
|
|
|
|
VAR_VOICE_BUNDLE_LOADED = 46;
|
2002-12-23 15:46:53 +00:00
|
|
|
|
2004-01-14 15:20:07 +00:00
|
|
|
VAR_SCROLL_SCRIPT = 50;
|
2002-12-23 15:46:53 +00:00
|
|
|
VAR_ENTRY_SCRIPT = 51;
|
|
|
|
VAR_ENTRY_SCRIPT2 = 52;
|
|
|
|
VAR_EXIT_SCRIPT = 53;
|
|
|
|
VAR_EXIT_SCRIPT2 = 54;
|
2002-12-26 01:03:48 +00:00
|
|
|
VAR_VERB_SCRIPT = 55;
|
2002-12-23 15:46:53 +00:00
|
|
|
VAR_SENTENCE_SCRIPT = 56;
|
2003-06-14 12:23:30 +00:00
|
|
|
VAR_INVENTORY_SCRIPT = 57;
|
2002-12-23 15:46:53 +00:00
|
|
|
VAR_CUTSCENE_START_SCRIPT = 58;
|
|
|
|
VAR_CUTSCENE_END_SCRIPT = 59;
|
|
|
|
|
2004-01-14 15:20:07 +00:00
|
|
|
VAR_CUTSCENEEXIT_KEY = 62;
|
2002-12-27 00:22:42 +00:00
|
|
|
|
2002-12-29 14:56:25 +00:00
|
|
|
VAR_PAUSE_KEY = 64;
|
2003-11-03 23:26:13 +00:00
|
|
|
VAR_MAINMENU_KEY = 65;
|
2004-07-22 04:13:46 +00:00
|
|
|
VAR_VERSION_KEY = 66;
|
2003-01-01 21:51:12 +00:00
|
|
|
VAR_TALKSTOP_KEY = 67;
|
2002-12-24 15:27:27 +00:00
|
|
|
|
2004-01-19 19:47:47 +00:00
|
|
|
VAR_CUSTOMSCALETABLE = 111;
|
|
|
|
|
|
|
|
VAR_TIMER_NEXT = 112;
|
|
|
|
VAR_TMR_1 = 113;
|
|
|
|
VAR_TMR_2 = 114;
|
|
|
|
VAR_TMR_3 = 115;
|
|
|
|
|
2004-01-09 14:00:36 +00:00
|
|
|
VAR_CAMERA_MIN_X = 116;
|
|
|
|
VAR_CAMERA_MAX_X = 117;
|
|
|
|
VAR_CAMERA_MIN_Y = 118;
|
|
|
|
VAR_CAMERA_MAX_Y = 119;
|
|
|
|
VAR_CAMERA_SPEED_X = 120;
|
|
|
|
VAR_CAMERA_SPEED_Y = 121;
|
|
|
|
VAR_CAMERA_ACCEL_X = 122;
|
|
|
|
VAR_CAMERA_ACCEL_Y = 123;
|
|
|
|
VAR_CAMERA_THRESHOLD_X = 124;
|
|
|
|
VAR_CAMERA_THRESHOLD_Y = 125;
|
2002-12-26 10:47:57 +00:00
|
|
|
|
2002-12-26 21:50:13 +00:00
|
|
|
VAR_EGO = 126;
|
|
|
|
|
2004-09-21 12:44:34 +00:00
|
|
|
VAR_DEFAULT_TALK_DELAY = 128;
|
|
|
|
VAR_CHARINC = 129;
|
|
|
|
|
2002-12-26 10:47:57 +00:00
|
|
|
VAR_DEBUGMODE = 130;
|
2002-12-28 11:36:30 +00:00
|
|
|
VAR_KEYPRESS = 132;
|
2004-10-04 14:58:37 +00:00
|
|
|
VAR_BLAST_ABOVE_TEXT = 133;
|
2004-01-09 22:11:38 +00:00
|
|
|
VAR_SYNC = 134;
|
2002-12-23 15:46:53 +00:00
|
|
|
}
|
2003-10-03 18:33:57 +00:00
|
|
|
|
2004-09-20 22:04:06 +00:00
|
|
|
void ScummEngine::initScummVars() {
|
|
|
|
|
|
|
|
// This needs to be at least greater than 40 to get the more
|
|
|
|
// elaborate version of the EGA Zak into. I don't know where
|
|
|
|
// else it makes any difference.
|
|
|
|
if (_gameId == GID_ZAK)
|
|
|
|
VAR(VAR_MACHINE_SPEED) = 0x7FFF;
|
|
|
|
|
|
|
|
if (_version <= 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (_version >= 4 && _version <= 5)
|
|
|
|
VAR(VAR_V5_TALK_STRING_Y) = -0x50;
|
|
|
|
|
|
|
|
if (_version == 8) { // Fixme: How do we deal with non-cd installs?
|
|
|
|
VAR(VAR_CURRENTDISK) = 1;
|
|
|
|
VAR(VAR_LANGUAGE) = _language;
|
|
|
|
} else if (_version >= 7) {
|
|
|
|
VAR(VAR_V6_EMSSPACE) = 10000;
|
|
|
|
VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
|
|
|
|
} else if (_heversion >= 70) {
|
2004-10-18 06:40:36 +00:00
|
|
|
VAR(VAR_NUM_SOUND_CHANNELS) = 8;
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_MUSIC_CHANNEL) = 1;
|
|
|
|
VAR(VAR_SOUND_CHANNEL) = 2;
|
|
|
|
|
|
|
|
if (_heversion >= 72) {
|
|
|
|
VAR(VAR_NUM_ROOMS) = _numRooms - 1;
|
|
|
|
VAR(VAR_NUM_SCRIPTS) = _numScripts - 1;
|
|
|
|
VAR(VAR_NUM_SOUNDS) = _numSounds - 1;
|
|
|
|
VAR(VAR_NUM_COSTUMES) = _numCostumes - 1;
|
|
|
|
VAR(VAR_NUM_IMAGES) = _numImages - 1;
|
|
|
|
VAR(VAR_NUM_CHARSETS) = _numCharsets - 1;
|
|
|
|
VAR(VAR_NUM_GLOBAL_OBJS) = _numGlobalObjects - 1;
|
|
|
|
}
|
2005-04-17 03:09:03 +00:00
|
|
|
if (_heversion >= 80) {
|
2005-04-16 15:21:19 +00:00
|
|
|
VAR(78) = 1;
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_WINDOWS_VERSION) = 40;
|
2005-03-02 23:14:06 +00:00
|
|
|
|
2005-04-16 15:21:19 +00:00
|
|
|
VAR(VAR_NUM_ACTIVE_SOUND_CHANNELS) = (_heversion >= 90) ? 8 : 4;
|
2005-04-17 03:09:03 +00:00
|
|
|
}
|
2005-04-16 15:21:19 +00:00
|
|
|
if (_heversion >= 90) {
|
2005-02-28 13:23:10 +00:00
|
|
|
VAR(VAR_SCRIPT_CYCLE) = 1;
|
|
|
|
VAR(VAR_NUM_SCRIPT_CYCLES) = 1;
|
2005-04-19 03:32:08 +00:00
|
|
|
}
|
|
|
|
if (_heversion >= 95) {
|
2005-03-02 23:14:06 +00:00
|
|
|
VAR(VAR_NUM_SPRITE_GROUPS) = MAX(64, _numSprites / 4) - 1;
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_NUM_SPRITES) = _numSprites - 1;
|
2005-03-02 23:14:06 +00:00
|
|
|
VAR(VAR_WIZ_TCOLOR) = 5;
|
2004-10-17 04:35:36 +00:00
|
|
|
}
|
2004-10-04 02:23:02 +00:00
|
|
|
if (_heversion >= 99) {
|
|
|
|
VAR(VAR_NUM_PALETTES) = _numPalettes;
|
|
|
|
VAR(VAR_NUM_UNK) = _numUnk;
|
|
|
|
}
|
2004-09-20 22:04:06 +00:00
|
|
|
} else {
|
|
|
|
switch (_midiDriver) {
|
|
|
|
case MD_NULL: VAR(VAR_SOUNDCARD) = 0; break;
|
|
|
|
case MD_PCSPK:
|
|
|
|
case MD_PCJR: VAR(VAR_SOUNDCARD) = 1; break;
|
2005-03-19 02:40:42 +00:00
|
|
|
case MD_ADLIB: VAR(VAR_SOUNDCARD) = 3; break;
|
2004-09-20 22:04:06 +00:00
|
|
|
default:
|
|
|
|
if ((_gameId == GID_MONKEY_EGA || _gameId == GID_MONKEY_VGA || _gameId == GID_LOOM)
|
2005-04-20 18:21:30 +00:00
|
|
|
&& (_platform == Common::kPlatformPC)) {
|
2004-09-20 22:04:06 +00:00
|
|
|
if (_gameId == GID_LOOM) {
|
|
|
|
char buf[50];
|
|
|
|
File f;
|
2005-03-19 02:40:42 +00:00
|
|
|
for (int i = 82; i < 86; i++) {
|
2004-09-20 22:04:06 +00:00
|
|
|
sprintf(buf, "%d.LFL", i);
|
|
|
|
f.open(buf);
|
|
|
|
if (f.isOpen() == false)
|
|
|
|
error("Native MIDI support requires Roland patch from LucasArts");
|
|
|
|
f.close();
|
|
|
|
}
|
|
|
|
} else if (_gameId == GID_MONKEY_EGA) {
|
|
|
|
File f;
|
|
|
|
f.open("DISK09.LEC");
|
|
|
|
if (f.isOpen() == false)
|
|
|
|
error("Native MIDI support requires Roland patch from LucasArts");
|
|
|
|
}
|
|
|
|
VAR(VAR_SOUNDCARD) = 4;
|
2005-03-19 02:40:42 +00:00
|
|
|
} else {
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_SOUNDCARD) = 3;
|
2005-03-19 02:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (_gameId == GID_LOOM256 || _version >= 5) {
|
2005-04-20 01:33:44 +00:00
|
|
|
if (_heversion >= 60) {
|
2005-03-19 02:40:42 +00:00
|
|
|
VAR(VAR_SOUNDPARAM) = 1; // soundblaster for music
|
|
|
|
VAR(VAR_SOUNDPARAM2) = 1; // soundblaster for sfx
|
|
|
|
} else {
|
|
|
|
VAR(VAR_SOUNDPARAM) = 0;
|
|
|
|
VAR(VAR_SOUNDPARAM2) = 0;
|
|
|
|
}
|
|
|
|
VAR(VAR_SOUNDPARAM3) = 0;
|
2004-09-20 22:04:06 +00:00
|
|
|
}
|
2005-03-19 02:40:42 +00:00
|
|
|
|
2005-04-20 18:21:30 +00:00
|
|
|
if (_platform == Common::kPlatformFMTowns)
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_VIDEOMODE) = 42;
|
2005-04-20 18:21:30 +00:00
|
|
|
else if (_gameId == GID_INDY3 && (_platform == Common::kPlatformMacintosh))
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_VIDEOMODE) = 50;
|
2005-04-20 18:21:30 +00:00
|
|
|
else if (_gameId == GID_MONKEY2 && (_platform == Common::kPlatformAmiga))
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_VIDEOMODE) = 82;
|
2005-02-20 00:17:22 +00:00
|
|
|
else if (_renderMode == Common::kRenderCGA)
|
|
|
|
VAR(VAR_VIDEOMODE) = 4;
|
2005-03-02 21:46:51 +00:00
|
|
|
else if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG)
|
2005-02-20 00:17:22 +00:00
|
|
|
VAR(VAR_VIDEOMODE) = 30;
|
|
|
|
else if (_renderMode == Common::kRenderEGA)
|
|
|
|
VAR(VAR_VIDEOMODE) = 13;
|
2004-09-20 22:04:06 +00:00
|
|
|
else
|
|
|
|
VAR(VAR_VIDEOMODE) = 19;
|
2005-03-19 02:40:42 +00:00
|
|
|
|
|
|
|
VAR(VAR_CURRENTDRIVE) = 0;
|
|
|
|
if (_gameId == GID_LOOM && (_features & GF_OLD_BUNDLE)) {
|
2005-04-20 18:21:30 +00:00
|
|
|
if (_platform == Common::kPlatformMacintosh) {
|
2005-03-19 02:40:42 +00:00
|
|
|
// This is the for the Mac version of Indy3/Loom
|
|
|
|
VAR(39) = 320;
|
|
|
|
} else {
|
|
|
|
// Set number of sound resources
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(39) = 80;
|
2005-03-19 02:40:42 +00:00
|
|
|
}
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_HEAPSPACE) = 1400;
|
2005-03-19 02:40:42 +00:00
|
|
|
}
|
|
|
|
if (_version >= 4) {
|
2004-09-20 22:04:06 +00:00
|
|
|
VAR(VAR_HEAPSPACE) = 1400;
|
|
|
|
VAR(VAR_FIXEDDISK) = true;
|
|
|
|
}
|
|
|
|
if (_version >= 5)
|
|
|
|
VAR(VAR_MOUSEPRESENT) = true;
|
|
|
|
if (_version == 6)
|
|
|
|
VAR(VAR_V6_EMSSPACE) = 10000;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (VAR_CURRENT_LIGHTS != 0xFF) {
|
|
|
|
// Setup light
|
|
|
|
VAR(VAR_CURRENT_LIGHTS) = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_gameId == GID_MONKEY || _gameId == GID_MONKEY_SEGA)
|
|
|
|
_scummVars[74] = 1225;
|
|
|
|
|
|
|
|
if (_version >= 7) {
|
|
|
|
VAR(VAR_DEFAULT_TALK_DELAY) = 60;
|
|
|
|
VAR(VAR_VOICE_MODE) = ConfMan.getBool("subtitles");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (VAR_FADE_DELAY != 0xFF)
|
|
|
|
VAR(VAR_FADE_DELAY) = 3;
|
|
|
|
|
|
|
|
VAR(VAR_CHARINC) = 4;
|
|
|
|
setTalkingActor(0);
|
|
|
|
}
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|