diff options
Diffstat (limited to 'scumm')
| -rw-r--r-- | scumm/intern.h | 1 | ||||
| -rw-r--r-- | scumm/script_v6.cpp | 35 | 
2 files changed, 35 insertions, 1 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 8af677560c..4f9d704c87 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -377,6 +377,7 @@ protected:  	void o6_pickVarRandom();  	void o6_getDateTime();  	void o6_unknownE0(); +	void o6_unknownE1();  	void o6_unknownE4();  	void o6_localizeArray();  	void o6_shuffle(); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 23440e47c9..009415172c 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -323,7 +323,7 @@ void Scumm_v6::setupOpcodes() {  		OPCODE(o6_invalid),  		/* E0 */  		OPCODE(o6_unknownE0), -		OPCODE(o6_invalid), +		OPCODE(o6_unknownE1),  		OPCODE(o6_localizeArray),  		OPCODE(o6_pickVarRandom),  		/* E4 */ @@ -2922,6 +2922,39 @@ void Scumm_v6::o6_getDateTime() {  		_vars[VAR_TIMEDATE_SECOND] = t->tm_sec;  } +void Scumm_v6::o6_unknownE1() { +	// this opcode check ground area in minigame in the dig +	int x = pop(); +	int y = pop(); + +	if (x > _realWidth - 1) { +		push(-1); +		return; +	} +	if (x < 0) { +		push(-1); +		return; +	} + +	if (y < 0) { +		push(-1); +		return; +	} +	 +	VirtScreen *vs = findVirtScreen(y); + +	if (vs == NULL) { +		push(-1); +		return; +	} + +	// FIXME: something is wrong, it take wrong position or wrong buffer check +	int offset = (y - vs->topline) * _realWidth + x + vs->tdirty[0]; + +	byte area = *(getResourceAddress(rtBuffer, vs->number + 1) + offset); +	push(area); +} +  void Scumm_v6::o6_unknownE0() {  	int a = fetchScriptByte();  	warning("o6_unknownEO(%d) stub", a);  | 
