Add HE70+ version of seekFilePos opcode.

svn-id: r17450
This commit is contained in:
Travis Howell
2005-04-08 11:10:01 +00:00
parent 328c588eab
commit 2a5aaf9fc2
7 changed files with 32 additions and 12 deletions
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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),
+2 -6
View File
@@ -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);
}
}
+1 -1
View File
@@ -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 */
+25 -1
View File
@@ -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();
+1 -1
View File
@@ -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 */
+1 -1
View File
@@ -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 */