From ba6de1bcdf075747e855ed681fa8926dd89cc906 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 17 Nov 2010 20:46:59 +0000 Subject: 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 --- engines/sci/engine/script.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/sci/engine/script.cpp') 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); } } -- cgit v1.2.3