Skip to content

Commit

Permalink
SAMSUNGTV: Update port
Browse files Browse the repository at this point in the history
This combines the following Samsung TV port updates from master:

944e0be
dc1d077

It also includes the parts touching this backend of:

69b1485
2fa63ca
  • Loading branch information
aquadran authored and wjp committed May 24, 2011
1 parent 96519ad commit 48b4c6c
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 43 deletions.
4 changes: 0 additions & 4 deletions backends/base-backend.cpp
Expand Up @@ -61,12 +61,8 @@ void BaseBackend::fillScreen(uint32 col) {


#if defined(UNIX)
#if defined(SAMSUNGTV)
#define DEFAULT_CONFIG_FILE "/dtv/usb/sda1/.scummvmrc"
#else
#define DEFAULT_CONFIG_FILE ".scummvmrc"
#endif
#endif

#if !defined(UNIX)
#define DEFAULT_CONFIG_FILE "scummvm.ini"
Expand Down
58 changes: 58 additions & 0 deletions backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
@@ -0,0 +1,58 @@
/* 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/platform/samsungtv/samsungtv.h"
#include "backends/events/samsungtvsdl/samsungtvsdl-events.h"
#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h"

#if defined(SAMSUNGTV)

SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource)
: SdlGraphicsManager(sdlEventSource) {
}

bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) {
return
(f == OSystem::kFeatureAspectRatioCorrection) ||
(f == OSystem::kFeatureCursorHasPalette);
}

void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
SdlGraphicsManager::setFeatureState(f, enable);
break;
default:
break;
}
}

bool SamsungTVSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
return SdlGraphicsManager::getFeatureState(f);
default:
return false;
}
}

#endif
41 changes: 41 additions & 0 deletions backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
@@ -0,0 +1,41 @@
/* 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_GRAPHICS_SAMSUNGTV_H
#define BACKENDS_GRAPHICS_SAMSUNGTV_H

#if defined(SAMSUNGTV)

#include "backends/graphics/sdl/sdl-graphics.h"

class SamsungTVSdlGraphicsManager : public SdlGraphicsManager {
public:
SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource);

bool hasFeature(OSystem::Feature f);
void setFeatureState(OSystem::Feature f, bool enable);
bool getFeatureState(OSystem::Feature f);
};

#endif

#endif
1 change: 1 addition & 0 deletions backends/module.mk
Expand Up @@ -31,6 +31,7 @@ MODULE_OBJS := \
graphics/opengl/opengl-graphics.o \
graphics/openglsdl/openglsdl-graphics.o \
graphics/openpandora/op-graphics.o \
graphics/samsungtvsdl/samsungtvsdl-graphics.o \
graphics/sdl/sdl-graphics.o \
graphics/symbiansdl/symbiansdl-graphics.o \
graphics/wincesdl/wincesdl-graphics.o \
Expand Down
9 changes: 4 additions & 5 deletions backends/platform/samsungtv/main.cpp
Expand Up @@ -18,11 +18,10 @@
* 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$
*
*/

#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h

#include "backends/platform/samsungtv/samsungtv.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
Expand All @@ -39,7 +38,7 @@ extern "C" int Game_Main(char *path, char *) {
assert(g_system);

// Pre initialize the backend
((OSystem_SDL_SamsungTV *)g_system)->init();
((OSystem_POSIX *)g_system)->init();

#ifdef DYNAMIC_MODULES
PluginManager::instance().addPluginProvider(new SDLPluginProvider());
Expand All @@ -49,7 +48,7 @@ extern "C" int Game_Main(char *path, char *) {
int res = scummvm_main(0, 0);

// Free OSystem
delete g_system;
delete (OSystem_SDL_SamsungTV *)g_system;

return res;
}
Expand Down
39 changes: 13 additions & 26 deletions backends/platform/samsungtv/samsungtv.cpp
Expand Up @@ -18,53 +18,40 @@
* 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$
*
*/

#include "backends/platform/samsungtv/samsungtv.h"
#include "backends/events/samsungtvsdl/samsungtvsdl-events.h"
#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h"

#if defined(SAMSUNGTV)

OSystem_SDL_SamsungTV::OSystem_SDL_SamsungTV()
:
OSystem_POSIX("/dtv/usb/sda1/.scummvmrc") {
}

bool OSystem_SDL_SamsungTV::hasFeature(Feature f) {
return
(f == OSystem::kFeatureAspectRatioCorrection) ||
(f == OSystem::kFeatureCursorHasPalette);
OSystem_POSIX("/mtd_rwarea/.scummvmrc") {
}

void OSystem_SDL_SamsungTV::initBackend() {
// Create the events manager
if (_eventSource == 0)
_eventSource = new SamsungTVSdlEventSource();

if (_graphicsManager == 0)
_graphicsManager = new SamsungTVSdlGraphicsManager(_eventSource);

// Call parent implementation of this method
OSystem_SDL::initBackend();
OSystem_POSIX::initBackend();
}

void OSystem_SDL_SamsungTV::setFeatureState(Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
_graphicsManager->setFeatureState(f, enable);
break;
default:
break;
}
void OSystem_SDL_SamsungTV::quit() {
delete this;
}

bool OSystem_SDL_SamsungTV::getFeatureState(Feature f) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
return _graphicsManager->getFeatureState(f);
default:
return false;
}
void OSystem_SDL_SamsungTV::fatalError() {
delete this;
// FIXME
warning("fatal error");
for (;;) {}
}

#endif
13 changes: 6 additions & 7 deletions backends/platform/samsungtv/samsungtv.h
Expand Up @@ -18,25 +18,24 @@
* 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 PLATFORM_SDL_SAMSUNGTV_H
#define PLATFORM_SDL_SAMSUNGTV_H

#if defined(SAMSUNGTV)

#include "backends/platform/sdl/posix/posix.h"

class OSystem_SDL_SamsungTV : public OSystem_POSIX {
public:
OSystem_SDL_SamsungTV();

virtual void initBackend();

virtual bool hasFeature(Feature f);
virtual void setFeatureState(Feature f, bool enable);
virtual bool getFeatureState(Feature f);
virtual void quit();
virtual void fatalError();
};

#endif

#endif
1 change: 1 addition & 0 deletions backends/platform/sdl/main.cpp
Expand Up @@ -36,6 +36,7 @@
!defined(DINGUX) && \
!defined(CAANOO) && \
!defined(LINUXMOTO) && \
!defined(SAMSUNGTV) && \
!defined(OPENPANDORA)

#include "backends/platform/sdl/sdl.h"
Expand Down
3 changes: 3 additions & 0 deletions backends/platform/sdl/posix/posix.cpp
Expand Up @@ -81,6 +81,9 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
#else
logFile += "/.scummvm";
#endif
#ifdef SAMSUNGTV
logFile = "/mtd_ram";
#endif

struct stat sb;

Expand Down
2 changes: 1 addition & 1 deletion backends/saves/posix/posix-saves.cpp
Expand Up @@ -48,7 +48,7 @@
POSIXSaveFileManager::POSIXSaveFileManager() {
// Register default savepath based on HOME
#if defined(SAMSUNGTV)
ConfMan.registerDefault("savepath", "/dtv/usb/sda1/.scummvm");
ConfMan.registerDefault("savepath", "/mtd_wiselink/scummvm/savegames");
#else
Common::String savePath;
const char *home = getenv("HOME");
Expand Down

0 comments on commit 48b4c6c

Please sign in to comment.