Skip to content

Commit

Permalink
Merge branch 'scummvm:master' into add_libretro
Browse files Browse the repository at this point in the history
  • Loading branch information
spleen1981 committed Feb 6, 2023
2 parents 8478e19 + 57a9a80 commit 5d01153
Show file tree
Hide file tree
Showing 347 changed files with 20,374 additions and 1,200 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Expand Up @@ -25,6 +25,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- 1st generation Miyoo (New BittBoy, Pocket Go and PowKiddy Q90-V90-Q20)
under TriForceX MiyooCFW.
- Miyoo mini
- KolibriOS

General:
- Reduced amount of false positives in Mass Add.
Expand Down
8 changes: 6 additions & 2 deletions backends/events/sdl/sdl-events.cpp
Expand Up @@ -81,12 +81,14 @@ SdlEventSource::SdlEventSource()
if (joystick_num >= 0) {
// Initialize SDL joystick subsystem
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) {
error("Could not initialize SDL: %s", SDL_GetError());
warning("Could not initialize SDL joystick: %s", SDL_GetError());
return;
}

#if SDL_VERSION_ATLEAST(2, 0, 0)
if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == -1) {
error("Could not initialize SDL: %s", SDL_GetError());
warning("Could not initialize SDL game controller: %s", SDL_GetError());
return;
}
loadGameControllerMappingFile();
#endif
Expand Down Expand Up @@ -318,7 +320,9 @@ Common::KeyCode SdlEventSource::SDLToOSystemKeycode(const SDL_Keycode key) {
case SDLK_SYSREQ: return Common::KEYCODE_SYSREQ;
case SDLK_MENU: return Common::KEYCODE_MENU;
case SDLK_POWER: return Common::KEYCODE_POWER;
#if SDL_VERSION_ATLEAST(1, 2, 3)
case SDLK_UNDO: return Common::KEYCODE_UNDO;
#endif
#if SDL_VERSION_ATLEAST(2, 0, 0)
case SDLK_SCROLLLOCK: return Common::KEYCODE_SCROLLOCK;
case SDLK_NUMLOCKCLEAR: return Common::KEYCODE_NUMLOCK;
Expand Down
48 changes: 48 additions & 0 deletions backends/fs/kolibrios/kolibrios-fs-factory.cpp
@@ -0,0 +1,48 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/

// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
// Also with clock() in sys/time.h in some macOS SDKs.
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h
#define FORBIDDEN_SYMBOL_EXCEPTION_random
#define FORBIDDEN_SYMBOL_EXCEPTION_srandom

#include "backends/fs/kolibrios/kolibrios-fs-factory.h"
#include "backends/fs/kolibrios/kolibrios-fs.h"

#include <unistd.h>

AbstractFSNode *KolibriOSFilesystemFactory::makeRootFileNode() const {
return new KolibriOSFilesystemNode("/");
}

AbstractFSNode *KolibriOSFilesystemFactory::makeCurrentDirectoryFileNode() const {
char buf[MAXPATHLEN];
return getcwd(buf, MAXPATHLEN) ? new KolibriOSFilesystemNode(buf) : NULL;
}

AbstractFSNode *KolibriOSFilesystemFactory::makeFileNodePath(const Common::String &path) const {
assert(!path.empty());
return new KolibriOSFilesystemNode(path);
}
39 changes: 39 additions & 0 deletions backends/fs/kolibrios/kolibrios-fs-factory.h
@@ -0,0 +1,39 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/

#ifndef KOLIBRIOS_FILESYSTEM_FACTORY_H
#define KOLIBRIOS_FILESYSTEM_FACTORY_H

#include "backends/fs/fs-factory.h"

/**
* Creates KolibriOSFilesystemNode objects.
*
* Parts of this class are documented in the base interface class, FilesystemFactory.
*/
class KolibriOSFilesystemFactory : public FilesystemFactory {
protected:
AbstractFSNode *makeRootFileNode() const override;
AbstractFSNode *makeCurrentDirectoryFileNode() const override;
AbstractFSNode *makeFileNodePath(const Common::String &path) const override;
};

#endif /*KOLIBRIOS_FILESYSTEM_FACTORY_H*/

0 comments on commit 5d01153

Please sign in to comment.