diff options
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 8 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v7he.cpp | 26 | ||||
-rw-r--r-- | scumm/script_v80he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 2 |
7 files changed, 32 insertions, 12 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 4e05fc2ed1..d3f6e8d85b 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -636,7 +636,6 @@ protected: void writeFileFromArray(int slot, int resID); int virtScreenSave(byte *dst, int x1, int y1, int x2, int y2); void virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2); - void seekFilePos(int slot, int offset, int mode); virtual void decodeParseString(int a, int b); void swapObjects(int object1, int object2); @@ -706,6 +705,7 @@ protected: void o70_resourceRoutines(); void o70_quitPauseRestart(); void o70_kernelSetFunctions(); + void o70_seekFilePos(); void o70_copyString(); void o70_getStringWidth(); void o70_getStringLen(); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 609b1558f5..8156cc02f1 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -178,7 +178,7 @@ void ScummEngine_v100he::setupOpcodes() { /* 6C */ OPCODE(o72_talkEgo), OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), + OPCODE(o70_seekFilePos), OPCODE(o6_setBoxFlags), /* 70 */ OPCODE(o6_invalid), diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index f6b907ca81..c3c24e826e 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -1197,11 +1197,7 @@ void ScummEngine_v60he::o60_seekFilePos() { offset = pop(); slot = pop(); - seekFilePos(slot, offset, mode - 1); -} - -void ScummEngine_v60he::seekFilePos(int slot, int offset, int mode) { - if (slot == 1) + if (slot == -1) return; switch (mode) { @@ -1215,7 +1211,7 @@ void ScummEngine_v60he::seekFilePos(int slot, int offset, int mode) { _hFileTable[slot].seek(offset, SEEK_END); break; default: - error("seekFilePos: default case 0x%x", mode); + error("o60_seekFilePos: default case %d", mode); } } diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 1562878eb2..091cb66208 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -334,7 +334,7 @@ void ScummEngine_v72he::setupOpcodes() { OPCODE(o6_invalid), /* E8 */ OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), + OPCODE(o70_seekFilePos), OPCODE(o72_redimArray), OPCODE(o60_readFilePos), /* EC */ diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 12ef2b9452..f3127a5314 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -333,7 +333,7 @@ void ScummEngine_v70he::setupOpcodes() { OPCODE(o6_invalid), /* E8 */ OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), + OPCODE(o70_seekFilePos), OPCODE(o60_redimArray), OPCODE(o60_readFilePos), /* EC */ @@ -679,6 +679,30 @@ void ScummEngine_v70he::o70_quitPauseRestart() { } } +void ScummEngine_v70he::o70_seekFilePos() { + int mode, offset, slot; + mode = pop(); + offset = pop(); + slot = pop(); + + if (slot == -1) + return; + + switch (mode) { + case 1: + _hFileTable[slot].seek(offset, SEEK_SET); + break; + case 2: + _hFileTable[slot].seek(offset, SEEK_CUR); + break; + case 3: + _hFileTable[slot].seek(offset, SEEK_END); + break; + default: + error("o70_seekFilePos: default case 0x%x", mode); + } +} + void ScummEngine_v70he::o70_copyString() { int dst, size; int src = pop(); diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index 4c1e59a11e..a0858ee103 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -332,7 +332,7 @@ void ScummEngine_v80he::setupOpcodes() { OPCODE(o6_invalid), /* E8 */ OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), + OPCODE(o70_seekFilePos), OPCODE(o72_redimArray), OPCODE(o60_readFilePos), /* EC */ diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 6a050e6d4d..979458731e 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -332,7 +332,7 @@ void ScummEngine_v90he::setupOpcodes() { OPCODE(o6_invalid), /* E8 */ OPCODE(o6_invalid), - OPCODE(o60_seekFilePos), + OPCODE(o70_seekFilePos), OPCODE(o72_redimArray), OPCODE(o60_readFilePos), /* EC */ |