diff options
-rw-r--r-- | backends/fs/morphos/abox-fs-factory.cpp | 42 | ||||
-rw-r--r-- | backends/fs/morphos/abox-fs-factory.h | 51 | ||||
-rw-r--r-- | backends/fs/morphos/abox-fs.cpp | 418 | ||||
-rw-r--r-- | backends/midi/morphos.cpp | 101 | ||||
-rw-r--r-- | backends/module.mk | 2 | ||||
-rw-r--r-- | common/scummsys.h | 8 | ||||
-rw-r--r-- | common/system.cpp | 4 | ||||
-rw-r--r-- | sound/mididrv.cpp | 8 |
8 files changed, 0 insertions, 634 deletions
diff --git a/backends/fs/morphos/abox-fs-factory.cpp b/backends/fs/morphos/abox-fs-factory.cpp deleted file mode 100644 index be96deb61b..0000000000 --- a/backends/fs/morphos/abox-fs-factory.cpp +++ /dev/null @@ -1,42 +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. - * - * $URL$ - * $Id$ - */ - -#if defined(__MORPHOS__) -#include "backends/fs/morphos/abox-fs-factory.h" -#include "backends/fs/morphos/abox-fs.cpp" - -DECLARE_SINGLETON(ABoxFilesystemFactory); - -AbstractFilesystemNode *ABoxFilesystemFactory::makeRootFileNode() const { - return new ABoxFilesystemNode(); -} - -AbstractFilesystemNode *ABoxFilesystemFactory::makeCurrentDirectoryFileNode() const { - return new ABoxFilesystemNode(); -} - -AbstractFilesystemNode *ABoxFilesystemFactory::makeFileNodePath(const String &path) const { - return new ABoxFilesystemNode(path); -} -#endif diff --git a/backends/fs/morphos/abox-fs-factory.h b/backends/fs/morphos/abox-fs-factory.h deleted file mode 100644 index 0a53822447..0000000000 --- a/backends/fs/morphos/abox-fs-factory.h +++ /dev/null @@ -1,51 +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. - * - * $URL$ - * $Id$ - */ - -#ifndef ABOX_FILESYSTEM_FACTORY_H -#define ABOX_FILESYSTEM_FACTORY_H - -#include "common/singleton.h" -#include "backends/fs/fs-factory.h" - -/** - * Creates ABoxFilesystemNode objects. - * - * Parts of this class are documented in the base interface class, FilesystemFactory. - */ -class ABoxFilesystemFactory : public FilesystemFactory, public Common::Singleton<ABoxFilesystemFactory> { -public: - typedef Common::String String; - - virtual AbstractFilesystemNode *makeRootFileNode() const; - virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; - -protected: - ABoxFilesystemFactory() {}; - -private: - friend class Common::Singleton<SingletonBaseType>; -}; - -#endif /*ABOX_FILESYSTEM_FACTORY_H*/ diff --git a/backends/fs/morphos/abox-fs.cpp b/backends/fs/morphos/abox-fs.cpp deleted file mode 100644 index 9274c3804b..0000000000 --- a/backends/fs/morphos/abox-fs.cpp +++ /dev/null @@ -1,418 +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. - * - * $URL$ - * $Id$ - */ - -#if defined(__MORPHOS__) - -#include <proto/dos.h> - -#include <stdio.h> -#include <sys/stat.h> - -#include "common/util.h" -#include "base/engine.h" -#include "backends/fs/abstract-fs.h" - -/** - * Implementation of the ScummVM file system API based on the MorphOS A-Box API. - * - * Parts of this class are documented in the base interface class, AbstractFilesystemNode. - */ -class ABoxFilesystemNode : public AbstractFilesystemNode { -protected: - BPTR _lock; - String _displayName; - String _path; - bool _isDirectory; - bool _isValid; - -public: - /** - * Creates a ABoxFilesystemNode with the root node as path. - */ - ABoxFilesystemNode(); - - /** - * Creates a ABoxFilesystemNode for a given path. - * - * @param path String with the path the new node should point to. - */ - ABoxFilesystemNode(const String &p); - - /** - * FIXME: document this constructor. - */ - ABoxFilesystemNode(BPTR lock, CONST_STRPTR display_name = NULL); - - /** - * Copy constructor. - */ - ABoxFilesystemNode(const ABoxFilesystemNode &node); - - /** - * Destructor. - */ - ~ABoxFilesystemNode(); - - virtual bool exists() const { return true; } //FIXME: this is just a stub - virtual String getDisplayName() const { return _displayName; } - virtual String getName() const { return _displayName; }; - virtual String getPath() const { return _path; } - virtual bool isDirectory() const { return _isDirectory; } - virtual bool isReadable() const { return true; } //FIXME: this is just a stub - virtual bool isWritable() const { return true; } //FIXME: this is just a stub - - virtual AbstractFilesystemNode *getChild(const String &name) const; - virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; - virtual AbstractFilesystemNode *getParent() const; - - /** - * Return the list of child nodes for the root node. - */ - static AbstractFSList getRootChildren(); -}; - -/** - * Returns the last component of a given path. - * - * @param str String containing the path. - * @return Pointer to the first char of the last component inside str. - */ -const char *lastPathComponent(const Common::String &str) { - if (str.empty()) - return ""; - - const char *str = _path.c_str(); - while (offset > 0 && (str[offset-1] == '/' || str[offset-1] == ':') ) - offset--; - while (offset > 0 && (str[offset-1] != '/' && str[offset-1] != ':')) { - len++; - offset--; - } - - return str + offset; -} - -ABoxFilesystemNode::ABoxFilesystemNode() -{ - _path = ""; - _displayName = "Mounted Volumes"; - _isValid = true; - _isDirectory = true; - _lock = NULL; -} - -ABoxFilesystemNode::ABoxFilesystemNode(const String &p) { - int len = 0, offset = p.size(); - - assert(offset > 0); - - _path = p; - _displayName = lastPathComponent(_path); - _lock = NULL; - _isDirectory = false; - - struct FileInfoBlock *fib = (struct FileInfoBlock *)AllocDosObject(DOS_FIB, NULL); - if (!fib) - { - debug(6, "FileInfoBlock is NULL"); - return; - } - - // Check whether the node exists and if it is a directory - BPTR pLock = Lock((STRPTR)_path.c_str(), SHARED_LOCK); - if (pLock) - { - if (Examine(pLock, fib) != DOSFALSE) { - if (fib->fib_EntryType > 0) - { - _isDirectory = true; - _lock = DupLock(pLock); - _isValid = (_lock != 0); - - // Add a trailing slash if it is needed - const char c = _path.lastChar(); - if (c != '/' && c != ':') - _path += '/'; - - } - else - { - _isDirectory = false; - _isValid = true; - } - } - - UnLock(pLock); - } - - FreeDosObject(DOS_FIB, fib); -} - -ABoxFilesystemNode::ABoxFilesystemNode(BPTR lock, CONST_STRPTR display_name) -{ - int bufsize = 256; - - _lock = NULL; - for (;;) - { - char name[bufsize]; - if (NameFromLock(lock, name, bufsize) != DOSFALSE) - { - _path = name; - _displayName = display_name ? display_name : FilePart(name); - break; - } - if (IoErr() != ERROR_LINE_TOO_LONG) - { - _isValid = false; - debug(6, "Error while retrieving path name: %ld", IoErr()); - return; - } - bufsize *= 2; - } - - _isDirectory = false; - _isValid = false; - - FileInfoBlock *fib = (FileInfoBlock*) AllocDosObject(DOS_FIB, NULL); - if (fib == NULL) - { - debug(6, "Failed to allocate memory for FileInfoBlock"); - return; - } - - if (Examine(lock, fib) != DOSFALSE) - { - _isDirectory = fib->fib_EntryType > 0; - if (_isDirectory) - { - if (fib->fib_EntryType != ST_ROOT) - _path += "/"; - _lock = DupLock(lock); - _isValid = (_lock != NULL); - } - else - { - _isValid = true; - } - } - - FreeDosObject(DOS_FIB, fib); -} - -ABoxFilesystemNode::ABoxFilesystemNode(const ABoxFilesystemNode& node) -{ - _path = node._path; - _displayName = node._displayName; - _isValid = node._isValid; - _isDirectory = node._isDirectory; - _lock = DupLock(node._lock); -} - -ABoxFilesystemNode::~ABoxFilesystemNode() -{ - if (_lock) - { - UnLock(_lock); - _lock = NULL; - } -} - -AbstractFilesystemNode *ABoxFilesystemNode::getChild(const String &name) const { - assert(_isDirectory); - String newPath(_path); - - if (_path.lastChar() != '/') - newPath += '/'; - newPath += name; - - BPTR lock = Lock(newPath.c_str(), SHARED_LOCK); - - if (!lock) - { - return 0; - } - - UnLock(lock); - - return new ABoxFilesystemNode(newPath); -} - -bool ABoxFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const -{ - //TODO: honor the hidden flag - - if (!_isValid) - { - debug(6, "listDir() called on invalid node"); - return false; - } - if (!_isDirectory) - { - debug(6, "listDir() called on file node"); - return false; - } - - if (_lock == NULL) - { - /* This is the root node */ - list = getRootChildren(); - return true; - } - - /* "Normal" file system directory */ - FileInfoBlock *fib = (FileInfoBlock*) AllocDosObject(DOS_FIB, NULL); - - if (fib == NULL) - { - debug(6, "Failed to allocate memory for FileInfoBlock"); - return false; - } - - if (Examine(_lock, fib) != DOSFALSE) - { - while (ExNext(_lock, fib) != DOSFALSE) - { - ABoxFilesystemNode *entry; - String full_path; - BPTR lock; - - if ((mode == FilesystemNode::kListAll) || - (fib->fib_EntryType > 0 && (mode & FilesystemNode::kListDirectoriesOnly)) || - (fib->fib_EntryType < 0 && (mode & FilesystemNode::kListFilesOnly))) - { - full_path = _path; - full_path += fib->fib_FileName; - lock = Lock(full_path.c_str(), SHARED_LOCK); - if (lock) - { - entry = new ABoxFilesystemNode(lock, fib->fib_FileName); - if (entry) - { - //FIXME: since the isValid() function is no longer part of the AbstractFilesystemNode - // specification, the following call had to be changed: - // if (entry->isValid()) - // Please verify that the logic of the code remains coherent. Also, remember - // that the isReadable() and isWritable() methods are available. - if (entry->exists()) - list.push_back(entry); - else - delete entry; - } - UnLock(lock); - } - } - } - - if (IoErr() != ERROR_NO_MORE_ENTRIES) - debug(6, "Error while reading directory: %ld", IoErr()); - } - - FreeDosObject(DOS_FIB, fib); - - return true; -} - -AbstractFilesystemNode *ABoxFilesystemNode::getParent() const -{ - AbstractFilesystemNode *node = NULL; - - if (!_isDirectory) - { - debug(6, "parent() called on file node"); - return NULL; - } - - if (_lock == NULL) { - /* Parent of the root is the root itself */ - return new ABoxFilesystemNode(*this); - } else { - BPTR parent_lock = ParentDir(_lock); - if (parent_lock) { - node = new ABoxFilesystemNode(parent_lock); - UnLock(parent_lock); - } else - node = new ABoxFilesystemNode(); - } - - return node; -} - -AbstractFSList ABoxFilesystemNode::getRootChildren() -{ - AbstractFSList list; - DosList *dosList; - CONST ULONG lockDosListFlags = LDF_READ | LDF_VOLUMES; - char name[256]; - - dosList = LockDosList(lockDosListFlags); - if (dosList == NULL) - { - return list; - } - - dosList = NextDosEntry(dosList, LDF_VOLUMES); - while (dosList) - { - if (dosList->dol_Type == DLT_VOLUME && // Should always be true, but ... - dosList->dol_Name && // Same here - dosList->dol_Task // Will be NULL if volume is removed from drive but still in use by some program - ) - { - ABoxFilesystemNode *entry; - CONST_STRPTR volume_name = (CONST_STRPTR)BADDR(dosList->dol_Name)+1; - CONST_STRPTR device_name = (CONST_STRPTR)((struct Task *)dosList->dol_Task->mp_SigTask)->tc_Node.ln_Name; - BPTR volume_lock; - - strcpy(name, volume_name); - strcat(name, ":"); - volume_lock = Lock(name, SHARED_LOCK); - if (volume_lock) - { - sprintf(name, "%s (%s)", volume_name, device_name); - entry = new ABoxFilesystemNode(volume_lock, name); - if (entry) - { - //FIXME: since the isValid() function is no longer part of the AbstractFilesystemNode - // specification, the following call had to be changed: - // if (entry->isValid()) - // Please verify that the logic of the code remains coherent. Also, remember - // that the isReadable() and isWritable() methods are available. - if (entry->exists()) - list.push_back(entry); - else - delete entry; - } - UnLock(volume_lock); - } - } - dosList = NextDosEntry(dosList, LDF_VOLUMES); - } - - UnLockDosList(lockDosListFlags); - - return list; -} - -#endif // defined(__MORPHOS__) diff --git a/backends/midi/morphos.cpp b/backends/midi/morphos.cpp deleted file mode 100644 index 1a322dc6e2..0000000000 --- a/backends/midi/morphos.cpp +++ /dev/null @@ -1,101 +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. - * - * $URL$ - * $Id$ - */ - -#if defined(__MORPHOS__) - -#include <exec/memory.h> -#include <exec/types.h> -#include <devices/etude.h> - -#include <clib/alib_protos.h> -#include <proto/exec.h> -#include <proto/dos.h> -#include <proto/etude.h> - -#include "common/endian.h" -#include "sound/mpu401.h" -#include "common/util.h" -#include "morphos.h" -#include "morphos_sound.h" - -/* - * MorphOS MIDI driver for Etude device - */ - -class MidiDriver_ETUDE : public MidiDriver_MPU401 { -public: - MidiDriver_ETUDE(); - int open(); - void close(); - void send(uint32 b); - -private: - bool _isOpen; -}; - -MidiDriver_ETUDE::MidiDriver_ETUDE() -{ - _isOpen = false; -} - -int MidiDriver_ETUDE::open() -{ - if (_isOpen) - return MERR_ALREADY_OPEN; - _isOpen = true; - if (!init_morphos_music(ScummMidiUnit, ETUDEF_DIRECT)) - return MERR_DEVICE_NOT_AVAILABLE; - - return 0; -} - -void MidiDriver_ETUDE::close() -{ - MidiDriver_MPU401::close(); - exit_morphos_music(); - _isOpen = false; -} - -void MidiDriver_ETUDE::send(uint32 b) -{ - if (!_isOpen) - error("MidiDriver_ETUDE::send called but driver was no opened"); - - if (ScummMidiRequest) { - ULONG midi_data = READ_LE_UINT32(&b); - SendShortMidiMsg(ScummMidiRequest, midi_data); - } -} - -extern MidiDriver* EtudeMidiDriver; - -MidiDriver *MidiDriver_ETUDE_create() -{ - if (!EtudeMidiDriver) - EtudeMidiDriver = new MidiDriver_ETUDE(); - return EtudeMidiDriver; -} - -#endif - diff --git a/backends/module.mk b/backends/module.mk index dad25f058b..e8ba303dea 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -4,7 +4,6 @@ MODULE_OBJS := \ fs/amigaos4/amigaos4-fs-factory.o \ fs/ds/ds-fs-factory.o \ fs/gp32/gp32-fs-factory.o \ - fs/morphos/abox-fs-factory.o \ fs/palmos/palmos-fs-factory.o \ fs/posix/posix-fs-factory.o \ fs/ps2/ps2-fs-factory.o \ @@ -16,7 +15,6 @@ MODULE_OBJS := \ midi/camd.o \ midi/coreaudio.o \ midi/coremidi.o \ - midi/morphos.o \ midi/quicktime.o \ midi/seq.o \ midi/timidity.o \ diff --git a/common/scummsys.h b/common/scummsys.h index dfdf728ff4..4299de7243 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -301,14 +301,6 @@ # undef UNUSED #endif -#elif defined(__MORPHOS__) - - #define scumm_stricmp stricmp - #define scumm_strnicmp strnicmp - - #define SCUMM_BIG_ENDIAN - #define SCUMM_NEED_ALIGNMENT - #elif defined(__DC__) #define scumm_stricmp strcasecmp diff --git a/common/system.cpp b/common/system.cpp index 73119da9e6..6328f392b8 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -142,8 +142,6 @@ void OSystem::getTimeAndDate(struct tm &t) const { #include "backends/fs/ds/ds-fs-factory.h" #elif defined(__GP32__) #include "backends/fs/gp32/gp32-fs-factory.h" -#elif defined(__MORPHOS__) - #include "backends/fs/morphos/abox-fs-factory.h" #elif defined(PALMOS_MODE) #include "backends/fs/palmos/palmos-fs-factory.h" #elif defined(__PLAYSTATION2__) @@ -160,8 +158,6 @@ FilesystemFactory *OSystem::getFilesystemFactory() { return &DSFilesystemFactory::instance(); #elif defined(__GP32__) return &GP32FilesystemFactory::instance(); - #elif defined(__MORPHOS__) - return &ABoxFilesystemFactory::instance(); #elif defined(PALMOS_MODE) return &PalmOSFilesystemFactory::instance(); #elif defined(__PLAYSTATION2__) diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 9e7ba686f4..b504925a37 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -73,9 +73,6 @@ static const MidiDriverDescription s_musicDrivers[] = { # endif #endif -#if defined(__MORPHOS__) - {"etude", "Etude", MD_ETUDE, MDT_MIDI}, -#endif #ifdef USE_FLUIDSYNTH {"fluidsynth", "FluidSynth", MD_FLUIDSYNTH, MDT_MIDI}, #endif @@ -165,8 +162,6 @@ static int getDefaultMIDIDriver() { #else return MD_NULL; #endif -#elif defined(__MORPHOS__) - return MD_ETUDE; #else return MD_NULL; #endif @@ -252,9 +247,6 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) { #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) case MD_WINDOWS: return MidiDriver_WIN_create(); #endif -#if defined(__MORPHOS__) - case MD_ETUDE: return MidiDriver_ETUDE_create(); -#endif #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) case MD_SEQ: return MidiDriver_SEQ_create(); #endif |