diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 978aa96c1f0..75496bb894a 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -1447,7 +1447,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const tmp = GB(2); else tmp = GB(2) - 1; - if ((uint) tmp < 8) + if ((uint) tmp < 24) akos_queCommand(3, a, a->sound[tmp], 0); continue; case AKC_CmdQue3Quick: diff --git a/scumm/intern.h b/scumm/intern.h index 41d11f1bf5f..bf83eb8ef71 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -696,6 +696,7 @@ protected: void shuffleArray(int num, int minIdx, int maxIdx); int readFileToArray(int slot, int32 size); void writeFileFromArray(int slot, int resID); + void arrrays_unk2(int dst, int src, int len2, int len); void drawWizImage(int restype, int resnum, int state, int x1, int y1, int flags); void flushWizBuffer(); @@ -747,12 +748,14 @@ protected: void o72_getPixel(); void o72_pickVarRandom(); void o72_redimArray(); + void o72_unknownEC(); void o72_unknownED(); void o72_unknownEF(); void o72_unknownF1(); void o72_checkGlobQueue(); void o72_readINI(); void o72_writeINI(); + void o72_unknownF0(); void o72_unknownF4(); void o72_unknownF5(); void o72_unknownF6(); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index db28fbf7add..4962ca3f333 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -340,12 +340,12 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o72_redimArray), OPCODE(o6_readFilePos), /* EC */ - OPCODE(o6_invalid), + OPCODE(o72_unknownEC), OPCODE(o72_unknownED), OPCODE(o7_stringLen), OPCODE(o72_unknownEF), /* F0 */ - OPCODE(o6_invalid), + OPCODE(o72_unknownF0), OPCODE(o72_unknownF1), OPCODE(o72_checkGlobQueue), OPCODE(o72_readINI), @@ -1664,6 +1664,47 @@ void ScummEngine_v72he::redimArray(int arrayId, int newDim2start, int newDim2end ah->dim2end = TO_LE_32(newDim2end); } +void ScummEngine_v72he::arrrays_unk2(int dst, int src, int len2, int len) { + int edi, value; + int i = 0; + + if (len == -1) { + len = resStrLen(getStringAddress(src)); + len2 = 0; + } + + edi = resStrLen(getStringAddress(dst)); + + len -= len2; + len++; + + while (i < len) { + writeVar(0, src); + value = readArray(0, 0, len2 + i); + writeVar(0, dst); + writeArray(0, 0, edi + i, value); + i++; + } + + writeArray(0, 0, edi + i, 0); +} + +void ScummEngine_v72he::o72_unknownEC() { + int dst, size; + int src = pop(); + + size = resStrLen(getStringAddress(src)) + 1; + + writeVar(0, 0); + defineArray(0, kStringArray, 0, 0, 0, size); + writeArray(0, 0, 0, 0); + dst = readVar(0); + + arrrays_unk2(dst, src, -1, -1); + + push(dst); + debug(1,"stub o72_unknownEC"); +} void ScummEngine_v72he::o72_unknownED() { int array, pos, len; @@ -1691,45 +1732,44 @@ void ScummEngine_v72he::o72_unknownED() { } void ScummEngine_v72he::o72_unknownEF() { - int value; - int array, array2, len, len2, len3, offset; - int b, size; - len = pop(); - b = pop(); - array2 = pop(); + int dst, size; + int b = pop(); + int a = pop(); + int src = pop(); - size = len - b + 2; + size = b - a + 2; writeVar(0, 0); defineArray(0, kStringArray, 0, 0, 0, size); writeArray(0, 0, 0, 0); - array = readVar(0); + dst = readVar(0); - len2 = len; - if (len == -1) { - len2 = resStrLen(getStringAddress(array2)); - len = 0; - } else { - len = b; - } - len3 = resStrLen(getStringAddress(array)); + arrrays_unk2(dst, src, a, b); - offset = 0; - len2 -= len; - len2++; - while (offset < len2) { - writeVar(0, array2); - value = readArray(0, 0, offset + len); - writeVar(0, array); - writeArray(0, 0, offset + len3, value); - offset++; - } + push(dst); + debug(1,"stub o72_unknownEF"); +} - writeArray(0, 0, len3 + offset, 0); +void ScummEngine_v72he::o72_unknownF0() { + int dst, size; - push(array); - debug(1,"stub o72_unknownEF (array %d, array2 %d)", array, array2); + int src2 = pop(); + int src1 = pop(); + + size = resStrLen(getStringAddress(src1)) * 2 + 1; + + writeVar(0, 0); + defineArray(0, kStringArray, 0, 0, 0, size); + writeArray(0, 0, 0, 0); + + dst = readVar(0); + + arrrays_unk2(dst, src1, 0, -1); + arrrays_unk2(dst, src2, 0, -1); + + push(dst); + debug(1,"stub o72_unknownF0"); } void ScummEngine_v72he::o72_unknownF1() { diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index f5b95f2a36f..9ceea5e10de 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -340,12 +340,12 @@ void ScummEngine_v80he::setupOpcodes() { OPCODE(o72_redimArray), OPCODE(o6_readFilePos), /* EC */ - OPCODE(o6_invalid), + OPCODE(o72_unknownEC), OPCODE(o72_unknownED), OPCODE(o7_stringLen), OPCODE(o72_unknownEF), /* F0 */ - OPCODE(o6_invalid), + OPCODE(o72_unknownF0), OPCODE(o72_unknownF1), OPCODE(o72_checkGlobQueue), OPCODE(o72_readINI), diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 2dc33df2bfd..6a9c082172e 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -340,12 +340,12 @@ void ScummEngine_v90he::setupOpcodes() { OPCODE(o72_redimArray), OPCODE(o6_readFilePos), /* EC */ - OPCODE(o6_invalid), + OPCODE(o72_unknownEC), OPCODE(o72_unknownED), OPCODE(o7_stringLen), OPCODE(o72_unknownEF), /* F0 */ - OPCODE(o6_invalid), + OPCODE(o72_unknownF0), OPCODE(o72_unknownF1), OPCODE(o72_checkGlobQueue), OPCODE(o72_readINI),