diff options
author | Filippos Karapetis | 2010-08-01 11:10:14 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-08-01 11:10:14 +0000 |
commit | 9699f8291d4ec254d165954b5d4751cba93a8fe1 (patch) | |
tree | c58fd7f3fae9df92afe58d27efebdcf61bc823c0 /engines | |
parent | af76912e873df1acb39714d1aa9479bb777591f9 (diff) | |
download | scummvm-rg350-9699f8291d4ec254d165954b5d4751cba93a8fe1.tar.gz scummvm-rg350-9699f8291d4ec254d165954b5d4751cba93a8fe1.tar.bz2 scummvm-rg350-9699f8291d4ec254d165954b5d4751cba93a8fe1.zip |
SCI: Ignoring non-critical script bug in QFG1VGA, when closing any conversation dialog with esc (doesn't affect gameplay in any manner)
svn-id: r51572
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 9 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 7 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.h | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 99e02d92f2..5ef4157119 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -236,8 +236,13 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) { 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 : { diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 25cf1d069f..3fac6925a4 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -851,13 +851,14 @@ byte *SegManager::allocDynmem(int size, const char *descr, reg_t *addr) { 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 diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index e0808dbb1b..59ac6f39b6 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -274,7 +274,7 @@ public: * 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 |