[Scummvm-cvs-logs] SF.net SVN: scummvm: [23726] scummvm/trunk/backends/platform/ds/arm9/source

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Sat Aug 19 13:11:25 CEST 2006


Revision: 23726
Author:   agent-q
Date:     2006-08-19 04:11:18 -0700 (Sat, 19 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23726&view=rev

Log Message:
-----------
Fixed bug causing crash during saving in Saga engine, changed audio to low quality.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h
    scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/ramsave.cpp
Modified: scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp	2006-08-19 11:10:19 UTC (rev 23725)
+++ scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.cpp	2006-08-19 11:11:18 UTC (rev 23726)
@@ -27,7 +27,7 @@
 
 GBAMPSaveFile::GBAMPSaveFile(char* name, bool saveOrLoad) {
 	handle = DS::std_fopen(name, saveOrLoad? "w": "r");
-	//consolePrintf("%s handle is %d\n", name, handle);
+//	consolePrintf("%s handle is %d\n", name, handle);
 //	consolePrintf("Created %s\n", name);
 	bufferPos = 0;
 	saveSize = 0;
@@ -36,7 +36,7 @@
 
 GBAMPSaveFile::~GBAMPSaveFile() {
 	flushSaveBuffer();
-	DS::std_fclose(handle);
+	if (handle) DS::std_fclose(handle);
 }
 
 uint32 GBAMPSaveFile::read(void *buf, uint32 size) {
@@ -143,11 +143,22 @@
 	}
 	
 //	consolePrintf(fileSpec);
-
-	return new GBAMPSaveFile(fileSpec, saveOrLoad);
+	GBAMPSaveFile* sf = new GBAMPSaveFile(fileSpec, saveOrLoad);
+	if (sf->isOpen()) {
+		return sf;	
+	} else {
+		delete sf;
+		return NULL;	
+	}
 }
 
 void GBAMPSaveFileManager::listSavefiles(char const* prefix, bool* marks, int num) {
+	memset(marks, true, num * sizeof(bool));
+	return;
+	
+	// Seems like I misunderstood what this function was supposed to do.
+	// I thought I was meant to set the marks[] array according to which
+	// saves are present on disk.
 	enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 };
 	char name[128];
 	char path[128];

Modified: scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h	2006-08-19 11:10:19 UTC (rev 23725)
+++ scummvm/trunk/backends/platform/ds/arm9/source/gbampsave.h	2006-08-19 11:11:18 UTC (rev 23726)
@@ -50,7 +50,7 @@
 	void flushSaveBuffer();
 	
 	virtual bool isOpen() const {
-		return true;
+		return handle != 0;
 	}
 };
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp	2006-08-19 11:10:19 UTC (rev 23725)
+++ scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp	2006-08-19 11:11:18 UTC (rev 23726)
@@ -51,7 +51,7 @@
 
 void OSystem_DS::initBackend() {
 	ConfMan.setInt("autosave_period", 0);
-	ConfMan.setBool("FM_medium_quality", true);
+	ConfMan.setBool("FM_low_quality", true);
 }
 
 bool OSystem_DS::hasFeature(Feature f) {

Modified: scummvm/trunk/backends/platform/ds/arm9/source/ramsave.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/ramsave.cpp	2006-08-19 11:10:19 UTC (rev 23725)
+++ scummvm/trunk/backends/platform/ds/arm9/source/ramsave.cpp	2006-08-19 11:11:18 UTC (rev 23726)
@@ -382,6 +382,9 @@
 }
 
 void DSSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num) {
+	memset(marks, true, num * sizeof(bool));
+	return;
+
 	memset(marks, false, num*sizeof(bool));
 
 	for (int saveNum = 0; saveNum < num; saveNum++) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list