diff options
| author | Matthew Hoops | 2011-05-11 00:30:02 -0400 | 
|---|---|---|
| committer | Matthew Hoops | 2011-05-11 00:30:28 -0400 | 
| commit | a1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch) | |
| tree | 8c51419daa486f1d4833757db4715dadab6c3497 /backends/platform | |
| parent | accb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff) | |
| parent | 33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff) | |
| download | scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2 scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip | |
Merge remote branch 'upstream/master' into t7g-ios
Conflicts:
	audio/decoders/qdm2.h
	common/util.cpp
	engines/groovie/music.cpp
	engines/groovie/resource.h
	video/qt_decoder.cpp
	video/qt_decoder.h
Diffstat (limited to 'backends/platform')
80 files changed, 1230 insertions, 506 deletions
| diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index bbfdb06b8d..b1d0727d1f 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -25,6 +25,23 @@  #if defined(__ANDROID__) +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +//   __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +//   __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <sys/time.h>  #include <sys/resource.h>  #include <sys/system_properties.h> @@ -32,6 +49,7 @@  #include <unistd.h>  #include "common/util.h" +#include "common/textconsole.h"  #include "common/rect.h"  #include "common/queue.h"  #include "common/mutex.h" diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 6eebdb97d9..109d252a99 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -31,6 +31,7 @@  #include "common/fs.h"  #include "common/archive.h"  #include "audio/mixer_intern.h" +#include "graphics/palette.h"  #include "graphics/surface.h"  #include "backends/base-backend.h"  #include "backends/plugins/posix/posix-provider.h" diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp index 8e95029894..7c21b35281 100644 --- a/backends/platform/android/asset-archive.cpp +++ b/backends/platform/android/asset-archive.cpp @@ -35,6 +35,7 @@  #include "common/util.h"  #include "common/archive.h"  #include "common/debug.h" +#include "common/textconsole.h"  #include "backends/platform/android/jni.h"  #include "backends/platform/android/asset-archive.h" diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp index 09466b4d2f..0d74e1c524 100644 --- a/backends/platform/android/events.cpp +++ b/backends/platform/android/events.cpp @@ -25,6 +25,23 @@  #if defined(__ANDROID__) +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +//   __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +//   __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include "common/events.h"  #include "backends/platform/android/android.h" @@ -444,8 +461,12 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,  		if (arg4 & JMETA_SHIFT)  			e.kbd.flags |= Common::KBD_SHIFT; -		if (arg4 & JMETA_ALT) -			e.kbd.flags |= Common::KBD_ALT; +		// JMETA_ALT is Fn on physical keyboards! +		// when mapping this to ALT - as we know it from PC keyboards - all +		// Fn combos will be broken (like Fn+q, which needs to end as 1 and +		// not ALT+1). Do not want. +		//if (arg4 & JMETA_ALT) +		//	e.kbd.flags |= Common::KBD_ALT;  		if (arg4 & (JMETA_SYM | JMETA_CTRL))  			e.kbd.flags |= Common::KBD_CTRL; diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 86232030ff..ebce58e291 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -25,6 +25,23 @@  #if defined(__ANDROID__) +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +//   __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +//   __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include "common/endian.h"  #include "graphics/conversion.h" @@ -628,13 +645,13 @@ void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) {  	GLTHREADCHECK;  	const Graphics::Surface *surface = _overlay_texture->surface_const(); -	assert(surface->bytesPerPixel == sizeof(buf[0])); +	assert(surface->format.bytesPerPixel == sizeof(buf[0]));  	const byte *src = (const byte *)surface->pixels;  	uint h = surface->h;  	do { -		memcpy(buf, src, surface->w * surface->bytesPerPixel); +		memcpy(buf, src, surface->w * surface->format.bytesPerPixel);  		src += surface->pitch;  		// This 'pitch' is pixels not bytes  		buf += pitch; diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp index 08a1491998..13aef11fa2 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -25,9 +25,28 @@  #if defined(__ANDROID__) +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +//   __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +//   __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include "base/main.h"  #include "base/version.h"  #include "common/config-manager.h" +#include "common/error.h" +#include "common/textconsole.h"  #include "engines/engine.h"  #include "backends/platform/android/android.h" diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java index 8bf40ac553..c4de6d62f8 100644 --- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java +++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java @@ -35,7 +35,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {  	private String[] _args; -	final private native void create(AssetManager _asset_manager, +	final private native void create(AssetManager asset_manager,  										EGL10 egl, EGLDisplay egl_display,  										AudioTrack audio_track,  										int sample_rate, int buffer_size); diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index a6b28ca485..c830676c07 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -25,6 +25,23 @@  #if defined(__ANDROID__) +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +//   __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +//   __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include "base/main.h"  #include "graphics/surface.h" @@ -147,7 +164,7 @@ void GLESBaseTexture::setLinearFilter(bool value) {  void GLESBaseTexture::allocBuffer(GLuint w, GLuint h) {  	_surface.w = w;  	_surface.h = h; -	_surface.bytesPerPixel = _pixelFormat.bytesPerPixel; +	_surface.format = _pixelFormat;  	if (w == _texture_width && h == _texture_height)  		return; @@ -241,14 +258,14 @@ void GLESTexture::allocBuffer(GLuint w, GLuint h) {  	delete[] _buf;  	delete[] _pixels; -	_pixels = new byte[w * h * _surface.bytesPerPixel]; +	_pixels = new byte[w * h * _surface.format.bytesPerPixel];  	assert(_pixels);  	_surface.pixels = _pixels;  	fillBuffer(0); -	_buf = new byte[w * h * _surface.bytesPerPixel]; +	_buf = new byte[w * h * _surface.format.bytesPerPixel];  	assert(_buf);  } @@ -257,10 +274,10 @@ void GLESTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h,  	setDirtyRect(Common::Rect(x, y, x + w, y + h));  	const byte *src = (const byte *)buf; -	byte *dst = _pixels + y * _surface.pitch + x * _surface.bytesPerPixel; +	byte *dst = _pixels + y * _surface.pitch + x * _surface.format.bytesPerPixel;  	do { -		memcpy(dst, src, w * _surface.bytesPerPixel); +		memcpy(dst, src, w * _surface.format.bytesPerPixel);  		dst += _surface.pitch;  		src += pitch_buf;  	} while (--h); @@ -301,10 +318,10 @@ void GLESTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {  			_tex = _buf;  			byte *src = _pixels + _dirty_rect.top * _surface.pitch + -						_dirty_rect.left * _surface.bytesPerPixel; +						_dirty_rect.left * _surface.format.bytesPerPixel;  			byte *dst = _buf; -			uint16 l = dwidth * _surface.bytesPerPixel; +			uint16 l = dwidth * _surface.format.bytesPerPixel;  			for (uint16 i = 0; i < dheight; ++i) {  				memcpy(dst, src, l); @@ -373,7 +390,7 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {  	GLESBaseTexture::allocBuffer(w, h); -	_surface.bytesPerPixel = 1; +	_surface.format = Graphics::PixelFormat::createFormatCLUT8();  	_surface.pitch = w;  	if (_surface.w == oldw && _surface.h == oldh) { diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile index 637f474b4b..11d9421a0a 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -65,7 +65,7 @@ ENABLE_TOUCHE = $(ENABLED)  ENABLE_TUCKER = $(ENABLED)  OBJS :=	dcmain.o time.o display.o audio.o input.o selector.o icon.o \ -	label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o +	label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o plugins.o  MODULE_DIRS += ./ diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp index e21a12fa33..a024b5d70d 100644 --- a/backends/platform/dc/dc-fs.cpp +++ b/backends/platform/dc/dc-fs.cpp @@ -22,6 +22,8 @@   * $Id$   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +  #include "dc.h"  #include "backends/fs/abstract-fs.h"  #include "backends/fs/stdiostream.h" diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 76c4b8cfd2..060eff2b48 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -26,11 +26,15 @@  #include "backends/base-backend.h"  #include <graphics/surface.h>  #include <graphics/colormasks.h> +#include <graphics/palette.h>  #include <ronin/soundcommon.h>  #include "backends/timer/default/default-timer.h"  #include "backends/audiocd/default/default-audiocd.h"  #include "backends/fs/fs-factory.h"  #include "audio/mixer_intern.h" +#ifdef DYNAMIC_MODULES +#include "backends/plugins/dynamic-plugin.h" +#endif  #define NUM_BUFFERS 4  #define SOUND_BUFFER_SHIFT 3 @@ -69,7 +73,11 @@ class DCCDManager : public DefaultAudioCDManager {    void updateCD();  }; -class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory { +class OSystem_Dreamcast : private DCHardware, public BaseBackend, public PaletteManager, public FilesystemFactory +#ifdef DYNAMIC_MODULES +  , public FilePluginProvider +#endif + {   public:    OSystem_Dreamcast(); @@ -250,6 +258,14 @@ public:    void logMessage(LogMessageType::Type type, const char *message);    Common::String getSystemLanguage() const; + +#ifdef DYNAMIC_MODULES +  class DCPlugin; + + protected: +  Plugin* createPlugin(const Common::FSNode &node) const; +  bool isPluginFilename(const Common::FSNode &node) const; +#endif  }; diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index bbd4f994f7..a3a1200178 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -23,6 +23,11 @@   *   */ +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <common/scummsys.h>  #include <engines/engine.h>  #include <base/main.h> @@ -33,7 +38,6 @@  #include <common/config-manager.h>  #include <common/memstream.h> -#include "backends/plugins/dc/dc-provider.h"  #include "audio/mixer_intern.h" @@ -336,7 +340,7 @@ int main()    g_system = &osys_dc;  #ifdef DYNAMIC_MODULES -  PluginManager::instance().addPluginProvider(new DCPluginProvider()); +  PluginManager::instance().addPluginProvider(&osys_dc);  #endif    scummvm_main(argc, argv); diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index b297022775..78fa2182dc 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -720,7 +720,7 @@ Graphics::Surface *OSystem_Dreamcast::lockScreen()    _framebuffer.w = _screen_w;    _framebuffer.h = _screen_h;    _framebuffer.pitch = SCREEN_W*2; -  _framebuffer.bytesPerPixel = (_screenFormat == 0? 1 : 2); +  _framebuffer.format = screenFormats[_screenFormat];    return &_framebuffer;  } diff --git a/backends/platform/dc/dreamcast.mk b/backends/platform/dc/dreamcast.mk index 8651a2936c..666e03eece 100644 --- a/backends/platform/dc/dreamcast.mk +++ b/backends/platform/dc/dreamcast.mk @@ -35,3 +35,7 @@ ip.txt : $(srcdir)/backends/platform/dc/ip.txt.in  	  ver="V$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)"; fi; \  	sed -e 's/[@]VERSION[@]/'"$$ver"/ -e 's/[@]DATE[@]/$(shell date '+%Y%m%d')/' < $< > $@ + +dcdist : dist +	mkdir -p dcdist/scummvm +	cp scummvm.elf SCUMMVM.BIN IP.BIN *.PLG dcdist/scummvm/ diff --git a/backends/platform/dc/module.mk b/backends/platform/dc/module.mk index c52ca1a474..9ab287c080 100644 --- a/backends/platform/dc/module.mk +++ b/backends/platform/dc/module.mk @@ -1,7 +1,7 @@  MODULE := backends/platform/dc  MODULE_OBJS :=	dcmain.o time.o display.o audio.o input.o selector.o icon.o \ -	label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o +	label.o vmsave.o softkbd.o dcloader.o cache.o dc-fs.o plugins.o  # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS.  MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp new file mode 100644 index 0000000000..44b8960513 --- /dev/null +++ b/backends/platform/dc/plugins.cpp @@ -0,0 +1,136 @@ +/* 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$ + * + */ + +#include "common/scummsys.h" + +#if defined(DYNAMIC_MODULES) + +#include "backends/plugins/dynamic-plugin.h" +#include "common/fs.h" + +#include "dcloader.h" + +extern void draw_solid_quad(float x1, float y1, float x2, float y2, +			    int c0, int c1, int c2, int c3); + +static void drawPluginProgress(const Common::String &filename) +{ +  ta_sync(); +  void *mark = ta_txmark(); +  const char *fn = filename.c_str(); +  Label lab1, lab2, lab3; +  char buf[32]; +  unsigned memleft = 0x8cf00000-((unsigned)sbrk(0)); +  float ffree = memleft*(1.0/(16<<20)); +  int fcol = (memleft < (1<<20)? 0xffff0000: +	      (memleft < (4<<20)? 0xffffff00: 0xff00ff00)); +  snprintf(buf, sizeof(buf), "%dK free memory", memleft>>10); +  if (fn[0] == '/') fn++; +  lab1.create_texture("Loading plugins, please wait..."); +  lab2.create_texture(fn); +  lab3.create_texture(buf); +  ta_begin_frame(); +  draw_solid_quad(80.0, 270.0, 560.0, 300.0, +		  0xff808080, 0xff808080, 0xff808080, 0xff808080); +  draw_solid_quad(85.0, 275.0, 555.0, 295.0,  +		  0xff202020, 0xff202020, 0xff202020, 0xff202020); +  draw_solid_quad(85.0, 275.0, 85.0+470.0*ffree, 295.0, +		  fcol, fcol, fcol, fcol); +  ta_commit_end(); +  lab1.draw(100.0, 150.0, 0xffffffff); +  lab2.draw(100.0, 190.0, 0xffaaffaa); +  lab3.draw(100.0, 230.0, 0xffffffff); +  ta_commit_frame(); +  ta_sync(); +  ta_txrelease(mark); +} + + +class OSystem_Dreamcast::DCPlugin : public DynamicPlugin { +protected: +	void *_dlHandle; + +	virtual VoidFunc findSymbol(const char *symbol) { +		void *func = dlsym(_dlHandle, symbol); +		if (!func) +			warning("Failed loading symbol '%s' from plugin '%s' (%s)", symbol, _filename.c_str(), dlerror()); + +		// FIXME HACK: This is a HACK to circumvent a clash between the ISO C++ +		// standard and POSIX: ISO C++ disallows casting between function pointers +		// and data pointers, but dlsym always returns a void pointer. For details, +		// see e.g. <http://www.trilithium.com/johan/2004/12/problem-with-dlsym/>. +		assert(sizeof(VoidFunc) == sizeof(func)); +		VoidFunc tmp; +		memcpy(&tmp, &func, sizeof(VoidFunc)); +		return tmp; +	} + +public: +	DCPlugin(const Common::String &filename) +		: DynamicPlugin(filename), _dlHandle(0) {} + +	bool loadPlugin() { +		assert(!_dlHandle); +		drawPluginProgress(_filename); +		_dlHandle = dlopen(_filename.c_str(), RTLD_LAZY); + +		if (!_dlHandle) { +			warning("Failed loading plugin '%s' (%s)", _filename.c_str(), dlerror()); +			return false; +		} + +		bool ret = DynamicPlugin::loadPlugin(); + +		if (ret) +			dlforgetsyms(_dlHandle); + +		return ret; +	} + +	void unloadPlugin() { +		DynamicPlugin::unloadPlugin(); +		if (_dlHandle) { +			if (dlclose(_dlHandle) != 0) +				warning("Failed unloading plugin '%s' (%s)", _filename.c_str(), dlerror()); +			_dlHandle = 0; +		} +	} +}; + + +Plugin* OSystem_Dreamcast::createPlugin(const Common::FSNode &node) const { +	return new DCPlugin(node.getPath()); +} + +bool OSystem_Dreamcast::isPluginFilename(const Common::FSNode &node) const { +	// Check the plugin suffix +	Common::String filename = node.getName(); +	if (!filename.hasSuffix(".PLG")) +		return false; + +	return true; +} + +#endif // defined(DYNAMIC_MODULES) diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp index 8fd12d66bf..77f34394a1 100644 --- a/backends/platform/dc/selector.cpp +++ b/backends/platform/dc/selector.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_chdir +  #include <common/scummsys.h>  #include <engines/engine.h>  #include <engines/metaengine.h> diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp index 6c8289684f..63e345efbe 100644 --- a/backends/platform/dc/vmsave.cpp +++ b/backends/platform/dc/vmsave.cpp @@ -23,6 +23,11 @@   *   */ +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf +  #include <common/scummsys.h>  #include "engines/engine.h"  #include "dc.h" diff --git a/backends/platform/dingux/main.cpp b/backends/platform/dingux/main.cpp index c5dccc5f50..cf25e1cb42 100644 --- a/backends/platform/dingux/main.cpp +++ b/backends/platform/dingux/main.cpp @@ -30,8 +30,6 @@  #if defined(DINGUX) -#include <unistd.h> -  int main(int argc, char* argv[]) {  	g_system = new OSystem_SDL_Dingux(); diff --git a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c index 7f0757ef53..698590418c 100644 --- a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c +++ b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c @@ -18,6 +18,9 @@  //---------------------------------------------------------------  // Includes +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +  #include "gba_nds_fat.h"  #include "disc_io.h"  #include <string.h> diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 3ad92b4355..462990cb32 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -20,6 +20,9 @@   */ +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +  #include "common/scummsys.h"  #include "common/system.h" @@ -243,7 +246,7 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) {  }  bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) { -	surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); +	surf->create(DS::getGameWidth(), DS::getGameHeight(), Graphics::PixelFormat::createFormatCLUT8());  	// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing @@ -259,13 +262,13 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) {  	return true;  } -void OSystem_DS::grabPalette(unsigned char *colours, uint start, uint num) { +void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {  //	consolePrintf("Grabpalette");  	for (unsigned int r = start; r < start + num; r++) { -		*colours++ = (BG_PALETTE[r] & 0x001F) << 3; -		*colours++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3; -		*colours++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3; +		*colors++ = (BG_PALETTE[r] & 0x001F) << 3; +		*colors++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3; +		*colors++ = (BG_PALETTE[r] & 0x7C00) >> 10 << 3;  	}  } @@ -756,7 +759,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() {  		_framebuffer.w = DS::getGameWidth();  		_framebuffer.h = DS::getGameHeight();  		_framebuffer.pitch = DS::getGameWidth(); -		_framebuffer.bytesPerPixel = 1; +		_framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();  	} else { @@ -781,7 +784,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() {  		_framebuffer.w = width;  		_framebuffer.h = height;  		_framebuffer.pitch = width; -		_framebuffer.bytesPerPixel = 1; +		_framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();  	} @@ -849,16 +852,16 @@ Common::WriteStream *OSystem_DS::createConfigWriteStream() {  	return file.createWriteStream();  } -u16 OSystem_DS::applyGamma(u16 colour) { +u16 OSystem_DS::applyGamma(u16 color) {  	// Attempt to do gamma correction (or something like it) to palette entries  	// to improve the contrast of the image on the original DS screen. -	// Split the colour into it's component channels -	int r = colour & 0x001F; -	int g = (colour & 0x03E0) >> 5; -	int b = (colour & 0x7C00) >> 10; +	// Split the color into it's component channels +	int r = color & 0x001F; +	int g = (color & 0x03E0) >> 5; +	int b = (color & 0x7C00) >> 10; -	// Caluclate the scaling factor for this colour based on it's brightness +	// Caluclate the scaling factor for this color based on it's brightness  	int scale = ((23 - ((r + g + b) >> 2)) * _gammaValue) >> 3;  	// Scale the three components by the scaling factor, with clamping @@ -871,7 +874,7 @@ u16 OSystem_DS::applyGamma(u16 colour) {  	b = b + ((b * scale) >> 4);  	if (b > 31) b = 31; -	// Stick them back together into a 555 colour value +	// Stick them back together into a 555 color value  	return 0x8000 | r | (g << 5) | (b << 10);  } diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index 7feed7541f..b745b4dc6e 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -36,6 +36,7 @@  #include "audio/mixer_intern.h"  #include "graphics/surface.h"  #include "graphics/colormasks.h" +#include "graphics/palette.h"  class OSystem_DS : public BaseBackend, public PaletteManager {  protected: @@ -183,7 +184,7 @@ public:  	Common::WriteStream *createConfigWriteStream();  	Common::SeekableReadStream *createConfigReadStream(); -	u16 applyGamma(u16 colour); +	u16 applyGamma(u16 color);  	void setGammaValue(int gamma) { _gammaValue = gamma; }  	void engineDone(); diff --git a/backends/platform/ds/ds.mk b/backends/platform/ds/ds.mk index a9ed3e0096..654475e1f3 100644 --- a/backends/platform/ds/ds.mk +++ b/backends/platform/ds/ds.mk @@ -170,10 +170,10 @@ dsclean:  # HACK/FIXME: C compiler, for cartreset.c -- we should switch this to use CXX  # as soon as possible. -CC := $(DEVKITARM)/bin/arm-eabi-gcc +CC := $(DEVKITPRO)/devkitARM/bin/arm-eabi-gcc  # HACK/TODO: Pointer to objcopy. This should really be set by configure -OBJCOPY := $(DEVKITARM)/bin/arm-eabi-objcopy +OBJCOPY := $(DEVKITPRO)/devkitARM/bin/arm-eabi-objcopy  #  # Set various flags diff --git a/backends/platform/ds/makefile b/backends/platform/ds/makefile index 58d6fd4c02..e24a36ef81 100644 --- a/backends/platform/ds/makefile +++ b/backends/platform/ds/makefile @@ -3,7 +3,7 @@ -export PATH	:=	$(DEVKITARM)/bin:$(PATH) +export PATH	:=	$(DEVKITPRO)/devkitARM/bin:$(PATH)  export portdir = $(CURDIR)/arm9  export srcdir = $(CURDIR)/../../.. diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp index 0432974246..375ee37378 100644 --- a/backends/platform/gph/gph-backend.cpp +++ b/backends/platform/gph/gph-backend.cpp @@ -26,23 +26,23 @@  #include "backends/platform/sdl/sdl-sys.h"  // #include "backends/platform/gph/gph-options.h" -#include "backends/platform/gph/gph-sdl.h" +#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"  #include "backends/platform/gph/gph-hw.h" +#include "backends/platform/gph/gph-sdl.h"  #include "backends/plugins/posix/posix-provider.h" +#include "backends/saves/default/default-saves.h" +#include "backends/timer/default/default-timer.h" +  #include "base/main.h"  #include "common/archive.h"  #include "common/config-manager.h"  #include "common/debug.h"  #include "common/events.h" -#include "common/util.h" -  #include "common/file.h" -#include "base/main.h" - -#include "backends/saves/default/default-saves.h" +#include "common/textconsole.h" +#include "common/util.h" -#include "backends/timer/default/default-timer.h"  #include "audio/mixer_intern.h"  #include <stdio.h> @@ -67,6 +67,14 @@ void OSystem_GPH::initBackend() {  		_graphicsManager = new GPHGraphicsManager(_eventSource);  	} +	// Create the mixer manager +	if (_mixer == 0) { +		_mixerManager = new DoubleBufferSDLMixerManager(); + +		// Setup and start mixer +		_mixerManager->init(); +	} +  	/* Setup default save path to be workingdir/saves */  	char savePath[PATH_MAX+1]; diff --git a/backends/platform/gph/gph-sdl.h b/backends/platform/gph/gph-sdl.h index 51c609d29e..68a641eed7 100644 --- a/backends/platform/gph/gph-sdl.h +++ b/backends/platform/gph/gph-sdl.h @@ -32,7 +32,6 @@  #include "backends/events/gph/gph-events.h"  #define __GP2XWIZ__ -#define MIXER_DOUBLE_BUFFERING 1  #ifndef PATH_MAX  	#define PATH_MAX 255 diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h index 5e88510980..79f596632f 100644 --- a/backends/platform/iphone/osys_main.h +++ b/backends/platform/iphone/osys_main.h @@ -30,6 +30,7 @@  #include "audio/mixer_intern.h"  #include "backends/fs/posix/posix-fs-factory.h"  #include "graphics/colormasks.h" +#include "graphics/palette.h"  #include <AudioToolbox/AudioQueue.h> @@ -81,7 +82,7 @@ protected:  	bool _mouseVisible;  	byte *_mouseBuf; -	byte _mouseKeyColour; +	byte _mouseKeyColor;  	uint _mouseWidth, _mouseHeight;  	uint _mouseX, _mouseY;  	int _mouseHotspotX, _mouseHotspotY; diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp index d67d38932a..a10efeff40 100644 --- a/backends/platform/iphone/osys_video.cpp +++ b/backends/platform/iphone/osys_video.cpp @@ -312,7 +312,7 @@ void OSystem_IPHONE::drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect  		uint16 *dst = &_fullscreen[top * _screenWidth + left];  		for (int y = displayHeight; y > srcY; y--) {  			for (int x = displayWidth; x > srcX; x--) { -				if (*src != _mouseKeyColour) +				if (*src != _mouseKeyColor)  					*dst = _palette[*src];  				dst++;  				src++; @@ -334,7 +334,7 @@ Graphics::Surface *OSystem_IPHONE::lockScreen() {  	_framebuffer.w = _screenWidth;  	_framebuffer.h = _screenHeight;  	_framebuffer.pitch = _screenWidth; -	_framebuffer.bytesPerPixel = 1; +	_framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();  	return &_framebuffer;  } @@ -497,7 +497,7 @@ void OSystem_IPHONE::setMouseCursor(const byte *buf, uint w, uint h, int hotspot  	_mouseHotspotX = hotspotX;  	_mouseHotspotY = hotspotY; -	_mouseKeyColour = (byte)keycolor; +	_mouseKeyColor = (byte)keycolor;  	memcpy(_mouseBuf, buf, w * h); diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index 2daa41a9f6..b9acb7c76c 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -37,6 +37,7 @@  #include "graphics/surface.h"  #include "graphics/colormasks.h" +#include "graphics/palette.h"  #include "graphics/pixelformat.h"  #include "audio/mixer_intern.h" @@ -128,7 +129,7 @@ protected:  	volatile int _mouseMaxX, _mouseMaxY;  	int _mouseHotspotX, _mouseHotspotY; -	uint8 _controllerPort; +	int8 _controllerPort;  	int8 _mousePort;  	bool _controllerHasRumble; // Gets enabled if rumble-pak is detected diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index 54eab0fd52..ae8d23d3e2 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -32,6 +32,8 @@  #include "framfs_save_manager.h"  #include "backends/fs/n64/n64-fs-factory.h" +typedef unsigned long long uint64; +  extern uint8 _romfs; // Defined by linker (used to calculate position of romfs image)  inline uint16 colRGB888toBGR555(byte r, byte g, byte b); @@ -90,9 +92,9 @@ OSystem_N64::OSystem_N64() {  	_shakeOffset = 0;  	// Allocate memory for offscreen buffers -	_offscreen_hic = (uint16*)memalign(8, _screenWidth * _screenHeight * 2); -	_offscreen_pal = (uint8*)memalign(8, _screenWidth * _screenHeight); -	_overlayBuffer = (uint16*)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor)); +	_offscreen_hic = (uint16 *)memalign(8, _screenWidth * _screenHeight * 2); +	_offscreen_pal = (uint8 *)memalign(8, _screenWidth * _screenHeight); +	_overlayBuffer = (uint16 *)memalign(8, _overlayWidth * _overlayHeight * sizeof(OverlayColor));  	_cursor_pal = NULL;  	_cursor_hic = NULL; @@ -111,9 +113,9 @@ OSystem_N64::OSystem_N64() {  	_graphicMode = OVERS_NTSC_340X240;  	// Clear palette array -	_screenPalette = (uint16*)memalign(8, 256 * sizeof(uint16)); +	_screenPalette = (uint16 *)memalign(8, 256 * sizeof(uint16));  #ifndef N64_EXTREME_MEMORY_SAVING -	_screenExactPalette = (uint8*)memalign(8, 256 * 3); +	_screenExactPalette = (uint8 *)memalign(8, 256 * 3);  	memset(_screenExactPalette, 0, 256 * 3);  #endif  	memset(_screenPalette, 0, 256 * sizeof(uint16)); @@ -125,7 +127,7 @@ OSystem_N64::OSystem_N64() {  	_audioEnabled = false;  	// Initialize ROMFS access interface -	initRomFSmanager((uint8*)(((uint32)&_romfs + (uint32)0xc00) | (uint32)0xB0000000)); +	initRomFSmanager((uint8 *)(((uint32)&_romfs + (uint32)0xc00) | (uint32)0xB0000000));  	_mouseVisible = false; @@ -374,7 +376,7 @@ void OSystem_N64::rebuildOffscreenGameBuffer(void) {  	for (int h = 0; h < _gameHeight; h++) {  		for (int w = 0; w < _gameWidth; w += 4) { -			four_col_pal = *(uint32*)(_offscreen_pal + ((h * _screenWidth) + w)); +			four_col_pal = *(uint32 *)(_offscreen_pal + ((h * _screenWidth) + w));  			four_col_hi = 0;  			four_col_hi |= (uint64)_screenPalette[((four_col_pal >> 24) & 0xFF)] << 48; @@ -383,7 +385,7 @@ void OSystem_N64::rebuildOffscreenGameBuffer(void) {  			four_col_hi |= (uint64)_screenPalette[((four_col_pal >>  0) & 0xFF)] <<  0;  			// Save the converted pixels into hicolor buffer -			*(uint64*)((_offscreen_hic) + (h * _screenWidth) + w) = four_col_hi; +			*(uint64 *)((_offscreen_hic) + (h * _screenWidth) + w) = four_col_hi;  		}  	}  } @@ -520,7 +522,7 @@ void OSystem_N64::updateScreen() {  	// Obtain the framebuffer  	while (!(_dc = lockDisplay())); -	uint16 *overlay_framebuffer = (uint16*)_dc->conf.framebuffer; // Current screen framebuffer +	uint16 *overlay_framebuffer = (uint16 *)_dc->conf.framebuffer; // Current screen framebuffer  	uint16 *game_framebuffer = overlay_framebuffer + (_frameBufferWidth * skip_lines * 2); // Skip some lines to center the image vertically  	uint16 currentHeight, currentWidth; @@ -532,8 +534,8 @@ void OSystem_N64::updateScreen() {  		tmpDst = game_framebuffer;  		tmpSrc = _offscreen_hic + (_shakeOffset * _screenWidth);  		for (currentHeight = _shakeOffset; currentHeight < _gameHeight; currentHeight++) { -			uint64 *game_dest = (uint64*)(tmpDst + skip_pixels + _offscrPixels); -			uint64 *game_src = (uint64*)tmpSrc; +			uint64 *game_dest = (uint64 *)(tmpDst + skip_pixels + _offscrPixels); +			uint64 *game_src = (uint64 *)tmpSrc;  			// With uint64 we copy 4 pixels at a time  			for (currentWidth = 0; currentWidth < _gameWidth; currentWidth += 4) { @@ -552,8 +554,8 @@ void OSystem_N64::updateScreen() {  		tmpDst = overlay_framebuffer;  		tmpSrc = _overlayBuffer;  		for (currentHeight = 0; currentHeight < _overlayHeight; currentHeight++) { -			uint64 *over_dest = (uint64*)(tmpDst + _offscrPixels); -			uint64 *over_src = (uint64*)tmpSrc; +			uint64 *over_dest = (uint64 *)(tmpDst + _offscrPixels); +			uint64 *over_src = (uint64 *)tmpSrc;  			// Copy 4 pixels at a time  			for (currentWidth = 0; currentWidth < _overlayWidth; currentWidth += 4) { @@ -610,7 +612,7 @@ Graphics::Surface *OSystem_N64::lockScreen() {  	_framebuffer.w = _gameWidth;  	_framebuffer.h = _gameHeight;  	_framebuffer.pitch = _screenWidth; -	_framebuffer.bytesPerPixel = 1; +	_framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();  	return &_framebuffer;  } @@ -790,8 +792,8 @@ void OSystem_N64::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,  	}  	if (!_cursor_pal) { -		_cursor_pal = (uint8*)malloc(w * h); -		_cursor_hic = (uint16*)malloc(w * h * sizeof(uint16)); +		_cursor_pal = (uint8 *)malloc(w * h); +		_cursor_hic = (uint16 *)malloc(w * h * sizeof(uint16));  	}  	_cursorWidth = w; @@ -907,10 +909,10 @@ void OSystem_N64::setupMixer(void) {  /* Check all controller ports for a compatible input adapter. */  void OSystem_N64::detectControllers(void) { -	controller_data_status *ctrl_status = (controller_data_status*)memalign(8, sizeof(controller_data_status)); +	controller_data_status *ctrl_status = (controller_data_status *)memalign(8, sizeof(controller_data_status));  	controller_Read_Status(ctrl_status); -	_controllerPort = 0; // Use first controller as default +	_controllerPort = -1; // Default no controller  	_mousePort = -1; // Default no mouse  	for (int8 ctrl_port = 3; ctrl_port >= 0; ctrl_port--) {  		// Found a standard pad, use this by default. diff --git a/backends/platform/n64/osys_n64_events.cpp b/backends/platform/n64/osys_n64_events.cpp index 22b9addbfb..69c854750c 100644 --- a/backends/platform/n64/osys_n64_events.cpp +++ b/backends/platform/n64/osys_n64_events.cpp @@ -94,8 +94,13 @@ void OSystem_N64::readControllerAnalogInput(void) {  	// Read current controller status  	controller_Read_Buttons(&_ctrlData); -	pad_analogX = (_ctrlData.c[_controllerPort].throttle >> 8) & 0xFF; -	pad_analogY = (_ctrlData.c[_controllerPort].throttle >> 0) & 0xFF; +	pad_analogX = 0; +	pad_analogY = 0; + +	if (_controllerPort >= 0) { +		pad_analogX = (_ctrlData.c[_controllerPort].throttle >> 8) & 0xFF; +		pad_analogY = (_ctrlData.c[_controllerPort].throttle >> 0) & 0xFF; +	}  	pad_mouseX = 0;  	pad_mouseY = 0; @@ -157,9 +162,11 @@ bool OSystem_N64::pollEvent(Common::Event &event) {  	static uint16 oldButtons = 0; // old button data... used for button press/release  	static uint16 oldMouseButtons = 0; -	uint16 newButtons = _ctrlData.c[_controllerPort].buttons; // Read from controller +	uint16 newButtons = 0; +	if (_controllerPort >= 0) +		newButtons = _ctrlData.c[_controllerPort].buttons; // Read from controller +	  	uint16 newMouseButtons = 0; -  	if (_mousePort >= 0)  		newMouseButtons = _ctrlData.c[_mousePort].buttons; diff --git a/backends/platform/n64/pad_rom.sh b/backends/platform/n64/pad_rom.sh index 085203306f..085203306f 100644..100755 --- a/backends/platform/n64/pad_rom.sh +++ b/backends/platform/n64/pad_rom.sh diff --git a/backends/platform/openpandora/op-backend.cpp b/backends/platform/openpandora/op-backend.cpp index 5b333929c9..4c29636e40 100644 --- a/backends/platform/openpandora/op-backend.cpp +++ b/backends/platform/openpandora/op-backend.cpp @@ -26,20 +26,17 @@  #include "backends/platform/openpandora/op-sdl.h"  #include "base/main.h" +#include "backends/mixer/doublebuffersdl/doublebuffersdl-mixer.h"  #include "backends/saves/default/default-saves.h" +#include "backends/timer/default/default-timer.h"  #include "common/archive.h"  #include "common/config-manager.h"  #include "common/debug.h"  #include "common/events.h" -#include "common/util.h" -  #include "common/file.h" -#include "base/main.h" - -#include "backends/saves/default/default-saves.h" +#include "common/util.h" -#include "backends/timer/default/default-timer.h"  #include "audio/mixer_intern.h"  #include <stdio.h> @@ -78,6 +75,14 @@ void OSystem_OP::initBackend() {  //	}  // +	// Create the mixer manager +	if (_mixer == 0) { +		_mixerManager = new DoubleBufferSDLMixerManager(); + +		// Setup and start mixer +		_mixerManager->init(); +	} +  	/* Setup default save path to be workingdir/saves */  	char savePath[PATH_MAX+1]; diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h index 93c82ca397..9d92472b17 100644 --- a/backends/platform/openpandora/op-sdl.h +++ b/backends/platform/openpandora/op-sdl.h @@ -32,7 +32,6 @@  #include "backends/graphics/openpandora/op-graphics.h"  #define __OPENPANDORA__ -#define MIXER_DOUBLE_BUFFERING 1  #ifndef PATH_MAX  	#define PATH_MAX 255 diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index a460b919fd..c228a12b26 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include "Gs2dScreen.h"  #include <kernel.h>  #include <malloc.h> @@ -398,7 +400,7 @@ Graphics::Surface *Gs2dScreen::lockScreen() {  	_framebuffer.w = _width;  	_framebuffer.h = _height;  	_framebuffer.pitch = _width; // -not- _pitch; ! It's EE mem, not Tex -	_framebuffer.bytesPerPixel = 1; +	_framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();  	return &_framebuffer;  } @@ -441,7 +443,7 @@ void Gs2dScreen::grabPalette(uint8 *pal, uint8 start, uint16 num) {  void Gs2dScreen::grabScreen(Graphics::Surface *surf) {  	assert(surf);  	WaitSema(g_DmacSema); -	surf->create(_width, _height, 1); +	surf->create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());  	memcpy(surf->pixels, _screenBuf, _width * _height);  	SignalSema(g_DmacSema);  } diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h index 358e717cbe..6e842b3f55 100644 --- a/backends/platform/ps2/Gs2dScreen.h +++ b/backends/platform/ps2/Gs2dScreen.h @@ -46,7 +46,7 @@ enum GsInterlace {  namespace Graphics { -	struct Surface; +struct Surface;  }  class Gs2dScreen { diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp index 5ab7823e63..cc23df6575 100644 --- a/backends/platform/ps2/irxboot.cpp +++ b/backends/platform/ps2/irxboot.cpp @@ -73,7 +73,7 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath) {  	PS2Device device = _getDev(elfPath); -	printf("elf path: %s, device %d\n", elfPath, device); +	sioprintf("elf path: %s, device %d\n", elfPath, device);  	strcpy(bootPath, elfPath); diff --git a/backends/platform/ps2/ps2input.cpp b/backends/platform/ps2/ps2input.cpp index 964a773f7e..6da21172ad 100644 --- a/backends/platform/ps2/ps2input.cpp +++ b/backends/platform/ps2/ps2input.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <kernel.h>  #include <malloc.h>  #include <assert.h> diff --git a/backends/platform/ps2/ps2input.h b/backends/platform/ps2/ps2input.h index 266f408809..eca5950113 100644 --- a/backends/platform/ps2/ps2input.h +++ b/backends/platform/ps2/ps2input.h @@ -32,6 +32,10 @@  class OSystem_PS2;  class Ps2Pad; +namespace Common { +struct Event; +} +  class Ps2Input {  public:  	Ps2Input(OSystem_PS2 *system, bool mouseLoaded, bool kbdLoaded); diff --git a/backends/platform/ps2/ps2mutex.cpp b/backends/platform/ps2/ps2mutex.cpp index fe76202f32..974cf00f56 100644 --- a/backends/platform/ps2/ps2mutex.cpp +++ b/backends/platform/ps2/ps2mutex.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include "backends/platform/ps2/systemps2.h"  void OSystem_PS2::initMutexes(void) { diff --git a/backends/platform/ps2/ps2pad.cpp b/backends/platform/ps2/ps2pad.cpp index 3d285eedd5..090a5f2a35 100644 --- a/backends/platform/ps2/ps2pad.cpp +++ b/backends/platform/ps2/ps2pad.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <kernel.h>  #include <malloc.h>  #include <assert.h> diff --git a/backends/platform/ps2/ps2time.cpp b/backends/platform/ps2/ps2time.cpp index 4da8420478..4c682cb9f2 100644 --- a/backends/platform/ps2/ps2time.cpp +++ b/backends/platform/ps2/ps2time.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +  #include "backends/platform/ps2/systemps2.h"  #include "backends/platform/ps2/ps2debug.h"  #include "eecodyvdfs.h" diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp index a4b3ddb971..459920c34a 100644 --- a/backends/platform/ps2/savefilemgr.cpp +++ b/backends/platform/ps2/savefilemgr.cpp @@ -23,6 +23,10 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +  #include "common/config-manager.h"  #include "common/zlib.h" diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 77de74eb5b..aed2378faf 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -568,6 +568,11 @@ void OSystem_PS2::updateScreen(void) {  	_screen->updateScreen();  } +void OSystem_PS2::displayMessageOnOSD(const char *msg) { +	/* TODO : check */ +	printf("displayMessageOnOSD: %s\n", msg); +} +  uint32 OSystem_PS2::getMillis(void) {  	return msecCount;  } @@ -727,7 +732,7 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) {  	int maxWidth = 0;  	Graphics::Surface surf; -	surf.create(300, 200, 1); +	surf.create(300, 200, Graphics::PixelFormat::createFormatCLUT8());  	char *lnSta = resStr;  	while (*lnSta && (posY < 180)) { diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 37575f399f..26e3105cd9 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -28,6 +28,7 @@  #include "common/system.h"  #include "backends/base-backend.h" +#include "graphics/palette.h"  class DefaultTimerManager;  class DefaultSaveFileManager; @@ -47,11 +48,11 @@ struct Ps2Mutex {  };  namespace Common { -	class TimerManager; +class TimerManager;  };  namespace Audio { -	class MixerImpl; +class MixerImpl;  };  class OSystem_PS2 : public BaseBackend, public PaletteManager { @@ -78,9 +79,7 @@ public:  	virtual Graphics::Surface *lockScreen();  	virtual void unlockScreen();  	virtual void updateScreen(); -	/* TODO : check */ -	virtual void displayMessageOnOSD(const char *msg) { printf("displayMessageOnOSD: %s\n", msg); }; -	/* */ +	virtual void displayMessageOnOSD(const char *msg);  	virtual void showOverlay();  	virtual void hideOverlay(); diff --git a/backends/platform/psp/README.PSP b/backends/platform/psp/README.PSP index b520022033..dcfa30898c 100644 --- a/backends/platform/psp/README.PSP +++ b/backends/platform/psp/README.PSP @@ -1,4 +1,4 @@ -ScummVM-PSP 1.3.0git README +ScummVM-PSP 1.4.0git README  ==============================================================================  Installation diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp index cf879e095a..420b0398c3 100644 --- a/backends/platform/psp/cursor.cpp +++ b/backends/platform/psp/cursor.cpp @@ -327,8 +327,20 @@ inline void Cursor::setRendererModePalettized(bool palettized) {  		_renderer.setAlphaReverse(false);  		_renderer.setColorTest(false);  	} else {			// 16 bits, no palette +		// Color test is an easy way for the hardware to make our keycolor  +		// transparent. +		_renderer.setColorTest(true);	 +		 +		// Alpha blending is not strictly required, but makes the cursor look +		// much better  		_renderer.setAlphaBlending(true); -		_renderer.setAlphaReverse(true); // We can't change all alpha values, so just reverse -		_renderer.setColorTest(true);	// Color test to make our key color transparent +		 +		// Pixel formats without alpha (5650) are considered to have their alpha set. +		// Since pixel formats with alpha don't have their alpha bits set, we reverse +		// the alpha format for them so that 0 alpha is 1. +		if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650)  +			_renderer.setAlphaReverse(true); +		else +			_renderer.setAlphaReverse(false);  	}  } diff --git a/backends/platform/psp/default_display_client.cpp b/backends/platform/psp/default_display_client.cpp index bb42406c3e..34b1a70711 100644 --- a/backends/platform/psp/default_display_client.cpp +++ b/backends/platform/psp/default_display_client.cpp @@ -199,7 +199,7 @@ Graphics::Surface *Screen::lockAndGetForEditing() {  	_frameBuffer.w = _buffer.getSourceWidth();  	_frameBuffer.h = _buffer.getSourceHeight();  	_frameBuffer.pitch = _buffer.getBytesPerPixel() * _buffer.getWidth(); -	_frameBuffer.bytesPerPixel = _buffer.getBytesPerPixel(); +	_frameBuffer.format = _pixelFormat;  	// We'll set to dirty once we unlock the screen  	return &_frameBuffer; diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp index 76b4a28e4a..d43e876a17 100644 --- a/backends/platform/psp/display_client.cpp +++ b/backends/platform/psp/display_client.cpp @@ -23,6 +23,20 @@   *   */ +// Disable printf override in common/forbidden.h to avoid +// clashes with pspdebug.h from the PSP SDK. +// That header file uses +//   __attribute__((format(printf,1,2))); +// which gets messed up by our override mechanism; this could +// be avoided by either changing the PSP SDK to use the equally +// legal and valid +//   __attribute__((format(__printf__,1,2))); +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the PSP port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <pspgu.h>  #include <pspkerneltypes.h>  #include <pspdisplay.h> diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp index 54476dabfd..fd686513af 100644 --- a/backends/platform/psp/mp3.cpp +++ b/backends/platform/psp/mp3.cpp @@ -23,12 +23,26 @@   *   */ +// Disable printf override in common/forbidden.h to avoid +// clashes with pspdebug.h from the PSP SDK. +// That header file uses +//   __attribute__((format(printf,1,2))); +// which gets messed up by our override mechanism; this could +// be avoided by either changing the PSP SDK to use the equally +// legal and valid +//   __attribute__((format(__printf__,1,2))); +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the PSP port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf  #include "common/debug.h"  #include "common/stream.h"  #include "common/util.h"  #include "common/singleton.h"  #include "common/mutex.h" +#include "common/textconsole.h"  #include "audio/audiostream.h" diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h index 1d2fe5ec2f..95491d5788 100644 --- a/backends/platform/psp/mp3.h +++ b/backends/platform/psp/mp3.h @@ -30,7 +30,7 @@  #include "common/scummsys.h"  namespace Common { -	class SeekableReadStream; +class SeekableReadStream;  }  namespace Audio { diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index bb7c1ff7d5..e2a8a88c57 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -23,6 +23,9 @@   *   */ +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +  #include <pspuser.h>  #include <pspgu.h>  #include <pspdisplay.h> diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 051449d4a0..1e4aea70d3 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -29,6 +29,7 @@  #include "common/scummsys.h"  #include "graphics/surface.h"  #include "graphics/colormasks.h" +#include "graphics/palette.h"  #include "audio/mixer_intern.h"  #include "backends/base-backend.h"  #include "backends/fs/psp/psp-fs-factory.h" diff --git a/backends/platform/psp/portdefs.h b/backends/platform/psp/portdefs.h index bf7ed41e25..dae9b5d49e 100644 --- a/backends/platform/psp/portdefs.h +++ b/backends/platform/psp/portdefs.h @@ -26,6 +26,12 @@  #ifndef PORTDEFS_H  #define PORTDEFS_H +// FIXME: This file is only used when building using the file +// backends/platform/psp/Makefile, but not when building using configure +// && make. So either -DNONSTANDARD_PORT needs to be added to the PSP +// configure rules, or it should be removed from the aforementioned +// Makefile. +  #include <stdio.h>  #include <stdlib.h>  #include <string.h> diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp index d24c614e33..b85467f788 100644 --- a/backends/platform/psp/psp_main.cpp +++ b/backends/platform/psp/psp_main.cpp @@ -23,6 +23,20 @@   *   */ +// Disable printf override in common/forbidden.h to avoid +// clashes with pspdebug.h from the PSP SDK. +// That header file uses +//   __attribute__((format(printf,1,2))); +// which gets messed up by our override mechanism; this could +// be avoided by either changing the PSP SDK to use the equally +// legal and valid +//   __attribute__((format(__printf__,1,2))); +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the PSP port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #define	USERSPACE_ONLY	//don't use kernel mode features  #ifndef USERSPACE_ONLY diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp index 74c2f64300..92ee7b669e 100644 --- a/backends/platform/psp/trace.cpp +++ b/backends/platform/psp/trace.cpp @@ -23,6 +23,19 @@   *   */ +// Disable printf override in common/forbidden.h to avoid +// clashes with pspdebug.h from the PSP SDK. +// That header file uses +//   __attribute__((format(printf,1,2))); +// which gets messed up by our override mechanism; this could +// be avoided by either changing the PSP SDK to use the equally +// legal and valid +//   __attribute__((format(__printf__,1,2))); +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the PSP port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf  #include <pspkernel.h>  #include <pspdebug.h> diff --git a/backends/platform/samsungtv/main.cpp b/backends/platform/samsungtv/main.cpp index 3beb97165f..a1962dd904 100644 --- a/backends/platform/samsungtv/main.cpp +++ b/backends/platform/samsungtv/main.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +  #include "backends/platform/samsungtv/samsungtv.h"  #include "backends/plugins/sdl/sdl-provider.h"  #include "base/main.h" diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 71a88265a0..2208f7c351 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -23,6 +23,9 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h	//On IRIX, sys/stat.h includes sys/time.h +  #include "common/scummsys.h"  #ifdef UNIX @@ -34,6 +37,7 @@  #include <errno.h>  #include <sys/stat.h> +  OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName)  	:  	_baseConfigName(baseConfigName) { diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index d6e79248f9..e6ca423f61 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +  #ifdef WIN32  #define WIN32_LEAN_AND_MEAN  #include <windows.h> @@ -32,6 +34,7 @@  #include "backends/platform/sdl/sdl.h"  #include "common/config-manager.h"  #include "common/EventRecorder.h" +#include "common/textconsole.h"  #include "backends/saves/default/default-saves.h"  #include "backends/audiocd/sdl/sdl-audiocd.h" @@ -378,7 +381,11 @@ void OSystem_SDL::setupIcon() {  	unsigned int rgba[256];  	unsigned int *icon; -	sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); +	if (sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes) != 4) { +		warning("Wrong format of scummvm_icon[0] (%s)", scummvm_icon[0]); +		 +		return; +	}  	if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) {  		warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes);  		return; @@ -393,13 +400,17 @@ void OSystem_SDL::setupIcon() {  		unsigned char code;  		char color[32];  		unsigned int col; -		sscanf(scummvm_icon[1 + i], "%c c %s", &code, color); +		if (sscanf(scummvm_icon[1 + i], "%c c %s", &code, color) != 2) { +			warning("Wrong format of scummvm_icon[%d] (%s)", 1 + i, scummvm_icon[1 + i]); +		}  		if (!strcmp(color, "None"))  			col = 0x00000000;  		else if (!strcmp(color, "black"))  			col = 0xFF000000;  		else if (color[0] == '#') { -			sscanf(color + 1, "%06x", &col); +			if (sscanf(color + 1, "%06x", &col) != 1) { +				warning("Wrong format of color (%s)", color + 1); +			}  			col |= 0xFF000000;  		} else {  			warning("Could not load the built-in icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 9459263ae2..d6a39ff48f 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -27,6 +27,8 @@  #define FORBIDDEN_SYMBOL_ALLOW_ALL  #include "common/scummsys.h" +#include "common/error.h" +#include "common/textconsole.h"  #ifdef WIN32 @@ -37,6 +39,8 @@  #include "backends/platform/sdl/win32/win32.h"  #include "backends/fs/windows/windows-fs-factory.h" +#include "common/memstream.h" +  #define DEFAULT_CONFIG_FILE "scummvm.ini"  //#define	HIDE_CONSOLE @@ -168,4 +172,88 @@ Common::WriteStream *OSystem_Win32::createLogFile() {  	}  } +namespace { + +class Win32ResourceArchive : public Common::Archive { +	friend BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam); +public: +	Win32ResourceArchive(); + +	virtual bool hasFile(const Common::String &name); +	virtual int listMembers(Common::ArchiveMemberList &list); +	virtual Common::ArchiveMemberPtr getMember(const Common::String &name); +	virtual Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const; +private: +	typedef Common::List<Common::String> FilenameList; + +	FilenameList _files; +}; + +BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam) { +	if (IS_INTRESOURCE(lpszName)) +		return TRUE; + +	Win32ResourceArchive *arch = (Win32ResourceArchive *)lParam; +	arch->_files.push_back(lpszName); +	return TRUE; +} + +Win32ResourceArchive::Win32ResourceArchive() { +	EnumResourceNames(NULL, MAKEINTRESOURCE(256), &EnumResNameProc, (LONG_PTR)this); +} + +bool Win32ResourceArchive::hasFile(const Common::String &name) { +	for (FilenameList::const_iterator i = _files.begin(); i != _files.end(); ++i) { +		if (i->equalsIgnoreCase(name)) +			return true; +	} + +	return false; +} + +int Win32ResourceArchive::listMembers(Common::ArchiveMemberList &list) { +	int count = 0; + +	for (FilenameList::const_iterator i = _files.begin(); i != _files.end(); ++i, ++count) +		list.push_back(Common::ArchiveMemberPtr(new Common::GenericArchiveMember(*i, this))); + +	return count; +} + +Common::ArchiveMemberPtr Win32ResourceArchive::getMember(const Common::String &name) { +	return Common::ArchiveMemberPtr(new Common::GenericArchiveMember(name, this)); +} + +Common::SeekableReadStream *Win32ResourceArchive::createReadStreamForMember(const Common::String &name) const { +	HRSRC resource = FindResource(NULL, name.c_str(), MAKEINTRESOURCE(256)); + +	if (resource == NULL) +		return 0; + +	HGLOBAL handle = LoadResource(NULL, resource); + +	if (handle == NULL) +		return 0; + +	const byte *data = (const byte *)LockResource(handle); + +	if (data == NULL) +		return 0; + +	uint32 size = SizeofResource(NULL, resource); + +	if (size == 0) +		return 0; + +	return new Common::MemoryReadStream(data, size); +} + +} // End of anonymous namespace + +void OSystem_Win32::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { +	s.add("Win32Res", new Win32ResourceArchive()); + +	OSystem_SDL::addSysArchivesToSearchSet(s, priority); +} +  #endif diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h index 8379c49437..25cb6bfbba 100644 --- a/backends/platform/sdl/win32/win32.h +++ b/backends/platform/sdl/win32/win32.h @@ -32,6 +32,7 @@ class OSystem_Win32 : public OSystem_SDL {  public:  	virtual void init(); +	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);  protected:  	virtual Common::String getDefaultConfigFileName();  	virtual Common::WriteStream *createLogFile(); diff --git a/backends/platform/symbian/AdaptAllMMPs.pl b/backends/platform/symbian/AdaptAllMMPs.pl index 921f384c65..dbced3126a 100644 --- a/backends/platform/symbian/AdaptAllMMPs.pl +++ b/backends/platform/symbian/AdaptAllMMPs.pl @@ -36,6 +36,7 @@ chdir("../../../");  	"mmp/scummvm_hugo.mmp",  	"mmp/scummvm_toon.mmp",  	"mmp/scummvm_lastexpress.mmp", +	"mmp/scummvm_tsage.mmp",  	# Target Platform Project Files  	"S60/ScummVM_S60.mmp",  	"S60v3/ScummVM_S60v3.mmp", @@ -111,7 +112,8 @@ ParseModule("_base",	"base",		\@section_empty); # now in ./TRG/ScummVM_TRG.mmp,  ParseModule("_base",	"common",	\@section_empty);  ParseModule("_base",	"gui",		\@section_empty,		\@excludes_gui);  ParseModule("_base",	"graphics",	\@section_empty,		\@excludes_graphics); -ParseModule("_base",	"sound",	\@section_empty,		\@excludes_snd); +ParseModule("_base",	"audio",	\@section_empty,		\@excludes_snd); +ParseModule("_base",	"video",	\@section_empty);  chdir("engines/");  ParseModule("_scumm",	"scumm",	\@sections_scumm,		\@excludes_scumm ); @@ -142,6 +144,7 @@ ParseModule("_mohawk"   ,"mohawk",	\@section_empty);  ParseModule("_hugo"     ,"hugo",	\@section_empty);  ParseModule("_toon"     ,"toon",	\@section_empty);  ParseModule("_lastexpress","lastexpress",	\@section_empty); +ParseModule("_tsage","tsage",	\@section_empty);  print "  =======================================================================================  Done. Enjoy :P diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl index 5c127afaa0..cb1c508fa1 100644 --- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl +++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl @@ -4,7 +4,7 @@  	@WorkingEngines = qw(  		scumm agos sky queen gob groovie saga drascula  		kyra lure agi touche parallaction cine -		cruise made m4 tinsel tucker sword1 sword2 draci sci teenagent mohawk hugo toon lastexpress +		cruise made m4 tinsel tucker sword1 sword2 draci sci teenagent mohawk hugo toon lastexpress tsage  	);  	@WorkingEngines_1st = qw( @@ -14,9 +14,10 @@  	);  	@WorkingEngines_2nd = qw( -		agos sky gob -		kyra lure agi tinsel -		sword1 sword2 draci sci teenagent hugo toon +		agos sky gob kyra lure  +		agi tinsel sword1 sword2  +		draci sci teenagent hugo toon +		tsage  	);  	@TestingEngines = qw( diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in index 12b4cb3610..4e0a66793c 100644 --- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in @@ -63,8 +63,8 @@ START BITMAP    ScummVM.mbm  TARGETPATH              \Resource\Apps  SOURCEPATH              ..\res  // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively  SOURCE  c24             ScummSmall.bmp  SOURCE  8               ScummSmallMask.bmp  SOURCE  c24             ScummLarge.bmp @@ -119,6 +119,7 @@ SOURCE backends\platform\sdl\hardwarekeys.cpp  SOURCE backends\platform\sdl\sdl.cpp  SOURCE backends\audiocd\sdl\sdl-audiocd.cpp  SOURCE backends\audiocd\default\default-audiocd.cpp +SOURCE backends\fs\symbian\symbian-fs.cpp  SOURCE backends\fs\symbian\symbian-fs-factory.cpp  SOURCE backends\platform\symbian\src\SymbianOS.cpp  SOURCE backends\platform\symbian\src\SymbianActions.cpp diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in index 9af6535b22..1929723fb6 100644 --- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in @@ -63,8 +63,8 @@ START BITMAP    ScummVM.mbm  TARGETPATH              \Resource\Apps  SOURCEPATH              ..\res  // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively  SOURCE  c24             ScummSmall.bmp  SOURCE  8               ScummSmallMask.bmp  SOURCE  c24             ScummLarge.bmp @@ -119,6 +119,7 @@ SOURCE backends\platform\sdl\hardwarekeys.cpp  SOURCE backends\platform\sdl\sdl.cpp  SOURCE backends\audiocd\sdl\sdl-audiocd.cpp  SOURCE backends\audiocd\default\default-audiocd.cpp +SOURCE backends\fs\symbian\symbian-fs.cpp  SOURCE backends\fs\symbian\symbian-fs-factory.cpp  SOURCE backends\platform\symbian\src\SymbianOS.cpp  SOURCE backends\platform\symbian\src\SymbianActions.cpp diff --git a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in index 3fab5cc2b7..f5bdaac237 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_A0000658_UIQ3.mmp.in @@ -64,8 +64,8 @@ START BITMAP    ScummVM.mbm  TARGETPATH              \Resource\Apps  SOURCEPATH              ..\res  // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively  SOURCE  c24             ScummSmall.bmp  SOURCE  8               ScummSmallMask.bmp  SOURCE  c24             ScummLarge.bmp @@ -117,6 +117,7 @@ SOURCE backends\platform\sdl\hardwarekeys.cpp  SOURCE backends\platform\sdl\sdl.cpp  SOURCE backends\audiocd\sdl\sdl-audiocd.cpp  SOURCE backends\audiocd\default\default-audiocd.cpp +SOURCE backends\fs\symbian\symbian-fs.cpp  SOURCE backends\fs\symbian\symbian-fs-factory.cpp  SOURCE backends\platform\symbian\src\SymbianOS.cpp  SOURCE backends\platform\symbian\src\SymbianActions.cpp diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in index 31dfc36399..2354161e47 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in @@ -64,8 +64,8 @@ START BITMAP    ScummVM.mbm  TARGETPATH              \Resource\Apps  SOURCEPATH              ..\res  // Source Color-depth Source-bitmap-list -// c denotes whether the bitmap is a colour bitmap and the digits represent the -// colour-depth of the bitmap and the bitmap mask respectively +// c denotes whether the bitmap is a color bitmap and the digits represent the +// color-depth of the bitmap and the bitmap mask respectively  SOURCE  c24             ScummSmall.bmp  SOURCE  8               ScummSmallMask.bmp  SOURCE  c24             ScummLarge.bmp @@ -117,6 +117,7 @@ SOURCE backends\platform\sdl\hardwarekeys.cpp  SOURCE backends\platform\sdl\sdl.cpp  SOURCE backends\audiocd\sdl\sdl-audiocd.cpp  SOURCE backends\audiocd\default\default-audiocd.cpp +SOURCE backends\fs\symbian\symbian-fs.cpp  SOURCE backends\fs\symbian\symbian-fs-factory.cpp  SOURCE backends\platform\symbian\src\SymbianOS.cpp  SOURCE backends\platform\symbian\src\SymbianActions.cpp diff --git a/backends/platform/symbian/mmp/scummvm_base.mmp.in b/backends/platform/symbian/mmp/scummvm_base.mmp.in index b3bfbab530..2b74bca42b 100644 --- a/backends/platform/symbian/mmp/scummvm_base.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_base.mmp.in @@ -96,11 +96,11 @@ SOURCEPATH ..\..\..\..\gui  //SOURCE Actions.cpp  SOURCEPATH ..\..\..\..\audio -//START_AUTO_OBJECTS_SOUND_// +//START_AUTO_OBJECTS_AUDIO_//  	// empty base file, will be updated by Perl build scripts -//STOP_AUTO_OBJECTS_SOUND_// +//STOP_AUTO_OBJECTS_AUDIO_//  SOURCE softsynth\fmtowns_pc98\towns_pc98_fmsynth.cpp // Included since its excluded by filter  #if defined (WINS) diff --git a/backends/platform/symbian/mmp/scummvm_tsage.mmp.in b/backends/platform/symbian/mmp/scummvm_tsage.mmp.in new file mode 100644 index 0000000000..8265d9e772 --- /dev/null +++ b/backends/platform/symbian/mmp/scummvm_tsage.mmp.in @@ -0,0 +1,64 @@ +/* ScummVM - Graphic Adventure Engine + * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL + * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System + * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer + * Copyright (C) 2005-2011 The ScummVM project + * + * 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$ + * + */ + +// +// EPOC MMP makefile project for ScummVM +// + +// *** Definitions + +TARGET          scummvm_tsage.lib +TARGETTYPE      lib +OPTION			MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp +OPTION			GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +OPTION			GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char +ALWAYS_BUILD_AS_ARM + +//START_AUTO_MACROS_SLAVE// + +	// empty base file, will be updated by Perl build scripts + +//STOP_AUTO_MACROS_SLAVE// + +// *** SOURCE files + +SOURCEPATH ..\..\..\..\engines\tsage + +//START_AUTO_OBJECTS_TSAGE_// + +	// empty base file, will be updated by Perl build scripts + +//STOP_AUTO_OBJECTS_TSAGE_// + +// *** Include paths + +USERINCLUDE     ..\..\..\..\engines +USERINCLUDE     ..\..\..\.. ..\..\..\..\common ..\..\..\..\gui ..\..\..\..\audio ..\src +SYSTEMINCLUDE	\epoc32\include\ZLIB // before \epoc32\include because symbian already has older version +SYSTEMINCLUDE   \epoc32\include \epoc32\include\libc ..\src diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index 1c5de2d43c..e8a620475e 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -35,6 +35,11 @@  #include <e32std.h>  #include <math.h> +/* define pi */ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif  /*  M_PI  */ +  #define DISABLE_COMMAND_LINE  #if defined(USE_TREMOR) && !defined(USE_VORBIS) diff --git a/backends/platform/symbian/src/vsnprintf.h b/backends/platform/symbian/src/vsnprintf.h index 5a9c836ea3..6e75719d55 100644 --- a/backends/platform/symbian/src/vsnprintf.h +++ b/backends/platform/symbian/src/vsnprintf.h @@ -1,8 +1,11 @@  /* - * This is the vsnprintf for scummvm/symbian implementation from the original snprintf.c, - * all support functions has been removed and vsnprintf renamed to symbian_vsnprintf + * This is the vsnprintf for scummvm/symbian implementation from the original + * snprintf.c, all support functions has been removed and vsnprintf renamed to + * symbian_vsnprintf + * According to the homepage this function may be licensed under either the + * Frontier Artistic License or the GPL. + *   * snprintf.c - a portable implementation of snprintf - * According to the homepage this function could be licensed as either Frontier Aritistic or GPL.   *   * AUTHOR   *   Mark Martinec <mark.martinec@ijs.si>, April 1999. @@ -244,13 +247,14 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {  			/* if (str_l < str_m) str[str_l++] = *p++;    -- this would be sufficient */  			/* but the following code achieves better performance for cases  			* where format string is long and contains few conversions */ -			const char *q = strchr(p+1,'%'); -			size_t n = !q ? strlen(p) : (q-p); +			const char *q = strchr(p + 1, '%'); +			size_t n = !q ? strlen(p) : (q - p);  			if (str_l < str_m) { -				size_t avail = str_m-str_l; -				fast_memcpy(str+str_l, p, (n>avail?avail:n)); +				size_t avail = str_m - str_l; +				fast_memcpy(str + str_l, p, (n > avail ? avail : n));  			} -			p += n; str_l += n; +			p += n; +			str_l += n;  		} else {  			const char *starting_p;  			size_t min_field_width = 0, precision = 0; @@ -262,398 +266,453 @@ int symbian_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {  			char tmp[32];/* temporary buffer for simple numeric->string conversion */  			const char *str_arg;      /* string address in case of string argument */ -									  size_t str_arg_l;         /* natural field width of arg without padding +			size_t str_arg_l;         /* natural field width of arg without padding  									  and sign */ -									  unsigned char uchar_arg; -									  /* unsigned char argument value - only defined for c conversion. -									  N.B. standard explicitly states the char argument for -									  the c conversion is unsigned */ +			unsigned char uchar_arg; +			/* unsigned char argument value - only defined for c conversion. +			N.B. standard explicitly states the char argument for +			the c conversion is unsigned */ -									  size_t number_of_zeros_to_pad = 0; -									  /* number of zeros to be inserted for numeric conversions -									  as required by the precision or minimal field width */ +			size_t number_of_zeros_to_pad = 0; +			/* number of zeros to be inserted for numeric conversions +			as required by the precision or minimal field width */ -									  size_t zero_padding_insertion_ind = 0; -									  /* index into tmp where zero padding is to be inserted */ +			size_t zero_padding_insertion_ind = 0; +			/* index into tmp where zero padding is to be inserted */ -									  char fmt_spec = '\0'; -									  /* current conversion specifier character */ +			char fmt_spec = '\0'; +			/* current conversion specifier character */ -									  str_arg = credits;/* just to make compiler happy (defined but not used)*/ -									  str_arg = NULL; -									  starting_p = p; p++;  /* skip '%' */ -									  /* parse flags */ -									  while (*p == '0' || *p == '-' || *p == '+' || -										  *p == ' ' || *p == '#' || *p == '\'') { -										  switch (*p) { -										  case '0': zero_padding = 1; break; -										  case '-': justify_left = 1; break; -										  case '+': force_sign = 1; space_for_positive = 0; break; -										  case ' ': force_sign = 1; -											  /* If both the ' ' and '+' flags appear, the ' ' flag should be ignored */ -											  break; -										  case '#': alternate_form = 1; break; -										  case '\'': break; -										  } -										  p++; -									  } -									  /* If the '0' and '-' flags both appear, the '0' flag should be ignored. */ +			str_arg = credits;/* just to make compiler happy (defined but not used)*/ +			str_arg = NULL; +			starting_p = p; +			p++;  /* skip '%' */ +			/* parse flags */ +			while (*p == '0' || *p == '-' || *p == '+' || +			       *p == ' ' || *p == '#' || *p == '\'') { +				switch (*p) { +				case '0': +					zero_padding = 1; +					break; +				case '-': +					justify_left = 1; +					break; +				case '+': +					force_sign = 1; +					space_for_positive = 0; +					break; +				case ' ': +					force_sign = 1; +					/* If both the ' ' and '+' flags appear, the ' ' flag should be ignored */ +					break; +				case '#': +					alternate_form = 1; +					break; +				case '\'': +					break; +				} +				p++; +			} +			/* If the '0' and '-' flags both appear, the '0' flag should be ignored. */ -									  /* parse field width */ -									  if (*p == '*') { -										  int j; -										  p++; j = va_arg(ap, int); -										  if (j >= 0) min_field_width = j; -										  else { min_field_width = -j; justify_left = 1; } -									  } else if (isdigit((int)(*p))) { -									  /* size_t could be wider than unsigned int; -										  make sure we treat argument like common implementations do */ -										  unsigned int uj = *p++ - '0'; -										  while (isdigit((int)(*p))) uj = 10*uj + (unsigned int)(*p++ - '0'); -										  min_field_width = uj; -									  } -									  /* parse precision */ -									  if (*p == '.') { -										  p++; precision_specified = 1; -										  if (*p == '*') { -											  int j = va_arg(ap, int); -											  p++; -											  if (j >= 0) precision = j; -											  else { -												  precision_specified = 0; precision = 0; -												  /* NOTE: -												  *   Solaris 2.6 man page claims that in this case the precision -												  *   should be set to 0.  Digital Unix 4.0, HPUX 10 and BSD man page -												  *   claim that this case should be treated as unspecified precision, -												  *   which is what we do here. -												  */ -											  } -										  } else if (isdigit((int)(*p))) { -										  /* size_t could be wider than unsigned int; -											  make sure we treat argument like common implementations do */ -											  unsigned int uj = *p++ - '0'; -											  while (isdigit((int)(*p))) uj = 10*uj + (unsigned int)(*p++ - '0'); -											  precision = uj; -										  } -									  } -									  /* parse 'h', 'l' and 'll' length modifiers */ -									  if (*p == 'h' || *p == 'l') { -										  length_modifier = *p; p++; -										  if (length_modifier == 'l' && *p == 'l') {   /* double l = long long */ +			/* parse field width */ +			if (*p == '*') { +				int j; +				p++; +				j = va_arg(ap, int); +				if (j >= 0) min_field_width = j; +				else { min_field_width = -j; justify_left = 1; } +			} else if (isdigit((int)(*p))) { +				/* size_t could be wider than unsigned int; +				    make sure we treat argument like common implementations do */ +				unsigned int uj = *p++ - '0'; +				while (isdigit((int)(*p))) uj = 10 * uj + (unsigned int)(*p++ - '0'); +				min_field_width = uj; +			} +			/* parse precision */ +			if (*p == '.') { +				p++; +				precision_specified = 1; +				if (*p == '*') { +					int j = va_arg(ap, int); +					p++; +					if (j >= 0) precision = j; +					else { +						precision_specified = 0; +						precision = 0; +						/* NOTE: +						*   Solaris 2.6 man page claims that in this case the precision +						*   should be set to 0.  Digital Unix 4.0, HPUX 10 and BSD man page +						*   claim that this case should be treated as unspecified precision, +						*   which is what we do here. +						*/ +					} +				} else if (isdigit((int)(*p))) { +					/* size_t could be wider than unsigned int; +					    make sure we treat argument like common implementations do */ +					unsigned int uj = *p++ - '0'; +					while (isdigit((int)(*p))) uj = 10 * uj + (unsigned int)(*p++ - '0'); +					precision = uj; +				} +			} +			/* parse 'h', 'l' and 'll' length modifiers */ +			if (*p == 'h' || *p == 'l') { +				length_modifier = *p; +				p++; +				if (length_modifier == 'l' && *p == 'l') {   /* double l = long long */  #ifdef SNPRINTF_LONGLONG_SUPPORT -											  length_modifier = '2';                  /* double l encoded as '2' */ +					length_modifier = '2';                  /* double l encoded as '2' */  #else -											  length_modifier = 'l';                 /* treat it as a single 'l' */ +					length_modifier = 'l';                 /* treat it as a single 'l' */  #endif -											  p++; -										  } -									  } -									  fmt_spec = *p; -									  /* common synonyms: */ -									  switch (fmt_spec) { -									  case 'i': fmt_spec = 'd'; break; -									  case 'D': fmt_spec = 'd'; length_modifier = 'l'; break; -									  case 'U': fmt_spec = 'u'; length_modifier = 'l'; break; -									  case 'O': fmt_spec = 'o'; length_modifier = 'l'; break; -									  default: break; -									  } -									  /* get parameter value, do initial processing */ -									  switch (fmt_spec) { -									  case '%': /* % behaves similar to 's' regarding flags and field widths */ -									  case 'c': /* c behaves similar to 's' regarding flags and field widths */ -									  case 's': -										  length_modifier = '\0';          /* wint_t and wchar_t not supported */ -										  /* the result of zero padding flag with non-numeric conversion specifier*/ -										  /* is undefined. Solaris and HPUX 10 does zero padding in this case,    */ -										  /* Digital Unix and Linux does not. */ -										  zero_padding = 0;    /* turn zero padding off for string conversions */ -										  str_arg_l = 1; -										  switch (fmt_spec) { -										  case '%': -											  str_arg = p; break; -										  case 'c': { -											  int j = va_arg(ap, int); -											  uchar_arg = (unsigned char) j;   /* standard demands unsigned char */ -											  str_arg = (const char *) &uchar_arg; -											  break; -													} -										  case 's': -											  str_arg = va_arg(ap, const char *); -											  if (!str_arg) str_arg_l = 0; -											  /* make sure not to address string beyond the specified precision !!! */ -											  else if (!precision_specified) str_arg_l = strlen(str_arg); -											  /* truncate string if necessary as requested by precision */ -											  else if (precision == 0) str_arg_l = 0; -											  else { -												  /* memchr on HP does not like n > 2^31  !!! */ -												  const char *q = (const char*) memchr(str_arg, '\0', -													  precision <= 0x7fffffff ? precision : 0x7fffffff); -												  str_arg_l = !q ? precision : (q-str_arg); -											  } -											  break; -										  default: break; -										  } -										  break; -										  case 'd': case 'u': case 'o': case 'x': case 'X': case 'p': { -										  /* NOTE: the u, o, x, X and p conversion specifiers imply -											  the value is unsigned;  d implies a signed value */ +					p++; +				} +			} +			fmt_spec = *p; +			/* common synonyms: */ +			switch (fmt_spec) { +			case 'i': +				fmt_spec = 'd'; +				break; +			case 'D': +				fmt_spec = 'd'; +				length_modifier = 'l'; +				break; +			case 'U': +				fmt_spec = 'u'; +				length_modifier = 'l'; +				break; +			case 'O': +				fmt_spec = 'o'; +				length_modifier = 'l'; +				break; +			default: +				break; +			} +			/* get parameter value, do initial processing */ +			switch (fmt_spec) { +			case '%': /* % behaves similar to 's' regarding flags and field widths */ +			case 'c': /* c behaves similar to 's' regarding flags and field widths */ +			case 's': +				length_modifier = '\0';          /* wint_t and wchar_t not supported */ +				/* the result of zero padding flag with non-numeric conversion specifier*/ +				/* is undefined. Solaris and HPUX 10 does zero padding in this case,    */ +				/* Digital Unix and Linux does not. */ +				zero_padding = 0;    /* turn zero padding off for string conversions */ +				str_arg_l = 1; +				switch (fmt_spec) { +				case '%': +					str_arg = p; +					break; +				case 'c': { +					int j = va_arg(ap, int); +					uchar_arg = (unsigned char) j;   /* standard demands unsigned char */ +					str_arg = (const char *) & uchar_arg; +					break; +				} +				case 's': +					str_arg = va_arg(ap, const char *); +					if (!str_arg) str_arg_l = 0; +					/* make sure not to address string beyond the specified precision !!! */ +					else if (!precision_specified) str_arg_l = strlen(str_arg); +					/* truncate string if necessary as requested by precision */ +					else if (precision == 0) str_arg_l = 0; +					else { +						/* memchr on HP does not like n > 2^31  !!! */ +						const char *q = (const char*) memchr(str_arg, '\0', +						                                     precision <= 0x7fffffff ? precision : 0x7fffffff); +						str_arg_l = !q ? precision : (q - str_arg); +					} +					break; +				default: +					break; +				} +				break; +			case 'd': +			case 'u': +			case 'o': +			case 'x': +			case 'X': +			case 'p': { +				/* NOTE: the u, o, x, X and p conversion specifiers imply +				    the value is unsigned;  d implies a signed value */ -											  int arg_sign = 0; -											  /* 0 if numeric argument is zero (or if pointer is NULL for 'p'), -											  +1 if greater than zero (or nonzero for unsigned arguments), -											  -1 if negative (unsigned argument is never negative) */ +				int arg_sign = 0; +				/* 0 if numeric argument is zero (or if pointer is NULL for 'p'), +				+1 if greater than zero (or nonzero for unsigned arguments), +				-1 if negative (unsigned argument is never negative) */ -											  int int_arg = 0;  unsigned int uint_arg = 0; -											  /* only defined for length modifier h, or for no length modifiers */ +				int int_arg = 0; +				unsigned int uint_arg = 0; +				/* only defined for length modifier h, or for no length modifiers */ -											  long int long_arg = 0;  unsigned long int ulong_arg = 0; -											  /* only defined for length modifier l */ +				long int long_arg = 0; +				unsigned long int ulong_arg = 0; +				/* only defined for length modifier l */ -											  void *ptr_arg = NULL; -											  /* pointer argument value -only defined for p conversion */ +				void *ptr_arg = NULL; +				/* pointer argument value -only defined for p conversion */  #ifdef SNPRINTF_LONGLONG_SUPPORT -											  long long int long_long_arg = 0; -											  unsigned long long int ulong_long_arg = 0; -											  /* only defined for length modifier ll */ +				long long int long_long_arg = 0; +				unsigned long long int ulong_long_arg = 0; +				/* only defined for length modifier ll */  #endif -											  if (fmt_spec == 'p') { -											  /* HPUX 10: An l, h, ll or L before any other conversion character -											  *   (other than d, i, u, o, x, or X) is ignored. -											  * Digital Unix: -											  *   not specified, but seems to behave as HPUX does. -											  * Solaris: If an h, l, or L appears before any other conversion -											  *   specifier (other than d, i, u, o, x, or X), the behavior -											  *   is undefined. (Actually %hp converts only 16-bits of address -											  *   and %llp treats address as 64-bit data which is incompatible -											  *   with (void *) argument on a 32-bit system). -												  */ -												  length_modifier = '\0'; -												  ptr_arg = va_arg(ap, void *); -												  if (ptr_arg != NULL) arg_sign = 1; -											  } else if (fmt_spec == 'd') {  /* signed */ -												  switch (length_modifier) { -												  case '\0': -												  case 'h': -												  /* It is non-portable to specify a second argument of char or short -												  * to va_arg, because arguments seen by the called function -												  * are not char or short.  C converts char and short arguments -												  * to int before passing them to a function. -													  */ -													  int_arg = va_arg(ap, int); -													  if      (int_arg > 0) arg_sign =  1; -													  else if (int_arg < 0) arg_sign = -1; -													  break; -												  case 'l': -													  long_arg = va_arg(ap, long int); -													  if      (long_arg > 0) arg_sign =  1; -													  else if (long_arg < 0) arg_sign = -1; -													  break; +				if (fmt_spec == 'p') { +					/* HPUX 10: An l, h, ll or L before any other conversion character +					*   (other than d, i, u, o, x, or X) is ignored. +					* Digital Unix: +					*   not specified, but seems to behave as HPUX does. +					* Solaris: If an h, l, or L appears before any other conversion +					*   specifier (other than d, i, u, o, x, or X), the behavior +					*   is undefined. (Actually %hp converts only 16-bits of address +					*   and %llp treats address as 64-bit data which is incompatible +					*   with (void *) argument on a 32-bit system). +					    */ +					length_modifier = '\0'; +					ptr_arg = va_arg(ap, void *); +					if (ptr_arg != NULL) arg_sign = 1; +				} else if (fmt_spec == 'd') {  /* signed */ +					switch (length_modifier) { +					case '\0': +					case 'h': +						/* It is non-portable to specify a second argument of char or short +						* to va_arg, because arguments seen by the called function +						* are not char or short.  C converts char and short arguments +						* to int before passing them to a function. +						    */ +						int_arg = va_arg(ap, int); +						if (int_arg > 0) arg_sign =  1; +						else if (int_arg < 0) arg_sign = -1; +						break; +					case 'l': +						long_arg = va_arg(ap, long int); +						if (long_arg > 0) arg_sign =  1; +						else if (long_arg < 0) arg_sign = -1; +						break;  #ifdef SNPRINTF_LONGLONG_SUPPORT -												  case '2': -													  long_long_arg = va_arg(ap, long long int); -													  if      (long_long_arg > 0) arg_sign =  1; -													  else if (long_long_arg < 0) arg_sign = -1; -													  break; +					case '2': +						long_long_arg = va_arg(ap, long long int); +						if (long_long_arg > 0) arg_sign =  1; +						else if (long_long_arg < 0) arg_sign = -1; +						break;  #endif -												  } -											  } else {  /* unsigned */ -												  switch (length_modifier) { -												  case '\0': -												  case 'h': -													  uint_arg = va_arg(ap, unsigned int); -													  if (uint_arg) arg_sign = 1; -													  break; -												  case 'l': -													  ulong_arg = va_arg(ap, unsigned long int); -													  if (ulong_arg) arg_sign = 1; -													  break; +					} +				} else {  /* unsigned */ +					switch (length_modifier) { +					case '\0': +					case 'h': +						uint_arg = va_arg(ap, unsigned int); +						if (uint_arg) arg_sign = 1; +						break; +					case 'l': +						ulong_arg = va_arg(ap, unsigned long int); +						if (ulong_arg) arg_sign = 1; +						break;  #ifdef SNPRINTF_LONGLONG_SUPPORT -												  case '2': -													  ulong_long_arg = va_arg(ap, unsigned long long int); -													  if (ulong_long_arg) arg_sign = 1; -													  break; +					case '2': +						ulong_long_arg = va_arg(ap, unsigned long long int); +						if (ulong_long_arg) arg_sign = 1; +						break;  #endif -												  } -											  } -											  str_arg = tmp; str_arg_l = 0; -											  /* NOTE: -											  *   For d, i, u, o, x, and X conversions, if precision is specified, -											  *   the '0' flag should be ignored. This is so with Solaris 2.6, -											  *   Digital UNIX 4.0, HPUX 10, Linux, FreeBSD, NetBSD; but not with Perl. -											  */ -											  if (precision_specified) zero_padding = 0; -											  if (fmt_spec == 'd') { -												  if (force_sign && arg_sign >= 0) -													  tmp[str_arg_l++] = space_for_positive ? ' ' : '+'; -													  /* leave negative numbers for sprintf to handle, -												  to avoid handling tricky cases like (short int)(-32768) */ -											  } else if (alternate_form) { -												  if (arg_sign != 0 && (fmt_spec == 'x' || fmt_spec == 'X') ) -												  { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = fmt_spec; } -												  /* alternate form should have no effect for p conversion, but ... */ -											  } -											  zero_padding_insertion_ind = str_arg_l; -											  if (!precision_specified) precision = 1;   /* default precision is 1 */ -											  if (precision == 0 && arg_sign == 0 -												  ) { -												  /* converted to null string */ -												  /* When zero value is formatted with an explicit precision 0, -												  the resulting formatted string is empty (d, i, u, o, x, X, p).   */ -											  } else { -												  char f[5]; int f_l = 0; -												  f[f_l++] = '%';    /* construct a simple format string for sprintf */ -												  if (!length_modifier) { } -												  else if (length_modifier=='2') { f[f_l++] = 'l'; f[f_l++] = 'l'; } -												  else f[f_l++] = length_modifier; -												  f[f_l++] = fmt_spec; f[f_l++] = '\0'; -												  if (fmt_spec == 'p') str_arg_l += sprintf(tmp+str_arg_l, f, ptr_arg); -												  else if (fmt_spec == 'd') {  /* signed */ -													  switch (length_modifier) { -													  case '\0': -													  case 'h': str_arg_l+=sprintf(tmp+str_arg_l, f, int_arg);  break; -													  case 'l': str_arg_l+=sprintf(tmp+str_arg_l, f, long_arg); break; +					} +				} +				str_arg = tmp; +				str_arg_l = 0; +				/* NOTE: +				*   For d, i, u, o, x, and X conversions, if precision is specified, +				*   the '0' flag should be ignored. This is so with Solaris 2.6, +				*   Digital UNIX 4.0, HPUX 10, Linux, FreeBSD, NetBSD; but not with Perl. +				*/ +				if (precision_specified) zero_padding = 0; +				if (fmt_spec == 'd') { +					if (force_sign && arg_sign >= 0) +						tmp[str_arg_l++] = space_for_positive ? ' ' : '+'; +					/* leave negative numbers for sprintf to handle, +					to avoid handling tricky cases like (short int)(-32768) */ +				} else if (alternate_form) { +					if (arg_sign != 0 && (fmt_spec == 'x' || fmt_spec == 'X')) +						{ tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = fmt_spec; } +					/* alternate form should have no effect for p conversion, but ... */ +				} +				zero_padding_insertion_ind = str_arg_l; +				if (!precision_specified) precision = 1;   /* default precision is 1 */ +				if (precision == 0 && arg_sign == 0 +				   ) { +					/* converted to null string */ +					/* When zero value is formatted with an explicit precision 0, +					the resulting formatted string is empty (d, i, u, o, x, X, p).   */ +				} else { +					char f[5]; +					int f_l = 0; +					f[f_l++] = '%';    /* construct a simple format string for sprintf */ +					if (!length_modifier) { } else if (length_modifier == '2') { f[f_l++] = 'l'; f[f_l++] = 'l'; } else f[f_l++] = length_modifier; +					f[f_l++] = fmt_spec; +					f[f_l++] = '\0'; +					if (fmt_spec == 'p') str_arg_l += sprintf(tmp + str_arg_l, f, ptr_arg); +					else if (fmt_spec == 'd') {  /* signed */ +						switch (length_modifier) { +						case '\0': +						case 'h': +							str_arg_l += sprintf(tmp + str_arg_l, f, int_arg); +							break; +						case 'l': +							str_arg_l += sprintf(tmp + str_arg_l, f, long_arg); +							break;  #ifdef SNPRINTF_LONGLONG_SUPPORT -													  case '2': str_arg_l+=sprintf(tmp+str_arg_l,f,long_long_arg); break; +						case '2': +							str_arg_l += sprintf(tmp + str_arg_l, f, long_long_arg); +							break;  #endif -													  } -												  } else {  /* unsigned */ -													  switch (length_modifier) { -													  case '\0': -													  case 'h': str_arg_l+=sprintf(tmp+str_arg_l, f, uint_arg);  break; -													  case 'l': str_arg_l+=sprintf(tmp+str_arg_l, f, ulong_arg); break; +						} +					} else {  /* unsigned */ +						switch (length_modifier) { +						case '\0': +						case 'h': +							str_arg_l += sprintf(tmp + str_arg_l, f, uint_arg); +							break; +						case 'l': +							str_arg_l += sprintf(tmp + str_arg_l, f, ulong_arg); +							break;  #ifdef SNPRINTF_LONGLONG_SUPPORT -													  case '2': str_arg_l+=sprintf(tmp+str_arg_l,f,ulong_long_arg);break; +						case '2': +							str_arg_l += sprintf(tmp + str_arg_l, f, ulong_long_arg); +							break;  #endif -													  } -												  } -												  /* include the optional minus sign and possible "0x" -												  in the region before the zero padding insertion point */ -												  if (zero_padding_insertion_ind < str_arg_l && -													  tmp[zero_padding_insertion_ind] == '-') { -													  zero_padding_insertion_ind++; -												  } -												  if (zero_padding_insertion_ind+1 < str_arg_l && -													  tmp[zero_padding_insertion_ind]   == '0' && -													  (tmp[zero_padding_insertion_ind+1] == 'x' || -													  tmp[zero_padding_insertion_ind+1] == 'X') ) { -													  zero_padding_insertion_ind += 2; -												  } -											  } -											  { size_t num_of_digits = str_arg_l - zero_padding_insertion_ind; -											  if (alternate_form && fmt_spec == 'o' -												  /* unless zero is already the first character */ -												  && !(zero_padding_insertion_ind < str_arg_l -												  && tmp[zero_padding_insertion_ind] == '0') -												  ) {        /* assure leading zero for alternate-form octal numbers */ -												  if (!precision_specified || precision < num_of_digits+1) { -												  /* precision is increased to force the first character to be zero, -												  except if a zero value is formatted with an explicit precision -													  of zero */ -													  precision = num_of_digits+1; precision_specified = 1; -												  } -											  } -											  /* zero padding to specified precision? */ -											  if (num_of_digits < precision) -												  number_of_zeros_to_pad = precision - num_of_digits; -											  } -											  /* zero padding to specified minimal field width? */ -											  if (!justify_left && zero_padding) { -												  int n = min_field_width - (str_arg_l+number_of_zeros_to_pad); -												  if (n > 0) number_of_zeros_to_pad += n; -											  } -											  break; -      } -      default: /* unrecognized conversion specifier, keep format string as-is*/ -		  zero_padding = 0;  /* turn zero padding off for non-numeric convers. */ -		  justify_left = 1; min_field_width = 0;                /* reset flags */ -																/* discard the unrecognized conversion, just keep * -		  * the unrecognized conversion character          */ -		  str_arg = p; str_arg_l = 0; -		  if (*p) str_arg_l++;  /* include invalid conversion specifier unchanged +						} +					} +					/* include the optional minus sign and possible "0x" +					in the region before the zero padding insertion point */ +					if (zero_padding_insertion_ind < str_arg_l && +					        tmp[zero_padding_insertion_ind] == '-') { +						zero_padding_insertion_ind++; +					} +					if (zero_padding_insertion_ind + 1 < str_arg_l && +					        tmp[zero_padding_insertion_ind]   == '0' && +					        (tmp[zero_padding_insertion_ind+1] == 'x' || +					         tmp[zero_padding_insertion_ind+1] == 'X')) { +						zero_padding_insertion_ind += 2; +					} +				} +				{ +					size_t num_of_digits = str_arg_l - zero_padding_insertion_ind; +					if (alternate_form && fmt_spec == 'o' +					        /* unless zero is already the first character */ +					        && !(zero_padding_insertion_ind < str_arg_l +					             && tmp[zero_padding_insertion_ind] == '0') +					   ) {        /* assure leading zero for alternate-form octal numbers */ +						if (!precision_specified || precision < num_of_digits + 1) { +							/* precision is increased to force the first character to be zero, +							except if a zero value is formatted with an explicit precision +							    of zero */ +							precision = num_of_digits + 1; +							precision_specified = 1; +						} +					} +					/* zero padding to specified precision? */ +					if (num_of_digits < precision) +						number_of_zeros_to_pad = precision - num_of_digits; +				} +				/* zero padding to specified minimal field width? */ +				if (!justify_left && zero_padding) { +					int n = min_field_width - (str_arg_l + number_of_zeros_to_pad); +					if (n > 0) number_of_zeros_to_pad += n; +				} +				break; +			} +			default: /* unrecognized conversion specifier, keep format string as-is*/ +				zero_padding = 0;  /* turn zero padding off for non-numeric convers. */ +				justify_left = 1; +				min_field_width = 0;                /* reset flags */ +				/* discard the unrecognized conversion, just keep * +				* the unrecognized conversion character          */ +				str_arg = p; +				str_arg_l = 0; +				if (*p) str_arg_l++;  /* include invalid conversion specifier unchanged  		  if not at end-of-string */ -		  break; -      } -      if (*p) p++;      /* step over the just processed conversion specifier */ -						/* insert padding to the left as requested by min_field_width; -      this does not include the zero padding in case of numerical conversions*/ -      if (!justify_left) {                /* left padding with blank or zero */ -		  int n = min_field_width - (str_arg_l+number_of_zeros_to_pad); -		  if (n > 0) { -			  if (str_l < str_m) { -				  size_t avail = str_m-str_l; -				  fast_memset(str+str_l, (zero_padding?'0':' '), (n>avail?avail:n)); -			  } -			  str_l += n; -		  } -      } -	  /* zero padding as requested by the precision or by the minimal field width -	  * for numeric conversions required? */ -      if (number_of_zeros_to_pad <= 0) { -	  /* will not copy first part of numeric right now, * -		  * force it to be copied later in its entirety    */ -		  zero_padding_insertion_ind = 0; -      } else { -		  /* insert first part of numerics (sign or '0x') before zero padding */ -		  int n = zero_padding_insertion_ind; -		  if (n > 0) { -			  if (str_l < str_m) { -				  size_t avail = str_m-str_l; -				  fast_memcpy(str+str_l, str_arg, (n>avail?avail:n)); -			  } -			  str_l += n; -		  } -		  /* insert zero padding as requested by the precision or min field width */ -		  n = number_of_zeros_to_pad; -		  if (n > 0) { -			  if (str_l < str_m) { -				  size_t avail = str_m-str_l; -				  fast_memset(str+str_l, '0', (n>avail?avail:n)); -			  } -			  str_l += n; -		  } -      } -	  /* insert formatted string -	  * (or as-is conversion specifier for unknown conversions) */ -      { int n = str_arg_l - zero_padding_insertion_ind; -	  if (n > 0) { -          if (str_l < str_m) { -			  size_t avail = str_m-str_l; -			  fast_memcpy(str+str_l, str_arg+zero_padding_insertion_ind, -				  (n>avail?avail:n)); -          } -          str_l += n; -	  } -      } -	  /* insert right padding */ -      if (justify_left) {          /* right blank padding to the field width */ -		  int n = min_field_width - (str_arg_l+number_of_zeros_to_pad); -		  if (n > 0) { -			  if (str_l < str_m) { -				  size_t avail = str_m-str_l; -				  fast_memset(str+str_l, ' ', (n>avail?avail:n)); -			  } -			  str_l += n; -		  } -      } -    } -  } -  if (str_m > 0) { /* make sure the string is null-terminated +				break; +			} +			if (*p) p++;      /* step over the just processed conversion specifier */ +			/* insert padding to the left as requested by min_field_width; +			this does not include the zero padding in case of numerical conversions*/ +			if (!justify_left) {                /* left padding with blank or zero */ +				int n = min_field_width - (str_arg_l + number_of_zeros_to_pad); +				if (n > 0) { +					if (str_l < str_m) { +						size_t avail = str_m - str_l; +						fast_memset(str + str_l, (zero_padding ? '0' : ' '), (n > avail ? avail : n)); +					} +					str_l += n; +				} +			} +			/* zero padding as requested by the precision or by the minimal field width +			* for numeric conversions required? */ +			if (number_of_zeros_to_pad <= 0) { +				/* will not copy first part of numeric right now, * +				    * force it to be copied later in its entirety    */ +				zero_padding_insertion_ind = 0; +			} else { +				/* insert first part of numerics (sign or '0x') before zero padding */ +				int n = zero_padding_insertion_ind; +				if (n > 0) { +					if (str_l < str_m) { +						size_t avail = str_m - str_l; +						fast_memcpy(str + str_l, str_arg, (n > avail ? avail : n)); +					} +					str_l += n; +				} +				/* insert zero padding as requested by the precision or min field width */ +				n = number_of_zeros_to_pad; +				if (n > 0) { +					if (str_l < str_m) { +						size_t avail = str_m - str_l; +						fast_memset(str + str_l, '0', (n > avail ? avail : n)); +					} +					str_l += n; +				} +			} +			/* insert formatted string +			* (or as-is conversion specifier for unknown conversions) */ +			{ +				int n = str_arg_l - zero_padding_insertion_ind; +				if (n > 0) { +					if (str_l < str_m) { +						size_t avail = str_m - str_l; +						fast_memcpy(str + str_l, str_arg + zero_padding_insertion_ind, +						            (n > avail ? avail : n)); +					} +					str_l += n; +				} +			} +			/* insert right padding */ +			if (justify_left) {          /* right blank padding to the field width */ +				int n = min_field_width - (str_arg_l + number_of_zeros_to_pad); +				if (n > 0) { +					if (str_l < str_m) { +						size_t avail = str_m - str_l; +						fast_memset(str + str_l, ' ', (n > avail ? avail : n)); +					} +					str_l += n; +				} +			} +		} +	} +	if (str_m > 0) { /* make sure the string is null-terminated  				   even at the expense of overwriting the last character  	  (shouldn't happen, but just in case) */ -	  str[str_l <= str_m-1 ? str_l : str_m-1] = '\0'; -  } -  /* Return the number of characters formatted (excluding trailing null -  * character), that is, the number of characters that would have been -  * written to the buffer if it were large enough. -  * -  * The value of str_l should be returned, but str_l is of unsigned type -  * size_t, and snprintf is int, possibly leading to an undetected -  * integer overflow, resulting in a negative return value, which is illegal. -  * Both XSH5 and ISO C99 (at least the draft) are silent on this issue. -  * Should errno be set to EOVERFLOW and EOF returned in this case??? -  */ -  return (int) str_l; +		str[str_l <= str_m-1 ? str_l : str_m-1] = '\0'; +	} +	/* Return the number of characters formatted (excluding trailing null +	 * character), that is, the number of characters that would have been +	 * written to the buffer if it were large enough. +	 * +	 * The value of str_l should be returned, but str_l is of unsigned type +	 * size_t, and snprintf is int, possibly leading to an undetected +	 * integer overflow, resulting in a negative return value, which is illegal. +	 * Both XSH5 and ISO C99 (at least the draft) are silent on this issue. +	 * Should errno be set to EOVERFLOW and EOF returned in this case??? +	 */ +	return (int) str_l;  }  int symbian_snprintf(char *text, size_t maxlen, const char *fmt, ...) { diff --git a/backends/platform/webos/main.cpp b/backends/platform/webos/main.cpp index bbf55c6efd..eefdd30496 100644 --- a/backends/platform/webos/main.cpp +++ b/backends/platform/webos/main.cpp @@ -23,6 +23,8 @@   *   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +  #include "backends/platform/webos/webos.h"  #include "backends/plugins/sdl/sdl-provider.h"  #include "base/main.h" diff --git a/backends/platform/webos/webos.mk b/backends/platform/webos/webos.mk index 885c9eb90e..37223ac56c 100644 --- a/backends/platform/webos/webos.mk +++ b/backends/platform/webos/webos.mk @@ -1,23 +1,96 @@  # WebOS specific build targets +# ============================================================================ +# +# Build instructions: +# +# 1. Install the WebOS SDK and PDK and setup the environment variables +#    WEBOS_SDK and WEBOS_PDK accordingly. +# +# 2. Cross-compile zlib, flac, mad and tremor and install it into the PDK. +# +# 3. Prepare the ScummVM source for a webOS build: +#    $ ./configure --host=webos --enable-plugins --default-dynamic \ +#          --enable-release +# +# 4. Create the package: +#    $ make package +# +# The package is now in the "portdist" folder. +# +# See http://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for +# more detailed build instructions. +# +# +# Palm App catalog instructions: +# +# VER_PACKAGE must be set to a number which is higher than the currently +# used package version in the app catalog.  So when creating an updated +# package for ScummVM 1.3.9 and the current ScummVM package in the app +# catalog is version 1.3.0902 then you must specify VER_PACKAGE=3 to create +# the ScummVM package with version 1.3.0903.  Yeah, I know that's ugly but +# WebOS package version numbers are restricted to three numeric components. +# +# As long as Palm doesn't support Team-maintained apps the uploaded packages +# MUST NOT be packaged with the default "org.scummvm" base id.  Instead apps +# must be uploaded with a user-specific base id.  A good practice is using +# the github user as base id: com.github.<username>.  It is also necessary +# to use a user-specific app name when submitting the created package to the +# Palm app catalog.  Use "ScummVM (<username>)" instead of "ScummVM" and +# "ScummVM Beta (<username>)" instead of "ScummVM Beta". +# +# The app id is automatically parsed from the installation prefix.  So add a +# configure parameter like this to prepare a build of a package for the Palm +# App Catalog: +# +#   --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm +# +# To build a package for the Palm Beta App Catalog add "-beta" to the prefix: +# +#   --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm-beta +# ============================================================================ + +# Increment this number when the packaging of the app has been changed while +# ScummVM itself has the same version as before. The number can be reset to  +# 1 when the ScummVM version is increased. +VER_PACKAGE = 5  PATH_DIST = $(srcdir)/dists/webos  PATH_MOJO = $(PATH_DIST)/mojo +APP_ID = $(shell basename $(prefix)) +APP_VERSION = $(shell printf "%d.%d.%02d%02d" $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) $(VER_PACKAGE)) +DESTDIR ?= staging +PORTDISTDIR ?= portdist + +install: all +	$(QUIET)$(INSTALL) -d "$(DESTDIR)$(prefix)" +	$(QUIET)$(INSTALL) -m 0644 -t "$(DESTDIR)$(prefix)/" "$(PATH_MOJO)/"* +	$(QUIET)$(INSTALL) -m 0755 "$(PATH_MOJO)/start" "$(DESTDIR)$(prefix)/" +	$(QUIET)$(INSTALL) -d "$(DESTDIR)$(bindir)" +	$(QUIET)$(INSTALL) -c -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(bindir)/$(EXECUTABLE)" +	$(QUIET)$(STRIP) "$(DESTDIR)$(bindir)/$(EXECUTABLE)" +	$(QUIET)$(INSTALL) -d "$(DESTDIR)$(docdir)" +	$(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)" +	$(QUIET)$(INSTALL) -d "$(DESTDIR)$(datadir)" +	$(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/" +ifdef DYNAMIC_MODULES +	$(QUIET)$(INSTALL) -d "$(DESTDIR)$(libdir)/" +	$(QUIET)$(INSTALL) -c -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/" +	$(QUIET)$(STRIP) "$(DESTDIR)$(libdir)/"* +endif +	$(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json" +	$(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json" +ifneq (,$(findstring -beta,$(APP_ID))) +	$(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json" +else +	$(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json" +endif -STAGING_DIR=STAGING/org.scummvm.scummvm +uninstall: +	$(QUIET)$(RM_REC) "$(DESTDIR)$(prefix)" -webosrelease: -	rm -rf $(STAGING_DIR) -	rm -f *.ipk -	mkdir -p $(STAGING_DIR) -	mkdir -p $(STAGING_DIR)/bin -	mkdir -p $(STAGING_DIR)/lib -	mkdir -p $(STAGING_DIR)/share/scummvm -	cp -f $(PATH_MOJO)/* $(STAGING_DIR) -	cp -f gui/themes/translations.dat $(STAGING_DIR)/share/scummvm -	cp -f gui/themes/scummmodern.zip $(STAGING_DIR)/share/scummvm -	cp -f scummvm $(STAGING_DIR)/bin -	$(STRIP) $(STAGING_DIR)/bin/scummvm -	$(WEBOS_SDK)/bin/palm-package $(STAGING_DIR) -	rm -rf STAGING +package: uninstall install +	$(QUIET)$(RM_REC) "$(PORTDISTDIR)" +	$(QUIET)$(MKDIR) "$(PORTDISTDIR)" +	$(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format "$(DESTDIR)$(prefix)" -o "$(PORTDISTDIR)" -.PHONY: webosrelease +.PHONY: install uninstall package diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp index aa688534fc..3965f51b7f 100644 --- a/backends/platform/wii/main.cpp +++ b/backends/platform/wii/main.cpp @@ -19,6 +19,10 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_chdir +#define FORBIDDEN_SYMBOL_EXCEPTION_getcwd +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <sys/stat.h>  #include <sys/types.h>  #include <errno.h> diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index 2aefe48f0c..401b19b0e1 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -19,6 +19,12 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ +// Allow use of stuff in <time.h> +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +#define FORBIDDEN_SYMBOL_EXCEPTION_getcwd +  #include <unistd.h>  #include <ogc/conf.h> @@ -26,6 +32,7 @@  #include <ogc/lwp_watchdog.h>  #include "common/config-manager.h" +#include "common/textconsole.h"  #include "backends/fs/wii/wii-fs-factory.h"  #include "osystem.h" diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index 3c992b8bdc..0db5f92fff 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -24,7 +24,6 @@  #include <gctypes.h>  #include <gccore.h> -#include <ogcsys.h>  #include <gxflux/gfx.h> @@ -36,6 +35,7 @@  #include "backends/saves/default/default-saves.h"  #include "backends/timer/default/default-timer.h"  #include "graphics/colormasks.h" +#include "graphics/palette.h"  #include "graphics/surface.h"  #include "audio/mixer_intern.h" diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp index 5d0bca453f..8e51bbc673 100644 --- a/backends/platform/wii/osystem_events.cpp +++ b/backends/platform/wii/osystem_events.cpp @@ -19,6 +19,8 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <unistd.h>  #include <malloc.h> diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index cb9a8c72e9..b44c1270f5 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -19,6 +19,8 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <malloc.h>  #include <gxflux/gfx_con.h> @@ -537,10 +539,10 @@ Graphics::Surface *OSystem_Wii::lockScreen() {  	_surface.h = _gameHeight;  #ifdef USE_RGB_COLOR  	_surface.pitch = _gameWidth * _pfGame.bytesPerPixel; -	_surface.bytesPerPixel = _pfGame.bytesPerPixel; +	_surface.format = _pfGame;  #else  	_surface.pitch = _gameWidth; -	_surface.bytesPerPixel = 1; +	_surface.format = Graphics::PixelFormat::createFormatCLUT8();  #endif  	return &_surface; diff --git a/backends/platform/wii/osystem_sfx.cpp b/backends/platform/wii/osystem_sfx.cpp index 33397f0a93..acab6df7e1 100644 --- a/backends/platform/wii/osystem_sfx.cpp +++ b/backends/platform/wii/osystem_sfx.cpp @@ -19,6 +19,8 @@   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.   */ +#define FORBIDDEN_SYMBOL_EXCEPTION_printf +  #include <malloc.h>  #include "osystem.h" diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index b829686cb0..b54aebe6bd 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -33,6 +33,7 @@  #include "common/debug.h"  #include "common/events.h"  #include "common/util.h" +#include "common/textconsole.h"  #include "common/timer.h"  #include "common/translation.h" | 
