2007-08-18 05:24:18 +00:00
|
|
|
/* 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.
|
2014-02-18 02:34:23 +01:00
|
|
|
*
|
2007-08-18 05:24:18 +00:00
|
|
|
*/
|
|
|
|
|
2008-02-24 23:14:04 +00:00
|
|
|
#if defined(__PSP__)
|
2011-05-03 10:33:03 +02:00
|
|
|
|
2011-05-03 14:14:21 +02:00
|
|
|
// 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
|
|
|
|
|
2011-05-03 14:30:25 +02:00
|
|
|
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
|
2011-05-03 14:14:21 +02:00
|
|
|
|
2007-09-18 20:02:04 +00:00
|
|
|
#include "backends/fs/psp/psp-fs-factory.h"
|
2011-05-03 10:33:03 +02:00
|
|
|
#include "backends/fs/psp/psp-fs.h"
|
2011-05-03 14:14:21 +02:00
|
|
|
#include "backends/platform/psp/powerman.h"
|
|
|
|
|
|
|
|
#include <unistd.h>
|
2007-05-03 02:39:33 +00:00
|
|
|
|
2011-06-28 02:06:23 +03:00
|
|
|
namespace Common {
|
2010-11-16 08:23:13 +00:00
|
|
|
DECLARE_SINGLETON(PSPFilesystemFactory);
|
2011-06-28 02:06:23 +03:00
|
|
|
}
|
2007-05-31 23:44:43 +00:00
|
|
|
|
2008-10-02 16:58:59 +00:00
|
|
|
AbstractFSNode *PSPFilesystemFactory::makeRootFileNode() const {
|
2007-05-03 02:39:33 +00:00
|
|
|
return new PSPFilesystemNode();
|
|
|
|
}
|
|
|
|
|
2008-10-02 16:58:59 +00:00
|
|
|
AbstractFSNode *PSPFilesystemFactory::makeCurrentDirectoryFileNode() const {
|
2009-08-15 10:44:58 +00:00
|
|
|
char buf[MAXPATHLEN];
|
2011-05-03 10:33:03 +02:00
|
|
|
char *ret = 0;
|
2009-08-17 12:57:37 +00:00
|
|
|
|
|
|
|
PowerMan.beginCriticalSection();
|
|
|
|
ret = getcwd(buf, MAXPATHLEN);
|
|
|
|
PowerMan.endCriticalSection();
|
|
|
|
|
|
|
|
return (ret ? new PSPFilesystemNode(buf) : NULL);
|
2007-05-03 02:39:33 +00:00
|
|
|
}
|
|
|
|
|
2008-10-02 16:58:59 +00:00
|
|
|
AbstractFSNode *PSPFilesystemFactory::makeFileNodePath(const Common::String &path) const {
|
2007-05-03 02:39:33 +00:00
|
|
|
return new PSPFilesystemNode(path, true);
|
|
|
|
}
|
2011-05-03 10:33:03 +02:00
|
|
|
|
2008-02-24 23:14:04 +00:00
|
|
|
#endif
|