diff options
| -rw-r--r-- | engines/scumm/script_v4.cpp | 29 | ||||
| -rw-r--r-- | engines/scumm/script_v5.cpp | 40 | ||||
| -rw-r--r-- | engines/scumm/scumm_v4.h | 2 | ||||
| -rw-r--r-- | engines/scumm/scumm_v5.h | 2 | 
4 files changed, 39 insertions, 34 deletions
| diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 5691f6707c..08df1e4653 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -45,6 +45,35 @@ void ScummEngine_v4::setupOpcodes() {  	OPCODE(0x5c, o4_oldRoomEffect);  	OPCODE(0xdc, o4_oldRoomEffect); + +	OPCODE(0x0f, o4_ifState); +	OPCODE(0x2f, o4_ifNotState); +	OPCODE(0x4f, o4_ifState); +	OPCODE(0x6f, o4_ifNotState); +	OPCODE(0x8f, o4_ifState); +	OPCODE(0xaf, o4_ifNotState); +	OPCODE(0xcf, o4_ifState); +	OPCODE(0xef, o4_ifNotState); +} + +void ScummEngine_v4::o4_ifState() { +	int a = getVarOrDirectWord(PARAM_1); +	int b = getVarOrDirectByte(PARAM_2); + +	if (getState(a) != b) +		o5_jumpRelative(); +	else +		ignoreScriptWord(); +} + +void ScummEngine_v4::o4_ifNotState() { +	int a = getVarOrDirectWord(PARAM_1); +	int b = getVarOrDirectByte(PARAM_2); + +	if (getState(a) == b) +		o5_jumpRelative(); +	else +		ignoreScriptWord();  }  void ScummEngine_v4::o4_pickupObject() { diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 97c79a367a..b8930463d3 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -98,7 +98,7 @@ void ScummEngine_v5::setupOpcodes() {  	OPCODE(0x2c, o5_cursorCommand);  	OPCODE(0x2d, o5_putActorInRoom);  	OPCODE(0x2e, o5_delay); -	OPCODE(0x2f, o5_ifNotState); +//	OPCODE(0x2f, o5_ifNotState);  	/* 30 */  	OPCODE(0x30, o5_matrixOps);  	OPCODE(0x31, o5_getInventoryCount); @@ -138,7 +138,7 @@ void ScummEngine_v5::setupOpcodes() {  	OPCODE(0x4c, o5_soundKludge);  	OPCODE(0x4d, o5_walkActorToActor);  	OPCODE(0x4e, o5_putActorAtObject); -	OPCODE(0x4f, o5_ifState); +//	OPCODE(0x4f, o5_ifState);  	/* 50 */  //	OPCODE(0x50, o5_pickupObjectOld);  	OPCODE(0x51, o5_animateActor); @@ -178,7 +178,7 @@ void ScummEngine_v5::setupOpcodes() {  	OPCODE(0x6c, o5_getActorWidth);  	OPCODE(0x6d, o5_putActorInRoom);  	OPCODE(0x6e, o5_stopObjectScript); -	OPCODE(0x6f, o5_ifNotState); +//	OPCODE(0x6f, o5_ifNotState);  	/* 70 */  	OPCODE(0x70, o5_lights);  	OPCODE(0x71, o5_getActorCostume); @@ -258,7 +258,7 @@ void ScummEngine_v5::setupOpcodes() {  	OPCODE(0xac, o5_expression);  	OPCODE(0xad, o5_putActorInRoom);  	OPCODE(0xae, o5_wait); -	OPCODE(0xaf, o5_ifNotState); +//	OPCODE(0xaf, o5_ifNotState);  	/* B0 */  	OPCODE(0xb0, o5_matrixOps);  	OPCODE(0xb1, o5_getInventoryCount); @@ -298,7 +298,7 @@ void ScummEngine_v5::setupOpcodes() {  	OPCODE(0xcc, o5_pseudoRoom);  	OPCODE(0xcd, o5_walkActorToActor);  	OPCODE(0xce, o5_putActorAtObject); -	OPCODE(0xcf, o5_ifState); +//	OPCODE(0xcf, o5_ifState);  	/* D0 */  //	OPCODE(0xd0, o5_pickupObjectOld);  	OPCODE(0xd1, o5_animateActor); @@ -338,7 +338,7 @@ void ScummEngine_v5::setupOpcodes() {  	OPCODE(0xec, o5_getActorWidth);  	OPCODE(0xed, o5_putActorInRoom);  	OPCODE(0xee, o5_stopObjectScript); -	OPCODE(0xef, o5_ifNotState); +//	OPCODE(0xef, o5_ifNotState);  	/* F0 */  	OPCODE(0xf0, o5_lights);  	OPCODE(0xf1, o5_getActorCostume); @@ -1407,32 +1407,8 @@ void ScummEngine_v5::o5_getObjectOwner() {  }  void ScummEngine_v5::o5_getObjectState() { -	if (_game.features & GF_SMALL_HEADER) { -		o5_ifState(); -	} else { -		getResultPos(); -		setResult(getState(getVarOrDirectWord(PARAM_1))); -	} -} - -void ScummEngine_v5::o5_ifState() { -	int a = getVarOrDirectWord(PARAM_1); -	int b = getVarOrDirectByte(PARAM_2); - -	if (getState(a) != b) -		o5_jumpRelative(); -	else -		ignoreScriptWord(); -} - -void ScummEngine_v5::o5_ifNotState() { -	int a = getVarOrDirectWord(PARAM_1); -	int b = getVarOrDirectByte(PARAM_2); - -	if (getState(a) == b) -		o5_jumpRelative(); -	else -		ignoreScriptWord(); +	getResultPos(); +	setResult(getState(getVarOrDirectWord(PARAM_1)));  }  void ScummEngine_v5::o5_getRandomNr() { diff --git a/engines/scumm/scumm_v4.h b/engines/scumm/scumm_v4.h index 6942b73682..6e0326ed17 100644 --- a/engines/scumm/scumm_v4.h +++ b/engines/scumm/scumm_v4.h @@ -52,6 +52,8 @@ protected:  	virtual void resetRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL);  	/* Version 4 script opcodes */ +	void o4_ifState(); +	void o4_ifNotState();  	void o4_oldRoomEffect();  	void o4_pickupObject();  }; diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h index c84b6ca74a..4ff51868ff 100644 --- a/engines/scumm/scumm_v5.h +++ b/engines/scumm/scumm_v5.h @@ -136,8 +136,6 @@ protected:  	void o5_getStringWidth();  	void o5_getVerbEntrypoint();  	void o5_ifClassOfIs(); -	void o5_ifNotState(); -	void o5_ifState();  	void o5_increment();  	void o5_isActorInBox();  	void o5_isEqual(); | 
