diff options
author | Filippos Karapetis | 2010-11-17 20:46:59 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-11-17 20:46:59 +0000 |
commit | ba6de1bcdf075747e855ed681fa8926dd89cc906 (patch) | |
tree | be12650fd6d7d04a94f519737be7d1bd7bc15b26 /engines/sci/engine | |
parent | 8a6efcac65c91ed9760bd11824582f05dfd45320 (diff) | |
download | scummvm-rg350-ba6de1bcdf075747e855ed681fa8926dd89cc906.tar.gz scummvm-rg350-ba6de1bcdf075747e855ed681fa8926dd89cc906.tar.bz2 scummvm-rg350-ba6de1bcdf075747e855ed681fa8926dd89cc906.zip |
SCI: Added sanity checks for SCI3 scripts bigger than 64KB
- Extended the "verify_scripts" console command for SCI3 scripts
- Added a check for such large scripts when scripts are loaded, with
an error for now, till a mechanism to support such scripts with a
16-bit addressing scheme is in place (e.g. overlaying, or splitting
scripts). Either way, such scripts should span over more than one segment
svn-id: r54304
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/script.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 6216e1b201..424102a90d 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -113,6 +113,15 @@ void Script::init(int script_nr, ResourceManager *resMan) { error("Script and heap sizes combined exceed 64K. This means a fundamental " "design bug was made regarding SCI1.1 and newer games.\n" "Please report this error to the ScummVM team"); + } else if (getSciVersion() == SCI_VERSION_3) { + // Check for scripts over 64KB. These won't work with the current 16-bit address + // scheme. We need an overlaying mechanism, or a mechanism to split script parts + // in different segments to handle these. For now, simply stop when such a script + // is found. + // TODO: Remove this once such a mechanism is in place + if (script->size > 65535) + error("TODO: SCI script %d is over 64KB - it's %d bytes long. This can't " + "be handled at the moment, thus stopping", script_nr, script->size); } } |