diff options
author | Filippos Karapetis | 2011-10-19 15:23:48 +0300 |
---|---|---|
committer | Filippos Karapetis | 2011-10-19 15:24:45 +0300 |
commit | de6e5c7366c9bf52c210e7bb03353d1cf2e142fd (patch) | |
tree | 253f4fca192ad16d29e9bf5948995e187c5b7d62 /engines | |
parent | 33e6f64179cc7504fd822e0b4a5b85f62557a73c (diff) | |
download | scummvm-rg350-de6e5c7366c9bf52c210e7bb03353d1cf2e142fd.tar.gz scummvm-rg350-de6e5c7366c9bf52c210e7bb03353d1cf2e142fd.tar.bz2 scummvm-rg350-de6e5c7366c9bf52c210e7bb03353d1cf2e142fd.zip |
SCI: Fixed script bug #3425276 - "SCI: PQ2: Game crashes when looking at file"
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 75fef0a3ec..23177dfc7b 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -467,9 +467,9 @@ void GfxPaint16::kernelGraphRedrawBox(Common::Rect rect) { #define SCI_DISPLAY_WIDTH 106 #define SCI_DISPLAY_SAVEUNDER 107 #define SCI_DISPLAY_RESTOREUNDER 108 -#define SCI_DISPLAY_DUMMY1 114 // used in longbow demo/qfg1 ega demo, not supported in sierra sci - no parameters -#define SCI_DISPLAY_DUMMY2 115 // used in longbow demo, not supported in sierra sci - has 1 parameter -#define SCI_DISPLAY_DUMMY3 117 // used in qfg1 ega demo, not supported in sierra sci - no parameters +#define SCI_DISPLAY_DUMMY1 114 +#define SCI_DISPLAY_DUMMY2 115 +#define SCI_DISPLAY_DUMMY3 117 #define SCI_DISPLAY_DONTSHOWBITS 121 reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { @@ -539,26 +539,29 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { bRedraw = 0; break; - // 2 Dummy functions, longbow-demo is using those several times but sierra sci doesn't support them at all - // The Quest for Glory 1 EGA demo also calls kDisplay(114) and kDisplay(117) - case SCI_DISPLAY_DUMMY1: - case SCI_DISPLAY_DUMMY2: - case SCI_DISPLAY_DUMMY3: - if (!g_sci->isDemo() || (g_sci->getGameId() != GID_LONGBOW && g_sci->getGameId() != GID_QFG1)) + // The following three dummy calls are not supported by the Sierra SCI + // interpreter, but are erroneously called in some game scripts. + case SCI_DISPLAY_DUMMY1: // Longbow demo (all rooms) and QFG1 EGA demo (room 11) + case SCI_DISPLAY_DUMMY2: // Longbow demo (all rooms) + case SCI_DISPLAY_DUMMY3: // QFG1 EGA demo (room 11) and PQ2 (room 23) + if (!(g_sci->getGameId() == GID_LONGBOW && g_sci->isDemo()) && + !(g_sci->getGameId() == GID_QFG1 && g_sci->isDemo()) && + !(g_sci->getGameId() == GID_PQ2)) error("Unknown kDisplay argument %d", displayArg.offset); + if (displayArg.offset == SCI_DISPLAY_DUMMY2) { - if (argc) { - argc--; argv++; - } else { + if (!argc) error("No parameter left for kDisplay(115)"); - } + argc--; argv++; } break; default: SciTrackOriginReply originReply; SciWorkaroundSolution solution = trackOriginAndFindWorkaround(0, kDisplay_workarounds, &originReply); if (solution.type == WORKAROUND_NONE) - error("Unknown kDisplay argument (%04x:%04x) from method %s::%s (script %d, localCall %x)", PRINT_REG(displayArg), originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, originReply.localCallOffset); + error("Unknown kDisplay argument (%04x:%04x) from method %s::%s (script %d, localCall %x)", + PRINT_REG(displayArg), originReply.objectName.c_str(), originReply.methodName.c_str(), + originReply.scriptNr, originReply.localCallOffset); assert(solution.type == WORKAROUND_IGNORE); break; } |