[Scummvm-git-logs] scummvm master -> 7a8ddcbe38a828c6c674bd6147bcddfc6734c97b

sev- sev at scummvm.org
Fri Sep 6 14:48:19 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7a8ddcbe38 PSP: Replace PSPSaveFileManager with DefaultSaveFileManager


Commit: 7a8ddcbe38a828c6c674bd6147bcddfc6734c97b
    https://github.com/scummvm/scummvm/commit/7a8ddcbe38a828c6c674bd6147bcddfc6734c97b
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-09-06T14:48:16+02:00

Commit Message:
PSP: Replace PSPSaveFileManager with DefaultSaveFileManager

Changed paths:
  R backends/saves/psp/psp-saves.cpp
  R backends/saves/psp/psp-saves.h
    backends/module.mk
    backends/platform/psp/osys_psp.cpp


diff --git a/backends/module.mk b/backends/module.mk
index 491be80..771b3f8 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -312,7 +312,6 @@ MODULE_OBJS += \
 	fs/psp/psp-fs-factory.o \
 	fs/psp/psp-stream.o \
 	plugins/psp/psp-provider.o \
-	saves/psp/psp-saves.o \
 	timer/psp/timer.o
 endif
 
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 5d9e3ab..91f223b 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -38,7 +38,7 @@
 #include "backends/platform/psp/powerman.h"
 #include "backends/platform/psp/rtc.h"
 
-#include "backends/saves/psp/psp-saves.h"
+#include "backends/saves/default/default-saves.h"
 #include "backends/timer/default/default-timer.h"
 #include "graphics/surface.h"
 #include "audio/mixer_intern.h"
@@ -61,6 +61,8 @@ OSystem_PSP::~OSystem_PSP() {}
 #define PSP_SCREEN_WIDTH 480
 #define PSP_SCREEN_HEIGHT 272
 
+#define PSP_DEFAULT_SAVE_PATH "ms0:/scummvm_savegames"
+
 void OSystem_PSP::initBackend() {
 	DEBUG_ENTER_FUNC();
 
@@ -93,7 +95,7 @@ void OSystem_PSP::initBackend() {
 	_imageViewer.setInputHandler(&_inputHandler);
 	_imageViewer.setDisplayManager(&_displayManager);
 
-	_savefileManager = new PSPSaveFileManager;
+	_savefileManager = new DefaultSaveFileManager(PSP_DEFAULT_SAVE_PATH)
 
 	_timerManager = new DefaultTimerManager();
 
diff --git a/backends/saves/psp/psp-saves.cpp b/backends/saves/psp/psp-saves.cpp
deleted file mode 100644
index ba09223..0000000
--- a/backends/saves/psp/psp-saves.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-// Disable printf override in common/forbidden.h to avoid
-// clashes with pspdebug.h from the PSP SDK.
-// That header file uses
-//   __attribute__((format(printf,1,2)));
-// which gets messed up by our override mechanism; this could
-// be avoided by either changing the PSP SDK to use the equally
-// legal and valid
-//   __attribute__((format(__printf__,1,2)));
-// or by refining our printf override to use a varadic macro
-// (which then wouldn't be portable, though).
-// Anyway, for now we just disable the printf override globally
-// for the PSP port
-#define FORBIDDEN_SYMBOL_EXCEPTION_printf
-
-#include "common/scummsys.h"
-
-#ifdef __PSP__
-
-#include "backends/saves/psp/psp-saves.h"
-#include "backends/platform/psp/powerman.h"
-
-#include "common/config-manager.h"
-#include "common/savefile.h"
-
-#include <pspkernel.h>
-
-#define PSP_DEFAULT_SAVE_PATH "ms0:/scummvm_savegames"
-
-
-PSPSaveFileManager::PSPSaveFileManager() {
-	// Register default savepath
-	ConfMan.registerDefault("savepath", PSP_DEFAULT_SAVE_PATH);
-}
-/*
-PSPSaveFileManager::PSPSaveFileManager(const Common::String &defaultSavepath)
-	: DefaultSaveFileManager(defaultSavepath) {
-}
-*/
-
-void PSPSaveFileManager::checkPath(const Common::FSNode &dir) {
-	clearError();
-
-	PowerMan.beginCriticalSection();
-
-	//check if the save directory exists
-	SceUID fd = sceIoDopen(dir.getPath().c_str());
-	if (fd < 0) {
-		//No? then let's create it.
-		sceIoMkdir(dir.getPath().c_str(), 0777);
-	} else {
-		//it exists, so close it again.
-		sceIoDclose(fd);
-	}
-
-	PowerMan.endCriticalSection();
-}
-#endif
diff --git a/backends/saves/psp/psp-saves.h b/backends/saves/psp/psp-saves.h
deleted file mode 100644
index a0e4c38..0000000
--- a/backends/saves/psp/psp-saves.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef BACKEND_PSP_SAVES_H
-#define BACKEND_PSP_SAVES_H
-
-#include "backends/saves/default/default-saves.h"
-
-/**
- * Customization of the DefaultSaveFileManager for the PSP platform.
- * The only two differences are that the default constructor sets
- * up a default savepath, and that checkPath tries to create the savedir,
- * if missing, via the sceIoMkdir() call.
- */
-class PSPSaveFileManager : public DefaultSaveFileManager {
-public:
-	PSPSaveFileManager();
-//	PSPSaveFileManager(const Common::String &defaultSavepath);
-
-protected:
-	/**
-	 * Checks the given path for read access, existence, etc.
-	 * In addition, tries to create a missing savedir, if possible.
-	 * Sets the internal error and error message accordingly.
-	 */
-	virtual void checkPath(const Common::FSNode &dir);
-};
-
-#endif





More information about the Scummvm-git-logs mailing list