DS: List all available devices in the file browser

This commit is contained in:
Cameron Cawley 2020-06-05 19:50:43 +01:00 committed by Eugene Sandulenko
parent ab577c7930
commit 8c9eb8edc8
6 changed files with 89 additions and 4 deletions

View file

@ -0,0 +1,44 @@
/* 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.
*
*/
#if defined(__DS__)
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "backends/fs/devoptab/devoptab-fs-factory.h"
#include <sys/iosupport.h>
DevoptabFilesystemFactory::DevoptabFilesystemFactory() {
// skip in, out and err
for (uint8 i = 3; i < STD_MAX; ++i) {
const devoptab_t *dt = devoptab_list[i];
if (!dt || !dt->name || !dt->open_r || !dt->diropen_r)
continue;
addDrive(Common::String(dt->name) + ":/");
}
}
#endif

View file

@ -0,0 +1,38 @@
/* 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 DEVOPTAB_FILESYSTEM_FACTORY_H
#define DEVOPTAB_FILESYSTEM_FACTORY_H
#include "backends/fs/posix-drives/posix-drives-fs-factory.h"
/**
* A FilesystemFactory implementation for filesystems with a special
* top-level directory listing all registered devoptab devices but
* that otherwise implement the POSIX APIs.
*/
class DevoptabFilesystemFactory : public DrivesPOSIXFilesystemFactory {
public:
DevoptabFilesystemFactory();
};
#endif

View file

@ -20,7 +20,7 @@
*
*/
#if defined(POSIX) || defined(PSP2)
#if defined(POSIX) || defined(PSP2) || defined(__DS__)
#define FORBIDDEN_SYMBOL_ALLOW_ALL

View file

@ -20,7 +20,7 @@
*
*/
#if defined(POSIX) || defined(PSP2)
#if defined(POSIX) || defined(PSP2) || defined(__DS__)
#define FORBIDDEN_SYMBOL_ALLOW_ALL