[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.74,2.75 script.cpp,1.70,1.71 script_v2.cpp,2.39,2.40 scumm.h,1.177,1.178
Max Horn
fingolfin at users.sourceforge.net
Sat May 3 19:29:25 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv29737
Modified Files:
intern.h script.cpp script_v2.cpp scumm.h
Log Message:
yet more v2 fixes & cleanup
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.74
retrieving revision 2.75
diff -u -d -r2.74 -r2.75
--- intern.h 4 May 2003 02:10:49 -0000 2.74
+++ intern.h 4 May 2003 02:27:22 -0000 2.75
@@ -197,6 +197,8 @@
virtual void decodeParseString();
+ void getResultPosIndirect();
+ virtual void getResultPos();
virtual int readVar(uint var);
virtual void ifStateCommon(byte type);
@@ -213,16 +215,16 @@
void o2_clearState02();
void o2_setState01();
void o2_clearState01();
- void o2_assignVarByteDirect();
- void o2_assignVarWordDirect();
+ void o2_assignVarByteIndirect();
+ void o2_assignVarWordIndirect();
void o2_assignVarByte();
void o2_assignVarWord();
void o2_setObjY();
void o2_getObjY();
void o2_setBitVar();
void o2_getBitVar();
- void o2_addDirect();
- void o2_subDirect();
+ void o2_addIndirect();
+ void o2_subIndirect();
void o2_ifState08();
void o2_ifNotState08();
void o2_ifState04();
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- script.cpp 4 May 2003 02:10:49 -0000 1.70
+++ script.cpp 4 May 2003 02:27:22 -0000 1.71
@@ -357,7 +357,7 @@
#ifdef BYPASS_COPY_PROT
static byte copyprotbypassed;
#endif
- debug(9, "readvar=%d", var);
+ debug(9, "readvar(%d)", var);
if (!(var & 0xF000)) {
#if defined(BYPASS_COPY_PROT)
if (var == 490 && _gameId == GID_MONKEY2 && !copyprotbypassed) {
@@ -486,17 +486,8 @@
error("Illegal varbits (w)");
}
-void Scumm::getResultPosDirect() {
- _resultVarNumber = _vars[fetchScriptByte()];
-}
-
void Scumm::getResultPos() {
int a;
-
- if (_features & GF_AFTER_V2) {
- _resultVarNumber = fetchScriptByte();
- return;
- }
_resultVarNumber = fetchScriptWord();
if (_resultVarNumber & 0x2000) {
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.39
retrieving revision 2.40
diff -u -d -r2.39 -r2.40
--- script_v2.cpp 4 May 2003 02:10:49 -0000 2.39
+++ script_v2.cpp 4 May 2003 02:27:22 -0000 2.40
@@ -45,7 +45,7 @@
/* 08 */
OPCODE(o2_isNotEqual),
OPCODE(o5_faceActor),
- OPCODE(o2_assignVarWordDirect),
+ OPCODE(o2_assignVarWordIndirect),
OPCODE(o2_setObjY),
/* 0C */
OPCODE(o2_resourceRoutines),
@@ -85,7 +85,7 @@
/* 28 */
OPCODE(o2_equalZero),
OPCODE(o2_setOwnerOf),
- OPCODE(o2_addDirect),
+ OPCODE(o2_addIndirect),
OPCODE(o2_delayVariable),
/* 2C */
OPCODE(o2_assignVarByte),
@@ -165,7 +165,7 @@
/* 68 */
OPCODE(o5_isScriptRunning),
OPCODE(o2_setOwnerOf),
- OPCODE(o2_subDirect),
+ OPCODE(o2_subIndirect),
OPCODE(o2_dummy),
/* 6C */
OPCODE(o2_getObjY),
@@ -205,7 +205,7 @@
/* 88 */
OPCODE(o2_isNotEqual),
OPCODE(o5_faceActor),
- OPCODE(o2_assignVarWordDirect),
+ OPCODE(o2_assignVarWordIndirect),
OPCODE(o2_setObjY),
/* 8C */
OPCODE(o2_resourceRoutines),
@@ -245,7 +245,7 @@
/* A8 */
OPCODE(o2_notEqualZero),
OPCODE(o2_setOwnerOf),
- OPCODE(o2_addDirect),
+ OPCODE(o2_addIndirect),
OPCODE(o2_dummy),
/* AC */
OPCODE(o2_drawSentence),
@@ -325,7 +325,7 @@
/* E8 */
OPCODE(o5_isScriptRunning),
OPCODE(o2_setOwnerOf),
- OPCODE(o2_subDirect),
+ OPCODE(o2_subIndirect),
OPCODE(o2_dummy),
/* EC */
OPCODE(o2_getObjY),
@@ -394,7 +394,7 @@
}
int Scumm_v2::readVar(uint var) {
- debug(6, "readvar=%d", var);
+ debug(6, "readvar(%d)", var);
if (var >= 14 && var <= 16)
var = _vars[var];
@@ -402,6 +402,14 @@
return _vars[var];
}
+void Scumm_v2::getResultPosIndirect() {
+ _resultVarNumber = _vars[fetchScriptByte()];
+}
+
+void Scumm_v2::getResultPos() {
+ _resultVarNumber = fetchScriptByte();
+}
+
void Scumm_v2::setStateCommon(byte type) {
int obj = getVarOrDirectWord(0x80);
putState(obj, getState(obj) | type);
@@ -450,13 +458,13 @@
clearStateCommon(0x01);
}
-void Scumm_v2::o2_assignVarByteDirect() {
- getResultPosDirect();
+void Scumm_v2::o2_assignVarByteIndirect() {
+ getResultPosIndirect();
setResult(fetchScriptByte());
}
-void Scumm_v2::o2_assignVarWordDirect() {
- getResultPosDirect();
+void Scumm_v2::o2_assignVarWordIndirect() {
+ getResultPosIndirect();
setResult(fetchScriptWord());
}
@@ -570,16 +578,16 @@
ifNotStateCommon(0x01);
}
-void Scumm_v2::o2_addDirect() {
+void Scumm_v2::o2_addIndirect() {
int a;
- getResultPosDirect();
+ getResultPosIndirect();
a = getVarOrDirectWord(0x80);
_vars[_resultVarNumber] += a;
}
-void Scumm_v2::o2_subDirect() {
+void Scumm_v2::o2_subIndirect() {
int a;
- getResultPosDirect();
+ getResultPosIndirect();
a = getVarOrDirectWord(0x80);
_vars[_resultVarNumber] -= a;
}
@@ -902,11 +910,11 @@
Actor *a;
a = derefActorSafe(getVarOrDirectByte(0x80), "o2_putActor");
- if (!a)
- return;
x = getVarOrDirectByte(0x40);
y = getVarOrDirectByte(0x20);
+ if (!a)
+ return;
a->putActor(x, y, a->room);
}
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- scumm.h 3 May 2003 20:49:53 -0000 1.177
+++ scumm.h 4 May 2003 02:27:22 -0000 1.178
@@ -514,8 +514,7 @@
virtual int fetchScriptWordSigned();
void ignoreScriptWord() { fetchScriptWord(); }
void ignoreScriptByte() { fetchScriptByte(); }
- void getResultPos();
- void getResultPosDirect();
+ virtual void getResultPos();
void setResult(int result);
void push(int a);
int pop();
More information about the Scummvm-git-logs
mailing list