aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/bundle.cpp2
-rw-r--r--scumm/script_v5.cpp3
-rw-r--r--scumm/script_v8.cpp27
-rw-r--r--scumm/scumm.h3
-rw-r--r--scumm/string.cpp11
5 files changed, 36 insertions, 10 deletions
diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp
index edc8516049..a0b5395436 100644
--- a/scumm/bundle.cpp
+++ b/scumm/bundle.cpp
@@ -361,7 +361,7 @@ int32 Bundle::decompressVoiceSampleByName(char *name, byte **comp_final) {
return final_size;
}
}
- warning("Failed finding voice %s", name);
+ debug(2, "Failed finding voice %s", name);
return final_size;
}
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index f046713fb4..6f7b33a2a8 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -2346,7 +2346,7 @@ void Scumm_v5::o5_walkActorToObject() {
int Scumm_v5::getWordVararg(int *ptr) {
int i;
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 15; i++)
ptr[i] = 0;
i = 0;
@@ -2494,6 +2494,7 @@ void Scumm_v5::o5_oldRoomEffect() {
// that something is missing here :-)
if (a == 4) {
+printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a);
// No idea what byte_2FCCF is, but it's a globale boolean flag.
// I only add it here as a temporary hack to make the pseudo code compile.
int byte_2FCCF = 0;
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index ac09e727df..95fcb574dc 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -515,11 +515,14 @@ void Scumm_v8::decodeParseString(int m, int n) {
}
pointer[j] = 0;
- // Stop any talking that's still going on
- if (_sound->_talkChannel > -1)
- _mixer->stop(_sound->_talkChannel);
+ int new_sound = _sound->playBundleSound(pointer);
+ if (new_sound != -1) {
+ // Stop any talking that's still going on
+ if (_sound->_talkChannel > -1)
+ _mixer->stop(_sound->_talkChannel);
+ _sound->_talkChannel = new_sound;
+ }
- _sound->_talkChannel = _sound->playBundleSound(pointer);
_messagePtr = _transText;
}
@@ -607,10 +610,24 @@ void Scumm::drawBlastTexts() {
_charset->_nextTop = _charset->_top;
}
} while (c);
+
+ _blastTextQueue[i].left = _charset->_strLeft;
+ _blastTextQueue[i].right = _charset->_strRight;
+ _blastTextQueue[i].top = _charset->_strTop;
+ _blastTextQueue[i].bottom = _charset->_strBottom;
}
_charset->_ignoreCharsetMask = false;
}
+void Scumm::removeBlastTexts() {
+ int i;
+
+ for (i = 0; i < _blastTextQueuePos; i++) {
+ restoreBG(_blastTextQueue[i].left, _blastTextQueue[i].top, _blastTextQueue[i].right, _blastTextQueue[i].bottom);
+ }
+ _blastTextQueuePos = 0;
+}
+
void Scumm_v8::o8_mod() {
int a = pop();
push(pop() % a);
@@ -1614,7 +1631,7 @@ void Scumm_v8::o8_kernelGetFunctions() {
// scripts. Probably a wrong push/pop somewhere. For now override to correct value.
array = 658;
ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
- if (!strcmp((char *)ah->data, "Saveload Page"))
+ if (!strcmp((char *)ah->data, "Saveload Page") || !strcmp((char *)ah->data, "Object Names"))
push(1);
else
push(0);
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 2494fcd94e..248fb26c45 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -116,6 +116,7 @@ struct NestedScript {
struct BlastText {
int16 xpos, ypos;
+ int16 left, right, top, bottom;
byte color;
byte charset;
bool center;
@@ -877,7 +878,7 @@ public:
void enqueueText(byte *text, int x, int y, byte color, byte charset, bool center);
void drawBlastTexts();
- void removeBlastTexts() { _blastTextQueuePos = 0; }
+ void removeBlastTexts();
void enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth,
int objectHeight, int scaleX, int scaleY, int image, int mode);
diff --git a/scumm/string.cpp b/scumm/string.cpp
index a5bc387f3d..7a5369272a 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -857,15 +857,22 @@ void Scumm::translateText(byte *text, byte *trans_buff) {
if (_gameId == GID_CMI) {
if ((text[0] == '/') && (_existLanguageFile == true)) {
struct langIndexNode target;
- struct langIndexNode *found;
+ struct langIndexNode *found = NULL;
// copy name from text /..../
for (l = 0; (l < 8) && (text[l + 1] != '/'); l++)
target.tag[l] = toupper(text[l + 1]);
target.tag[l] = 0;
- found = (struct langIndexNode *)bsearch(&target, _languageIndex, _languageStrCount, sizeof(struct langIndexNode), indexCompare);
+ // HACK: These are used for the object line when
+ // using one object on another. I don't know if the
+ // text in the language file is a placeholder or if
+ // we're supposed to use it, but at least in the
+ // English version things will work so much better if
+ // we can't find translations for these.
+ if (strcmp(target.tag, "PU_M001") != 0 && strcmp(target.tag, "PU_M002") != 0)
+ found = (struct langIndexNode *)bsearch(&target, _languageIndex, _languageStrCount, sizeof(struct langIndexNode), indexCompare);
if (found != NULL) {
File file;