[Scummvm-cvs-logs] SF.net SVN: scummvm: [21055] scummvm/trunk/base

sev at users.sourceforge.net sev at users.sourceforge.net
Fri Mar 3 17:33:02 CET 2006


Revision: 21055
Author:   sev
Date:     2006-03-03 17:32:04 -0800 (Fri, 03 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=21055&view=rev

Log Message:
-----------
WIP of maemo port

Modified Paths:
--------------
    scummvm/trunk/backends/midi/seq.cpp
    scummvm/trunk/backends/sdl/sdl.cpp
    scummvm/trunk/base/main.cpp
    scummvm/trunk/sound/fmopl.cpp
    scummvm/trunk/sound/mididrv.cpp

Added Paths:
-----------
    scummvm/trunk/backends/maemo/
    scummvm/trunk/backends/maemo/Makefile
    scummvm/trunk/backends/maemo/hildon.cpp
    scummvm/trunk/backends/maemo/main.cpp
    scummvm/trunk/backends/maemo/portdefs.h

Property changes on: scummvm/trunk/backends/maemo
___________________________________________________________________
Name: svn:ignore
   + *.o
scummvm
*~


Added: scummvm/trunk/backends/maemo/Makefile
===================================================================
--- scummvm/trunk/backends/maemo/Makefile	                        (rev 0)
+++ scummvm/trunk/backends/maemo/Makefile	2006-03-04 01:32:04 UTC (rev 21055)
@@ -0,0 +1,54 @@
+# ScummVM Maemo MakeFile
+# $Header: /cvsroot/scummvm/scummvm/backends/psp/Makefile,v 1.6 2005/11/20 17:36:02 joostp Exp $
+
+#control build
+DISABLE_HQ_SCALERS = true
+
+srcdir = ../..
+VPATH = $(srcdir)
+
+CXX := g++
+EXECUTABLE  := scummvm
+
+INCDIR = ../../
+
+CXXFLAGS := -g -ansi -W -Wno-unused-parameter
+CXXFLAGS += `pkg-config --cflags gconf-2.0 hildon-libs gtk+-2.0 libosso gdk-2.0`
+CXXFLAGS += $(addprefix -I,$(INCDIR)) -I. -Wall $(CXXFLAGS)
+CXXFLAGS += -O -Wuninitialized
+CXXFLAGS += -Wno-long-long -Wno-multichar -Wno-unknown-pragmas
+# Even more warnings...
+CXXFLAGS += -pedantic -Wpointer-arith -Wcast-qual -Wconversion
+CXXFLAGS += -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor
+CXXFLAGS += -Wno-reorder -Wwrite-strings -fcheck-new
+
+LIBS     += -lz -L/usr/lib -lSDL -lpthread -lXsp -losso
+LIBS     += `pkg-config --libs gconf-2.0 hildon-libs gtk+-2.0 libosso gdk-2.0`
+INCLUDES += -I/usr/include/SDL -D_REENTRANT -I/usr/X11R6/include
+OBJS     += 
+DEFINES  += -DUNIX -DNONSTANDARD_PORT -D__MAEMO__
+LDFLAGS  += 
+
+RANLIB  := ranlib
+INSTALL := install
+AR      := ar cru
+MKDIR   := mkdir -p
+ECHO    := printf
+CAT     := cat
+RM      := rm -f
+RM_REC  := rm -f -r
+CP      := cp
+
+OBJS := main.o
+
+MODULE_DIRS += .
+
+
+BACKEND := sdl
+MODULES +=  backends/sdl base
+MODULE_DIRS += .
+
+HAVE_GCC3 = 1
+
+include $(srcdir)/Makefile.common
+


Property changes on: scummvm/trunk/backends/maemo/Makefile
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: scummvm/trunk/backends/maemo/hildon.cpp
===================================================================
--- scummvm/trunk/backends/maemo/hildon.cpp	                        (rev 0)
+++ scummvm/trunk/backends/maemo/hildon.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -0,0 +1,134 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * 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 <hildon-widgets/hildon-app.h>
+#include <gtk/gtk.h>
+#include <libosso.h>
+
+#define OSSO_APP_NAME    "scummvm"
+#define OSSO_APP_VERSION "0.9.0CVS"
+#define OSSO_APP_SERVICE "org.scummvm."OSSO_APP_NAME
+#define OSSO_APP_OBJECT  "/org/scummvm/"OSSO_APP_NAME
+#define OSSO_APP_IFACE   "org.scummvm."OSSO_APP_NAME
+
+// Application UI data struct
+typedef struct _AppData AppData;
+struct _AppData {
+    HildonApp *app;
+    HildonAppView *appview;
+    osso_context_t *osso_context;
+};
+
+// Callback for exit D-BUS event
+void exit_event_handler(gboolean die_now, gpointer data) {
+    AppData *appdata;
+    appdata = (AppData *)data;
+    g_print("exit_event_handler called\n");
+    /* Do whatever application needs to do before exiting */
+    gtk_infoprint(GTK_WINDOW(appdata->app), "Exiting...");
+}
+
+// Callback for normal D-BUS messages
+gint dbus_req_handler(const gchar *interface, const gchar *method,
+                      GArray *arguments, gpointer data,
+                      osso_rpc_t *retval) {
+    AppData *appdata;
+    appdata = (AppData *)data;
+    osso_system_note_infoprint(appdata->osso_context, method, retval);
+    return OSSO_OK;
+}
+
+
+// Main application
+int main(int argc, char *argv[]) {
+    // Create needed variables
+    HildonApp *app;
+    HildonAppView *appview;
+    osso_context_t *osso_context;
+    osso_return_t result;
+    GtkWidget *main_vbox;
+    GtkWidget *label;
+
+    // Initialize the GTK.
+    gtk_init(&argc, &argv);
+
+    // Initialize maemo application
+    osso_context = osso_initialize(OSSO_APP_NAME, OSSO_APP_VERSION, TRUE, NULL);
+
+    // Check that initialization was ok
+    if (osso_context == NULL) {
+        return OSSO_ERROR;
+    }
+
+    // Create the hildon application and setup the title
+    app = HILDON_APP(hildon_app_new());
+    hildon_app_set_title(app, "ScummVM");
+    hildon_app_set_two_part_title(app, TRUE);
+
+    // Create HildonAppView and set it to HildonApp
+    appview = HILDON_APPVIEW(hildon_appview_new("AppView Title"));
+    hildon_app_set_appview(app, appview);
+
+    // Create AppData
+    AppData *appdata;
+    appdata = g_new0(AppData, 1);
+    appdata->app = app;
+    appdata->appview = appview;
+    appdata->osso_context = osso_context;
+
+    // Add vbox to appview
+    main_vbox = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(appview), main_vbox);
+
+    // Add button to vbox
+    label = gtk_label_new("Waiting for DBUS message...");
+    gtk_box_pack_start(GTK_BOX(main_vbox), label, FALSE, TRUE, 0);
+
+    // Add handler for hello D-BUS messages
+    result = osso_rpc_set_cb_f(appdata->osso_context, 
+                               OSSO_APP_SERVICE, 
+                               OSSO_APP_OBJECT, 
+                               OSSO_APP_IFACE,
+                               dbus_req_handler, appdata);
+    if (result != OSSO_OK) {
+        g_print("Error setting D-BUS callback (%d)\n", result);
+        return OSSO_ERROR;
+    }
+
+    // Add handler for Exit D-BUS messages
+    result = osso_application_set_exit_cb(appdata->osso_context,
+                                          exit_event_handler,
+                                          (gpointer) appdata);
+    if (result != OSSO_OK) {
+        g_print("Error setting exit callback (%d)\n", result);
+        return OSSO_ERROR;
+    }
+
+    // Begin the main application
+    gtk_widget_show_all(GTK_WIDGET(app));
+    gtk_main();
+
+    // Deinitialize OSSO
+    osso_deinitialize(osso_context);
+
+    return 0;
+}


Property changes on: scummvm/trunk/backends/maemo/hildon.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: scummvm/trunk/backends/maemo/main.cpp
===================================================================
--- scummvm/trunk/backends/maemo/main.cpp	                        (rev 0)
+++ scummvm/trunk/backends/maemo/main.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -0,0 +1,76 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * 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$
+ *
+ */
+ 
+#define	REAL_MAIN
+#include <common/stdafx.h>
+#include <common/scummsys.h>
+#include <X11/Xlib.h> 
+#include <X11/extensions/Xsp.h>
+
+#include <SDL/SDL.h>
+#include <SDL/SDL_syswm.h>
+
+#include <hildon-widgets/hildon-app.h>
+#include <gtk/gtk.h>
+#include <libosso.h>
+
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#define OSSO_APP_NAME    "scummvm"
+#define OSSO_APP_VERSION "0.9.0CVS"
+
+void set_doubling(unsigned char enable) {
+  return;
+
+  SDL_SysWMinfo wminfo;
+  SDL_VERSION(&wminfo.version);
+  SDL_GetWMInfo(&wminfo);
+  XSPSetPixelDoubling(wminfo.info.x11.display, 0, enable);
+}
+
+extern "C" int scummvm_main(int argc, char *argv[]);
+
+int main(int argc, char *argv[]) {
+    osso_context_t *osso_context;
+
+    // Initialize maemo application
+    //osso_context = osso_initialize(OSSO_APP_NAME, OSSO_APP_VERSION, TRUE, NULL);
+
+    // Check that initialization was ok
+    //if (osso_context == NULL) {
+	//   return OSSO_ERROR;
+    //}
+
+	// Maemo task navigator priority inheritance fix                             
+	setpriority(PRIO_PROCESS, 0, 0);
+
+	set_doubling(0);
+	scummvm_main(argc, argv);
+
+    /* Deinitialize OSSO */
+    //osso_deinitialize(osso_context);
+
+	set_doubling(0);
+	
+	return 0;
+}


Property changes on: scummvm/trunk/backends/maemo/main.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: scummvm/trunk/backends/maemo/portdefs.h
===================================================================
--- scummvm/trunk/backends/maemo/portdefs.h	                        (rev 0)
+++ scummvm/trunk/backends/maemo/portdefs.h	2006-03-04 01:32:04 UTC (rev 21055)
@@ -0,0 +1,75 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * 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$
+ *
+ */
+
+#ifndef PORTDEFS_H
+#define PORTDEFS_H
+
+#define SCUMM_LITTLE_ENDIAN
+#define SCUMM_NEED_ALIGNMENT
+
+#undef HAVE_X86
+
+#undef LINUPY
+
+/* Data types */
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned int uint32;
+typedef signed char int8;
+typedef signed short int16;
+typedef signed int int32;
+
+/* Libs */
+#undef USE_VORBIS
+#undef USE_TREMOR
+#undef USE_FLAC
+#undef USE_MAD
+#define USE_ZLIB
+#undef USE_MPEG2
+#undef USE_MT32EMU
+
+/* Whether we should use i386 assembly routines */
+#undef USE_NASM
+
+#undef main
+
+#ifndef REAL_MAIN
+#define main scummvm_main
+#endif
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+#include <time.h>
+#include <math.h>
+
+void set_doubling(unsigned char enable);
+
+#endif /* PORTDEFS_H */
+
+


Property changes on: scummvm/trunk/backends/maemo/portdefs.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Modified: scummvm/trunk/backends/midi/seq.cpp
===================================================================
--- scummvm/trunk/backends/midi/seq.cpp	2006-03-04 01:02:49 UTC (rev 21054)
+++ scummvm/trunk/backends/midi/seq.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -26,7 +26,7 @@
  *    both the QuickTime support and (vkeybd http://www.alsa-project.org/~iwai/alsa.html)
  */
 
-#if defined(UNIX) && !defined(__BEOS__)
+#if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__)
 
 #include "common/stdafx.h"
 #include "sound/mpu401.h"

Modified: scummvm/trunk/backends/sdl/sdl.cpp
===================================================================
--- scummvm/trunk/backends/sdl/sdl.cpp	2006-03-04 01:02:49 UTC (rev 21054)
+++ scummvm/trunk/backends/sdl/sdl.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -78,7 +78,7 @@
 	_scaleFactor = 1;
 	_scalerProc = Normal1x;
 
-#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) &&  !defined(__MAEMO__)
 	_fullscreen = ConfMan.getBool("fullscreen");
 #else
 	_fullscreen = true;

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2006-03-04 01:02:49 UTC (rev 21054)
+++ scummvm/trunk/base/main.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -331,7 +331,7 @@
 
 #ifdef _WIN32_WCE
 extern "C" int scummvm_main(GameDetector &detector, int argc, char *argv[]) {
-#elif defined(__PLAYSTATION2__) || defined(__PSP__) || defined(__GP32__)
+#elif defined(__PLAYSTATION2__) || defined(__PSP__) || defined(__GP32__) || defined(__MAEMO__)
 extern "C" int scummvm_main(int argc, char *argv[]) {
 #else
 extern "C" int main(int argc, char *argv[]) {

Modified: scummvm/trunk/sound/fmopl.cpp
===================================================================
--- scummvm/trunk/sound/fmopl.cpp	2006-03-04 01:02:49 UTC (rev 21054)
+++ scummvm/trunk/sound/fmopl.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -35,7 +35,7 @@
 
 #include "common/util.h"
 
-#if defined (_WIN32_WCE) || defined (__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__)
+#if defined (_WIN32_WCE) || defined (__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__) || defined (__MAEMO__)
 #include "common/config-manager.h"
 #endif
 
@@ -1143,7 +1143,7 @@
 	// We need to emulate one YM3812 chip
 	int env_bits = FMOPL_ENV_BITS_HQ;
 	int eg_ent = FMOPL_EG_ENT_HQ;
-#if defined (_WIN32_WCE) || defined(__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__)
+#if defined (_WIN32_WCE) || defined(__SYMBIAN32__) || defined(PALMOS_MODE) || defined(__GP32__) || defined(__MAEMO__)
 	if (ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) {
 		env_bits = FMOPL_ENV_BITS_HQ;
 		eg_ent = FMOPL_EG_ENT_HQ;

Modified: scummvm/trunk/sound/mididrv.cpp
===================================================================
--- scummvm/trunk/sound/mididrv.cpp	2006-03-04 01:02:49 UTC (rev 21054)
+++ scummvm/trunk/sound/mididrv.cpp	2006-03-04 01:32:04 UTC (rev 21055)
@@ -45,7 +45,7 @@
 	{"alsa", "ALSA", MD_ALSA, MDT_MIDI},
 #endif
 
-#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX)
+#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) 
 	{"seq", "SEQ", MD_SEQ, MDT_MIDI},
 #endif
 
@@ -243,7 +243,7 @@
 #if defined(__MORPHOS__)
 	case MD_ETUDE:     return MidiDriver_ETUDE_create();
 #endif
-#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX)
+#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__)
 	case MD_SEQ:       return MidiDriver_SEQ_create();
 #endif
 #if defined(MACOSX)







More information about the Scummvm-git-logs mailing list