diff options
| author | Eugene Sandulenko | 2005-03-25 22:11:08 +0000 | 
|---|---|---|
| committer | Eugene Sandulenko | 2005-03-25 22:11:08 +0000 | 
| commit | a9c2e6ecbfdc6be61c86e6ac9cb05e232f7e7d43 (patch) | |
| tree | d1108444226cfa73fe489f4878446a9a2dce1e0a | |
| parent | 9a4bc8ce16dd8e5c4a15269cdda23398f9f59684 (diff) | |
| download | scummvm-rg350-a9c2e6ecbfdc6be61c86e6ac9cb05e232f7e7d43.tar.gz scummvm-rg350-a9c2e6ecbfdc6be61c86e6ac9cb05e232f7e7d43.tar.bz2 scummvm-rg350-a9c2e6ecbfdc6be61c86e6ac9cb05e232f7e7d43.zip | |
MM NES fixes:
  o Fixed crash when in-game GUI was displayed
  o Support for save/load
  o Savegame version bumped
svn-id: r17232
| -rw-r--r-- | gui/newgui.cpp | 3 | ||||
| -rw-r--r-- | scumm/gfx.cpp | 2 | ||||
| -rw-r--r-- | scumm/saveload.cpp | 14 | ||||
| -rw-r--r-- | scumm/saveload.h | 2 | 
4 files changed, 17 insertions, 4 deletions
| diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 9b9ff8f3bd..3bbbfc7ee1 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -83,7 +83,8 @@ void NewGui::updateScaleFactor() {  			kDefaultGUIHeight = 200  		}; -		_scaleFactor = MIN(_system->getOverlayWidth() / kDefaultGUIWidth, _system->getOverlayHeight() / kDefaultGUIHeight); +		// NES has 256 pixels width which makes MIN() return 0 here. +		_scaleFactor = MAX(MIN(_system->getOverlayWidth() / kDefaultGUIWidth, _system->getOverlayHeight() / kDefaultGUIHeight), 1);  	}  	// Pick the font depending on the scale factor. diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index af00a6b47c..5ce9a8008d 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -272,7 +272,7 @@ void ScummEngine::initScreens(int b, int h) {  		}  	} -	if (_features & GF_NES) { +	if ((_features & GF_NES) && (h != _screenHeight)) {  		adj = 16;  		initVirtScreen(kUnkVirtScreen, 0, 0, _screenWidth, adj, false, false);  	} diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index de39f67cb6..e998ecdd33 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -248,7 +248,10 @@ bool ScummEngine::loadState(int slot, bool compat) {  	// ever add options for using different 16-colour palettes.  	if (_version == 1) {  		if (_gameId == GID_MANIAC) -			setupV1ManiacPalette(); +			if (_features & GF_NES) +				setupNESPalette(); +			else +				setupV1ManiacPalette();  		else  			setupV1ZakPalette();  	} else if (_features & GF_16COLOR) { @@ -296,6 +299,7 @@ bool ScummEngine::loadState(int slot, bool compat) {  	// Restore the virtual screens and force a fade to black.  	initScreens(kMainVirtScreen, _screenHeight); +  	VirtScreen *vs = &virtscr[kMainVirtScreen];  	memset(vs->getPixels(0, 0), 0, vs->pitch * vs->h);  	vs->setDirtyRange(0, vs->h); @@ -594,6 +598,8 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {  		MKLINE(ScummEngine, _screenB, sleUint16, VER(8)),  		MKLINE(ScummEngine, _screenH, sleUint16, VER(8)), +		MKLINE(ScummEngine, _NESCostumeSet, sleUint16, VER(47)), +  		MK_OBSOLETE(ScummEngine, _cd_track, sleInt16, VER(9), VER(9)),  		MK_OBSOLETE(ScummEngine, _cd_loops, sleInt16, VER(9), VER(9)),  		MK_OBSOLETE(ScummEngine, _cd_frame, sleInt16, VER(9), VER(9)), @@ -746,6 +752,12 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {  		}  	} +	if (_features & GF_NES) +		if (savegameVersion < VER(47)) +			NES_loadCostumeSet(_NESCostumeSet = 0); +		else +			NES_loadCostumeSet(_NESCostumeSet); +  	if (_heversion >= 71) {  		Wiz *wiz = &((ScummEngine_v70he *)this)->_wiz;  		s->saveLoadArrayOf(wiz->_polygons, ARRAYSIZE(wiz->_polygons), sizeof(wiz->_polygons[0]), polygonEntries); diff --git a/scumm/saveload.h b/scumm/saveload.h index 0844dac53f..3a3e9ea34d 100644 --- a/scumm/saveload.h +++ b/scumm/saveload.h @@ -32,7 +32,7 @@ namespace Scumm {  // Can be useful for other ports too :)  #define VER(x) x -#define CURRENT_VER 46 +#define CURRENT_VER 47  // To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,  // we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC | 
