[Scummvm-cvs-logs] SF.net SVN: scummvm:[51572] scummvm/trunk/engines/sci/engine

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Aug 1 13:10:14 CEST 2010


Revision: 51572
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51572&view=rev
Author:   thebluegr
Date:     2010-08-01 11:10:14 +0000 (Sun, 01 Aug 2010)

Log Message:
-----------
SCI: Ignoring non-critical script bug in QFG1VGA, when closing any conversation dialog with esc (doesn't affect gameplay in any manner)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kmisc.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.h

Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp	2010-08-01 10:17:31 UTC (rev 51571)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp	2010-08-01 11:10:14 UTC (rev 51572)
@@ -236,8 +236,13 @@
 		s->_segMan->allocDynmem(argv[1].toUint16(), "kMemory() non-critical", &s->r_acc);
 		break;
 	case K_MEMORY_FREE :
-		if (s->_segMan->freeDynmem(argv[1])) {
-			error("Attempt to kMemory::free() non-dynmem pointer %04x:%04x", PRINT_REG(argv[1]));
+		if (!s->_segMan->freeDynmem(argv[1])) {
+			if (g_sci->getGameId() == GID_QFG1VGA) {
+				// Ignore script bug in QFG1VGA, when closing any conversation dialog with esc
+			} else {
+				// Usually, the result of a script bug. Non-critical
+				warning("Attempt to kMemory::free() non-dynmem pointer %04x:%04x", PRINT_REG(argv[1]));
+			}
 		}
 		break;
 	case K_MEMORY_MEMCPY : {

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2010-08-01 10:17:31 UTC (rev 51571)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2010-08-01 11:10:14 UTC (rev 51572)
@@ -851,13 +851,14 @@
 	return (byte *)(d._buf);
 }
 
-int SegManager::freeDynmem(reg_t addr) {
+bool SegManager::freeDynmem(reg_t addr) {
+	SegmentType foo = _heap[addr.segment]->getType();
 	if (addr.segment < 1 || addr.segment >= _heap.size() || !_heap[addr.segment] || _heap[addr.segment]->getType() != SEG_TYPE_DYNMEM)
-		return 1; // error
+		return false; // error
 
 	deallocate(addr.segment, true);
 
-	return 0; // OK
+	return true; // OK
 }
 
 #ifdef ENABLE_SCI32

Modified: scummvm/trunk/engines/sci/engine/seg_manager.h
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.h	2010-08-01 10:17:31 UTC (rev 51571)
+++ scummvm/trunk/engines/sci/engine/seg_manager.h	2010-08-01 11:10:14 UTC (rev 51572)
@@ -274,7 +274,7 @@
 	 * Deallocates a piece of dynamic memory
 	 * @param[in] addr	Offset of the dynmem chunk to free
 	 */
-	int freeDynmem(reg_t addr);
+	bool freeDynmem(reg_t addr);
 
 
 	// Generic Operations on Segments and Addresses


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list