From 086724d774399aa0b101d2503929e3fca54813d5 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 13 Oct 2004 10:55:50 +0000 Subject: Remove more duplicates. svn-id: r15544 --- scumm/script_v7he.cpp | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'scumm/script_v7he.cpp') diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 8c45d57d7c..791cfefc52 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -347,7 +347,7 @@ void ScummEngine_v70he::setupOpcodes() { OPCODE(o70_unknownEF), /* F0 */ OPCODE(o6_invalid), - OPCODE(o6_invalid), + OPCODE(o70_unknownF1), OPCODE(o6_invalid), OPCODE(o70_readINI), /* F4 */ @@ -761,6 +761,48 @@ void ScummEngine_v70he::o70_unknownEF() { debug(1,"stub o70_unknownEF"); } +void ScummEngine_v70he::o70_unknownF1() { + byte *addr, *addr2; + int i = 0; + + int id = pop(); + int id2 = pop(); + + addr = getStringAddress(id); + if (!addr) + error("o72_stringLen: Reference to zeroed array pointer (%d)", id); + + addr2 = getStringAddress(id2); + if (!addr) + error("o72_stringLen: Reference to zeroed array pointer (%d)", id); + + while(1) { + if (*addr != *addr2) + break; + if (*addr == 0) { + push(0); + return; + } + + addr++; + addr2++; + + if (*addr != *addr2) + break; + if (*addr == 0) { + push(0); + return; + } + + addr++; + addr2++; + i += 2; + } + + push (i); + debug(1,"o70_unknownF1 stub (%d, %d, %d)", id, id2, i); +} + void ScummEngine_v70he::o70_readINI() { int len; int type; -- cgit v1.2.3