[Scummvm-cvs-logs] scummvm master -> ca1f9a075f7914ae3ceb83b9a01b5b7a193041e9
bluegr
md5 at scummvm.org
Mon Mar 14 19:15:32 CET 2011
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
75319afbfd SCI: Ignore some more leftovers scripts in the find_callk console command
ca1f9a075f SCI: Got rid of VERIFY() and removed some newlines in error messages
Commit: 75319afbfdc1e42179e261065a876bcf6f685bab
https://github.com/scummvm/scummvm/commit/75319afbfdc1e42179e261065a876bcf6f685bab
Author: md5 (md5 at scummvm.org)
Date: 2011-03-14T10:59:30-07:00
Commit Message:
SCI: Ignore some more leftovers scripts in the find_callk console command
Changed paths:
engines/sci/console.cpp
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 5c7feb3..b13ae3c 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2720,9 +2720,10 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) {
SegManager *segMan = _engine->getEngineState()->_segMan;
while (itr != resources->end()) {
- if (_engine->getGameId() == GID_KQ5 && itr->getNumber() == 980) {
- // Ignore script 980 in KQ5. Seems to be a leftover, as it
- // uses a superclass from script 988, which doesn't exist
+ // Ignore specific leftover scripts, which require other non-existing scripts
+ if ((_engine->getGameId() == GID_HOYLE3 && itr->getNumber() == 995) ||
+ (_engine->getGameId() == GID_KQ5 && itr->getNumber() == 980) ||
+ (_engine->getGameId() == GID_SLATER && itr->getNumber() == 947)) {
itr++;
continue;
}
Commit: ca1f9a075f7914ae3ceb83b9a01b5b7a193041e9
https://github.com/scummvm/scummvm/commit/ca1f9a075f7914ae3ceb83b9a01b5b7a193041e9
Author: md5 (md5 at scummvm.org)
Date: 2011-03-14T11:00:26-07:00
Commit Message:
SCI: Got rid of VERIFY() and removed some newlines in error messages
Changed paths:
engines/sci/engine/script.cpp
engines/sci/engine/seg_manager.cpp
engines/sci/engine/seg_manager.h
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 3c81a93..fb96518 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -70,7 +70,7 @@ void Script::init(int script_nr, ResourceManager *resMan) {
Resource *script = resMan->findResource(ResourceId(kResourceTypeScript, script_nr), 0);
if (!script)
- error("Script %d not found\n", script_nr);
+ error("Script %d not found", script_nr);
_localsOffset = 0;
_localsBlock = NULL;
@@ -257,9 +257,8 @@ Object *Script::scriptObjInit(reg_t obj_pos, bool fullObjectInit) {
if (getSciVersion() < SCI_VERSION_1_1 && fullObjectInit)
obj_pos.offset += 8; // magic offset (SCRIPT_OBJECT_MAGIC_OFFSET)
- VERIFY(obj_pos.offset < _bufSize, "Attempt to initialize object beyond end of script\n");
-
- VERIFY(obj_pos.offset + kOffsetFunctionArea < (int)_bufSize, "Function area pointer stored beyond end of script\n");
+ if (obj_pos.offset >= _bufSize)
+ error("Attempt to initialize object beyond end of script");
// Get the object at the specified position and init it. This will
// automatically "allocate" space for it in the _objects map if necessary.
@@ -327,8 +326,9 @@ void Script::relocateSci0Sci21(reg_t block) {
heapOffset = _scriptSize;
}
- VERIFY(block.offset < (uint16)heapSize && READ_SCI11ENDIAN_UINT16(heap + block.offset) * 2 + block.offset < (uint16)heapSize,
- "Relocation block outside of script\n");
+ if (block.offset >= (uint16)heapSize ||
+ READ_SCI11ENDIAN_UINT16(heap + block.offset) * 2 + block.offset >= (uint16)heapSize)
+ error("Relocation block outside of script");
int count = READ_SCI11ENDIAN_UINT16(heap + block.offset);
int exportIndex = 0;
@@ -418,7 +418,8 @@ uint16 Script::validateExportFunc(int pubfunct, bool relocate) {
offset = relocateOffsetSci3(pubfunct * 2 + 22);
}
- VERIFY(offset < _bufSize, "invalid export function pointer");
+ if (offset >= _bufSize)
+ error("Invalid export function pointer");
// Check if the offset found points to a second export table (e.g. script 912
// in Camelot and script 306 in KQ4). Such offsets are usually small (i.e. < 10),
@@ -432,7 +433,8 @@ uint16 Script::validateExportFunc(int pubfunct, bool relocate) {
if (secondExportTable) {
secondExportTable += 3; // skip header plus 2 bytes (secondExportTable is a uint16 pointer)
offset = READ_SCI11ENDIAN_UINT16(secondExportTable + pubfunct);
- VERIFY(offset < _bufSize, "invalid export function pointer");
+ if (offset >= _bufSize)
+ error("Invalid export function pointer");
}
}
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index a3e5239..0dc245a 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -152,7 +152,8 @@ Script *SegManager::allocateScript(int script_nr, SegmentId *segid) {
}
void SegManager::deallocate(SegmentId seg) {
- VERIFY(check(seg), "invalid seg id");
+ if (!check(seg))
+ error("SegManager::deallocate(): invalid segment ID");
SegmentObj *mobj = _heap[seg];
@@ -359,9 +360,8 @@ LocalVariables *SegManager::allocLocalsSegment(Script *scr) {
if (scr->_localsSegment) {
locals = (LocalVariables *)_heap[scr->_localsSegment];
- VERIFY(locals != NULL, "Re-used locals segment was NULL'd out");
- VERIFY(locals->getType() == SEG_TYPE_LOCALS, "Re-used locals segment did not consist of local variables");
- VERIFY(locals->script_id == scr->getScriptNumber(), "Re-used locals segment belonged to other script");
+ if (!locals || locals->getType() != SEG_TYPE_LOCALS || locals->script_id != scr->getScriptNumber())
+ error("Invalid script locals segment while allocating locals");
} else
locals = (LocalVariables *)allocSegment(new LocalVariables(), &scr->_localsSegment);
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 58c88ca..d402afb 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -36,15 +36,6 @@
namespace Sci {
/**
- * Verify the the given condition is true, output the message if condition is false, and exit.
- * @param cond condition to be verified
- * @param msg the message to be printed if condition fails
- */
-#define VERIFY( cond, msg ) if (!(cond)) {\
- error("%s, line, %d, %s", __FILE__, __LINE__, msg); \
- }
-
-/**
* Parameters for getScriptSegment().
*/
enum ScriptLoadType {
More information about the Scummvm-git-logs
mailing list