diff options
author | John Willis | 2010-09-06 17:22:22 +0000 |
---|---|---|
committer | John Willis | 2010-09-06 17:22:22 +0000 |
commit | e81dad8e61fca9ca740051fcfcec639354689875 (patch) | |
tree | fd212225e8e159836a7f3667cfa8e19d52da4745 /backends/platform/openpandora | |
parent | c87b7aafd874bbec29fdd109f0e9a442e8418834 (diff) | |
download | scummvm-rg350-e81dad8e61fca9ca740051fcfcec639354689875.tar.gz scummvm-rg350-e81dad8e61fca9ca740051fcfcec639354689875.tar.bz2 scummvm-rg350-e81dad8e61fca9ca740051fcfcec639354689875.zip |
OPENPANDORA: Commit basic version of the OpenPandora backend.
Overload of the SDL backend.
Basic functional backend with support for most main ScummVM features and engines.
Supports building to a .PND OpenPandora bundle for ease of use on the device.
svn-id: r52598
Diffstat (limited to 'backends/platform/openpandora')
19 files changed, 1005 insertions, 0 deletions
diff --git a/backends/platform/openpandora/build/PXML.xml b/backends/platform/openpandora/build/PXML.xml new file mode 100755 index 0000000000..57299a6cbd --- /dev/null +++ b/backends/platform/openpandora/build/PXML.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<PXML xmlns="http://openpandora.org/namespaces/PXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PXML_schema.xsd"> + + <application id="scummvm.djwillis.0001" appdata="scummvm"> + + <title lang="en_US">ScummVM</title> + + <exec command="./runscummvm.sh"/> + <icon src="icon/scummvm.png"/> + + <previewpics> + <pic src="icon/preview-pic.png"/> + </previewpics> + + <info name="ScummVM Documentation" type="text/html" src="docs/index.html"/> + + <description lang="en_US">Point & click game interpreter.</description> + + <author name="DJWillis" website="http://www.scummvm.org/"/> + + <version major="1" minor="1" release="1" build="1"/><!--This programs version--> + <osversion major="1" minor="0" release="0" build="0"/><!--The minimum OS version required--> + + <categories> + <category name="Game"><!--category like "Games", "Graphics", "Internet" etc--> + <subcategory name="Adventure Games"/><!--subcategory, like "Board Games", "Strategy", "First Person Shooters"--> + </category> + </categories> + + <clockspeed frequency="500"/><!--Frequency in Hz--> + + </application> + +</PXML> diff --git a/backends/platform/openpandora/build/README-OPENPANDORA b/backends/platform/openpandora/build/README-OPENPANDORA new file mode 100755 index 0000000000..18bfd3be21 --- /dev/null +++ b/backends/platform/openpandora/build/README-OPENPANDORA @@ -0,0 +1,140 @@ +ScummVM - OPENPANDORA SPECIFIC README - HEAD SVN +------------------------------------------------------------------------ + +Contents: + + * About the backend/port <#About_the_backendport> + * Game compatability <#Game_compatibility> + * Included engines <#Included_engines> + * Supported audio options <#Supported_audio_options> + * Supported cut-scene options <#Supported_cut-scene_options> + * Recent changes <#Recent_changes> + * How to save <#How_to_save> + * Controller mappings <#Controller_mappings> + * Known issues <#Knonw_issues> + * Additional resources/links <#Additional_resourceslinks> + * Credits <#Credits> + +------------------------------------------------------------------------ + +Please refer to the: + +ScummVM Forum: <http://forums.scummvm.org/> +WiKi: <http://wiki.scummvm.org/index.php/OpenPandora> + +for the most current information on the port and any updates to this +documentation. + +------------------------------------------------------------------------ +About the backend/port + +This is the readme for the official GP2XWiz ScummVM backend (also known as +the GP2XWiz port). + +This is an SVN test release of ScummVM for the GP2XWiz, it would be +appreciated if this SVN test distribution was not mirrored and that +people be directed to http://scummvm.distant-earth.com/ instead for +updated SVN builds. + +Full supported official releases of the GP2X WIZ ScummVM backend are made in +line with main official releases and are avalalble from the ScummVM +downloads page <http://www.scummvm.org/downloads.php>. + +This build is in an active state of development and as such no +"expected" behavior can be guaranteed ;). + +------------------------------------------------------------------------ +Game compatibility + +For information on the compatability of a specific game please refer to +the GP2XWiz compatability section of the ScummVM WiKi +<http://wiki.scummvm.org/index.php/GP2XWiz#Compatibility_List>. + +Please note the version and date of the ScummVM build you are running +when reviewing the above list. + +------------------------------------------------------------------------ +Supported audio options + +Raw audio. +MP3 audio. +OGG Vorbis audio. + +FLAC audio is currently unsupported. + +For best results use uncompressed audio in games. + +------------------------------------------------------------------------ +How to save + +NOTE: Everything is saved to the SD card, saves are stored in the saves +folder under your main ScummVM executable unless you set another save +location. + +The configiration file for ScummVM (.scummvmrc) is stored in the same +place as the ScummVM executable. + +The save process below is for Scumm engine games but the principle is +the same for all. + +In Game. + +1. Menu Button +2. Select SAVE with B +3. Select a position with B +4. Right trigger puts 0 in the name box for some text. +5. Press B to save + +Basically the emulated keys you can use are equivelent to the values +buttons are mapped to, + +------------------------------------------------------------------------ +Controller mappings + +Touch screen: +Touch: Move Pointer and Left click + +Mouse emulation: + +dPad: Move Pointer +B: Left click +X: Right click + +Keyboard emulation: + +Right Trigger: Return +Select: Escape +Y: Space Bar (Pause) +Menu: Game Menu (Save, Load, Quit etc.) +Volume Buttons: Increase and Decrease volume + +Fancy button combos: + +NOTE: To use button combos press and hold the Left Trigger then... + +Right Trigger: Display Virtual Keyboard +Menu: Bring up the Global main menu for ScummVM +Select: Exit ScummVM completely (and gracefully) + +------------------------------------------------------------------------ +Known issues + +No major known issues + +------------------------------------------------------------------------ +Additional resources/links + + * ScummVM WiKi GP2X page <http://wiki.scummvm.org/index.php/GP2X> + * ScummVM forums GP2X forum + <http://forums.scummvm.org/viewforum.php?f=14> + * My own ScummVM page <http://scummvm.distant-earth.com/> (for + SVN/test builds) + * Main ScummVM site <http://www.scummvm.org> (for official supported + release builds) + +------------------------------------------------------------------------ +Credits + +Core ScummVM code (c) The ScummVM Team +GP2X Wiz backend (c) John Willis +Detailed (c) information can be found within the source code diff --git a/backends/platform/openpandora/build/README-PND.txt b/backends/platform/openpandora/build/README-PND.txt new file mode 100755 index 0000000000..38b22fc38d --- /dev/null +++ b/backends/platform/openpandora/build/README-PND.txt @@ -0,0 +1,38 @@ +ScummVM - OPENPANDORA README - HOW TO INSTALL +------------------------------------------------------------------------ + +Please refer to the: + +ScummVM Forum: <http://forums.scummvm.org/> +WiKi: <http://wiki.scummvm.org/index.php/OpenPandora> + +for the most current information on the port and any updates to this +documentation. + +------------------------------------------------------------------------ +Installing: + +This archive contains ScummVM in a PND format ready to be copied to the +OpenPandora and used. + +To install just copy the .pnd file from this archive to your device. + +You will need to place the .pnd file in a suitable location on your SD +card. + +/pandora/desktop <- place here if you wish the icon to show on the + desktop. Documentation will show in the menu. + +/pandora/menu <- place here if you wish the icon to show on the + Xfce menu. Documentation will show in the menu. + +/pandora/apps <- place here if you wish the icon to show on the + desktop and in the menu. Documentation will show + in the menu. + +------------------------------------------------------------------------ +Credits + +Core ScummVM code (c) The ScummVM Team +OpenPandora backend (c) John Willis +Detailed (c) information can be found within the source code diff --git a/backends/platform/openpandora/build/build.sh b/backends/platform/openpandora/build/build.sh new file mode 100755 index 0000000000..10b98fe092 --- /dev/null +++ b/backends/platform/openpandora/build/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +echo Quick script to make building all the time less painful. + +. /usr/local/angstrom/arm/environment-setup + +CROSS_COMPILE=arm-angstrom-linux-gnueabi- +export CROSS_COMPILE + +# Export the tool names for cross-compiling +export CXX=arm-angstrom-linux-gnueabi-g++ +export CC=arm-angstrom-linux-gnueabi-gcc +export DEFINES=-DNDEBUG + +cd ../../../.. + +echo Building ScummVM/OpenPandora. +make + +echo Build for OpenPandora complete - Please check build logs. diff --git a/backends/platform/openpandora/build/bundle.sh b/backends/platform/openpandora/build/bundle.sh new file mode 100755 index 0000000000..12d34380bc --- /dev/null +++ b/backends/platform/openpandora/build/bundle.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +. /usr/local/angstrom/arm/environment-setup + +CROSS_COMPILE=arm-angstrom-linux-gnueabi- +export CROSS_COMPILE + +echo Quick script to make building a distribution of the OpenPanodra backend more consistent. + +cd ../../../.. + +make op-bundle +make op-pnd diff --git a/backends/platform/openpandora/build/clean.sh b/backends/platform/openpandora/build/clean.sh new file mode 100755 index 0000000000..3574db2298 --- /dev/null +++ b/backends/platform/openpandora/build/clean.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +echo Quick script to make building all the time less painful. + +. /usr/local/angstrom/arm/environment-setup + +cd ../../../.. + +echo Cleaning ScummVM for the OpenPandora. +make clean diff --git a/backends/platform/openpandora/build/config-alleng.sh b/backends/platform/openpandora/build/config-alleng.sh new file mode 100755 index 0000000000..cd9a17ef40 --- /dev/null +++ b/backends/platform/openpandora/build/config-alleng.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +echo Quick script to make running configure all the time less painful +echo and let all the build work be done from the backend/build folder. + +. /usr/local/angstrom/arm/environment-setup + +CROSS_COMPILE=arm-angstrom-linux-gnueabi- +export CROSS_COMPILE + +# Export the tool names for cross-compiling +export CXX=arm-angstrom-linux-gnueabi-g++ +export CPPFLAGS=-I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include +export LDFLAGS=-L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib + +export DEFINES=-DNDEBUG + +# Edit the configure line to suit. +cd ../../../.. +./configure --backend=openpandora --host=openpandora --disable-nasm --with-sdl-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin --with-mpeg2-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --disable-vorbis --enable-tremor --with-tremor-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --enable-zlib --with-zlib-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --enable-mad --with-mad-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --enable-all-engines --enable-plugins --default-dynamic + +echo Generating config for OpenPandora complete. Check for errors. diff --git a/backends/platform/openpandora/build/config.sh b/backends/platform/openpandora/build/config.sh new file mode 100755 index 0000000000..8be16f1317 --- /dev/null +++ b/backends/platform/openpandora/build/config.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +echo Quick script to make running configure all the time less painful +echo and let all the build work be done from the backend/build folder. + +. /usr/local/angstrom/arm/environment-setup + +CROSS_COMPILE=arm-angstrom-linux-gnueabi- +export CROSS_COMPILE + +# Export the tool names for cross-compiling +export CXX=arm-angstrom-linux-gnueabi-g++ +export CPPFLAGS=-I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include +export LDFLAGS=-L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib + +export DEFINES=-DNDEBUG + +# Edit the configure line to suit. +cd ../../../.. +./configure --backend=openpandora --host=openpandora --disable-nasm --with-sdl-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin --with-mpeg2-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --disable-vorbis --enable-tremor --with-tremor-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --enable-zlib --with-zlib-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --enable-mad --with-mad-prefix=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr --enable-plugins --default-dynamic + +echo Generating config for OpenPandora complete. Check for errors. diff --git a/backends/platform/openpandora/build/icon/preview-pic.png b/backends/platform/openpandora/build/icon/preview-pic.png Binary files differnew file mode 100755 index 0000000000..2f4a536d30 --- /dev/null +++ b/backends/platform/openpandora/build/icon/preview-pic.png diff --git a/backends/platform/openpandora/build/icon/scummvm.png b/backends/platform/openpandora/build/icon/scummvm.png Binary files differnew file mode 100755 index 0000000000..128e59efc4 --- /dev/null +++ b/backends/platform/openpandora/build/icon/scummvm.png diff --git a/backends/platform/openpandora/build/index.html b/backends/platform/openpandora/build/index.html new file mode 100755 index 0000000000..34d381d0f8 --- /dev/null +++ b/backends/platform/openpandora/build/index.html @@ -0,0 +1,26 @@ +<html> + +<h3> + <p>Welcome to the ScummVM!</p> +</h3> + +<h4> + <p>ScummVM: OpenPandora Specific Documentation</p> +</h4> + +<A href="docs/README-OPENPANDORA">ScummVM OpenPandora README</a><br/> +<A href="http://scummvm.distant-earth.com/">ScummVM OpenPandora Website</a><br/> +<A href="http://wiki.scummvm.org/index.php/OpenPandora">ScummVM OpenPandora WiKi</a><br/> + +<h4> + <p>ScummVM: General Documentation</p> +</h4> + +<A href="http://www.scummvm.org/">ScummVM website</a><br/> +<A href="docs/README">ScummVM README</a><br/> +<A href="docs/NEWS">ScummVM NEWS</a><br/> +<A href="docs/AUTHORS">ScummVM Authors</a><br/> +<A href="docs/COPYRIGHT">ScummVM Copyright</a><br/> +<A href="docs/COPYING">GPL Licence</a><br/> + +</html> diff --git a/backends/platform/openpandora/build/pnd_make.sh b/backends/platform/openpandora/build/pnd_make.sh new file mode 100755 index 0000000000..dcdcaceecd --- /dev/null +++ b/backends/platform/openpandora/build/pnd_make.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +######adjust path of genpxml.sh if you want to use that "feture"##### + +TEMP=`getopt -o p:d:x:i:c -- "$@"` + +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi + +eval set -- "$TEMP" +while true ; do + case "$1" in + -p) echo "PNDNAME set to $2" ;PNDNAME=$2;shift 2;; + -d) echo "FOLDER set to $2" ;FOLDER=$2;shift 2 ;; + -x) echo "PXML set to $2" ;PXML=$2;shift 2 ;; + -i) echo "ICON set to $2" ;ICON=$2;shift 2 ;; + -c) echo "-c set, will create compressed squasfs image instead of iso $2" ;SQUASH=1;shift 1 ;; + --) shift ; break ;; + *) echo "Error while parsing arguments! $2" ; exit 1 ;; + esac +done + +rnd=$RANDOM; # random number for genpxml and index$rnd.xml + +#generate pxml if guess or empty +if [ ! $PXML ] || [ $PXML = "guess" ] && [ $PNDNAME ] && [ $FOLDER ]; then + PXMLtxt=$(/home/user/libpnd/pandora-libraries/testdata/scripts/genpxml.sh $FOLDER $ICON) + PXML=$FOLDER/PXML.xml + echo "$PXMLtxt" > $FOLDER/PXML.xml +fi + +#check arguments +if [ ! $PNDNAME ] || [ ! $FOLDER ] || [ ! $PXML ]; then + echo " Usage: pnd_make.sh -p your.pnd -d folder/containing/your/app/ -x + your.pxml (or \"guess\" to try to generate it from the folder) -i icon.png" + exit 1 +fi +if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi #check if folder actually exists +if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi #check if pxml actually exists + +#make iso from folder +if [ ! $SQUASH ]; then + mkisofs -o $PNDNAME.iso -R $FOLDER +else + if [ $(mksquashfs -version | awk '{if ($3 >= 4) print 1}') = 1 ]; then + echo "your squashfs version is older then version 4, please upgrade to 4.0 or later" + exit 1 + fi + mksquashfs -no-recovery -nopad $FOLDER $PNDNAME.iso +fi +#append pxml to iso +cat $PNDNAME.iso $PXML > $PNDNAME +rm $PNDNAME.iso #cleanup + +#append icon if specified +if [ $ICON ]; then # check if we want to add an icon + if [ ! -f $ICON ]; then #does the icon actually exist? + echo "$ICON doesnt exist" + else # yes + mv $PNDNAME $PNDNAME.tmp + cat $PNDNAME.tmp $ICON > $PNDNAME # append icon + rm $PNDNAME.tmp #cleanup + fi +fi + +if [ $PXML = "guess" ];then rm $FOLDER/PXML.xml; fi #cleanup diff --git a/backends/platform/openpandora/build/runscummvm.sh b/backends/platform/openpandora/build/runscummvm.sh new file mode 100755 index 0000000000..0745bb41fd --- /dev/null +++ b/backends/platform/openpandora/build/runscummvm.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Make sure any extra libs not in the firmware are pulled in. +LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:../lib +export LD_LIBRARY_PATH + +# Ensure we have a folder to store save games on the SD card. +mkdir saves + +# make a runtime dir, just incase it creates anything in CWD +mkdir runtime +cd runtime + +../bin/scummvm --fullscreen --gfx-mode=2x --config=scummvmrc --extrapath=../data --savepath=../saves diff --git a/backends/platform/openpandora/module.mk b/backends/platform/openpandora/module.mk new file mode 100755 index 0000000000..c8a4b1b32d --- /dev/null +++ b/backends/platform/openpandora/module.mk @@ -0,0 +1,15 @@ +MODULE := backends/platform/openpandora + +MODULE_OBJS := \ + op-graphics.o \ + op-events.o \ + op-main.o + +MODULE_DIRS += \ + backends/platform/openpandora/ + +# We don't use the rules.mk here on purpose +OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS) + +# Hack to ensure the SDL backend is built so we can use OSystem_SDL. +-include $(srcdir)/backends/platform/sdl/module.mk
\ No newline at end of file diff --git a/backends/platform/openpandora/op-bundle.mk b/backends/platform/openpandora/op-bundle.mk new file mode 100755 index 0000000000..a08d64a643 --- /dev/null +++ b/backends/platform/openpandora/op-bundle.mk @@ -0,0 +1,85 @@ +# Special target to create bundles and PND's for the OpenPandora. + +#bundle_name = release/scummvm-op-`date '+%Y-%m-%d'` +bundle_name = release/scummvm-op +f=$(shell which $(STRIP)) +libloc = $(shell dirname $(f)) + +op-bundle: $(EXECUTABLE) + $(MKDIR) "$(bundle_name)" + $(MKDIR) "$(bundle_name)/scummvm" + $(MKDIR) "$(bundle_name)/scummvm/bin" + $(MKDIR) "$(bundle_name)/scummvm/data" + $(MKDIR) "$(bundle_name)/scummvm/docs" + $(MKDIR) "$(bundle_name)/scummvm/icon" + $(MKDIR) "$(bundle_name)/scummvm/lib" + + $(CP) $(srcdir)/backends/platform/openpandora/build/runscummvm.sh $(bundle_name)/scummvm/ + $(CP) $(srcdir)/backends/platform/openpandora/build/PXML.xml $(bundle_name)/scummvm/data/ + + $(CP) $(srcdir)/backends/platform/openpandora/build/icon/scummvm.png $(bundle_name)/scummvm/icon/ + $(CP) $(srcdir)/backends/platform/openpandora/build/icon/preview-pic.png $(bundle_name)/scummvm/icon/ + + + $(CP) $(srcdir)/backends/platform/openpandora/build/README-OPENPANDORA $(bundle_name)/scummvm/docs/ + $(CP) $(srcdir)/backends/platform/openpandora/build/index.html $(bundle_name)/scummvm/docs/ + + $(INSTALL) -c -m 644 $(DIST_FILES_DOCS) $(bundle_name)/scummvm/docs/ + + $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/data/ + $(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/data/ + + $(STRIP) $(EXECUTABLE) -o $(bundle_name)/scummvm/bin/$(EXECUTABLE) + +ifdef DYNAMIC_MODULES + $(INSTALL) -d "$(bundle_name)/scummvm/plugins" + $(INSTALL) -c -m 644 $(PLUGINS) "$(bundle_name)/scummvm/plugins" + $(STRIP) $(bundle_name)/scummvm/plugins/* +endif + + $(CP) $(libloc)/../arm-angstrom-linux-gnueabi/usr/lib/libFLAC.so.8.2.0 $(bundle_name)/scummvm/lib/libFLAC.so.8 + tar -C $(bundle_name) -cvjf $(bundle_name).tar.bz2 . + rm -R ./$(bundle_name) + +op-pnd: $(EXECUTABLE) + $(MKDIR) "$(bundle_name)" + $(MKDIR) "$(bundle_name)/scummvm" + $(MKDIR) "$(bundle_name)/scummvm/bin" + $(MKDIR) "$(bundle_name)/scummvm/data" + $(MKDIR) "$(bundle_name)/scummvm/docs" + $(MKDIR) "$(bundle_name)/scummvm/icon" + $(MKDIR) "$(bundle_name)/scummvm/lib" + + $(CP) $(srcdir)/backends/platform/openpandora/build/runscummvm.sh $(bundle_name)/scummvm/ + $(CP) $(srcdir)/backends/platform/openpandora/build/PXML.xml $(bundle_name)/scummvm/data/ + + $(CP) $(srcdir)/backends/platform/openpandora/build/icon/scummvm.png $(bundle_name)/scummvm/icon/ + $(CP) $(srcdir)/backends/platform/openpandora/build/icon/preview-pic.png $(bundle_name)/scummvm/icon/ + + + $(CP) $(srcdir)/backends/platform/openpandora/build/README-OPENPANDORA $(bundle_name)/scummvm/docs/ + $(CP) $(srcdir)/backends/platform/openpandora/build/index.html $(bundle_name)/scummvm/docs/ + + $(INSTALL) -c -m 644 $(DIST_FILES_DOCS) $(bundle_name)/scummvm/docs/ + + $(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(bundle_name)/scummvm/data/ + $(INSTALL) -c -m 644 $(DIST_FILES_ENGINEDATA) $(bundle_name)/scummvm/data/ + + $(STRIP) $(EXECUTABLE) -o $(bundle_name)/scummvm/bin/$(EXECUTABLE) + +ifdef DYNAMIC_MODULES + $(INSTALL) -d "$(bundle_name)/scummvm/plugins" + $(INSTALL) -c -m 644 $(PLUGINS) "$(bundle_name)/scummvm/plugins" + $(STRIP) $(bundle_name)/scummvm/plugins/* +endif + + $(CP) $(libloc)/../arm-angstrom-linux-gnueabi/usr/lib/libFLAC.so.8.2.0 $(bundle_name)/scummvm/lib/libFLAC.so.8 + + $(srcdir)/backends/platform/openpandora/build/pnd_make.sh -p $(bundle_name).pnd -d $(bundle_name)/scummvm -x $(bundle_name)/scummvm/data/PXML.xml -i $(bundle_name)/scummvm/icon/scummvm.png + + $(CP) $(srcdir)/backends/platform/openpandora/build/README-PND.txt $(bundle_name) + tar -cvjf $(bundle_name)-pnd.tar.bz2 $(bundle_name).pnd $(bundle_name)/README-PND.txt + rm -R ./$(bundle_name) +# rm $(bundle_name).pnd + +.PHONY: op-bundle op-pnd diff --git a/backends/platform/openpandora/op-events.cpp b/backends/platform/openpandora/op-events.cpp new file mode 100755 index 0000000000..b1caa7bb8a --- /dev/null +++ b/backends/platform/openpandora/op-events.cpp @@ -0,0 +1,182 @@ +/* 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$ + * + */ + +/* + * OpenPandora: Device Specific Event Handling. + * + */ + +#include "backends/platform/openpandora/op-sdl.h" + +bool OSystem_OP::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) { + if (ev.button.button == SDL_BUTTON_LEFT){ + SDLMod mod=SDL_GetModState(); + if (mod & KMOD_RCTRL) /* KMOD_RCTRL = Right Trigger */ + event.type = Common::EVENT_RBUTTONDOWN; + else if ( mod & KMOD_RSHIFT) /* KMOD_RSHIFT = Left Trigger */ + event.type = Common::EVENT_MOUSEMOVE; + else + event.type = Common::EVENT_LBUTTONDOWN; + } + else if (ev.button.button == SDL_BUTTON_RIGHT) + event.type = Common::EVENT_RBUTTONDOWN; +#if defined(SDL_BUTTON_WHEELUP) && defined(SDL_BUTTON_WHEELDOWN) + else if (ev.button.button == SDL_BUTTON_WHEELUP) + event.type = Common::EVENT_WHEELUP; + else if (ev.button.button == SDL_BUTTON_WHEELDOWN) + event.type = Common::EVENT_WHEELDOWN; +#endif +#if defined(SDL_BUTTON_MIDDLE) + else if (ev.button.button == SDL_BUTTON_MIDDLE) + event.type = Common::EVENT_MBUTTONDOWN; +#endif + else + return false; + + // People can use the touchscreen so may have no mouse motion events between taps. + // Not sure if this fixes anything ;). + // setMousePos(event.mouse.x, event.mouse.y); + + fillMouseEvent(event, ev.button.x, ev.button.y); + + return true; +} + +bool OSystem_OP::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) { + if (ev.button.button == SDL_BUTTON_LEFT){ + SDLMod mod=SDL_GetModState(); + if (mod & KMOD_RCTRL) /* KMOD_RCTRL = Right Trigger */ + event.type = Common::EVENT_RBUTTONUP; + else if ( mod & KMOD_RSHIFT) /* KMOD_RSHIFT = Left Trigger */ + event.type = Common::EVENT_MOUSEMOVE; + else + event.type = Common::EVENT_LBUTTONUP; + } + else if (ev.button.button == SDL_BUTTON_RIGHT) + event.type = Common::EVENT_RBUTTONUP; +#if defined(SDL_BUTTON_MIDDLE) + else if (ev.button.button == SDL_BUTTON_MIDDLE) + event.type = Common::EVENT_MBUTTONUP; +#endif + else + return false; + + fillMouseEvent(event, ev.button.x, ev.button.y); + + return true; +} + + +bool OSystem_OP::handleMouseMotion(SDL_Event &ev, Common::Event &event) { + event.type = Common::EVENT_MOUSEMOVE; + fillMouseEvent(event, ev.motion.x, ev.motion.y); + + setMousePos(event.mouse.x, event.mouse.y); + return true; +} + +void OSystem_OP::warpMouse(int x, int y) { + if (_mouseCurState.x != x || _mouseCurState.y != y) { + SDL_WarpMouse(x, y); + + // SDL_WarpMouse() generates a mouse movement event, so + // set_mouse_pos() would be called eventually. However, the + // cannon script in CoMI calls this function twice each time + // the cannon is reloaded. Unless we update the mouse position + // immediately the second call is ignored, causing the cannon + // to change its aim. + + setMousePos(x, y); + } +} + +void OSystem_OP::handleKbdMouse() { + uint32 curTime = getMillis(); + if (curTime >= _km.last_time + _km.delay_time) { + _km.last_time = curTime; + if (_km.x_down_count == 1) { + _km.x_down_time = curTime; + _km.x_down_count = 2; + } + if (_km.y_down_count == 1) { + _km.y_down_time = curTime; + _km.y_down_count = 2; + } + + if (_km.x_vel || _km.y_vel) { + if (_km.x_down_count) { + if (curTime > _km.x_down_time + _km.delay_time * 12) { + if (_km.x_vel > 0) + _km.x_vel++; + else + _km.x_vel--; + } else if (curTime > _km.x_down_time + _km.delay_time * 8) { + if (_km.x_vel > 0) + _km.x_vel = 5; + else + _km.x_vel = -5; + } + } + if (_km.y_down_count) { + if (curTime > _km.y_down_time + _km.delay_time * 12) { + if (_km.y_vel > 0) + _km.y_vel++; + else + _km.y_vel--; + } else if (curTime > _km.y_down_time + _km.delay_time * 8) { + if (_km.y_vel > 0) + _km.y_vel = 5; + else + _km.y_vel = -5; + } + } + + _km.x += _km.x_vel; + _km.y += _km.y_vel; + + if (_km.x < 0) { + _km.x = 0; + _km.x_vel = -1; + _km.x_down_count = 1; + } else if (_km.x > _km.x_max) { + _km.x = _km.x_max; + _km.x_vel = 1; + _km.x_down_count = 1; + } + + if (_km.y < 0) { + _km.y = 0; + _km.y_vel = -1; + _km.y_down_count = 1; + } else if (_km.y > _km.y_max) { + _km.y = _km.y_max; + _km.y_vel = 1; + _km.y_down_count = 1; + } + + warpMouse((Uint16)_km.x, (Uint16)_km.y); + } + } +} diff --git a/backends/platform/openpandora/op-graphics.cpp b/backends/platform/openpandora/op-graphics.cpp new file mode 100755 index 0000000000..4abe034ae4 --- /dev/null +++ b/backends/platform/openpandora/op-graphics.cpp @@ -0,0 +1,40 @@ +/* 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 "backends/platform/openpandora/op-sdl.h" + +bool OSystem_OP::loadGFXMode() { + _videoMode.overlayWidth = 800; + _videoMode.overlayHeight = 480; + _videoMode.fullscreen = true; + + if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400) + _videoMode.aspectRatioCorrection = false; + + OSystem_SDL::loadGFXMode(); + + return true; + +} diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp new file mode 100755 index 0000000000..71aa0b99f6 --- /dev/null +++ b/backends/platform/openpandora/op-main.cpp @@ -0,0 +1,206 @@ +/* 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" +#include <SDL/SDL.h> + +#include "backends/platform/openpandora/op-sdl.h" +#include "backends/plugins/posix/posix-provider.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 "backends/timer/default/default-timer.h" +#include "sound/mixer_intern.h" + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <limits.h> +#include <errno.h> +#include <sys/stat.h> +#include <time.h> // for getTimeAndDate() + +/* Dump console info to files. */ +#define DUMP_STDOUT + +int main(int argc, char *argv[]) { + + g_system = new OSystem_OP(); + assert(g_system); + +#ifdef DYNAMIC_MODULES + PluginManager::instance().addPluginProvider(new POSIXPluginProvider()); +#endif + + // Invoke the actual ScummVM main entry point: + int res = scummvm_main(argc, argv); + g_system->quit(); + + return res; +} + +void OSystem_OP::initBackend() { + + /* Setup default save path to be workingdir/saves */ + + char savePath[PATH_MAX+1]; + char workDirName[PATH_MAX+1]; + + if (getcwd(workDirName, PATH_MAX) == NULL) { + error("Could not obtain current working directory."); + } else { + printf("Current working directory: %s\n", workDirName); + } + + strcpy(savePath, workDirName); + strcat(savePath, "/../saves"); + printf("Current save directory: %s\n", savePath); + struct stat sb; + if (stat(savePath, &sb) == -1) + if (errno == ENOENT) // Create the dir if it does not exist + if (mkdir(savePath, 0755) != 0) + warning("mkdir for '%s' failed!", savePath); + + _savefile = new DefaultSaveFileManager(savePath); + + #ifdef DUMP_STDOUT + // The OpenPandora has a serial console on the EXT connection but most users do not use this so we + // output all our STDOUT and STDERR to files for debug purposes. + char STDOUT_FILE[PATH_MAX+1]; + char STDERR_FILE[PATH_MAX+1]; + + strcpy(STDOUT_FILE, workDirName); + strcpy(STDERR_FILE, workDirName); + strcat(STDOUT_FILE, "/../scummvm.stdout.txt"); + strcat(STDERR_FILE, "/../scummvm.stderr.txt"); + + // Flush the output in case anything is queued + fclose(stdout); + fclose(stderr); + + // Redirect standard input and standard output + FILE *newfp = freopen(STDOUT_FILE, "w", stdout); + if (newfp == NULL) { + #if !defined(stdout) + stdout = fopen(STDOUT_FILE, "w"); + #else + newfp = fopen(STDOUT_FILE, "w"); + if (newfp) { + *stdout = *newfp; + } + #endif + } + + newfp = freopen(STDERR_FILE, "w", stderr); + if (newfp == NULL) { + #if !defined(stderr) + stderr = fopen(STDERR_FILE, "w"); + #else + newfp = fopen(STDERR_FILE, "w"); + if (newfp) { + *stderr = *newfp; + } + #endif + } + + setbuf(stderr, NULL); + printf("%s\n", "Debug: STDOUT and STDERR redirected to text files."); + #endif /* DUMP_STDOUT */ + + /* Trigger autosave every 4 minutes. */ + ConfMan.registerDefault("autosave_period", 4 * 60); + + /* Make sure that aspect ratio correction is enabled on the 1st run to stop + users asking me what the 'wasted space' at the bottom is ;-). */ + ConfMan.registerDefault("aspect_ratio", true); + + /* Make sure that aspect ratio correction is enabled on the 1st run to stop + users asking me what the 'wasted space' at the bottom is ;-). */ + ConfMan.registerDefault("desired_screen_aspect_ratio", "5/4" ); + + /* Make sure SDL knows that we have a joystick we want to use. */ + ConfMan.setInt("joystick_num", 0); + + printf("%s\n", "Passing to OSystem::SDL initBackend."); + + /* Pass to SDL backend to do the heavy lifting */ + OSystem_SDL::initBackend(); +} + +void OSystem_OP::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { + + /* Setup default extra data paths for engine data files and plugins */ + char workDirName[PATH_MAX+1]; + + if (getcwd(workDirName, PATH_MAX) == NULL) { + error("Error: Could not obtain current working directory."); + } + + Common::FSNode workdirNode(workDirName); + if (workdirNode.exists() && workdirNode.isDirectory()) { + s.add("__OPENPANDORA_WORKDIR__", new Common::FSDirectory(workDirName), priority); + } + + char enginedataPath[PATH_MAX+1]; + + strcpy(enginedataPath, workDirName); + strcat(enginedataPath, "./../data"); + + Common::FSNode engineNode(enginedataPath); + if (engineNode.exists() && engineNode.isDirectory()) { + s.add("__OPENPANDORA_ENGDATA__", new Common::FSDirectory(enginedataPath), priority); + } + + char pluginsPath[PATH_MAX+1]; + + strcpy(pluginsPath, workDirName); + strcat(pluginsPath, "./../plugins"); + + Common::FSNode pluginsNode(pluginsPath); + if (pluginsNode.exists() && pluginsNode.isDirectory()) { + s.add("__OPENPANDORA_PLUGINS__", new Common::FSDirectory(pluginsPath), priority); + } +} + +void OSystem_OP::quit() { + + #ifdef DUMP_STDOUT + printf("%s\n", "Debug: STDOUT and STDERR text files closed."); + fclose(stdout); + fclose(stderr); + #endif /* DUMP_STDOUT */ + + OSystem_SDL::quit(); +} diff --git a/backends/platform/openpandora/op-sdl.h b/backends/platform/openpandora/op-sdl.h new file mode 100755 index 0000000000..5fd9bf4ed4 --- /dev/null +++ b/backends/platform/openpandora/op-sdl.h @@ -0,0 +1,73 @@ +/* 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$ + * + */ + +#ifndef OP_SDL_H +#define OP_SDL_H + +#include "backends/platform/sdl/sdl.h" + +#define __OPENPANDORA__ +#define MIXER_DOUBLE_BUFFERING 1 + +#ifndef PATH_MAX + #define PATH_MAX 255 +#endif + +class OSystem_OP : public OSystem_SDL { +public: + OSystem_OP() {} + + /* Events */ + bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); + bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); + bool handleMouseMotion(SDL_Event &ev, Common::Event &event); + void warpMouse(int, int); + void handleKbdMouse(); + + /* Graphics */ +// void initSize(uint w, uint h); +// void setGraphicsModeIntern(); +// bool setGraphicsMode(int mode); +// void internUpdateScreen(); +// const OSystem::GraphicsMode *getSupportedGraphicsModes() const; +// bool setGraphicsMode(const char *name); +// int getDefaultGraphicsMode() const; + bool loadGFXMode(); +// void drawMouse(); +// void undrawMouse(); +// void showOverlay(); +// void hideOverlay(); + +// void warpMouse(int, int); + + /* Platform Setup Stuff */ + void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); + void initBackend(); + void quit(); + +protected: + +}; +#endif |