diff options
author | Martin Kiewitz | 2010-08-03 13:17:30 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-08-03 13:17:30 +0000 |
commit | 4c7a6ac2d56e9fa136663028d6be45c01d53d321 (patch) | |
tree | 21848cc0976eb9d2e28506cf6cf47a35ae132c3c /engines/sci | |
parent | a02d9d656b8a066f362dd872d094dd4d849a8537 (diff) | |
download | scummvm-rg350-4c7a6ac2d56e9fa136663028d6be45c01d53d321.tar.gz scummvm-rg350-4c7a6ac2d56e9fa136663028d6be45c01d53d321.tar.bz2 scummvm-rg350-4c7a6ac2d56e9fa136663028d6be45c01d53d321.zip |
SCI: adding workaround for pq3 inside kMemory
fixing plot crimes warnings and bad text on screen
svn-id: r51693
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 5ef4157119..47d86f920a 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -227,12 +227,22 @@ enum { reg_t kMemory(EngineState *s, int argc, reg_t *argv) { switch (argv[0].toUint16()) { - case K_MEMORY_ALLOCATE_CRITICAL : - if (!s->_segMan->allocDynmem(argv[1].toUint16(), "kMemory() critical", &s->r_acc)) { + case K_MEMORY_ALLOCATE_CRITICAL: { + int byteCount = argv[1].toUint16(); + // WORKAROUND: pq3 when plotting crimes - allocates the returned bytes + // from kStrLen on "W" and "E" and wants to put a string in there, + // which doesn't fit of course. That's why we allocate one byte more + // all the time inside that room - maybe only multilingual pq3 + if (g_sci->getGameId() == GID_PQ3) { + if (s->currentRoomNumber() == 202) + byteCount++; + } + if (!s->_segMan->allocDynmem(byteCount, "kMemory() critical", &s->r_acc)) { error("Critical heap allocation failed"); } break; - case K_MEMORY_ALLOCATE_NONCRITICAL : + } + case K_MEMORY_ALLOCATE_NONCRITICAL: s->_segMan->allocDynmem(argv[1].toUint16(), "kMemory() non-critical", &s->r_acc); break; case K_MEMORY_FREE : |