aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/intern.h25
-rw-r--r--scumm/scumm.cpp21
-rw-r--r--scumm/scumm.h22
-rw-r--r--scumm/vars.cpp34
4 files changed, 62 insertions, 40 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index 7b603bec88..e05db067c4 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -1062,16 +1062,8 @@ protected:
byte VAR_NUM_COSTUMES;
byte VAR_NUM_IMAGES;
byte VAR_NUM_CHARSETS;
- byte VAR_NUM_SPRITE_GROUPS;
- byte VAR_NUM_SPRITES;
- byte VAR_NUM_PALETTES;
- byte VAR_NUM_UNK;
+
byte VAR_POLYGONS_ONLY;
- byte VAR_PLATFORM;
- byte VAR_WINDOWS_VERSION;
- byte VAR_CURRENT_CHARSET;
- byte VAR_U32_VERSION;
- byte VAR_U32_ARRAY_UNK;
};
class ScummEngine_v80he : public ScummEngine_v72he {
@@ -1094,6 +1086,7 @@ protected:
virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i);
+ virtual void setupScummVars();
virtual void initScummVars();
virtual void initCharset(int charset);
@@ -1118,6 +1111,11 @@ protected:
void o80_drawWizPolygon();
void o80_drawLine();
void o80_pickVarRandom();
+
+ byte VAR_PLATFORM;
+ byte VAR_WINDOWS_VERSION;
+ byte VAR_CURRENT_CHARSET;
+ byte VAR_COLOR_DEPTH;
};
class ScummEngine_v90he : public ScummEngine_v80he {
@@ -1168,6 +1166,7 @@ protected:
virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i);
+ virtual void setupScummVars();
virtual void initScummVars();
virtual void saveOrLoad(Serializer *s);
@@ -1241,6 +1240,14 @@ protected:
void o90_getActorAnimProgress();
void o90_kernelGetFunctions();
void o90_kernelSetFunctions();
+
+ byte VAR_NUM_SPRITE_GROUPS;
+ byte VAR_NUM_SPRITES;
+ byte VAR_NUM_PALETTES;
+ byte VAR_NUM_UNK;
+
+ byte VAR_U32_VERSION;
+ byte VAR_U32_ARRAY_UNK;
};
class ScummEngine_v99he : public ScummEngine_v90he {
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 5a26f447c1..11bf88709d 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -1608,15 +1608,7 @@ ScummEngine_v72he::ScummEngine_v72he(GameDetector *detector, OSystem *syst, cons
VAR_NUM_COSTUMES = 0xFF;
VAR_NUM_IMAGES = 0xFF;
VAR_NUM_CHARSETS = 0xFF;
- VAR_NUM_SPRITE_GROUPS = 0xFF;
- VAR_NUM_SPRITES = 0xFF;
- VAR_NUM_PALETTES = 0xFF;
- VAR_NUM_UNK = 0xFF;
VAR_POLYGONS_ONLY = 0xFF;
- VAR_PLATFORM = 0xFF;
- VAR_WINDOWS_VERSION = 0xFF;
- VAR_CURRENT_CHARSET = 0xFF;
- VAR_U32_VERSION = 0xFF;
}
ScummEngine_v80he::ScummEngine_v80he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
@@ -1625,11 +1617,24 @@ ScummEngine_v80he::ScummEngine_v80he(GameDetector *detector, OSystem *syst, cons
_curSndId = 0;
_sndPtrOffs = 0;
_sndTmrOffs = 0;
+
+ VAR_PLATFORM = 0xFF;
+ VAR_WINDOWS_VERSION = 0xFF;
+ VAR_CURRENT_CHARSET = 0xFF;
+ VAR_COLOR_DEPTH = 0xFF;
}
ScummEngine_v90he::ScummEngine_v90he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex)
: ScummEngine_v80he(detector, syst, gs, md5sum, substResFileNameIndex) {
_sprite = new Sprite(this);
+
+ VAR_NUM_SPRITE_GROUPS = 0xFF;
+ VAR_NUM_SPRITES = 0xFF;
+ VAR_NUM_PALETTES = 0xFF;
+ VAR_NUM_UNK = 0xFF;
+
+ VAR_U32_VERSION = 0xFF;
+ VAR_U32_ARRAY_UNK = 0xFF;
}
ScummEngine_v90he::~ScummEngine_v90he() {
diff --git a/scumm/scumm.h b/scumm/scumm.h
index b44bb82d90..c54e92cb94 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -1329,21 +1329,21 @@ public:
byte VAR_CLICK_AREA;
// HE specific variables
- byte VAR_REDRAW_ALL_ACTORS;
- byte VAR_SKIP_RESET_TALK_ACTOR;
+ byte VAR_REDRAW_ALL_ACTORS; // Used in setActorRedrawFlags()
+ byte VAR_SKIP_RESET_TALK_ACTOR; // Used in setActorCostume()
- byte VAR_SOUND_CHANNEL;
- byte VAR_TALK_CHANNEL;
- byte VAR_SOUNDCODE_TMR;
- byte VAR_RESERVED_SOUND_CHANNELS;
+ byte VAR_SOUND_CHANNEL; // Used in o_startSound()
+ byte VAR_TALK_CHANNEL; // Used in startHETalkSound()
+ byte VAR_SOUNDCODE_TMR; // Used in processSoundCode()
+ byte VAR_RESERVED_SOUND_CHANNELS; // Used in findFreeSoundChannel()
- byte VAR_MAIN_SCRIPT;
+ byte VAR_MAIN_SCRIPT; // Used in scummLoop()
- byte VAR_SCRIPT_CYCLE;
- byte VAR_NUM_SCRIPT_CYCLES;
+ byte VAR_SCRIPT_CYCLE; // Used in runScript()/runObjectScript()
+ byte VAR_NUM_SCRIPT_CYCLES; // Used in runAllScripts()
- byte VAR_KEY_STATE; // Used in parseEvents()
- byte VAR_MOUSE_STATE;
+ byte VAR_KEY_STATE; // Used in parseEvents()
+ byte VAR_MOUSE_STATE; // Used in checkExecVerbs();
// Exists both in V7 and in V72HE:
byte VAR_NUM_GLOBAL_OBJS;
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 91d9c652be..aa02c25e27 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -294,18 +294,27 @@ void ScummEngine_v72he::setupScummVars() {
if (_heversion <= 73) {
VAR_NUM_SOUND_CHANNELS = 56;
}
- if (_heversion >= 80)
- VAR_PLATFORM = 78; // 1 is PC, 2 is Macintosh
- VAR_WINDOWS_VERSION = 79; // 31 is Windows 3.1, 40 is Windows 95+
- VAR_CURRENT_CHARSET = 80;
- VAR_SOUNDCODE_TMR = 84;
- VAR_KEY_STATE = 86;
- VAR_NUM_SOUND_CHANNELS = 88;
- VAR_REDRAW_ALL_ACTORS = 95;
- if (_heversion >= 90) {
- VAR_SCRIPT_CYCLE = 103;
- VAR_NUM_SCRIPT_CYCLES = 104;
- }
+}
+
+void ScummEngine_v80he::setupScummVars() {
+ ScummEngine_v72he::setupScummVars();
+
+ VAR_PLATFORM = 78; // 1 is PC, 2 is Macintosh
+ VAR_WINDOWS_VERSION = 79; // 31 is Windows 3.1, 40 is Windows 95+
+ VAR_CURRENT_CHARSET = 80;
+ VAR_SOUNDCODE_TMR = 84;
+ VAR_KEY_STATE = 86;
+ VAR_NUM_SOUND_CHANNELS = 88;
+ VAR_COLOR_DEPTH = 89;
+ VAR_REDRAW_ALL_ACTORS = 95;
+}
+
+void ScummEngine_v90he::setupScummVars() {
+ ScummEngine_v80he::setupScummVars();
+
+ VAR_SCRIPT_CYCLE = 103;
+ VAR_NUM_SCRIPT_CYCLES = 104;
+
if (_heversion >= 95) {
VAR_NUM_SPRITE_GROUPS = 105;
VAR_NUM_SPRITES = 106;
@@ -604,6 +613,7 @@ void ScummEngine_v80he::initScummVars() {
VAR(VAR_PLATFORM) = 1;
VAR(VAR_WINDOWS_VERSION) = 40;
+ VAR(VAR_COLOR_DEPTH) = 256;
}
void ScummEngine_v90he::initScummVars() {