[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.166,1.167

Travis Howell kirben at users.sourceforge.net
Mon Sep 1 02:09:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv5084/scumm

Modified Files:
	script_v5.cpp 
Log Message:

Add v1 maniac load/save screen support
Detect save files


Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- script_v5.cpp	1 Sep 2003 07:50:47 -0000	1.166
+++ script_v5.cpp	1 Sep 2003 09:08:48 -0000	1.167
@@ -1089,7 +1089,19 @@
 	byte slot = (a & 0x1F) + 1;
 	byte result = 0;
 		
-	switch(a & 0xE0) {
+	if ((_gameId == GID_MANIAC) && (_version == 1)) {
+		// Convert older load/save screen
+		// 1 Load
+		// 2 Save
+		slot = 1;
+		if (a == 1)
+			_opcode = 0x40;
+		else if (a == 2)
+			_opcode = 0x80;
+	} else
+		_opcode = a & 0xE0;
+
+	switch (_opcode) {
 		case 0x00: // num slots available
 			result = 100;
 			break;
@@ -1110,10 +1122,11 @@
 			break;
 		case 0xC0: // test if save exists
 			bool avail_saves[100];
+			char filename[256];
 			SaveFileManager *mgr = _system->get_savefile_manager();
 			listSavegames(avail_saves, ARRAYSIZE(avail_saves), mgr);
-			delete mgr;
-			if (avail_saves[slot])
+			makeSavegameName(filename, slot, false);
+			if (avail_saves[slot] && (mgr->open_savefile(filename, getSavePath(), false)))
 				result = 6; // save file exists
 			else
 				result = 7; // save file does not exist





More information about the Scummvm-git-logs mailing list