diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 6 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 18 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/script_patches.cpp | 18 | ||||
-rw-r--r-- | engines/sci/engine/workarounds.cpp | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 0c5d4e680d..3c5af6fab7 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -602,7 +602,7 @@ static SciKernelMapEntry s_kernelMap[] = { }; /** Default kernel name table. */ -static const char *s_defaultKernelNames[] = { +static const char *const s_defaultKernelNames[] = { /*0x00*/ "Load", /*0x01*/ "UnLoad", /*0x02*/ "ScriptID", @@ -751,7 +751,7 @@ static const char *s_defaultKernelNames[] = { // NOTE: 0x72-0x79, 0x85-0x86, 0x88 are from the GK2 demo (which has debug support) and are // just Dummy in other SCI2 games. -static const char *sci2_default_knames[] = { +static const char *const sci2_default_knames[] = { /*0x00*/ "Load", /*0x01*/ "UnLoad", /*0x02*/ "ScriptID", @@ -916,7 +916,7 @@ static const char *sci2_default_knames[] = { /*0x9f*/ "MessageBox" }; -static const char *sci21_default_knames[] = { +static const char *const sci21_default_knames[] = { /*0x00*/ "Load", /*0x01*/ "UnLoad", /*0x02*/ "ScriptID", diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 36de767464..556e5249b6 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -49,6 +49,7 @@ #include "sci/graphics/text16.h" #include "sci/graphics/view.h" #ifdef ENABLE_SCI32 +#include "sci/graphics/text32.h" #include "sci/graphics/frameout.h" #include "sci/video/robot_decoder.h" #endif @@ -1380,15 +1381,19 @@ reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) { } reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) { - // TODO: argument 0 is usually 0, and arguments 1 and 2 are usually 1 switch (argv[0].toUint16()) { case 0: { if (argc != 4) { warning("kCreateTextBitmap(0): expected 4 arguments, got %i", argc); return NULL_REG; } - //reg_t object = argv[3]; - //Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text))); + reg_t object = argv[3]; + Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text))); + debugC(kDebugLevelStrings, "kCreateTextBitmap case 0 (%04x:%04x, %04x:%04x, %04x:%04x)", + PRINT_REG(argv[1]), PRINT_REG(argv[2]), PRINT_REG(argv[3])); + debugC(kDebugLevelStrings, "%s", text.c_str()); + // TODO: arguments 1 and 2 + g_sci->_gfxText32->createTextBitmap(object); break; } case 1: { @@ -1396,8 +1401,11 @@ reg_t kCreateTextBitmap(EngineState *s, int argc, reg_t *argv) { warning("kCreateTextBitmap(0): expected 2 arguments, got %i", argc); return NULL_REG; } - //reg_t object = argv[1]; - //Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text))); + reg_t object = argv[1]; + Common::String text = s->_segMan->getString(readSelector(s->_segMan, object, SELECTOR(text))); + debugC(kDebugLevelStrings, "kCreateTextBitmap case 1 (%04x:%04x)", PRINT_REG(argv[1])); + debugC(kDebugLevelStrings, "%s", text.c_str()); + g_sci->_gfxText32->createTextBitmap(object); break; } default: diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index b383f88840..783845bb76 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -42,6 +42,14 @@ reg_t kStrCat(EngineState *s, int argc, reg_t *argv) { Common::String s1 = s->_segMan->getString(argv[0]); Common::String s2 = s->_segMan->getString(argv[1]); + // The Japanese version of PQ2 splits the two strings here + // (check bug #3396887). + if (g_sci->getGameId() == GID_PQ2 && + g_sci->getLanguage() == Common::JA_JPN) { + s1 = g_sci->strSplit(s1.c_str(), NULL); + s2 = g_sci->strSplit(s2.c_str(), NULL); + } + s1 += s2; s->_segMan->strcpy(argv[0], s1.c_str()); return argv[0]; diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index a714980a35..7efcb42f4b 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -855,26 +855,8 @@ const uint16 qfg3PatchImportDialog[] = { PATCH_END }; -// Script 23 in QFG3 has a typo/bug which makes it loop endlessly and -// read garbage. Fixes bug #3040722. -const byte qfg3DialogCrash[] = { - 5, - 0x34, 0xe7, 0x03, // ldi 3e7 (999) - 0x22, // lt? - 0x33, // jmp [back] ---> BUG! Infinite loop - 0 -}; - -const uint16 qfg3PatchDialogCrash[] = { - 0x34, 0xe7, 0x03, // ldi 3e7 (999) - 0x22, // lt? - 0x31, // bnt [back] - PATCH_END -}; - // script, description, magic DWORD, adjust const SciScriptSignature qfg3Signatures[] = { - { 23, "dialog crash", 1, PATCH_MAGICDWORD(0xe7, 0x03, 0x22, 0x33), -1, qfg3DialogCrash, qfg3PatchDialogCrash }, { 944, "import dialog continuous calls", 1, PATCH_MAGICDWORD(0x2a, 0x31, 0x0b, 0x7a), -1, qfg3SignatureImportDialog, qfg3PatchImportDialog }, SCI_SIGNATUREENTRY_TERMINATOR }; diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index b2cde47f4a..968afcb11c 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -209,6 +209,8 @@ const SciWorkaroundEntry kDeviceInfo_workarounds[] = { // gameID, room,script,lvl, object-name, method-name, call,index, workaround const SciWorkaroundEntry kDisplay_workarounds[] = { { GID_ISLANDBRAIN, 300, 300, 0, "geneDude", "show", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the gene explanation chart - a parameter is an object + { GID_PQ1, 500, 500, 0, "endInter", "changeState", 0x3e8, 0, { WORKAROUND_IGNORE, 0 } }, // restoring a game at the map scene (bug #3389579) + { GID_PQ1, 500, 500, 0, "endInter", "changeState", 0x46b, 0, { WORKAROUND_IGNORE, 0 } }, // restoring a game at the map scene (bug #3389579) { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4ae, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4c1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id (another pq2 version, bug #3043904) { GID_QFG1, 11, 11, 0, "battle", "<noname90>", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: When entering battle, 0x75 as id |