aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/intern.h1
-rw-r--r--scumm/script.cpp6
-rw-r--r--scumm/script_v72he.cpp8
-rw-r--r--scumm/script_v90he.cpp13
4 files changed, 19 insertions, 9 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index b8ecf0aefa..685e744c9b 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -834,6 +834,7 @@ protected:
virtual const char *getOpcodeDesc(byte i);
/* HE version 90 script opcodes */
+ void o90_dup();
void o90_getLT();
void o90_getGT();
void o90_startLocalScript();
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 1c0b39dd87..8731d462cc 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -354,10 +354,6 @@ void ScummEngine::nukeArrays(byte script) {
if (_heversion < 60 || script == 0)
return;
- //FIXME Nukes wrong arrays
- if (_gameId == GID_FBEAR)
- return;
-
for (i = 1; i < _numArray; i++) {
if (_arraySlot[i] == script) {
nukeResource(rtString, i);
@@ -705,9 +701,9 @@ void ScummEngine::stopObjectCode() {
ss->cutsceneOverride = 0;
}
}
+ nukeArrays(ss->number);
ss->number = 0;
ss->status = ssDead;
- nukeArrays(_currentScript);
_currentScript = 0xFF;
}
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 1003130aa7..01d4302c32 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -2109,6 +2109,7 @@ void ScummEngine_v72he::o72_unknownF0() {
void ScummEngine_v72he::o72_unknownF1() {
byte *addr, *addr2;
+ int i = 0;
int id = pop();
int id2 = pop();
@@ -2122,16 +2123,17 @@ void ScummEngine_v72he::o72_unknownF1() {
error("o72_stringLen: Reference to zeroed array pointer (%d)", id);
while (*addr == *addr2) {
- if (addr == 0) {
+ if (*addr == 0) {
push(0);
return;
}
addr++;
addr2++;
+ i++;
}
- push (1);
- debug(1,"o70_unknownF1 stub (%d, %d)", id, id2);
+ push (i);
+ debug(1,"o70_unknownF1 stub (%d, %d, %d)", id, id2, i);
}
void ScummEngine_v72he::o72_checkGlobQueue() {
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index f58f458423..d547d4c1cb 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -57,7 +57,7 @@ void ScummEngine_v90he::setupOpcodes() {
/* 08 */
OPCODE(o6_invalid),
OPCODE(o6_invalid),
- OPCODE(o6_invalid),
+ OPCODE(o90_dup),
OPCODE(o6_wordArrayIndexedRead),
/* 0C */
OPCODE(o6_dup),
@@ -378,6 +378,17 @@ const char *ScummEngine_v90he::getOpcodeDesc(byte i) {
return _opcodesV90he[i].desc;
}
+void ScummEngine_v90he::o90_dup() {
+ int a, num;
+
+ num = fetchScriptWord();
+ for (int i = 0; i < num; i++) {
+ a = pop();
+ push(a);
+ push(a);
+ }
+}
+
void ScummEngine_v90he::o90_getLT() {
int a = pop();
int b = pop();