diff options
| author | James Brown | 2003-01-02 08:39:33 +0000 | 
|---|---|---|
| committer | James Brown | 2003-01-02 08:39:33 +0000 | 
| commit | 3c3c5bb57467d4bcef2c71c923dd9cacc49217f2 (patch) | |
| tree | 4e0db262d1c9d7ae8b3c92af13d47af9f1c135d0 | |
| parent | 50b3e798b6b9138e6bcde1fe8ea305ab66107c3d (diff) | |
| download | scummvm-rg350-3c3c5bb57467d4bcef2c71c923dd9cacc49217f2.tar.gz scummvm-rg350-3c3c5bb57467d4bcef2c71c923dd9cacc49217f2.tar.bz2 scummvm-rg350-3c3c5bb57467d4bcef2c71c923dd9cacc49217f2.zip  | |
implement temporary state saving for CMI
svn-id: r6321
| -rw-r--r-- | scumm/script_v8.cpp | 8 | ||||
| -rw-r--r-- | scumm/scummvm.cpp | 15 | ||||
| -rw-r--r-- | scumm/vars.cpp | 1 | 
3 files changed, 16 insertions, 8 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 4bed7f6016..991c6988c1 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -930,10 +930,14 @@ void Scumm_v8::o8_roomOps()  		setPalette(pop());	// fixme: i think this is right  		break;  	case 0x5D:		// SO_ROOM_SAVE_GAME Save game -		warning("V8 Save game opcode not implemented"); +		_saveLoadCompatible = true; +		_saveLoadSlot = 1; +		_saveLoadFlag = 1;  		break;  	case 0x5E:		// SO_ROOM_LOAD_GAME Load game -		warning("V8 Load game opcode not implemented"); +		_saveLoadCompatible = true; +		_saveLoadSlot = 1; +		_saveLoadFlag = 2;  		break;  	case 0x5F:		// SO_ROOM_SATURATION Set saturation of room colors  		e = pop(); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index e89a520f02..7299b046e0 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -445,6 +445,7 @@ int Scumm::scummLoop(int delta)  		_saveLoadCompatible = false;  	} +	_vars[VAR_GAME_LOADED] = 0;  	if (_saveLoadFlag) {  		bool success;  		const char *errMsg = "Succesfully saved game state to file:\n\n%s"; @@ -454,16 +455,19 @@ int Scumm::scummLoop(int delta)  			success = saveState(_saveLoadSlot, _saveLoadCompatible);  			if (!success)  				errMsg = "Failed to save game state to file:\n\n%s"; -			// Ender: Disabled for small_header games, as -			// can overwrite game variables (eg, Zak256 cashcards) -			if (success && _saveLoadCompatible && !(_features & GF_SMALL_HEADER)) + +			// Ender: Disabled for small_header games, as can overwrite game +			//  variables (eg, Zak256 cashcard values). Temp disabled for V8 +			// because of odd timing issue with scripts and the variable reset + 			if (success && _saveLoadCompatible && !(_features & GF_SMALL_HEADER) && !(_features & GF_AFTER_V8))   				_vars[VAR_GAME_LOADED] = 201;  		} else {  			success = loadState(_saveLoadSlot, _saveLoadCompatible);  			if (!success)  				errMsg = "Failed to load game state from file:\n\n%s"; -			// Ender: Disabled for small_header games, as -			// can overwrite game variables (eg, Zak256 cashcards) + +			// Ender: Disabled for small_header games, as can overwrite game +			//  variables (eg, Zak256 cashcard values).   			if (success && _saveLoadCompatible && !(_features & GF_SMALL_HEADER))  				_vars[VAR_GAME_LOADED] = 203;  		} @@ -1569,7 +1573,6 @@ void Scumm::mainRun()  	int new_time;  	for(;;) { -		  		updatePalette();  		_system->update_screen();		 diff --git a/scumm/vars.cpp b/scumm/vars.cpp index b707f9ecaa..155e4dd2bc 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -239,6 +239,7 @@ void Scumm_v8::setupScummVars()  	VAR_ROOM = 31;  	//VAR_VOICE_MODE = 39; // 0 is voice, 1 is voice+text, 2 is text only +	VAR_GAME_LOADED = 40;  	VAR_CURRENTDISK = 42;  	VAR_SCROLL_SCRIPT = 50;	// FIXME - guess based on where this is in V7  | 
