aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2011-06-23 01:34:05 -0700
committerEugene Sandulenko2011-06-23 01:34:05 -0700
commit627372a67cf4e0a36e3e2e14d308a98a0961ec9b (patch)
tree5bd7cef3ecb6b3acfa7df04b66ab9133f3479031
parent92f4b7c611f0c317805e79a62ed883614572d9dd (diff)
parentd2454d7e5f1ddcc59b779fa9daa2128078fc0fda (diff)
downloadscummvm-rg350-627372a67cf4e0a36e3e2e14d308a98a0961ec9b.tar.gz
scummvm-rg350-627372a67cf4e0a36e3e2e14d308a98a0961ec9b.tar.bz2
scummvm-rg350-627372a67cf4e0a36e3e2e14d308a98a0961ec9b.zip
Merge pull request #40 from bgK/ps3
PS3 Port
-rw-r--r--.gitignore1
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.cpp163
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.h38
-rw-r--r--backends/events/sdl/sdl-events.cpp21
-rw-r--r--backends/fs/posix/posix-fs-factory.cpp2
-rw-r--r--backends/fs/posix/posix-fs-factory.h1
-rw-r--r--backends/fs/posix/posix-fs.cpp2
-rw-r--r--backends/fs/ps3/ps3-fs-factory.cpp26
-rw-r--r--backends/fs/ps3/ps3-fs-factory.h36
-rw-r--r--backends/mixer/sdl13/sdl13-mixer.cpp109
-rw-r--r--backends/mixer/sdl13/sdl13-mixer.h67
-rw-r--r--backends/module.mk16
-rw-r--r--backends/platform/sdl/main.cpp1
-rw-r--r--backends/platform/sdl/module.mk6
-rw-r--r--backends/platform/sdl/posix/posix-main.cpp2
-rw-r--r--backends/platform/sdl/ps3/ps3-main.cpp49
-rw-r--r--backends/platform/sdl/ps3/ps3.cpp94
-rw-r--r--backends/platform/sdl/ps3/ps3.h47
-rw-r--r--backends/platform/sdl/sdl-sys.h23
-rw-r--r--backends/platform/sdl/sdl.cpp16
-rwxr-xr-xconfigure55
-rw-r--r--dists/ps3/ICON0.PNGbin0 -> 43210 bytes
-rw-r--r--dists/ps3/PIC1.PNGbin0 -> 3193068 bytes
-rw-r--r--dists/ps3/readme-ps3.md49
-rw-r--r--dists/ps3/sfo.xml33
-rw-r--r--ports.mk24
26 files changed, 861 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index a928f4d30c..4ad9f07b34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@ lib*.a
/MT32_CONTROL.ROM
/MT32_PCM.ROM
/ScummVM.app
+/scummvm-ps3.pkg
/*.ipk
/.project
/.cproject
diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp
new file mode 100644
index 0000000000..eefc641844
--- /dev/null
+++ b/backends/events/ps3sdl/ps3sdl-events.cpp
@@ -0,0 +1,163 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+
+#if defined(PLAYSTATION3)
+
+#include "backends/events/ps3sdl/ps3sdl-events.h"
+#include "backends/platform/sdl/sdl.h"
+#include "engines/engine.h"
+
+#include "common/util.h"
+#include "common/events.h"
+
+enum {
+ BTN_LEFT = 0,
+ BTN_DOWN = 1,
+ BTN_RIGHT = 2,
+ BTN_UP = 3,
+
+ BTN_START = 4,
+ BTN_R3 = 5,
+ BTN_L3 = 6,
+ BTN_SELECT = 7,
+
+ BTN_SQUARE = 8,
+ BTN_CROSS = 9,
+ BTN_CIRCLE = 10,
+ BTN_TRIANGLE = 11,
+
+ BTN_R1 = 12,
+ BTN_L1 = 13,
+ BTN_R2 = 14,
+ BTN_L2 = 15
+};
+
+bool PS3SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
+
+ event.kbd.flags = 0;
+
+ switch (ev.jbutton.button) {
+ case BTN_CROSS: // Left mouse button
+ event.type = Common::EVENT_LBUTTONDOWN;
+ fillMouseEvent(event, _km.x, _km.y);
+ break;
+ case BTN_CIRCLE: // Right mouse button
+ event.type = Common::EVENT_RBUTTONDOWN;
+ fillMouseEvent(event, _km.x, _km.y);
+ break;
+ case BTN_TRIANGLE: // Game menu
+ event.type = Common::EVENT_KEYDOWN;
+ event.kbd.keycode = Common::KEYCODE_F5;
+ event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0);
+ break;
+ case BTN_SELECT: // Virtual keyboard
+ event.type = Common::EVENT_KEYDOWN;
+ event.kbd.keycode = Common::KEYCODE_F7;
+ event.kbd.ascii = mapKey(SDLK_F7, (SDLMod) ev.key.keysym.mod, 0);
+ break;
+ case BTN_SQUARE: // Escape
+ event.type = Common::EVENT_KEYDOWN;
+ event.kbd.keycode = Common::KEYCODE_ESCAPE;
+ event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod) ev.key.keysym.mod, 0);
+ break;
+ case BTN_L1: // Predictive input dialog
+ event.type = Common::EVENT_PREDICTIVE_DIALOG;
+ break;
+ case BTN_START: // ScummVM in game menu
+ event.type = Common::EVENT_MAINMENU;
+ break;
+ }
+ return true;
+}
+
+bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
+
+ event.kbd.flags = 0;
+
+ switch (ev.jbutton.button) {
+ case BTN_CROSS: // Left mouse button
+ event.type = Common::EVENT_LBUTTONUP;
+ fillMouseEvent(event, _km.x, _km.y);
+ break;
+ case BTN_CIRCLE: // Right mouse button
+ event.type = Common::EVENT_RBUTTONUP;
+ fillMouseEvent(event, _km.x, _km.y);
+ break;
+ case BTN_TRIANGLE: // Game menu
+ event.type = Common::EVENT_KEYUP;
+ event.kbd.keycode = Common::KEYCODE_F5;
+ event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0);
+ break;
+ case BTN_SELECT: // Virtual keyboard
+ event.type = Common::EVENT_KEYUP;
+ event.kbd.keycode = Common::KEYCODE_F7;
+ event.kbd.ascii = mapKey(SDLK_F7, (SDLMod) ev.key.keysym.mod, 0);
+ break;
+ case BTN_SQUARE: // Escape
+ event.type = Common::EVENT_KEYUP;
+ event.kbd.keycode = Common::KEYCODE_ESCAPE;
+ event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod) ev.key.keysym.mod, 0);
+ break;
+ }
+ return true;
+}
+
+/**
+ * The XMB (PS3 in game menu) needs the screen buffers to be constantly flip while open.
+ * This pauses execution and keeps redrawing the screen until the XMB is closed.
+ */
+void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
+ if (event->type == SDL_ACTIVEEVENT) {
+ if (event->active.state == SDL_APPMOUSEFOCUS && !event->active.gain) {
+ // XMB opened
+ if (g_engine)
+ g_engine->pauseEngine(true);
+
+ for (;;) {
+ if (!SDL_PollEvent(event)) {
+ // Locking the screen forces a full redraw
+ Graphics::Surface* screen = g_system->lockScreen();
+ if (screen) {
+ g_system->unlockScreen();
+ g_system->updateScreen();
+ }
+ SDL_Delay(10);
+ continue;
+ }
+ if (event->type == SDL_QUIT)
+ return;
+ if (event->type != SDL_ACTIVEEVENT)
+ continue;
+ if (event->active.state == SDL_APPMOUSEFOCUS && event->active.gain) {
+ // XMB closed
+ if (g_engine)
+ g_engine->pauseEngine(false);
+ return;
+ }
+ }
+ }
+ }
+}
+
+#endif
diff --git a/backends/events/ps3sdl/ps3sdl-events.h b/backends/events/ps3sdl/ps3sdl-events.h
new file mode 100644
index 0000000000..8cf2f43426
--- /dev/null
+++ b/backends/events/ps3sdl/ps3sdl-events.h
@@ -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.
+ *
+ */
+
+#if !defined(BACKEND_EVENTS_PS3_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#define BACKEND_EVENTS_PS3_H
+
+#include "backends/events/sdl/sdl-events.h"
+
+/**
+ * SDL Events manager for the PS3.
+ */
+class PS3SdlEventSource : public SdlEventSource {
+protected:
+ void preprocessEvents(SDL_Event *event);
+ bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
+ bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
+};
+
+#endif /* BACKEND_EVENTS_PS3_H */
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 835d98e718..4489a2e580 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -206,7 +206,6 @@ bool SdlEventSource::pollEvent(Common::Event &event) {
}
SDL_Event ev;
- ev.type = SDL_NOEVENT;
while (SDL_PollEvent(&ev)) {
preprocessEvents(&ev);
if (dispatchSDLEvent(ev, event))
@@ -304,7 +303,7 @@ bool SdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
- event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+ event.kbd.ascii = mapKey(ev.key.keysym.sym, (SDLMod)ev.key.keysym.mod, (Uint16)ev.key.keysym.unicode);
return true;
}
@@ -348,7 +347,7 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_KEYUP;
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
- event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+ event.kbd.ascii = mapKey(ev.key.keysym.sym, (SDLMod)ev.key.keysym.mod, (Uint16)ev.key.keysym.unicode);
// Ctrl-Alt-<key> will change the GFX mode
SDLModToOSystemKeyFlags(mod, event);
@@ -418,19 +417,19 @@ bool SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
switch (ev.jbutton.button) {
case JOY_BUT_ESCAPE:
event.kbd.keycode = Common::KEYCODE_ESCAPE;
- event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod)ev.key.keysym.mod, 0);
break;
case JOY_BUT_PERIOD:
event.kbd.keycode = Common::KEYCODE_PERIOD;
- event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_PERIOD, (SDLMod)ev.key.keysym.mod, 0);
break;
case JOY_BUT_SPACE:
event.kbd.keycode = Common::KEYCODE_SPACE;
- event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_SPACE, (SDLMod)ev.key.keysym.mod, 0);
break;
case JOY_BUT_F5:
event.kbd.keycode = Common::KEYCODE_F5;
- event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_F5, (SDLMod)ev.key.keysym.mod, 0);
break;
}
}
@@ -449,19 +448,19 @@ bool SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
switch (ev.jbutton.button) {
case JOY_BUT_ESCAPE:
event.kbd.keycode = Common::KEYCODE_ESCAPE;
- event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod)ev.key.keysym.mod, 0);
break;
case JOY_BUT_PERIOD:
event.kbd.keycode = Common::KEYCODE_PERIOD;
- event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_PERIOD, (SDLMod)ev.key.keysym.mod, 0);
break;
case JOY_BUT_SPACE:
event.kbd.keycode = Common::KEYCODE_SPACE;
- event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_SPACE, (SDLMod)ev.key.keysym.mod, 0);
break;
case JOY_BUT_F5:
event.kbd.keycode = Common::KEYCODE_F5;
- event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+ event.kbd.ascii = mapKey(SDLK_F5, (SDLMod)ev.key.keysym.mod, 0);
break;
}
}
diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp
index 829355be84..776ea86155 100644
--- a/backends/fs/posix/posix-fs-factory.cpp
+++ b/backends/fs/posix/posix-fs-factory.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#if defined(POSIX)
+#if defined(POSIX) || defined(PLAYSTATION3)
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
// Also with clock() in sys/time.h in some Mac OS X SDKs.
diff --git a/backends/fs/posix/posix-fs-factory.h b/backends/fs/posix/posix-fs-factory.h
index a7075db94c..c7cec6fab5 100644
--- a/backends/fs/posix/posix-fs-factory.h
+++ b/backends/fs/posix/posix-fs-factory.h
@@ -30,6 +30,7 @@
* Parts of this class are documented in the base interface class, FilesystemFactory.
*/
class POSIXFilesystemFactory : public FilesystemFactory {
+protected:
virtual AbstractFSNode *makeRootFileNode() const;
virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const;
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 0b94c37b16..320c5a6f39 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#if defined(POSIX)
+#if defined(POSIX) || defined(PLAYSTATION3)
// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
// Also with clock() in sys/time.h in some Mac OS X SDKs.
diff --git a/backends/fs/ps3/ps3-fs-factory.cpp b/backends/fs/ps3/ps3-fs-factory.cpp
new file mode 100644
index 0000000000..3257246c50
--- /dev/null
+++ b/backends/fs/ps3/ps3-fs-factory.cpp
@@ -0,0 +1,26 @@
+/* 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.
+ */
+
+#include "backends/fs/ps3/ps3-fs-factory.h"
+
+AbstractFSNode *PS3FilesystemFactory::makeCurrentDirectoryFileNode() const {
+ return makeRootFileNode();
+}
diff --git a/backends/fs/ps3/ps3-fs-factory.h b/backends/fs/ps3/ps3-fs-factory.h
new file mode 100644
index 0000000000..6c1988b1c9
--- /dev/null
+++ b/backends/fs/ps3/ps3-fs-factory.h
@@ -0,0 +1,36 @@
+/* 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 PS3_FILESYSTEM_FACTORY_H
+#define PS3_FILESYSTEM_FACTORY_H
+
+#include "backends/fs/posix/posix-fs-factory.h"
+
+/**
+ * Creates PS3FilesystemFactory objects.
+ *
+ * Parts of this class are documented in the base interface class, FilesystemFactory.
+ */
+class PS3FilesystemFactory : public POSIXFilesystemFactory {
+ virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
+};
+
+#endif /*PS3_FILESYSTEM_FACTORY_H*/
diff --git a/backends/mixer/sdl13/sdl13-mixer.cpp b/backends/mixer/sdl13/sdl13-mixer.cpp
new file mode 100644
index 0000000000..84777c8bab
--- /dev/null
+++ b/backends/mixer/sdl13/sdl13-mixer.cpp
@@ -0,0 +1,109 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+
+#if defined(SDL_BACKEND)
+
+#include "backends/mixer/sdl13/sdl13-mixer.h"
+#include "common/debug.h"
+#include "common/system.h"
+#include "common/config-manager.h"
+#include "common/textconsole.h"
+
+#ifdef GP2X
+#define SAMPLES_PER_SEC 11025
+#else
+#define SAMPLES_PER_SEC 22050
+#endif
+//#define SAMPLES_PER_SEC 44100
+
+Sdl13MixerManager::Sdl13MixerManager()
+ :
+ SdlMixerManager(),
+ _device(0) {
+
+}
+
+Sdl13MixerManager::~Sdl13MixerManager() {
+ _mixer->setReady(false);
+
+ SDL_CloseAudioDevice(_device);
+
+ delete _mixer;
+}
+
+void Sdl13MixerManager::init() {
+ // Start SDL Audio subsystem
+ if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) {
+ error("Could not initialize SDL: %s", SDL_GetError());
+ }
+
+ // Get the desired audio specs
+ SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC);
+
+ // Start SDL audio with the desired specs
+ _device = SDL_OpenAudioDevice(NULL, 0, &desired, &_obtained,
+ SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
+
+ if (_device <= 0) {
+ warning("Could not open audio device: %s", SDL_GetError());
+
+ _mixer = new Audio::MixerImpl(g_system, desired.freq);
+ assert(_mixer);
+ _mixer->setReady(false);
+ } else {
+ debug(1, "Output sample rate: %d Hz", _obtained.freq);
+
+ _mixer = new Audio::MixerImpl(g_system, _obtained.freq);
+ assert(_mixer);
+ _mixer->setReady(true);
+
+ startAudio();
+ }
+}
+
+void Sdl13MixerManager::startAudio() {
+ // Start the sound system
+ SDL_PauseAudioDevice(_device, 0);
+}
+
+void Sdl13MixerManager::suspendAudio() {
+ SDL_CloseAudioDevice(_device);
+ _audioSuspended = true;
+}
+
+int Sdl13MixerManager::resumeAudio() {
+ if (!_audioSuspended)
+ return -2;
+
+ _device = SDL_OpenAudioDevice(NULL, 0, &_obtained, NULL, 0);
+ if (_device <= 0) {
+ return -1;
+ }
+
+ SDL_PauseAudioDevice(_device, 0);
+ _audioSuspended = false;
+ return 0;
+}
+
+#endif
diff --git a/backends/mixer/sdl13/sdl13-mixer.h b/backends/mixer/sdl13/sdl13-mixer.h
new file mode 100644
index 0000000000..9e07ea8673
--- /dev/null
+++ b/backends/mixer/sdl13/sdl13-mixer.h
@@ -0,0 +1,67 @@
+/* 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 BACKENDS_MIXER_SDL13_H
+#define BACKENDS_MIXER_SDL13_H
+
+#include "backends/mixer/sdl/sdl-mixer.h"
+
+/**
+ * SDL mixer manager. It wraps the actual implementation
+ * of the Audio:Mixer used by the engine, and setups
+ * the SDL audio subsystem and the callback for the
+ * audio mixer implementation.
+ */
+class Sdl13MixerManager : public SdlMixerManager {
+public:
+ Sdl13MixerManager();
+ virtual ~Sdl13MixerManager();
+
+ /**
+ * Initialize and setups the mixer
+ */
+ virtual void init();
+
+ /**
+ * Pauses the audio system
+ */
+ virtual void suspendAudio();
+
+ /**
+ * Resumes the audio system
+ */
+ virtual int resumeAudio();
+
+protected:
+
+ /**
+ * The opened SDL audio device
+ */
+ SDL_AudioDeviceID _device;
+
+ /**
+ * Starts SDL audio
+ */
+ virtual void startAudio();
+};
+
+#endif
diff --git a/backends/module.mk b/backends/module.mk
index e568002d40..63774cc4d0 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -60,7 +60,6 @@ endif
# derive from the SDL backend, and they all need the following files.
ifdef SDL_BACKEND
MODULE_OBJS += \
- audiocd/sdl/sdl-audiocd.o \
events/sdl/sdl-events.o \
graphics/surfacesdl/surfacesdl-graphics.o \
mixer/doublebuffersdl/doublebuffersdl-mixer.o \
@@ -68,6 +67,12 @@ MODULE_OBJS += \
mutex/sdl/sdl-mutex.o \
plugins/sdl/sdl-provider.o \
timer/sdl/sdl-timer.o
+
+# SDL 1.3 removed audio CD support
+ifndef USE_SDL13
+MODULE_OBJS += \
+ audiocd/sdl/sdl-audiocd.o
+endif
endif
ifdef POSIX
@@ -101,6 +106,15 @@ MODULE_OBJS += \
midi/camd.o
endif
+ifdef PLAYSTATION3
+MODULE_OBJS += \
+ fs/posix/posix-fs.o \
+ fs/posix/posix-fs-factory.o \
+ fs/ps3/ps3-fs-factory.o \
+ events/ps3sdl/ps3sdl-events.o \
+ mixer/sdl13/sdl13-mixer.o
+endif
+
ifeq ($(BACKEND),ds)
MODULE_OBJS += \
fs/ds/ds-fs.o \
diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp
index 1992bdd3f2..3947d010c4 100644
--- a/backends/platform/sdl/main.cpp
+++ b/backends/platform/sdl/main.cpp
@@ -34,6 +34,7 @@
!defined(CAANOO) && \
!defined(LINUXMOTO) && \
!defined(SAMSUNGTV) && \
+ !defined(PLAYSTATION3) && \
!defined(OPENPANDORA)
#include "backends/platform/sdl/sdl.h"
diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk
index efc5168d5b..e67bf859d6 100644
--- a/backends/platform/sdl/module.mk
+++ b/backends/platform/sdl/module.mk
@@ -29,6 +29,12 @@ MODULE_OBJS += \
amigaos/amigaos.o
endif
+ifdef PLAYSTATION3
+MODULE_OBJS += \
+ ps3/ps3-main.o \
+ ps3/ps3.o
+endif
+
# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.
MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS))
OBJS := $(MODULE_OBJS) $(OBJS)
diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp
index f78e001398..3bf7a5138a 100644
--- a/backends/platform/sdl/posix/posix-main.cpp
+++ b/backends/platform/sdl/posix/posix-main.cpp
@@ -22,7 +22,7 @@
#include "common/scummsys.h"
-#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA)
+#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3)
#include "backends/platform/sdl/posix/posix.h"
#include "backends/plugins/sdl/sdl-provider.h"
diff --git a/backends/platform/sdl/ps3/ps3-main.cpp b/backends/platform/sdl/ps3/ps3-main.cpp
new file mode 100644
index 0000000000..ba548a3749
--- /dev/null
+++ b/backends/platform/sdl/ps3/ps3-main.cpp
@@ -0,0 +1,49 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+
+#include "backends/platform/sdl/ps3/ps3.h"
+#include "backends/plugins/sdl/sdl-provider.h"
+#include "base/main.h"
+
+int main(int argc, char *argv[]) {
+
+ // Create our OSystem instance
+ g_system = new OSystem_PS3();
+ assert(g_system);
+
+ // Pre initialize the backend
+ ((OSystem_PS3 *)g_system)->init();
+
+#ifdef DYNAMIC_MODULES
+ PluginManager::instance().addPluginProvider(new SDLPluginProvider());
+#endif
+
+ // Invoke the actual ScummVM main entry point:
+ int res = scummvm_main(argc, argv);
+
+ // Free OSystem
+ delete (OSystem_PS3 *)g_system;
+
+ return res;
+}
diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp
new file mode 100644
index 0000000000..16722ccdb7
--- /dev/null
+++ b/backends/platform/sdl/ps3/ps3.cpp
@@ -0,0 +1,94 @@
+/* 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.
+ *
+ */
+
+#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
+#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
+
+#include "common/scummsys.h"
+#include "common/config-manager.h"
+#include "backends/platform/sdl/ps3/ps3.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
+#include "backends/saves/default/default-saves.h"
+#include "backends/fs/ps3/ps3-fs-factory.h"
+#include "backends/events/ps3sdl/ps3sdl-events.h"
+#include "backends/mixer/sdl13/sdl13-mixer.h"
+
+#include <dirent.h>
+#include <sys/stat.h>
+
+int access(const char *pathname, int mode) {
+ struct stat sb;
+
+ if (stat(pathname, &sb) == -1) {
+ return -1;
+ }
+
+ return 0;
+}
+
+OSystem_PS3::OSystem_PS3(Common::String baseConfigName)
+ : _baseConfigName(baseConfigName) {
+}
+
+void OSystem_PS3::init() {
+ // Initialze File System Factory
+ _fsFactory = new PS3FilesystemFactory();
+
+ // Invoke parent implementation of this method
+ OSystem_SDL::init();
+}
+
+void OSystem_PS3::initBackend() {
+ ConfMan.set("joystick_num", 0);
+ ConfMan.set("vkeybdpath", PREFIX "/data");
+ ConfMan.registerDefault("fullscreen", true);
+ ConfMan.registerDefault("aspect_ratio", true);
+
+ // Create the savefile manager
+ if (_savefileManager == 0)
+ _savefileManager = new DefaultSaveFileManager(PREFIX "/saves");
+
+ // Create the mixer manager
+ if (_mixer == 0) {
+ _mixerManager = new Sdl13MixerManager();
+
+ // Setup and start mixer
+ _mixerManager->init();
+ }
+
+ // Event source
+ if (_eventSource == 0)
+ _eventSource = new PS3SdlEventSource();
+
+ // Invoke parent implementation of this method
+ OSystem_SDL::initBackend();
+}
+
+Common::String OSystem_PS3::getDefaultConfigFileName() {
+ return PREFIX "/" + _baseConfigName;
+}
+
+Common::WriteStream *OSystem_PS3::createLogFile() {
+ Common::FSNode file(PREFIX "/scummvm.log");
+ return file.createWriteStream();
+}
diff --git a/backends/platform/sdl/ps3/ps3.h b/backends/platform/sdl/ps3/ps3.h
new file mode 100644
index 0000000000..daed7599a9
--- /dev/null
+++ b/backends/platform/sdl/ps3/ps3.h
@@ -0,0 +1,47 @@
+/* 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 PLATFORM_SDL_PS3_H
+#define PLATFORM_SDL_PS3_H
+
+#include "backends/platform/sdl/sdl.h"
+
+class OSystem_PS3 : public OSystem_SDL {
+public:
+ // Let the subclasses be able to change _baseConfigName in the constructor
+ OSystem_PS3(Common::String baseConfigName = "scummvm.ini");
+ virtual ~OSystem_PS3() {}
+
+ virtual void init();
+ virtual void initBackend();
+
+protected:
+ // Base string for creating the default path and filename
+ // for the configuration file
+ Common::String _baseConfigName;
+
+ virtual Common::String getDefaultConfigFileName();
+
+ virtual Common::WriteStream *createLogFile();
+};
+
+#endif
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
index 63bfc58617..ca3c586e03 100644
--- a/backends/platform/sdl/sdl-sys.h
+++ b/backends/platform/sdl/sdl-sys.h
@@ -27,7 +27,7 @@
// fashion, even on the Symbian port.
// Moreover, it contains a workaround for the fact that SDL_rwops.h uses
// a FILE pointer in one place, which conflicts with common/forbidden.h.
-
+// The SDL 1.3 headers also include strings.h
#include "common/scummsys.h"
@@ -39,6 +39,16 @@ typedef struct { int FAKE; } FAKE_FILE;
#define FILE FAKE_FILE
#endif
+#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp)
+#undef strcasecmp
+#define strcasecmp FAKE_strcasecmp
+#endif
+
+#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strncasecmp)
+#undef strncasecmp
+#define strncasecmp FAKE_strncasecmp
+#endif
+
#if defined(__SYMBIAN32__)
#include <esdl\SDL.h>
#else
@@ -51,4 +61,15 @@ typedef struct { int FAKE; } FAKE_FILE;
#define FILE FORBIDDEN_SYMBOL_REPLACEMENT
#endif
+#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strcasecmp)
+#undef strcasecmp
+#define strcasecmp FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_strncasecmp)
+#undef strncasecmp
+#define strncasecmp FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+
#endif
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 96d65c5eb2..d05cca4d1f 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -35,7 +35,14 @@
#include "common/textconsole.h"
#include "backends/saves/default/default-saves.h"
+
+// Audio CD support was removed with SDL 1.3
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+#include "backends/audiocd/default/default-audiocd.h"
+#else
#include "backends/audiocd/sdl/sdl-audiocd.h"
+#endif
+
#include "backends/events/sdl/sdl-events.h"
#include "backends/mutex/sdl/sdl-mutex.h"
#include "backends/timer/sdl/sdl-timer.h"
@@ -188,8 +195,15 @@ void OSystem_SDL::initBackend() {
_mixerManager->init();
}
- if (_audiocdManager == 0)
+ if (_audiocdManager == 0) {
+ // Audio CD support was removed with SDL 1.3
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+ _audiocdManager = new DefaultAudioCDManager();
+#else
_audiocdManager = new SdlAudioCDManager();
+#endif
+
+ }
// Setup a custom program icon.
setupIcon();
diff --git a/configure b/configure
index 8c89afae4c..0c0b34adc1 100755
--- a/configure
+++ b/configure
@@ -745,6 +745,7 @@ Special configuration feature:
n64 for Nintendo 64
openpandora for OpenPandora
ps2 for PlayStation 2
+ ps3 for PlayStation 3
psp for PlayStation Portable
samsungtv for Samsung TV
webos for HP Palm WebOS
@@ -1132,6 +1133,22 @@ ps2)
_host_cpu=mips64r5900el
_host_alias=ee
;;
+ps3)
+ _host_os=ps3
+ _host_cpu=ppc
+ _host_alias=powerpc64-ps3-elf
+
+ # The prefix is always the same on PS3 so we hardcode the default
+ # here. It is still possible to define a custom prefix which is
+ # needed when packaging the app with a user-specific app ID.
+ test "x$prefix" = xNONE && prefix=/dev_hdd0/game/SCUM12000/USRDIR
+ # PS3 apps are installed into app-specific directories. The
+ # default directory structure of ScummVM makes no sense here so we
+ # hardcode PS3 specific directories here.
+ datarootdir='${prefix}/data'
+ datadir='${datarootdir}'
+ docdir='${prefix}/doc'
+ ;;
psp)
_host_os=psp
_host_cpu=mipsallegrexel
@@ -1273,6 +1290,12 @@ ps2)
exit 1
fi
;;
+ps3)
+ if test -z "$PS3DEV"; then
+ echo "Please set PS3DEV in your environment. export PS3DEV=<path to ps3 toolchain>"
+ exit 1
+ fi
+ ;;
psp)
if test -z "$PSPDEV"; then
PSPDEV=`psp-config --pspdev-path`
@@ -1465,7 +1488,7 @@ if test "$have_gcc" = yes ; then
case $_host_os in
# newlib-based system include files suppress non-C89 function
# declarations under __STRICT_ANSI__
- amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | wii | wince )
+ amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | ps3 | wii | wince )
;;
*)
CXXFLAGS="$CXXFLAGS -ansi"
@@ -1854,6 +1877,16 @@ case $_host_os in
DEFINES="$DEFINES -D_EE"
DEFINES="$DEFINES -D__PLAYSTATION2__"
;;
+ ps3)
+ # Force use of SDL from the ps3 toolchain
+ _sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
+
+ DEFINES="$DEFINES -DPLAYSTATION3"
+ CXXFLAGS="$CXXFLAGS -mminimal-toc -I$PS3DEV/psl1ght/ppu/include -I$PS3DEV/portlibs/ppu/include"
+ LDFLAGS="$LDFLAGS -L$PS3DEV/psl1ght/ppu/lib -L$PS3DEV/portlibs/ppu/lib"
+ add_line_to_config_mk 'PLAYSTATION3 = 1'
+ add_line_to_config_h "#define PREFIX \"${prefix}\""
+ ;;
psp)
if test -d "$PSPDEV/psp/lib"; then
LDFLAGS="$LDFLAGS -L$PSPDEV/psp/lib"
@@ -2211,6 +2244,11 @@ if test -n "$_host"; then
CXXFLAGS="$CXXFLAGS -s"
fi
;;
+ ps3)
+ _mt32emu=no
+ _timidity=no
+ _vkeybd=yes
+ ;;
psp)
_backend="psp"
_build_scalers=no
@@ -2394,6 +2432,15 @@ case $_backend in
LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
DEFINES="$DEFINES -DSDL_BACKEND"
add_line_to_config_mk "SDL_BACKEND = 1"
+
+ _sdlversion=`$_sdlconfig --version`
+ case $_sdlversion in
+ 1.3.*)
+ add_line_to_config_mk "USE_SDL13 = 1"
+ ;;
+ *)
+ ;;
+ esac
;;
esac
@@ -2425,7 +2472,7 @@ esac
#
echo_n "Checking if host is POSIX compliant... "
case $_host_os in
- amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | psp | wii | wince)
+ amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince)
_posix=no
;;
android | beos* | bsd* | darwin* | freebsd* | gph-linux | haiku* | hpux* | iphone | irix* | linux* | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos)
@@ -3251,6 +3298,10 @@ fi
echo_n "Backend... "
echo_n "$_backend"
+if test "$_backend" = "sdl" -a -n "$_sdlversion"; then
+ echo_n " ($_sdlversion)"
+fi
+
if test "$_nasm" = yes ; then
echo_n ", assembly routines"
fi
diff --git a/dists/ps3/ICON0.PNG b/dists/ps3/ICON0.PNG
new file mode 100644
index 0000000000..e0dc9d7847
--- /dev/null
+++ b/dists/ps3/ICON0.PNG
Binary files differ
diff --git a/dists/ps3/PIC1.PNG b/dists/ps3/PIC1.PNG
new file mode 100644
index 0000000000..1fcdeb71fc
--- /dev/null
+++ b/dists/ps3/PIC1.PNG
Binary files differ
diff --git a/dists/ps3/readme-ps3.md b/dists/ps3/readme-ps3.md
new file mode 100644
index 0000000000..2fb393b4fb
--- /dev/null
+++ b/dists/ps3/readme-ps3.md
@@ -0,0 +1,49 @@
+Prerequisites
+=============
+- A homebrew enabled PlayStation 3 console. As of now that mostly means having a custom firmware installed. Obtaining and installing such a software is out of the scope of this document. Sorry, but you're on your own for that one.
+- At least one ScummVM supported game. The list of compatible games can be seen here: http://www.scummvm.org/compatibility/
+The page http://wiki.scummvm.org/index.php/Where_to_get_the_games references some places where those games can be bought. Demonstration versions for most of the supported games are downloadable on http://scummvm.org/demos/
+- An USB drive.
+
+Installing
+==========
+From a computer, download the installable package of the PS3 port from ScummVM's main site. It should be a .pkg file. Copy it to an USB drive.
+After having plugged the USB drive to you PS3, the installation package should appear in the XMB under the "Games > Install Package" menu. Installing it copies ScummVM and its dependencies to your PS3's hard drive. It also adds the "Games > PlayStation 3 > ScummVM" XMB entry which is to be used to launch ScummVM.
+
+Configuring and playing games
+=============================
+The user manual describes how to add games to ScummVM and launch them : http://wiki.scummvm.org/index.php/User_Manual
+
+PlayStation 3 Specifics
+=======================
+Games can be launched either from an USB drive or from the internal hard drive. The internal hard drive has better performance though.
+Savegames are wrote in the /hdd0/game/SCUM12000/saves folder.
+
+Joypad button mapping
+=====================
+- Left stick => Mouse
+- Cross => Left mouse button
+- Circle => Right mouse button
+- Triangle => Game menu (F5)
+- Square => Escape
+- Start => ScummVM's in global game menu
+- Select => Toggle virtual keyboard
+- L1 => AGI predictive input dialog
+
+Disclaimer
+==========
+Unauthorized distribution of an installable package with non freeware games included is a violation of the copyright law and is as such forbidden.
+
+Building from source
+====================
+This port of ScummVM to the PS3 is based on SDL. It uses the open source SDK PSL1GHT.
+
+The dependencies needed to build it are :
+
+- The toolchain from https://github.com/ps3dev/ps3toolchain
+- SDL from https://github.com/zeldin/SDL_PSL1GHT
+- ScummVM from https://github.com/scummvm/scummvm
+
+Once all the dependencies are correctly setup, an installable package can be obtained from source by issuing the following command :
+
+./configure --host=ps3 && make ps3pkg
diff --git a/dists/ps3/sfo.xml b/dists/ps3/sfo.xml
new file mode 100644
index 0000000000..657e1c1410
--- /dev/null
+++ b/dists/ps3/sfo.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" ?>
+<sfo>
+ <value name="ATTRIBUTE" type="integer">
+ 0
+ </value>
+ <value name="BOOTABLE" type="integer">
+ 1
+ </value>
+ <value name="CATEGORY" type="string">
+ HG
+ </value>
+ <value name="PARENTAL_LEVEL" type="integer">
+ 0
+ </value>
+ <value name="PS3_SYSTEM_VER" type="string">
+ 01.8000
+ </value>
+ <value name="RESOLUTION" type="integer">
+ 63
+ </value>
+ <value name="SOUND_FORMAT" type="integer">
+ 279
+ </value>
+ <value name="TITLE" type="string">
+ ScummVM
+ </value>
+ <value name="TITLE_ID" type="string">
+ SCUM12000
+ </value>
+ <value name="VERSION" type="string">
+ 01.00
+ </value>
+</sfo>
diff --git a/ports.mk b/ports.mk
index 15dc7e854b..eba8b686f2 100644
--- a/ports.mk
+++ b/ports.mk
@@ -211,6 +211,28 @@ ifdef DIST_FILES_ENGINEDATA
endif
cp $(DIST_FILES_DOCS) $(AOS4PATH)
+#
+# PlayStation 3 specific
+#
+ps3pkg: $(EXECUTABLE)
+ $(STRIP) $(EXECUTABLE)
+ sprxlinker $(EXECUTABLE)
+ mkdir -p ps3pkg/USRDIR/data/
+ mkdir -p ps3pkg/USRDIR/doc/
+ mkdir -p ps3pkg/USRDIR/saves/
+ make_self_npdrm "$(EXECUTABLE)" ps3pkg/USRDIR/EBOOT.BIN UP0001-SCUM12000_00-0000000000000000
+ cp $(DIST_FILES_THEMES) ps3pkg/USRDIR/data/
+ifdef DIST_FILES_ENGINEDATA
+ cp $(DIST_FILES_ENGINEDATA) ps3pkg/USRDIR/data/
+endif
+ cp $(DIST_FILES_DOCS) ps3pkg/USRDIR/doc/
+ cp dists/ps3/readme-ps3.md ps3pkg/USRDIR/doc/
+ cp $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip ps3pkg/USRDIR/data/
+ cp dists/ps3/ICON0.PNG ps3pkg/
+ cp dists/ps3/PIC1.PNG ps3pkg/
+ sfo.py -f dists/ps3/sfo.xml ps3pkg/PARAM.SFO
+ pkg.py --contentid UP0001-SCUM12000_00-0000000000000000 ps3pkg/ scummvm-ps3.pkg
+
# Mark special targets as phony
-.PHONY: deb bundle osxsnap win32dist install uninstall
+.PHONY: deb bundle osxsnap win32dist install uninstall ps3pkg