diff options
| -rw-r--r-- | simon/debug.cpp | 2 | ||||
| -rw-r--r-- | simon/debug.h | 48 | ||||
| -rw-r--r-- | simon/intern.h | 6 | ||||
| -rw-r--r-- | simon/items.cpp | 30 | ||||
| -rw-r--r-- | simon/simon.cpp | 42 | ||||
| -rw-r--r-- | simon/simon.h | 7 | 
6 files changed, 73 insertions, 62 deletions
| diff --git a/simon/debug.cpp b/simon/debug.cpp index b1e26cedb0..0060ba4db0 100644 --- a/simon/debug.cpp +++ b/simon/debug.cpp @@ -141,7 +141,7 @@ void SimonEngine::dumpSubroutineLine(SubroutineLine *sl, Subroutine *sub) {  	p = (byte *)sl + SUBROUTINE_LINE_SMALL_SIZE;  	if (sub->id == 0) { -		fprintf(_dumpFile, "; cond_a=%d, cond_b=%d, cond_c=%d\n", sl->cond_a, sl->cond_b, sl->cond_c); +		fprintf(_dumpFile, "; verb=%d, noun1=%d, noun2=%d\n", sl->verb, sl->noun1, sl->noun2);  		p = (byte *)sl + SUBROUTINE_LINE_BIG_SIZE;  	} diff --git a/simon/debug.h b/simon/debug.h index d61c2e32a2..086bfd96c6 100644 --- a/simon/debug.h +++ b/simon/debug.h @@ -186,7 +186,7 @@ static const char *const simon1dos_opcode_name_table[256] = {  	/* 128 */  	"W|GET_DUMMY_WORD",  	"W|GET_WORD_COND_TRUE", -	"Bww|UNK_130", +	"Bww|SET_ADJ_NOUN",  	NULL,  	/* 132 */  	"|SAVE_GAME", @@ -249,8 +249,8 @@ static const char *const simon1dos_opcode_name_table[256] = {  	"WWBB|PATHFIND",  	"BBB|ROOM_DESCRIPTION",  	/* 180 */ -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	"|LOAD_BEARD",  	"|UNLOAD_BEARD",  	/* 184 */ @@ -424,7 +424,7 @@ static const char *const simon1talkie_opcode_name_table[256] = {  	/* 128 */  	"W|GET_DUMMY_WORD",  	"W|GET_WORD_COND_TRUE", -	"Bww|UNK_130", +	"Bww|SET_ADJ_NOUN",  	NULL,  	/* 132 */  	"|SAVE_GAME", @@ -487,8 +487,8 @@ static const char *const simon1talkie_opcode_name_table[256] = {  	"WWBB|PATHFIND",  	"BBB|ROOM_DESCRIPTION",  	/* 180 */ -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	"|LOAD_BEARD",  	"|UNLOAD_BEARD",  	/* 184 */ @@ -662,7 +662,7 @@ static const char *const simon2dos_opcode_name_table[256] = {  	/* 128 */  	"W|GET_DUMMY_WORD",  	"W|GET_WORD_COND_TRUE", -	"Bww|UNK_130", +	"Bww|SET_ADJ_NOUN",  	NULL,  	/* 132 */  	"|SAVE_GAME", @@ -725,8 +725,8 @@ static const char *const simon2dos_opcode_name_table[256] = {  	"WWBB|PATHFIND",  	"BBB|ROOM_DESCRIPTION",  	/* 180 */ -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	NULL,  	NULL,  	/* 184 */ @@ -904,7 +904,7 @@ static const char *const simon2talkie_opcode_name_table[256] = {  	/* 128 */  	"W|GET_DUMMY_WORD",  	"W|GET_WORD_COND_TRUE", -	"Bww|UNK_130", +	"Bww|SET_ADJ_NOUN",  	NULL,  	/* 132 */  	"|SAVE_GAME", @@ -967,8 +967,8 @@ static const char *const simon2talkie_opcode_name_table[256] = {  	"WWBB|PATHFIND",  	"BBB|ROOM_DESCRIPTION",  	/* 180 */ -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	NULL,  	NULL,  	/* 184 */ @@ -1146,7 +1146,7 @@ static const char *const feeblefiles_opcode_name_table[256] = {  	/* 128 */  	"W|GET_DUMMY_WORD",  	"W|GET_WORD_COND_TRUE", -	"Bww|UNK_130", +	"Bww|SET_ADJ_NOUN",  	NULL,  	/* 132 */  	"|SAVE_GAME", @@ -1209,8 +1209,8 @@ static const char *const feeblefiles_opcode_name_table[256] = {  	"WWBB|PATHFIND",  	"BBB|ROOM_DESCRIPTION",  	/* 180 */ -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	"T|LOAD_VIDEO",  	"|PLAY_VIDEO",  	/* 184 */ @@ -1278,8 +1278,8 @@ const char *const simon1_video_opcode_name_table[] = {  	"d|SET_PALETTE_MODE",  	/* 32 */  	"vv|COPY_VAR", -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	"dd|VC35",  	/* 36 */  	"dd|SAVELOAD_THING", @@ -1361,8 +1361,8 @@ const char *const simon2_video_opcode_name_table[] = {  	"d|SET_PALETTE_MODE",  	/* 32 */  	"vv|COPY_VAR", -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	"dd|VC35",  	/* 36 */  	"dd|SAVELOAD_THING", @@ -1458,8 +1458,8 @@ const char *const feeblefiles_video_opcode_name_table[] = {  	"d|SET_PALETTE_MODE",  	/* 32 */  	"vv|COPY_VAR", -	"|FORCE_UNLOCK", -	"|FORCE_LOCK", +	"|MOUSE_ON", +	"|MOUSE_OFF",  	"dd|VC35",  	/* 36 */  	"dd|SAVELOAD_THING", @@ -1514,12 +1514,12 @@ const char *const feeblefiles_video_opcode_name_table[] = {  	/* 76 */  	"ddd|SETSCALEXOFFS",  	"ddd|SETSCALEYOFFS", -	"|PATHUNK1", -	"|PATHUNK1", +	"|COMPUTEXY", +	"|COMPUTEPOSNUM",  	/* 80 */  	"ddd|SETOVERLAYIMAGE",  	"dd|SETRANDOM", -	"d|PATHUNK3", +	"d|GETPATHVALUE",  	"ddd|PLAYSOUNDLOOP",  	"|STOPSOUNDLOOP",  }; diff --git a/simon/intern.h b/simon/intern.h index f00f15e5db..cbfbf3c2a4 100644 --- a/simon/intern.h +++ b/simon/intern.h @@ -106,9 +106,9 @@ enum {  struct SubroutineLine {  	uint16 next; -	int16 cond_a; -	int16 cond_b; -	int16 cond_c; +	int16 verb; +	int16 noun1; +	int16 noun2;  };  struct TimeEvent { diff --git a/simon/items.cpp b/simon/items.cpp index b9081ec04d..fb793c482c 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -722,13 +722,15 @@ int SimonEngine::runScript() {  			}  			break; -		case 130:{									/* set script cond */ +		case 130:{									/* set adj noun */  				uint var = getVarOrByte(); -				getNextWord(); -				if (var == 1) -					_scriptCondB = getNextWord(); -				else -					_scriptCondC = getNextWord(); +				if (var == 1) { +					_scriptAdj1 = getNextWord(); +					_scriptNoun1 = getNextWord(); +				} else { +					_scriptAdj2 = getNextWord(); +					_scriptNoun2 = getNextWord(); +				}  			}  			break; @@ -997,12 +999,12 @@ int SimonEngine::runScript() {  			break;  		case 180:{									/* force unlock */ -				o_force_unlock(); +				o_mouseOn();  			}  			break;  		case 181:{									/* force lock */ -				o_force_lock(); +				o_mouseOff();  				if (getGameType() == GType_SIMON2) {  					changeWindow(1);  					showMessageFormat("\xC"); @@ -1232,16 +1234,16 @@ bool SimonEngine::checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub  	if (sub->id)  		return true; -	if (sl->cond_a != -1 && sl->cond_a != _scriptCondA && -			(sl->cond_a != -2 || _scriptCondA != -1)) +	if (sl->verb != -1 && sl->verb != _scriptVerb && +			(sl->verb != -2 || _scriptVerb != -1))  		return false; -	if (sl->cond_b != -1 && sl->cond_b != _scriptCondB && -			(sl->cond_b != -2 || _scriptCondB != -1)) +	if (sl->noun1 != -1 && sl->noun1 != _scriptNoun1 && +			(sl->noun1 != -2 || _scriptNoun1 != -1))  		return false; -	if (sl->cond_c != -1 && sl->cond_c != _scriptCondC && -			(sl->cond_c != -2 || _scriptCondC != -1)) +	if (sl->noun2 != -1 && sl->noun2 != _scriptNoun2 && +			(sl->noun2 != -2 || _scriptNoun2 != -1))  		return false;  	return true; diff --git a/simon/simon.cpp b/simon/simon.cpp index 485a83e48b..319fc4b912 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -352,9 +352,11 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)  	_scrollImage = 0;  	_vgaVar8 = 0; -	_scriptCondA = 0; -	_scriptCondB = 0; -	_scriptCondC = 0; +	_scriptVerb = 0; +	_scriptNoun1 = 0; +	_scriptNoun2 = 0; +	_scriptAdj1 = 0; +	_scriptAdj2 = 0;  	_curWindow = 0;  	_textWindow = 0; @@ -880,9 +882,9 @@ void SimonEngine::readSubroutineLine(File *in, SubroutineLine *sl, Subroutine *s  	int size;  	if (sub->id == 0) { -		sl->cond_a = in->readUint16BE(); -		sl->cond_b = in->readUint16BE(); -		sl->cond_c = in->readUint16BE(); +		sl->verb = in->readUint16BE(); +		sl->noun1 = in->readUint16BE(); +		sl->noun2 = in->readUint16BE();  	}  	while ((*q = in->readByte()) != 0xFF) { @@ -1557,7 +1559,7 @@ bool SimonEngine::kickoffTimeEvents() {  void SimonEngine::invokeTimeEvent(TimeEvent *te) {  	Subroutine *sub; -	_scriptCondA = 0; +	_scriptVerb = 0;  	if (_runScriptReturn1)  		return;  	sub = getSubroutineByID(te->subroutine_id); @@ -1579,9 +1581,11 @@ void SimonEngine::o_setup_cond_c() {  		_objectItem = derefItem(getItem1Ptr()->parent);  	if (_objectItem != NULL) { -		_scriptCondC = _objectItem->noun; +		_scriptNoun2 = _objectItem->noun; +		_scriptAdj2 = _objectItem->adjective;  	} else { -		_scriptCondC = -1; +		_scriptNoun2 = -1; +		_scriptAdj2 = -1;  	}  } @@ -2194,18 +2198,22 @@ void SimonEngine::handle_verb_clicked(uint verb) {  	}  	if (_subjectItem) { -		_scriptCondB = _subjectItem->noun; +		_scriptNoun1 = _subjectItem->noun; +		_scriptAdj1 = _subjectItem->adjective;  	} else { -		_scriptCondB = -1; +		_scriptNoun1 = -1; +		_scriptAdj1 = -1;  	}  	if (_objectItem) { -		_scriptCondC = _objectItem->noun; +		_scriptNoun2 = _objectItem->noun; +		_scriptAdj2 = _objectItem->adjective;  	} else { -		_scriptCondC = -1; +		_scriptNoun2 = -1; +		_scriptAdj2 = -1;  	} -	_scriptCondA = _verbHitArea; +	_scriptVerb = _verbHitArea;  	sub = getSubroutineByID(0);  	if (sub == NULL) @@ -2221,7 +2229,7 @@ void SimonEngine::handle_verb_clicked(uint verb) {  	if (sub)  		startSubroutine(sub); -	if (getGameType() == GType_SIMON2) +	if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)  		_runScriptReturn1 = false;  	startUp_helper_2(); @@ -2661,13 +2669,13 @@ void SimonEngine::add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite,  	_lockWord &= ~1;  } -void SimonEngine::o_force_unlock() { +void SimonEngine::o_mouseOn() {  	if (getGameType() == GType_SIMON2 && _bitArray[4] & 0x8000)  		_mouseCursor = 0;  	_lockCounter = 0;  } -void SimonEngine::o_force_lock() { +void SimonEngine::o_mouseOff() {  	_lockWord |= 0x8000;  	vc34_setMouseOff();  	_lockWord &= ~0x8000; diff --git a/simon/simon.h b/simon/simon.h index 2d62691bc1..0456051f4e 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -264,7 +264,8 @@ protected:  	const byte *_scrollImage;  	byte _vgaVar8; -	int16 _scriptCondA, _scriptCondB, _scriptCondC; +	int16 _scriptVerb, _scriptNoun1, _scriptNoun2; +	int16 _scriptAdj1, _scriptAdj2;  	uint16 _curWindow;  	FillOrCopyStruct *_textWindow; @@ -566,8 +567,8 @@ protected:  	void o_lockZone();  	void o_unlockZone();  	void o_pathfind(int x, int y, uint var_1, uint var_2); -	void o_force_unlock(); -	void o_force_lock(); +	void o_mouseOn(); +	void o_mouseOff();  	void o_loadBeard();  	void o_unloadBeard();  	void o_clear_vgapointer_entry(uint a); | 
