ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

riscos.cpp

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "common/scummsys.h"
00024 
00025 #ifdef RISCOS
00026 
00027 #include "backends/platform/sdl/riscos/riscos.h"
00028 #include "backends/saves/default/default-saves.h"
00029 #include "backends/fs/riscos/riscos-fs-factory.h"
00030 #include "backends/fs/riscos/riscos-fs.h"
00031 
00032 #include <kernel.h>
00033 #include <swis.h>
00034 
00035 #ifndef URI_Dispatch
00036 #define URI_Dispatch 0x4e381
00037 #endif
00038 
00039 void OSystem_RISCOS::init() {
00040     // Initialze File System Factory
00041     _fsFactory = new RISCOSFilesystemFactory();
00042 
00043     // Invoke parent implementation of this method
00044     OSystem_SDL::init();
00045 }
00046 
00047 void OSystem_RISCOS::initBackend() {
00048     // Create the savefile manager
00049     if (_savefileManager == 0) {
00050         Common::String savePath = "/<Choices$Write>/ResidualVM/Saves";
00051         if (Riscos::assureDirectoryExists(savePath))
00052             _savefileManager = new DefaultSaveFileManager(savePath);
00053     }
00054 
00055     // Invoke parent implementation of this method
00056     OSystem_SDL::initBackend();
00057 }
00058 
00059 bool OSystem_RISCOS::hasFeature(Feature f) {
00060     if (f == kFeatureOpenUrl)
00061         return true;
00062 
00063     return OSystem_SDL::hasFeature(f);
00064 }
00065 
00066 bool OSystem_RISCOS::openUrl(const Common::String &url) {
00067     int flags;
00068     if (_swix(URI_Dispatch, _INR(0,2)|_OUT(0), 0, url.c_str(), 0, &flags) != NULL) {
00069         warning("openUrl() (RISCOS) failed to open URL");
00070         return false;
00071     }
00072     if ((flags & 1) == 1) {
00073         warning("openUrl() (RISCOS) failed to open URL");
00074         return false;
00075     }
00076     return true;
00077 }
00078 
00079 Common::String OSystem_RISCOS::getDefaultConfigFileName() {
00080     return "/<Choices$Write>/ResidualVM/residualvm";
00081 }
00082 
00083 Common::WriteStream *OSystem_RISCOS::createLogFile() {
00084     // Start out by resetting _logFilePath, so that in case
00085     // of a failure, we know that no log file is open.
00086     _logFilePath.clear();
00087 
00088     Common::String logFile = "/<Choices$Write>/ResidualVM/Logs";
00089 
00090     if (!Riscos::assureDirectoryExists(logFile)) {
00091         return 0;
00092     }
00093 
00094     logFile += "/residualvm";
00095 
00096     Common::FSNode file(logFile);
00097     Common::WriteStream *stream = file.createWriteStream();
00098     if (stream)
00099         _logFilePath = logFile;
00100     return stream;
00101 }
00102 
00103 #endif
00104 


Generated on Sat May 18 2019 05:01:18 for ResidualVM by doxygen 1.7.1
curved edge   curved edge