diff options
author | Travis Howell | 2004-09-01 03:58:04 +0000 |
---|---|---|
committer | Travis Howell | 2004-09-01 03:58:04 +0000 |
commit | db2f3cd8680f783728adcaa003da4f41d8b6b40a (patch) | |
tree | 24919196a153e78ccb4910efb7d07db81bd8d9fc /scumm | |
parent | ac7d8653bb90f2c9788e3f543407c98d4364312d (diff) | |
download | scummvm-rg350-db2f3cd8680f783728adcaa003da4f41d8b6b40a.tar.gz scummvm-rg350-db2f3cd8680f783728adcaa003da4f41d8b6b40a.tar.bz2 scummvm-rg350-db2f3cd8680f783728adcaa003da4f41d8b6b40a.zip |
Add HE 72 versions, still not working right yet.
svn-id: r14852
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 70 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 24 |
3 files changed, 85 insertions, 11 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 5cb7d9b0c5..8c60c54b6b 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -723,10 +723,12 @@ protected: void o72_getPixel(); void o72_pickVarRandom(); void o72_redimArray(); + void o72_unknownED(); void o72_unknownEF(); void o72_unknownF1(); void o72_readINI(); void o72_unknownF4(); + void o72_unknownF6(); void o72_unknownF8(); void o72_unknownF9(); void o72_unknownFA(); diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index f4dcb54d87..10a4e99061 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -342,7 +342,7 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_readFilePos), /* EC */ OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o72_unknownED), OPCODE(o7_stringLen), OPCODE(o72_unknownEF), /* F0 */ @@ -353,7 +353,7 @@ void ScummEngine_v72he::setupOpcodes() { /* F4 */ OPCODE(o72_unknownF4), OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o72_unknownF6), OPCODE(o6_invalid), /* F8 */ OPCODE(o72_unknownF8), @@ -1213,6 +1213,31 @@ void ScummEngine_v72he::redimArray(int arrayId, int newDim2start, int newDim2end } +void ScummEngine_v72he::o72_unknownED() { + int array, pos, len; + int letter = 0, result = 0; + + len = pop(); + pos = pop(); + array = pop(); + + if (len == -1) { + pos = 0; + len = resStrLen(getStringAddress(array)); + } + + writeVar(0, array); + while (len >= pos) { + letter = readArray(0, 0, pos); + if (letter) + result += getCharsetOffset(letter); + pos++; + } + + push(result); + debug(1,"stub o72_unknownED"); +} + void ScummEngine_v72he::o72_unknownEF() { int value; int array, array2, len, len2, len3, offset; @@ -1305,6 +1330,47 @@ void ScummEngine_v72he::o72_unknownF4() { } } +void ScummEngine_v72he::o72_unknownF6() { + int len, len2, pos, value, array; + value = pop(); + len = pop(); + pos = pop(); + array = pop(); + + if (len >= 0) { + len2 = resStrLen(getStringAddress(array)); + if (len2 < len) + len = len2; + } else { + len = 12; + } + + if (pos < 0) + pos = 0; + + writeVar(0, array); + if (pos > len) { + while (pos > len) { + if (readArray(0, 0, pos) == value) { + push(pos); + return; + } + pos--; + } + } else { + while (pos < len) { + if (readArray(0, 0, pos) == value) { + push(pos); + return; + } + pos++; + } + } + + push(-1); + debug(1,"stub o72_unknownF6"); +} + void ScummEngine_v72he::o72_unknownF8() { int a = fetchScriptByte(); push(1); diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 9dd9d0e5e3..3b0841b1d4 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -415,7 +415,7 @@ int ScummEngine_v7he::getCharsetOffset(int letter) { if (!ptr) error("getCharsetOffset: charset %d not found!", id); - offset = READ_LE_UINT32(ptr + 29 + letter); + offset = READ_LE_UINT32(ptr + 29 + letter + 4); if (offset == 0) return 0; @@ -673,6 +673,7 @@ void ScummEngine_v7he::o7_resourceRoutines() { case 122: case 123: case 203: + case 239: debug(5,"stub queueload (%d) resource %d", op, pop()); break; case 159: @@ -924,7 +925,7 @@ void ScummEngine_v7he::o7_unknownF5() { len = resStrLen(getStringAddress(array)); writeVar(0, array); - while (len <= pos) { + while (len < pos) { letter = readArray(0, 0, pos); result += getCharsetOffset(letter); if (result >= ebx) @@ -933,25 +934,30 @@ void ScummEngine_v7he::o7_unknownF5() { } push(result); - debug(1,"stub o7_unknownF5"); + debug(1,"stub o7_unknownF5 (%d)", result); } void ScummEngine_v7he::o7_unknownF6() { - int len, pos, value, array; + int len, len2, pos, value, array; value = pop(); len = pop(); pos = pop(); array = pop(); - if (len < 0) - len = resStrLen(getStringAddress(array)); + if (len >= 0) { + len2 = resStrLen(getStringAddress(array)); + if (len2 < len) + len = len2; + } else { + len = 12; + } if (pos < 0) pos = 0; writeVar(0, array); - if (len < pos) { - while (len < pos) { + if (pos > len) { + while (pos > len) { if (readArray(0, 0, pos) == value) { push(pos); return; @@ -959,7 +965,7 @@ void ScummEngine_v7he::o7_unknownF6() { pos--; } } else { - while (len >= pos) { + while (pos < len) { if (readArray(0, 0, pos) == value) { push(pos); return; |