nukeArrays seems fine now.

Fix dog regression

svn-id: r15242
This commit is contained in:
Travis Howell 2004-09-23 09:11:52 +00:00
parent caed46c816
commit d08a1994f2
4 changed files with 19 additions and 9 deletions

View File

@ -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();

View File

@ -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;
}

View File

@ -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() {

View File

@ -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();