diff options
| -rw-r--r-- | simon/simon.cpp | 6 | ||||
| -rw-r--r-- | simon/simon.h | 2 | ||||
| -rw-r--r-- | simon/vga.cpp | 51 | 
3 files changed, 41 insertions, 18 deletions
| diff --git a/simon/simon.cpp b/simon/simon.cpp index abfdf05e47..90c5f30520 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -2671,7 +2671,7 @@ void SimonEngine::o_wait_for_vga(uint a) {  	_exitCutscene = false;  	_skipSpeech = false;  	while (_vgaWaitFor != 0) { -		if (_skipSpeech && getGameType() == GType_SIMON2) { +		if (_skipSpeech && (getGameType() == GType_SIMON2 || getGameType() == GType_FF)) {  			if (_vgaWaitFor == 200 && !vc_get_bit(14)) {  				skip_speech();  				break; @@ -3204,7 +3204,7 @@ void SimonEngine::processSpecialKeys() {  		vc_write_var(86, 2);  		break;  	case 63: // F5 -		if (getGameType() == GType_SIMON2) +		if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)  			_exitCutscene = true;  		break;  	case 'p': @@ -4100,7 +4100,7 @@ void SimonEngine::delay(uint amount) {  #endif  				break;  			case OSystem::EVENT_RBUTTONDOWN: -				if (getGameType() == GType_SIMON2) +				if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)  					_skipSpeech = true;  				else  					_exitCutscene = true; diff --git a/simon/simon.h b/simon/simon.h index ff7e8202ef..5ee7ff9514 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -750,7 +750,7 @@ public:  	void vc76_setScaleXOffs();  	void vc77_setScaleYOffs();  	void vc78_computeXY(); -	void vc79_pathUnk2(); +	void vc79_computePosNum();  	void vc80_setOverlayImage();  	void vc81_setRandom();  	void vc82_pathUnk3(); diff --git a/simon/vga.cpp b/simon/vga.cpp index d0453eba95..c8b57e2253 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -111,7 +111,7 @@ void SimonEngine::setupVgaOpcodes() {  		&SimonEngine::vc76_setScaleXOffs,  		&SimonEngine::vc77_setScaleYOffs,  		&SimonEngine::vc78_computeXY, -		&SimonEngine::vc79_pathUnk2, +		&SimonEngine::vc79_computePosNum,  		&SimonEngine::vc80_setOverlayImage,  		&SimonEngine::vc81_setRandom,  		&SimonEngine::vc82_pathUnk3, @@ -754,6 +754,11 @@ void SimonEngine::vc10_draw() {  		return;  	} +	if (getGameType() == GType_FF && height > 480) { +		debug(0, "Vertical scrolling not supported\n"); +		return; +	} +  	if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {  		if (state.flags & 0x10) {  			state.depack_src = vc10_uncompressFlip(state.depack_src, width, height); @@ -1561,11 +1566,12 @@ void SimonEngine::vc48_setPathFinder() {  	if (getGameType() == GType_FF) {  		VgaSprite *vsp = find_cur_sprite(); -		int x, x2, y, y1, y2, ydiff, count = 0; +		int16 x, x2, y, y1, y2, ydiff; +		uint pos = 0; -		while(vsp->x < readUint16Wrapper(p + 2)) { +		while(vsp->x > readUint16Wrapper(p + 2)) {  			p += 2; -			count++; +			pos++;  		}  		y1 = readUint16Wrapper(p + 1); @@ -1593,7 +1599,7 @@ void SimonEngine::vc48_setPathFinder() {  		//checkScrollY(y, diff);  		_variableArray[11] = readUint16Wrapper(p); -		_variableArray[13] = count; +		_variableArray[13] = pos;  	} else {  		uint b = (uint16)_variableArray[13];  		p += b * 2 + 1; @@ -2056,12 +2062,15 @@ void SimonEngine::vc76_setScaleXOffs() {  	// Scale X related  	vsp->image = vc_read_next_word(); -	int xoffs = vc_read_next_word(); +	int16 xoffs = vc_read_next_word();  	int var = vc_read_next_word(); +	vsp->x += xoffs;  	vsp->flags = 0x40; -	debug(0, "STUB: vc76_setScaleXOffs: image %d xoffs %d flag %d", vsp->image, xoffs, var); +	_variableArray[var] = vsp->x; + +	debug(0, "STUB: vc76_setScaleXOffs: image %d xoffs %d var %d", vsp->image, xoffs, var);  }  void SimonEngine::vc77_setScaleYOffs() { @@ -2069,12 +2078,15 @@ void SimonEngine::vc77_setScaleYOffs() {  	// Scale Y related  	vsp->image = vc_read_next_word(); -	int yoffs = vc_read_next_word(); +	int16 yoffs = vc_read_next_word();  	int var = vc_read_next_word(); +	vsp->y += yoffs;  	vsp->flags = 0x40; -	debug(0, "STUB: vc77_setScaleYOffs: image %d yoffs %d flag %d", vsp->image, yoffs, var); +	_variableArray[var] = vsp->y; + +	debug(0, "STUB: vc77_setScaleYOffs: image %d yoffs %d var %d", vsp->image, yoffs, var);  }  void SimonEngine::vc78_computeXY() { @@ -2082,14 +2094,15 @@ void SimonEngine::vc78_computeXY() {  	uint a = (uint16)_variableArray[12];  	uint b = (uint16)_variableArray[13]; +  	const uint16 *p = _pathFindArray[a - 1];  	p += b * 2; -	uint posx = readUint16Wrapper(p); +	uint16 posx = readUint16Wrapper(p);  	_variableArray[15] = posx;  	vsp->x = posx; -	uint posy = readUint16Wrapper(p + 1); +	uint16 posy = readUint16Wrapper(p + 1);  	_variableArray[16] = posy;  	vsp->y = posy; @@ -2099,9 +2112,18 @@ void SimonEngine::vc78_computeXY() {  	}  } -void SimonEngine::vc79_pathUnk2() { -	// Pathfinder related -	debug(0, "STUB: vc79_pathUnk2"); +void SimonEngine::vc79_computePosNum() { +	uint a = (uint16)_variableArray[12]; +	uint pos = 0; +	const uint16 *p = _pathFindArray[a - 1]; + +	int16 y = vc_read_next_word(); +	while(y > readUint16Wrapper(p + 1)) { +		p += 2; +		pos++; +	} + +	_variableArray[13] = pos;  }  void SimonEngine::vc80_setOverlayImage() { @@ -2125,6 +2147,7 @@ void SimonEngine::vc81_setRandom() {  void SimonEngine::vc82_pathUnk3() {  	// Set var to path position  	int var = vc_read_next_word(); +  	debug(0, "STUB: vc82_pathUnk3: var %d", var);  } | 
