diff options
-rw-r--r-- | scumm/scumm.cpp | 18 | ||||
-rw-r--r-- | scumm/scumm.h | 15 | ||||
-rw-r--r-- | scumm/vars.cpp | 8 |
3 files changed, 36 insertions, 5 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index e71a8f90be..3fd9ea8a79 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -802,10 +802,17 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS VAR_BLAST_ABOVE_TEXT = 0xFF; VAR_VOICE_MODE = 0xFF; - VAR_NUM_GLOBAL_OBJS = 0xFF; VAR_MUSIC_BUNDLE_LOADED = 0xFF; VAR_VOICE_BUNDLE_LOADED = 0xFF; + VAR_NUM_ROOMS = 0xFF; + VAR_NUM_SCRIPTS = 0xFF; + VAR_NUM_SOUNDS = 0xFF; + VAR_NUM_COSTUMES = 0xFF; + VAR_NUM_IMAGES = 0xFF; + VAR_NUM_CHARSETS = 0xFF; + VAR_NUM_GLOBAL_OBJS = 0xFF; + // Use g_scumm from error() ONLY g_scumm = this; @@ -1392,6 +1399,15 @@ void ScummEngine::initScummVars() { // Set amount of sound channels VAR(9) = 8; + 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; + } } else { VAR(VAR_CURRENTDRIVE) = 0; switch (_midiDriver) { diff --git a/scumm/scumm.h b/scumm/scumm.h index 8af5594bf3..e70bea5247 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -477,11 +477,11 @@ protected: /* Global resource tables */ int _numVariables, _numBitVariables, _numLocalObjects; int _numGlobalObjects, _numArray, _numVerbs, _numFlObject; - int _numInventory, _numRooms, _numScripts; + int _numInventory; int _numNewNames, _numGlobalScripts; - int _numActors, _numImages, _numRoomVariables; + int _numActors, _numRoomVariables; public: - int _numSounds; + int _numImages, _numRooms, _numScripts, _numSounds; // Used by VARS in HE games int _numCostumes; // FIXME - should be protected, used by Actor::remapActorPalette int _numCharsets; // FIXME - should be protected, used by CharsetRenderer @@ -1293,9 +1293,16 @@ public: byte VAR_BLAST_ABOVE_TEXT; byte VAR_VOICE_MODE; - byte VAR_NUM_GLOBAL_OBJS; byte VAR_MUSIC_BUNDLE_LOADED; byte VAR_VOICE_BUNDLE_LOADED; + + byte VAR_NUM_ROOMS; + byte VAR_NUM_SCRIPTS; + byte VAR_NUM_SOUNDS; + byte VAR_NUM_COSTUMES; + byte VAR_NUM_IMAGES; + byte VAR_NUM_CHARSETS; + byte VAR_NUM_GLOBAL_OBJS; }; // This is a constant lookup table of reverse bit masks diff --git a/scumm/vars.cpp b/scumm/vars.cpp index 65c0b7b1b0..44a7ba9462 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -241,6 +241,14 @@ void ScummEngine_v72he::setupScummVars() { VAR_TIMEDATE_MONTH = 66; VAR_TIMEDATE_YEAR = 67; + 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; + } void ScummEngine_v7::setupScummVars() { |