aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorLars Persson2005-12-03 21:29:13 +0000
committerLars Persson2005-12-03 21:29:13 +0000
commit6ed67205ec31305ad19f2e4469de27e7a93c51e8 (patch)
treed32eeffc50c1a9a4d6d3db6c29e1f1774d441f63 /backends
parent02f5921cbeca2352df9fa84628d3e835df15cc2a (diff)
downloadscummvm-rg350-6ed67205ec31305ad19f2e4469de27e7a93c51e8.tar.gz
scummvm-rg350-6ed67205ec31305ad19f2e4469de27e7a93c51e8.tar.bz2
scummvm-rg350-6ed67205ec31305ad19f2e4469de27e7a93c51e8.zip
1. New build structure for Symbian builds to allow easier build and project updates
2. Updated framework files for new structure 3. Uncommented Debug statements in vorbis.cpp (Should probably be removed alltogether. 4. Incorporated Sevs code formatting changes in the new Symbian source structure. 5. Removed/Changed EScummVM to ScummVM instead, hopefully most cases covered. 6. Beginning vibration support to be used for Scumm shake effects (Work ongoing by SumthinWicked) 7. Replaced the ScummVM icon for the FavIcon and upscaled the icon to 32x32. I think it looks ok, comments are welcome. 8. Built for S60V1 and UIQ2 targets from the cvs 9. Updated Readme with new build instructions. Any comments are welcome. Hopefully the other builds are not affected by this and all Sevs code updates are also incorporated. svn-id: r19739
Diffstat (limited to 'backends')
-rw-r--r--backends/epoc/.placeholder1
-rw-r--r--backends/epoc/AdaptAllMMPs.pl295
-rw-r--r--backends/epoc/README29
-rw-r--r--backends/epoc/S60/ScummVMApp.cpp165
-rw-r--r--backends/epoc/S60/ScummVMApp.h84
-rw-r--r--backends/epoc/S60/ScummVMS60.rss62
-rw-r--r--backends/epoc/S60/ScummVM_S60_App.mmp49
-rw-r--r--backends/epoc/S60/scummvm-CVS-SymbianS60v1.pkg34
-rw-r--r--backends/epoc/S60/scummvm-CVS-SymbianS60v2.pkg34
-rw-r--r--backends/epoc/S60v3/ScummVM.rss45
-rw-r--r--backends/epoc/S60v3/ScummVMApp.cpp164
-rw-r--r--backends/epoc/S60v3/ScummVMApp.h79
-rw-r--r--backends/epoc/S60v3/ScummVMS60.rss62
-rw-r--r--backends/epoc/S60v3/scummvm-CVS-SymbianS60v3.pkg34
-rw-r--r--backends/epoc/S80/ScummVMApp.cpp167
-rw-r--r--backends/epoc/S80/ScummVMApp.h83
-rw-r--r--backends/epoc/S80/ScummVM_S80_App.mmp48
-rw-r--r--backends/epoc/S80/ScummvmS80.rss62
-rw-r--r--backends/epoc/S80/scummvm-CVS-SymbianS80.pkg31
-rw-r--r--backends/epoc/S90/ScummVMApp.cpp171
-rw-r--r--backends/epoc/S90/ScummVMApp.h83
-rw-r--r--backends/epoc/S90/ScummvmS90.rss62
-rw-r--r--backends/epoc/S90/Scummvm_S90_App.mmp48
-rw-r--r--backends/epoc/S90/scummvm-CVS-SymbianS90.pkg31
-rw-r--r--backends/epoc/UIQ2/ScummVM.rss45
-rw-r--r--backends/epoc/UIQ2/Vibration.sisbin0 -> 2175 bytes
-rw-r--r--backends/epoc/UIQ2/chkstk.objbin0 -> 329 bytes
-rw-r--r--backends/epoc/UIQ2/lldiv.objbin0 -> 418 bytes
-rw-r--r--backends/epoc/UIQ2/llmul.objbin0 -> 300 bytes
-rw-r--r--backends/epoc/UIQ2/llshl.objbin0 -> 280 bytes
-rw-r--r--backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2.pkg33
-rw-r--r--backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg38
-rw-r--r--backends/epoc/UIQ3/ScummVM.rss45
-rw-r--r--backends/epoc/UIQ3/scummvm-CVS-SymbianUIQ3.pkg33
-rw-r--r--backends/epoc/mmp/initial_mmps.zipbin0 -> 29153 bytes
-rw-r--r--backends/epoc/res/ScummS.bmpbin0 -> 822 bytes
-rw-r--r--backends/epoc/res/ScummVmAif.rss44
-rw-r--r--backends/epoc/res/scummL.bmpbin0 -> 3126 bytes
-rw-r--r--backends/epoc/res/scummLm.bmpbin0 -> 190 bytes
-rw-r--r--backends/epoc/res/scummSm.bmpbin0 -> 126 bytes
-rw-r--r--backends/epoc/src/ScummApp.cpp92
-rw-r--r--backends/epoc/src/ScummApp.h44
-rw-r--r--backends/epoc/src/ScummVm.hrh29
-rw-r--r--backends/epoc/src/SymbianActions.cpp187
-rw-r--r--backends/epoc/src/SymbianActions.h77
-rw-r--r--backends/epoc/src/SymbianOS.cpp400
-rw-r--r--backends/epoc/src/SymbianOS.h130
-rw-r--r--backends/epoc/src/portdefs.h143
-rw-r--r--backends/fs/symbian/symbian-fs.cpp49
49 files changed, 3280 insertions, 32 deletions
diff --git a/backends/epoc/.placeholder b/backends/epoc/.placeholder
new file mode 100644
index 0000000000..dcf4d34a62
--- /dev/null
+++ b/backends/epoc/.placeholder
@@ -0,0 +1 @@
+>> SumthinWicked *grins* << \ No newline at end of file
diff --git a/backends/epoc/AdaptAllMMPs.pl b/backends/epoc/AdaptAllMMPs.pl
new file mode 100644
index 0000000000..fc1873ab79
--- /dev/null
+++ b/backends/epoc/AdaptAllMMPs.pl
@@ -0,0 +1,295 @@
+
+use Cwd;
+
+$buildDir = getcwd();
+chdir("../../");
+
+print "
+=======================================================================================
+Updating slave MACRO settings in MMP files from master 'scummvm_base.mmp'
+=======================================================================================
+
+";
+
+@mmp_files = ( "mmp/scummvm_scumm.mmp", "mmp/scummvm_queen.mmp", "mmp/scummvm_simon.mmp", "mmp/scummvm_sky.mmp", "mmp/scummvm_gob.mmp", "mmp/scummvm_saga.mmp", "mmp/scummvm_kyra.mmp", "mmp/scummvm_sword1.mmp", "mmp/scummvm_sword2.mmp",
+ "UIQ2/ScummVM_UIQ2.mmp", "UIQ3/ScummVM_UIQ3.mmp", "S60/ScummVM_S60.mmp", "S60v3/ScummVM_S60v3.mmp", "S80/ScummVM_S80.mmp", "S90/ScummVM_S90.mmp");
+
+# do this first so we have @DisableDefines for correct inclusion of SOURCE files later
+UpdateSlaveMacros();
+
+print "
+=======================================================================================
+Preparing to update all the Symbian MMP project files with objects from module.mk files
+=======================================================================================
+
+";
+
+my @section_empty = (""); # section standard: no #ifdef's in module.mk files
+my @sections_scumm = ("", "DISABLE_SCUMM_7_8", "DISABLE_HE"); # special sections for engine SCUMM
+my @base_excludes = ("mt32","fluidsynth"); # case insensitive exclusions for sound
+
+#arseModule(mmpStr, dirStr, ifdefArray, [exclusionsArray])
+#ParseModule("_base", "base", \@section_empty); # now in ./TRG/ScummVM_TRG.mmp, these never change anyways...
+ParseModule("_base", "common", \@section_empty);
+ParseModule("_base", "gui", \@section_empty);
+ParseModule("_base", "graphics", \@section_empty);
+ParseModule("_base", "sound", \@section_empty, \@base_excludes);
+
+ParseModule("_scumm", "scumm", \@sections_scumm);
+ParseModule("_queen", "queen", \@section_empty);
+ParseModule("_simon", "simon", \@section_empty);
+ParseModule("_sky", "sky", \@section_empty);
+ParseModule("_gob", "gob", \@section_empty);
+ParseModule("_saga", "saga", \@section_empty);
+
+ParseModule("_kyra", "kyra", \@section_empty);
+ParseModule("_sword1", "sword1", \@section_empty);
+ParseModule("_sword2", "sword2", \@section_empty);
+
+print "
+=======================================================================================
+Done. Enjoy :P
+=======================================================================================
+";
+
+##################################################################################################################
+##################################################################################################################
+
+# parses multiple sections per mmp/module
+sub ParseModule
+{
+ my ($mmp,$module,$sections,$exclusions) = @_;
+ my @sections = @{$sections};
+ my @exclusions = @{$exclusions};
+
+ foreach $section (@sections)
+ {
+ CheckForModuleMK($module, $section, @exclusions);
+ UpdateProjectFile($mmp, $module, $section);
+ }
+}
+
+##################################################################################################################
+
+# parses all module.mk files in a dir and its subdirs
+sub CheckForModuleMK
+{
+ my ($item,$section,@exclusions) = @_;
+
+ # if dir: check subdirs too
+ if (-d $item)
+ {
+ #print "$item\n";
+
+ opendir DIR, $item;
+ #my @Files = readdir DIR;
+ my @Files = grep s/^([^\.].*)$/$1/, readdir DIR;
+ closedir DIR;
+
+ foreach $entry (@Files)
+ {
+ CheckForModuleMK("$item/$entry", $section, @exclusions);
+ }
+ }
+
+ # if this is a module.mk file
+ if (-f $item and $item =~ /.*\/module.mk$/)
+ {
+ my $sec = "";
+ my $secnum = 0;
+
+ print "Parsing $item for section '$section' ... ";
+
+ open FILE, $item;
+ my @lines = <FILE>;
+ close FILE;
+
+ my $count = @lines;
+ print "$count lines";
+
+ A: foreach $line (@lines)
+ {
+ # found a section? reset
+ if ($line =~ /^ifndef (.*)/)
+ {
+ $sec = $1;
+ }
+ # found an object? Not uncommented!
+ if (!($line =~ /^#/) && $line =~ s/\.o/.cpp/)
+ {
+ # handle this section?
+ if ($sec eq $section)
+ {
+ $line =~ s/^\s*//g; # remove possible leading whitespace
+ $line =~ s/ \\//; # remove possible trailing ' \'
+ $line =~ s/\//\\/g; # replace / with \
+ chop($line); # remove \n
+
+ # do we need to skip this file? According to our own @exclusions array
+ foreach $exclusion (@exclusions)
+ {
+ if ($line =~ /$exclusion/)
+ {
+ print "\n !$line (excluded, \@exclusions)";
+ next A;
+ }
+ }
+
+ # do we need to skip this file? According to MACROs in .MMPs
+ foreach $DisableDefine (@DisableDefines)
+ {
+ if ($DisableDefine eq $section && $section ne '')
+ {
+ print "\n !$line (excluded, MACRO $DisableDefine)";
+ next A;
+ }
+ }
+
+ $secnum++;
+ #print "\n $line";
+ $output .= "SOURCE $line\n";
+ }
+ }
+ }
+ print " -- $secnum objects selected\n";
+ }
+}
+
+##################################################################################################################
+
+# update an MMP project file with the new objects
+sub UpdateProjectFile
+{
+ my ($mmp,$module,$section) = @_;
+ my $n = "AUTO_OBJECTS_".uc($module)."_$section";
+ my $a = "\/\/START_$n\/\/";
+ my $b = "\/\/STOP_$n\/\/";
+ my $name = "mmp/scummvm$mmp.mmp";
+ my $file = "$buildDir/$name";
+ my $updated = " Updated @ ".localtime();
+
+ print " ===>Updating backends/epoc/$name @ $n ... ";
+
+ open FILE, "$file";
+ my @lines = <FILE>;
+ close FILE;
+
+ my $onestr = join("",@lines);
+ $onestr =~ s/$a.*$b/$a$updated\n$output$b/s;
+
+ open FILE, ">$file";
+ print FILE $onestr;
+ close FILE;
+
+ print "done.\n";
+
+ $output = "";
+}
+
+##################################################################################################################
+
+sub UpdateSlaveMacros
+{
+ my $updated = " Updated @ ".localtime();
+
+ my $name = "mmp/scummvm_base.mmp";
+ my $file = "$buildDir/$name";
+ print "Reading master MACROS from backends/epoc/$name ... ";
+
+ open FILE, "$file";
+ my @lines = <FILE>;
+ close FILE;
+ my $onestr = join("",@lines);
+
+ my $n = "AUTO_MACROS_MASTER";
+ my $a = "\/\/START_$n\/\/";
+ my $b = "\/\/STOP_$n\/\/";
+ $onestr =~ /$a(.*)$b/s;
+ my $macros = $1;
+
+ my $libs_first = "\n// automagically enabled static libs from macros above\n";
+ my $libs_second = "STATICLIBRARY scummvm_base.lib // must be above USE_* .libs\n";
+ my $macro_counter = 0;
+ my $macros2 = "\n"; # output for in *.mmp MACROS section
+ my $projects = "\n..\\mmp\\scummvm_base.mmp\n"; # output for in BLD.INF projects section
+
+ foreach $line (split("\n", $macros))
+ {
+ # do we need to add a static .lib?
+ if ($line =~ /^.*MACRO\s*([0-9A-Z_]*)\s*\/\/\s*LIB\:(.*)$/)
+ {
+ my $macro = $1; my $lib = $2;
+
+ # this macro enabled? then also add the .lib
+ if ($line =~ /^\s*MACRO\s*$macro/m)
+ {
+ # these are the USE_ libs
+ $libs_second .= "STATICLIBRARY $lib\n" if ($macro =~ /^USE_/);
+ }
+ else
+ {
+ # these are the non DISABLED_ libs
+ $libs_first .= "STATICLIBRARY $lib\n" if ($macro =~ /^DISABLE_/);
+
+ # add projects for BLD.INF's
+ my $projectname = substr("$lib",0,-4);
+ $projects .= "..\\mmp\\$projectname.mmp\n" if ($macro =~ /^DISABLE_/);
+ }
+ $macro_counter++;
+ }
+ # not commented out? then add the macro to output string
+ if ($line =~ /^\s*MACRO\s*([0-9A-Z_]*)\s*/)
+ {
+ my $macro = $1;
+ $macros2 .= "$line\n";
+ push @DisableDefines, $macro; # used in CheckForModuleMK()!!
+ }
+ }
+
+ print "$macro_counter macro lines.\n";
+
+ $n = "AUTO_MACROS_SLAVE";
+ $a = "\/\/START_$n\/\/";
+ $b = "\/\/STOP_$n\/\/";
+
+ $m = "AUTO_PROJECTS";
+ $p = "\/\/START_$m\/\/";
+ $q = "\/\/STOP_$m\/\/";
+
+ foreach $name (@mmp_files)
+ {
+ $file = "$buildDir/$name";
+ $fileBLDINF = $buildDir .'/'. substr($name, 0, rindex($name, "/")) . "/BLD.INF";
+ print "Updating macros in backends/epoc/$name ... ";
+
+ open FILE, "$file"; @lines = <FILE>; close FILE;
+ $onestr = join("",@lines);
+
+ my $extralibs = ""; # output
+ # slash in name means it's a phone specific build file: add LIBs
+ $extralibs .= "$libs_first$libs_second" if (-e $fileBLDINF);
+
+ $onestr =~ s/$a.*$b/$a$updated$macros2$extralibs$b/s;
+
+ open FILE, ">$file"; print FILE $onestr; close FILE;
+
+ my $count = @lines;
+ print "wrote $count lines.\n";
+
+ if (-e $fileBLDINF)
+ {
+ # slash in name means it's a phone specific build file:
+ # this also means we need to update a BLD.INF file here!
+ print "Updating projects in $fileBLDINF ... \n";
+
+ open FILE, "$fileBLDINF"; @lines = <FILE>; close FILE;
+ $onestr = join("",@lines);
+
+ $onestr =~ s/$p.*$q/$p$updated$projects$q/s;
+
+ open FILE, ">$fileBLDINF"; print FILE $onestr; close FILE;
+ }
+ }
+}
+
+##################################################################################################################
diff --git a/backends/epoc/README b/backends/epoc/README
index 0b1a65e58f..3a4b6142ad 100644
--- a/backends/epoc/README
+++ b/backends/epoc/README
@@ -1,5 +1,5 @@
- EScummVM - ScummVM ported to EPOC/SymbianOS
+ ScummVM - ScummVM ported to EPOC/SymbianOS
Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson
Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson
@@ -9,7 +9,7 @@
$Id$
-About EScummVM
+About ScummVM
--------------
The original ports (uptil 0.7.1) were made by Andreas Karlsson and Lars Persson.
The main transition to 0.8.0CVS and all relevant changes were done by Jurgen Braam.
@@ -18,7 +18,7 @@ About EScummVM
Nescessary components
---------------------
- Building EScummVM yourself using the UIQ 2.1/Nokia S60 SDK/Nokia S80 SDK/Nokia S90 SDK framework is not an easy task!
+ Building ScummVM yourself using the UIQ 2.1/Nokia S60 SDK/Nokia S80 SDK/Nokia S90 SDK framework is not an easy task!
Lets just say the framework needs quite some time to set up and takes a while
to get used to. If you choose to continue you will need the following items:
@@ -58,7 +58,7 @@ Nescessary components
http://libmpeg2.sourceforge.net/
-Building EScummVM
+Building ScummVM
-----------------
ECompXL: this is a tool that will compress your executable with GZIP and glue
it to a predefined loader app. The app will uncompress your application at
@@ -92,18 +92,23 @@ Building EScummVM
> bldmake bldfiles
> abld build
- EScummVM: make sure the SYSTEMINCLUDE dirs in EScumVM.mmp are correct. For the
+ ScummVM: make sure the SYSTEMINCLUDE dirs in ScumVM.mmp are correct. For the
'wins' platform also check the LIBRARY entries for the correct path to your MSVC
installation. Please note that you can only specify relative paths here, so every-
thing needs to be on the same physical drive! Another weird demand of the UIQ
- platform... In <DevRoot>/scummvm/backends/epoc/build/ go:
- > bldmake bldfiles
- > abld build
- > makesis EScummVM_xxx.pkg
+ platform... In <DevRoot>/scummvm/backends/epoc/ go:
+
+ > run 'unzip mmp\initial_mmps.zip'
+ > edit the scummvm_base.mmp to fit your needs (for supported target games and features, check the MACRO statements)
+ > run 'perl AdaptAllMMPs.pl' from the commandline, this will update all mmp and bld.inf files
+ > change to the directory for your designated target (uiq2 for UIQ 2.X, S60 for S60 v1 & V2 etc)
+ > 'bldmake bldfiles' to update and create the symbian build structure
+ > 'abld build armi urel' to build the target binaries
+ > makesis -d\sdkpath ScummVM_xxx.pkg to build the sis file for your target.
- Now you should have yourself a nice EScummVM_xxx.sis installer package for use
+ Now you should have yourself a nice ScummVM_xxx.sis installer package for use
on your phone. Please note that for development it will be a lot faster if you
- transfer the ESCUMMVM.APP file directly to your !:\system\apps\EScummVM\ dir!
+ transfer the SCUMMVM.APP/Scummvm.EXE file directly to your !:\system\apps\ScummVM\ dir!
Platforms can be one of: ARMi, ARM4, THUMB, WINS. The SE P900 uses the ARMi platform,
which is a combined ARM4/THUMB programming mode. Configurations can be one of:
@@ -116,7 +121,7 @@ Greetz & such
- Sprawl for having the nerve to start & carry this puppy for so long
- AnotherGuest for having the nerve to start & carry this puppy for so long
- Fingolfin for taking the time to go through 1000 patch versions with me
- - Myself (SumthinWicked), for writing this entire README :)
+ - Myself (SumthinWicked), for writing this entire README and adopting all sources together with Fingolfin :)
- the entire ScummVM Dev team for making a kicka$$ program
- the folks in #scummvm @ irc.freenode.net for their help, confort and support
- everybody else who wants to give me 'the look' for not including them here :P
diff --git a/backends/epoc/S60/ScummVMApp.cpp b/backends/epoc/S60/ScummVMApp.cpp
new file mode 100644
index 0000000000..bf263fea39
--- /dev/null
+++ b/backends/epoc/S60/ScummVMApp.cpp
@@ -0,0 +1,165 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#include "ScummVMapp.h"
+#include <scummvms60.rsg>
+#include <apgcli.h>
+#include <eikdll.h>
+
+EXPORT_C CApaApplication *NewApplication() {
+ return (new CScummVM);
+}
+
+CScummVM::CScummVM() {
+}
+
+CScummVM::~CScummVM() {
+}
+
+CApaDocument *CScummVM::CreateDocumentL() {
+ return new (ELeave)CScummVMDoc(*this);
+}
+
+TUid CScummVM::AppDllUid() const {
+ return TUid::Uid(0x101f9b57);
+}
+
+CScummVMDoc::CScummVMDoc(CEikApplication &aApp) : CAknDocument(aApp) {
+}
+
+CScummVMDoc::~CScummVMDoc() {
+}
+
+CEikAppUi *CScummVMDoc::CreateAppUiL() {
+ return new (ELeave)CScummVMUi;
+}
+
+void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
+ if (aForeground) {
+ BringUpEmulatorL();
+ }
+}
+
+CScummVMUi::CScummVMUi() {
+}
+
+CScummVMUi::~CScummVMUi() {
+ if(iWatcher) {
+ iThreadWatch.LogonCancel(iWatcher->iStatus);
+ iWatcher->Cancel();
+ }
+ delete iWatcher;
+
+ iThreadWatch.Close();
+}
+
+void CScummVMUi::ConstructL() {
+ BaseConstructL();
+ TApaTaskList taskList(iEikonEnv->WsSession());
+ TApaTask myTask=taskList.FindApp(TUid::Uid(0x101f9b57));
+ myTask.SendToBackground();
+
+ TBuf<128> startFile;
+ startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
+ TParse parser;
+ parser.Set(startFile, NULL, NULL);
+
+ startFile = parser.DriveAndPath();
+#ifndef __WINS__
+ startFile.Append( _L("ScummVM.exe"));
+#else
+ startFile.Append( _L("ScummVM.dll"));
+#endif
+ CApaCommandLine *cmdLine = CApaCommandLine::NewLC(startFile);
+ RApaLsSession lsSession;
+
+ lsSession.Connect();
+ CleanupClosePushL(lsSession);
+ lsSession.StartApp(*cmdLine, iThreadId);
+ CleanupStack::PopAndDestroy(); //close lsSession
+ CleanupStack::PopAndDestroy(cmdLine);
+
+ User::After(500000); // Let the application start
+
+ TApaTask exeTask=taskList.FindByPos(0);
+ iExeWgId=exeTask.WgId();
+
+ if(iExeWgId == myTask.WgId()) { // Should n't be the same
+ Exit();
+ }
+
+ if(iThreadWatch.Open(iThreadId) == KErrNone) {
+ iWatcher = new (ELeave)CScummWatcher;
+ iWatcher->iAppUi=this;
+ iThreadWatch.Logon(iWatcher->iStatus);
+ }
+}
+
+CScummWatcher::CScummWatcher():CActive(EPriorityStandard) {
+ CActiveScheduler::Add(this);
+ iStatus=KRequestPending;
+ SetActive();
+}
+
+CScummWatcher::~CScummWatcher() {
+}
+
+void CScummWatcher::DoCancel() {
+}
+
+void CScummWatcher::RunL() {
+ iAppUi->HandleCommandL(EEikCmdExit);
+}
+
+void CScummVMUi::BringUpEmulatorL() {
+ RThread thread;
+
+ if (thread.Open(iThreadId) == KErrNone) {
+ thread.Close();
+ TApaTask apaTask(iEikonEnv->WsSession());
+ apaTask.SetWgId(iExeWgId);
+ apaTask.BringToForeground();
+ } else {
+ iExeWgId = -1;
+ }
+}
+
+void CScummVMUi::HandleCommandL(TInt aCommand) {
+ switch(aCommand) {
+ case EEikCmdExit:
+ {
+ RThread thread;
+
+ if(thread.Open(iThreadId) == KErrNone) {
+ thread.Terminate(0);
+ thread.Close();
+ }
+ Exit();
+ }
+ break;
+ }
+}
+
+GLDEF_C TInt E32Dll(TDllReason) {
+ return KErrNone;
+}
diff --git a/backends/epoc/S60/ScummVMApp.h b/backends/epoc/S60/ScummVMApp.h
new file mode 100644
index 0000000000..21478ba089
--- /dev/null
+++ b/backends/epoc/S60/ScummVMApp.h
@@ -0,0 +1,84 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#ifndef ScummVMapps60h
+#define ScummVMapps60h
+
+#include <aknapp.h>
+#include <eikapp.h>
+#include <e32base.h>
+#include <coecntrl.h>
+#include <eikenv.h>
+#include <coeview.h>
+#include <eikappui.h>
+
+class CScummVM:public CEikApplication {
+public:
+ CScummVM();
+ ~CScummVM();
+
+ CApaDocument *CreateDocumentL();
+ TUid AppDllUid() const;
+};
+
+
+#include <AKNdoc.h>
+
+class CScummVMDoc:public CAknDocument {
+public:
+ CScummVMDoc(CEikApplication &aApplicaiton);
+ ~CScummVMDoc();
+
+ CEikAppUi *CreateAppUiL();
+ void ConstructL();
+};
+
+#include <aknappui.h>
+class CScummVMUi;
+class CScummWatcher : public CActive {
+public:
+ CScummWatcher();
+ ~CScummWatcher();
+
+ void DoCancel();
+ void RunL();
+ CScummVMUi *iAppUi;
+};
+
+class CScummVMUi : public CAknAppUi {
+public:
+ CScummVMUi();
+ ~CScummVMUi();
+
+ void ConstructL();
+ void HandleCommandL(TInt aCommand);
+ void HandleForegroundEventL(TBool aForeground);
+ void BringUpEmulatorL();
+
+private:
+ TThreadId iThreadId;
+ TInt iExeWgId;
+ RThread iThreadWatch;
+ CScummWatcher *iWatcher;
+};
+#endif
diff --git a/backends/epoc/S60/ScummVMS60.rss b/backends/epoc/S60/ScummVMS60.rss
new file mode 100644
index 0000000000..0b699ea305
--- /dev/null
+++ b/backends/epoc/S60/ScummVMS60.rss
@@ -0,0 +1,62 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header:
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ menubar = r_scum_menubar;
+ }
+
+RESOURCE MENU_BAR r_scum_menubar // *** Menu bar
+{
+ titles =
+ {
+ MENU_TITLE { menu_pane = r_scum_menu; txt = "ScummVM"; }
+ };
+}
+
+RESOURCE MENU_PANE r_scum_menu // *** Submenu
+{
+ items =
+ {
+
+ MENU_ITEM{command = EEikCmdExit;txt = "Exit";}
+ };
+}
diff --git a/backends/epoc/S60/ScummVM_S60_App.mmp b/backends/epoc/S60/ScummVM_S60_App.mmp
new file mode 100644
index 0000000000..44bbf1a2a0
--- /dev/null
+++ b/backends/epoc/S60/ScummVM_S60_App.mmp
@@ -0,0 +1,49 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header:
+ */
+
+//
+// MAKEFILE.MMP S60 ScummVM Launcher
+//
+
+TARGET ScummVMS60.app
+TARGETPATH system\apps\ScummVMS60
+TARGETTYPE app
+
+UID 0x100039ce 0x101f9b57
+RESOURCE SCUMMVMS60.rss
+
+SOURCEPATH .
+USERINCLUDE .
+SYSTEMINCLUDE \epoc32\include \epoc32\include\libc
+
+// app source
+SOURCE ScummVMApp.cpp
+
+sourcepath ..
+AIF ScummVmS60.Aif ..\res\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp ScummSM.bmp
+
+// libraries
+LIBRARY cone.lib EIKCORE.lib
+LIBRARY euser.lib apparc.lib
+LIBRARY efsrv.lib apgrfx.lib
+LIBRARY avkon.lib
diff --git a/backends/epoc/S60/scummvm-CVS-SymbianS60v1.pkg b/backends/epoc/S60/scummvm-CVS-SymbianS60v1.pkg
new file mode 100644
index 0000000000..5392b857d7
--- /dev/null
+++ b/backends/epoc/S60/scummvm-CVS-SymbianS60v1.pkg
@@ -0,0 +1,34 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM S60"},(0x101f9b57),0,80,0
+
+; Platform type
+(0x101F6F88), 0, 0, 0, {"Series60ProductID"}
+
+; Application file Launcher and actual exe
+"\epoc32\release\armi\urel\ScummVMS60.app"-"!:\system\apps\ScummVMS60\ScummVMS60.app"
+"\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVMS60\ScummVM.exe"
+
+; AIF application information file
+"\epoc32\release\armi\urel\ScummVMS60.aif"-"!:\system\apps\ScummVMS60\ScummVMS60.aif"
+
+; Resource file
+"\epoc32\release\armi\urel\ScummVMS60.rsc"-"!:\system\apps\ScummVMS60\ScummVMS60.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/S60/scummvm-CVS-SymbianS60v2.pkg b/backends/epoc/S60/scummvm-CVS-SymbianS60v2.pkg
new file mode 100644
index 0000000000..17aa77ef15
--- /dev/null
+++ b/backends/epoc/S60/scummvm-CVS-SymbianS60v2.pkg
@@ -0,0 +1,34 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM S60"},(0x101f9b57),0,80,3
+
+; Platform type
+(0x101F6F88), 0, 0, 0, {"Series60ProductID"}
+
+; Application file Launcher and actual exe
+"\epoc32\release\armi\urel\ScummVMS60.app"-"!:\system\apps\ScummVMS60\ScummVMS60.app"
+"\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVMS60\ScummVM.exe"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVMS60\ScummVMS60.aif"-"!:\system\apps\ScummVMS60\ScummVMS60.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVMS60\ScummVMS60.rsc"-"!:\system\apps\ScummVMS60\ScummVMS60.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/S60v3/ScummVM.rss b/backends/epoc/S60v3/ScummVM.rss
new file mode 100644
index 0000000000..58f3aeede7
--- /dev/null
+++ b/backends/epoc/S60v3/ScummVM.rss
@@ -0,0 +1,45 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ }
+
diff --git a/backends/epoc/S60v3/ScummVMApp.cpp b/backends/epoc/S60v3/ScummVMApp.cpp
new file mode 100644
index 0000000000..fb8ec041d6
--- /dev/null
+++ b/backends/epoc/S60v3/ScummVMApp.cpp
@@ -0,0 +1,164 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#include "ScummVMapp.h"
+#include <scummvms60.rsg>
+#include <apgcli.h>
+#include <eikdll.h>
+
+EXPORT_C CApaApplication* NewApplication() {
+ return (new CScummVM);
+}
+
+CScummVM::CScummVM() {
+}
+
+CScummVM::~CScummVM() {
+}
+
+CApaDocument* CScummVM::CreateDocumentL()
+{
+ return new (ELeave) CScummVMDoc(*this);
+}
+
+TUid CScummVM::AppDllUid() const
+{
+ return TUid::Uid(0x101f9b57);
+}
+
+CScummVMDoc::CScummVMDoc(CEikApplication& aApp):CAknDocument(aApp) {
+}
+
+CScummVMDoc::~CScummVMDoc() {
+}
+
+CEikAppUi* CScummVMDoc::CreateAppUiL() {
+ return new (ELeave) CScummVMUi;
+}
+
+void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
+ if(aForeground) {
+ BringUpEmulatorL();
+ }
+}
+
+CScummVMUi::CScummVMUi() {
+}
+
+CScummVMUi::~CScummVMUi() {
+ if(iWatcher) {
+ iThreadWatch.LogonCancel(iWatcher->iStatus);
+ iWatcher->Cancel();
+ }
+ delete iWatcher;
+
+ iThreadWatch.Close();
+}
+
+void CScummVMUi::ConstructL() {
+ BaseConstructL();
+ TApaTaskList taskList(iEikonEnv->WsSession());
+ TApaTask myTask=taskList.FindApp(TUid::Uid(0x101f9b57));
+ myTask.SendToBackground();
+
+ TBuf<128> startFile;
+ startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
+ TParse parser;
+ parser.Set(startFile,NULL,NULL);
+
+ startFile = parser.DriveAndPath();
+#ifndef __WINS__
+ startFile.Append( _L("ScummVM.exe"));
+#else
+ startFile.Append( _L("ScummVM.dll"));
+#endif
+ CApaCommandLine* cmdLine=CApaCommandLine::NewLC(startFile);
+ RApaLsSession lsSession;
+ lsSession.Connect();
+ CleanupClosePushL(lsSession);
+ lsSession.StartApp(*cmdLine,iThreadId);
+ CleanupStack::PopAndDestroy();//close lsSession
+ CleanupStack::PopAndDestroy(cmdLine);
+ User::After(500000);// Let the application start
+ TApaTask exeTask=taskList.FindByPos(0);
+ iExeWgId=exeTask.WgId();
+
+ if(iExeWgId == myTask.WgId()) { // Should n't be the same
+ Exit();
+ }
+ if(iThreadWatch.Open(iThreadId)==KErrNone) {
+ iWatcher = new (ELeave)CScummWatcher;
+ iWatcher->iAppUi=this;
+ iThreadWatch.Logon(iWatcher->iStatus);
+ }
+}
+
+CScummWatcher::CScummWatcher():CActive(EPriorityStandard) {
+ CActiveScheduler::Add(this);
+ iStatus=KRequestPending;
+ SetActive();
+}
+
+CScummWatcher::~CScummWatcher() {
+}
+
+void CScummWatcher::DoCancel() {
+}
+
+void CScummWatcher::RunL() {
+ iAppUi->HandleCommandL(EEikCmdExit);
+}
+
+void CScummVMUi::BringUpEmulatorL() {
+ RThread thread;
+ if(thread.Open(iThreadId)==KErrNone) {
+ thread.Close();
+ TApaTask apaTask(iEikonEnv->WsSession());
+ apaTask.SetWgId(iExeWgId);
+ apaTask.BringToForeground();
+ }
+ else
+ {
+ iExeWgId=-1;
+ }
+}
+
+void CScummVMUi::HandleCommandL(TInt aCommand) {
+ switch(aCommand) {
+ case EEikCmdExit:
+ {
+ RThread thread;
+ if(thread.Open(iThreadId)==KErrNone)
+ {
+ thread.Terminate(0);
+ thread.Close();
+ }
+ Exit();
+ }
+ break;
+ }
+}
+
+GLDEF_C TInt E32Dll(TDllReason) {
+ return KErrNone;
+}
diff --git a/backends/epoc/S60v3/ScummVMApp.h b/backends/epoc/S60v3/ScummVMApp.h
new file mode 100644
index 0000000000..9cf8623835
--- /dev/null
+++ b/backends/epoc/S60v3/ScummVMApp.h
@@ -0,0 +1,79 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#ifndef ScummVMapps60h
+#define ScummVMapps60h
+
+#include <aknapp.h>
+#include <eikapp.h>
+#include <e32base.h>
+#include <coecntrl.h>
+#include <eikenv.h>
+#include <coeview.h>
+#include <eikappui.h>
+
+class CScummVM:public CEikApplication {
+public:
+ CScummVM();
+ ~CScummVM();
+ CApaDocument* CreateDocumentL();
+ TUid AppDllUid() const;
+};
+
+
+#include <AKNdoc.h>
+
+class CScummVMDoc:public CAknDocument {
+public:
+ ~CScummVMDoc();
+ CEikAppUi* CreateAppUiL();
+ void ConstructL();
+ CScummVMDoc(CEikApplication& aApplicaiton);
+};
+
+#include <aknappui.h>
+class CScummVMUi;
+class CScummWatcher:public CActive {
+public:
+ CScummWatcher();
+ ~CScummWatcher();
+ void DoCancel();
+ void RunL();
+ CScummVMUi* iAppUi;
+};
+
+class CScummVMUi:public CAknAppUi {
+public:
+ CScummVMUi();
+ ~CScummVMUi();
+ void ConstructL();
+ void HandleCommandL(TInt aCommand);
+ void HandleForegroundEventL(TBool aForeground);
+ void BringUpEmulatorL();
+private:
+ TThreadId iThreadId;
+ TInt iExeWgId;
+ RThread iThreadWatch;
+ CScummWatcher* iWatcher;
+};
+#endif
diff --git a/backends/epoc/S60v3/ScummVMS60.rss b/backends/epoc/S60v3/ScummVMS60.rss
new file mode 100644
index 0000000000..0b699ea305
--- /dev/null
+++ b/backends/epoc/S60v3/ScummVMS60.rss
@@ -0,0 +1,62 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header:
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ menubar = r_scum_menubar;
+ }
+
+RESOURCE MENU_BAR r_scum_menubar // *** Menu bar
+{
+ titles =
+ {
+ MENU_TITLE { menu_pane = r_scum_menu; txt = "ScummVM"; }
+ };
+}
+
+RESOURCE MENU_PANE r_scum_menu // *** Submenu
+{
+ items =
+ {
+
+ MENU_ITEM{command = EEikCmdExit;txt = "Exit";}
+ };
+}
diff --git a/backends/epoc/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/epoc/S60v3/scummvm-CVS-SymbianS60v3.pkg
new file mode 100644
index 0000000000..17aa77ef15
--- /dev/null
+++ b/backends/epoc/S60v3/scummvm-CVS-SymbianS60v3.pkg
@@ -0,0 +1,34 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM S60"},(0x101f9b57),0,80,3
+
+; Platform type
+(0x101F6F88), 0, 0, 0, {"Series60ProductID"}
+
+; Application file Launcher and actual exe
+"\epoc32\release\armi\urel\ScummVMS60.app"-"!:\system\apps\ScummVMS60\ScummVMS60.app"
+"\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVMS60\ScummVM.exe"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVMS60\ScummVMS60.aif"-"!:\system\apps\ScummVMS60\ScummVMS60.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVMS60\ScummVMS60.rsc"-"!:\system\apps\ScummVMS60\ScummVMS60.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/S80/ScummVMApp.cpp b/backends/epoc/S80/ScummVMApp.cpp
new file mode 100644
index 0000000000..43d960b73f
--- /dev/null
+++ b/backends/epoc/S80/ScummVMApp.cpp
@@ -0,0 +1,167 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#include "ScummVMapp.h"
+#include <scummvms80.rsg>
+#include <apgcli.h>
+#include <eikdll.h>
+#include <apgtask.h>
+
+EXPORT_C CApaApplication *NewApplication() {
+ return (new CScummVM);
+}
+
+CScummVM::CScummVM() {
+}
+
+CScummVM::~CScummVM() {
+}
+
+CApaDocument *CScummVM::CreateDocumentL() {
+ return new (ELeave)CScummVMDoc(*this);
+}
+
+TUid CScummVM::AppDllUid() const {
+ return TUid::Uid(0x101f9b57);
+}
+
+CScummVMDoc::CScummVMDoc(CEikApplication &aApp) : CEikDocument(aApp) {
+}
+
+CScummVMDoc::~CScummVMDoc() {
+}
+
+CEikAppUi *CScummVMDoc::CreateAppUiL() {
+ return new (ELeave)CScummVMUi;
+}
+
+void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
+ if(aForeground) {
+ BringUpEmulatorL();
+ }
+}
+
+CScummVMUi::CScummVMUi() {
+}
+
+CScummVMUi::~CScummVMUi() {
+ if(iWatcher) {
+ iThreadWatch.LogonCancel(iWatcher->iStatus);
+ iWatcher->Cancel();
+ }
+ delete iWatcher;
+
+ iThreadWatch.Close();
+}
+
+void CScummVMUi::ConstructL() {
+ BaseConstructL();
+ TBuf<128> startFile;
+ startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
+ TParse parser;
+ parser.Set(startFile,NULL,NULL);
+
+ startFile = parser.DriveAndPath();
+#ifndef __WINS__
+ startFile.Append( _L("ScummVM.exe"));
+#else
+ startFile.Append( _L("ScummVM.dll"));
+#endif
+ CApaCommandLine *cmdLine = CApaCommandLine::NewLC(startFile);
+ RApaLsSession lsSession;
+
+ lsSession.Connect();
+ CleanupClosePushL(lsSession);
+ lsSession.StartApp(*cmdLine, iThreadId);
+
+ CleanupStack::PopAndDestroy(); // close lsSession
+ CleanupStack::PopAndDestroy(cmdLine);
+
+ User::After(500000); // Let the application start
+
+ TApaTaskList taskList(iEikonEnv->WsSession());
+
+ TApaTask myTask = taskList.FindApp(TUid::Uid(0x101f9b57));
+ myTask.SendToBackground();
+
+ TApaTask exeTask = taskList.FindByPos(0);
+
+ iExeWgId = exeTask.WgId();
+ exeTask.BringToForeground();
+
+ if(iExeWgId == myTask.WgId()) { // Should n't be the same
+ Exit();
+ }
+ if(iThreadWatch.Open(iThreadId) == KErrNone) {
+ iWatcher = new (ELeave)CScummWatcher;
+ iWatcher->iAppUi = this;
+ iThreadWatch.Logon(iWatcher->iStatus);
+ }
+}
+
+CScummWatcher::CScummWatcher() : CActive(EPriorityStandard) {
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+CScummWatcher::~CScummWatcher() {
+}
+
+void CScummWatcher::DoCancel() {
+}
+
+void CScummWatcher::RunL() {
+ iAppUi->HandleCommandL(EEikCmdExit);
+}
+
+void CScummVMUi::BringUpEmulatorL() {
+ RThread thread;
+ if(thread.Open(iThreadId) == KErrNone) {
+ thread.Close();
+ TApaTask apaTask(iEikonEnv->WsSession());
+ apaTask.SetWgId(iExeWgId);
+ apaTask.BringToForeground();
+ } else {
+ iExeWgId = -1;
+ }
+}
+
+void CScummVMUi::HandleCommandL(TInt aCommand) {
+ switch(aCommand) {
+ case EEikCmdExit:
+ {
+ RThread thread;
+ if(thread.Open(iThreadId) == KErrNone) {
+ thread.Terminate(0);
+ thread.Close();
+ }
+ Exit();
+ }
+ break;
+ }
+}
+
+GLDEF_C TInt E32Dll(TDllReason) {
+ return KErrNone;
+}
diff --git a/backends/epoc/S80/ScummVMApp.h b/backends/epoc/S80/ScummVMApp.h
new file mode 100644
index 0000000000..e297d75e9d
--- /dev/null
+++ b/backends/epoc/S80/ScummVMApp.h
@@ -0,0 +1,83 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+#ifndef ScummVMapps60h
+#define ScummVMapps60h
+
+#include <eikapp.h>
+#include <e32base.h>
+#include <coecntrl.h>
+#include <eikenv.h>
+#include <coeview.h>
+#include <eikappui.h>
+
+class CScummVM : public CEikApplication {
+public:
+ CScummVM();
+ ~CScummVM();
+
+ CApaDocument *CreateDocumentL();
+ TUid AppDllUid() const;
+};
+
+
+#include <eikdoc.h>
+
+class CScummVMDoc : public CEikDocument {
+public:
+ CScummVMDoc(CEikApplication &aApplicaiton);
+ ~CScummVMDoc();
+
+ CEikAppUi *CreateAppUiL();
+ void ConstructL();
+};
+
+#include <eikappui.h>
+class CScummVMUi;
+class CScummWatcher : public CActive {
+public:
+ CScummWatcher();
+ ~CScummWatcher();
+
+ void DoCancel();
+ void RunL();
+ CScummVMUi *iAppUi;
+};
+
+class CScummVMUi : public CEikAppUi {
+public:
+ CScummVMUi();
+ ~CScummVMUi();
+
+ void ConstructL();
+ void HandleCommandL(TInt aCommand);
+ void HandleForegroundEventL(TBool aForeground);
+ void BringUpEmulatorL();
+
+private:
+ TThreadId iThreadId;
+ TInt iExeWgId;
+ RThread iThreadWatch;
+ CScummWatcher *iWatcher;
+};
+#endif
diff --git a/backends/epoc/S80/ScummVM_S80_App.mmp b/backends/epoc/S80/ScummVM_S80_App.mmp
new file mode 100644
index 0000000000..268fd18a40
--- /dev/null
+++ b/backends/epoc/S80/ScummVM_S80_App.mmp
@@ -0,0 +1,48 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header:
+ */
+
+//
+// MAKEFILE.MMP S80 ScummVM Launcher
+//
+
+TARGET ScummVMS80.app
+TARGETPATH system\apps\ScummVMS80
+TARGETTYPE app
+
+UID 0x100039ce 0x101f9b57
+RESOURCE SCUMMVMS80.rss
+
+SOURCEPATH .
+USERINCLUDE .
+SYSTEMINCLUDE \epoc32\include \epoc32\include\libc
+
+// app source
+SOURCE ScummVMApp.cpp
+
+sourcepath ..
+AIF ScummVmS80.Aif ..\res\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp ScummSM.bmp
+
+// libraries
+LIBRARY cone.lib EIKCORE.lib
+LIBRARY euser.lib apparc.lib
+LIBRARY efsrv.lib apgrfx.lib
diff --git a/backends/epoc/S80/ScummvmS80.rss b/backends/epoc/S80/ScummvmS80.rss
new file mode 100644
index 0000000000..73988dab42
--- /dev/null
+++ b/backends/epoc/S80/ScummvmS80.rss
@@ -0,0 +1,62 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header:
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ menubar = r_scum_menubar;
+ }
+
+RESOURCE MENU_BAR r_scum_menubar // *** Menu bar
+{
+ titles =
+ {
+ MENU_TITLE { menu_pane = r_scum_menu; txt = "ScummVM"; }
+ };
+}
+
+RESOURCE MENU_PANE r_scum_menu // *** Submenu
+{
+ items =
+ {
+
+ MENU_ITEM{command = EEikCmdExit;txt = "Exit";}
+ };
+}
diff --git a/backends/epoc/S80/scummvm-CVS-SymbianS80.pkg b/backends/epoc/S80/scummvm-CVS-SymbianS80.pkg
new file mode 100644
index 0000000000..2809128a95
--- /dev/null
+++ b/backends/epoc/S80/scummvm-CVS-SymbianS80.pkg
@@ -0,0 +1,31 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM S80"},(0x101f9b57),0,80,3
+
+; Application file Launcher and actual exe
+"\epoc32\release\armi\urel\ScummVMS80.app"-"!:\system\apps\ScummVMS80\ScummVMS80.app"
+"\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVMS80\ScummVM.exe"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVMS80\ScummVMS80.aif"-"!:\system\apps\ScummVMS80\ScummVMS80.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVMS80\ScummVMS80.rsc"-"!:\system\apps\ScummVMS80\ScummVMS80.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/S90/ScummVMApp.cpp b/backends/epoc/S90/ScummVMApp.cpp
new file mode 100644
index 0000000000..4de27158b2
--- /dev/null
+++ b/backends/epoc/S90/ScummVMApp.cpp
@@ -0,0 +1,171 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#include "ScummVMapp.h"
+#include <scummvms90.rsg>
+#include <apgcli.h>
+#include <eikdll.h>
+#include <apgtask.h>
+
+EXPORT_C CApaApplication *NewApplication() {
+ return (new CScummVM);
+}
+
+CScummVM::CScummVM() {
+}
+
+CScummVM::~CScummVM() {
+}
+
+CApaDocument *CScummVM::CreateDocumentL() {
+ return new (ELeave)CScummVMDoc(*this);
+}
+
+TUid CScummVM::AppDllUid() const {
+ return TUid::Uid(0x101f9b57);
+}
+
+CScummVMDoc::CScummVMDoc(CEikApplication &aApp) : CEikDocument(aApp) {
+}
+
+CScummVMDoc::~CScummVMDoc() {
+}
+
+CEikAppUi *CScummVMDoc::CreateAppUiL() {
+ return new (ELeave)CScummVMUi;
+}
+
+void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
+ if(aForeground) {
+ BringUpEmulatorL();
+ }
+}
+
+CScummVMUi::CScummVMUi() {
+}
+
+CScummVMUi::~CScummVMUi() {
+ if(iWatcher) {
+ iThreadWatch.LogonCancel(iWatcher->iStatus);
+ iWatcher->Cancel();
+ }
+
+ delete iWatcher;
+
+ iThreadWatch.Close();
+}
+
+void CScummVMUi::ConstructL() {
+ BaseConstructL();
+ TBuf<128> startFile;
+ startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
+ TParse parser;
+ parser.Set(startFile,NULL,NULL);
+
+ startFile = parser.DriveAndPath();
+#ifndef __WINS__
+ startFile.Append( _L("ScummVM.exe"));
+#else
+ startFile.Append( _L("ScummVM.dll"));
+#endif
+ CApaCommandLine *cmdLine = CApaCommandLine::NewLC(startFile);
+ RApaLsSession lsSession;
+
+ lsSession.Connect();
+ CleanupClosePushL(lsSession);
+ lsSession.StartApp(*cmdLine, iThreadId);
+
+ CleanupStack::PopAndDestroy();//close lsSession
+ CleanupStack::PopAndDestroy(cmdLine);
+
+ User::After(500000);// Let the application start
+
+ TApaTaskList taskList(iEikonEnv->WsSession());
+
+ TApaTask myTask = taskList.FindApp(TUid::Uid(0x101f9b57));
+ myTask.SendToBackground();
+
+ TApaTask exeTask = taskList.FindByPos(0);
+
+ iExeWgId=exeTask.WgId();
+ exeTask.BringToForeground();
+
+ if(iExeWgId == myTask.WgId()) { // Should n't be the same
+ Exit();
+ }
+ if(iThreadWatch.Open(iThreadId) == KErrNone) {
+ iWatcher = new (ELeave)CScummWatcher;
+ iWatcher->iAppUi = this;
+ iThreadWatch.Logon(iWatcher->iStatus);
+ }
+}
+
+CScummWatcher::CScummWatcher() : CActive(EPriorityStandard) {
+ CActiveScheduler::Add(this);
+
+ iStatus = KRequestPending;
+ SetActive();
+}
+
+CScummWatcher::~CScummWatcher() {
+}
+
+void CScummWatcher::DoCancel() {
+}
+
+void CScummWatcher::RunL() {
+ iAppUi->HandleCommandL(EEikCmdExit);
+}
+
+void CScummVMUi::BringUpEmulatorL() {
+ RThread thread;
+
+ if(thread.Open(iThreadId) == KErrNone) {
+ thread.Close();
+ TApaTask apaTask(iEikonEnv->WsSession());
+ apaTask.SetWgId(iExeWgId);
+ apaTask.BringToForeground();
+ } else {
+ iExeWgId = -1;
+ Exit();
+ }
+}
+
+void CScummVMUi::HandleCommandL(TInt aCommand) {
+ switch(aCommand) {
+ case EEikCmdExit:
+ {
+ RThread thread;
+ if(thread.Open(iThreadId) == KErrNone) {
+ thread.Terminate(0);
+ thread.Close();
+ }
+ Exit();
+ }
+ break;
+ }
+}
+
+GLDEF_C TInt E32Dll(TDllReason) {
+ return KErrNone;
+}
diff --git a/backends/epoc/S90/ScummVMApp.h b/backends/epoc/S90/ScummVMApp.h
new file mode 100644
index 0000000000..e297d75e9d
--- /dev/null
+++ b/backends/epoc/S90/ScummVMApp.h
@@ -0,0 +1,83 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+#ifndef ScummVMapps60h
+#define ScummVMapps60h
+
+#include <eikapp.h>
+#include <e32base.h>
+#include <coecntrl.h>
+#include <eikenv.h>
+#include <coeview.h>
+#include <eikappui.h>
+
+class CScummVM : public CEikApplication {
+public:
+ CScummVM();
+ ~CScummVM();
+
+ CApaDocument *CreateDocumentL();
+ TUid AppDllUid() const;
+};
+
+
+#include <eikdoc.h>
+
+class CScummVMDoc : public CEikDocument {
+public:
+ CScummVMDoc(CEikApplication &aApplicaiton);
+ ~CScummVMDoc();
+
+ CEikAppUi *CreateAppUiL();
+ void ConstructL();
+};
+
+#include <eikappui.h>
+class CScummVMUi;
+class CScummWatcher : public CActive {
+public:
+ CScummWatcher();
+ ~CScummWatcher();
+
+ void DoCancel();
+ void RunL();
+ CScummVMUi *iAppUi;
+};
+
+class CScummVMUi : public CEikAppUi {
+public:
+ CScummVMUi();
+ ~CScummVMUi();
+
+ void ConstructL();
+ void HandleCommandL(TInt aCommand);
+ void HandleForegroundEventL(TBool aForeground);
+ void BringUpEmulatorL();
+
+private:
+ TThreadId iThreadId;
+ TInt iExeWgId;
+ RThread iThreadWatch;
+ CScummWatcher *iWatcher;
+};
+#endif
diff --git a/backends/epoc/S90/ScummvmS90.rss b/backends/epoc/S90/ScummvmS90.rss
new file mode 100644
index 0000000000..0c52253483
--- /dev/null
+++ b/backends/epoc/S90/ScummvmS90.rss
@@ -0,0 +1,62 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header:
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ menubar = r_scum_menubar;
+ }
+
+RESOURCE MENU_BAR r_scum_menubar // *** Menu bar
+{
+ titles =
+ {
+ MENU_TITLE { menu_pane = r_scum_menu; txt = "ScummVM"; }
+ };
+}
+
+RESOURCE MENU_PANE r_scum_menu // *** Submenu
+{
+ items =
+ {
+
+ MENU_ITEM{command = EEikCmdExit;txt = "Exit";}
+ };
+}
diff --git a/backends/epoc/S90/Scummvm_S90_App.mmp b/backends/epoc/S90/Scummvm_S90_App.mmp
new file mode 100644
index 0000000000..6fb8894027
--- /dev/null
+++ b/backends/epoc/S90/Scummvm_S90_App.mmp
@@ -0,0 +1,48 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header:
+ */
+
+//
+// MAKEFILE.MMP S90 ScummVM Launcher
+//
+
+TARGET ScummVMS90.app
+TARGETPATH system\apps\ScummVMS90
+TARGETTYPE app
+
+UID 0x100039ce 0x101f9b57
+RESOURCE SCUMMVMS90.rss
+
+SOURCEPATH .
+USERINCLUDE .
+SYSTEMINCLUDE \epoc32\include \epoc32\include\libc
+
+// app source
+SOURCE ScummVMApp.cpp
+
+sourcepath ..
+AIF ScummVmS90.Aif ..\res\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp ScummSM.bmp
+
+// libraries
+LIBRARY cone.lib EIKCORE.lib
+LIBRARY euser.lib apparc.lib
+LIBRARY efsrv.lib apgrfx.lib \ No newline at end of file
diff --git a/backends/epoc/S90/scummvm-CVS-SymbianS90.pkg b/backends/epoc/S90/scummvm-CVS-SymbianS90.pkg
new file mode 100644
index 0000000000..942a445103
--- /dev/null
+++ b/backends/epoc/S90/scummvm-CVS-SymbianS90.pkg
@@ -0,0 +1,31 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM S90"},(0x101f9b57),0,80,3
+
+; Application file Launcher and actual exe
+"\epoc32\release\armi\urel\ScummVMS90.app"-"!:\system\apps\ScummVMS90\ScummVMS90.app"
+"\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVMS90\ScummVM.exe"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVMS90\ScummVMS90.aif"-"!:\system\apps\ScummVMS90\ScummVMS90.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVMS90\ScummVMS90.rsc"-"!:\system\apps\ScummVMS90\ScummVMS90.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/UIQ2/ScummVM.rss b/backends/epoc/UIQ2/ScummVM.rss
new file mode 100644
index 0000000000..58f3aeede7
--- /dev/null
+++ b/backends/epoc/UIQ2/ScummVM.rss
@@ -0,0 +1,45 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ }
+
diff --git a/backends/epoc/UIQ2/Vibration.sis b/backends/epoc/UIQ2/Vibration.sis
new file mode 100644
index 0000000000..7cd9d33f15
--- /dev/null
+++ b/backends/epoc/UIQ2/Vibration.sis
Binary files differ
diff --git a/backends/epoc/UIQ2/chkstk.obj b/backends/epoc/UIQ2/chkstk.obj
new file mode 100644
index 0000000000..1df42b21c3
--- /dev/null
+++ b/backends/epoc/UIQ2/chkstk.obj
Binary files differ
diff --git a/backends/epoc/UIQ2/lldiv.obj b/backends/epoc/UIQ2/lldiv.obj
new file mode 100644
index 0000000000..60d7c98660
--- /dev/null
+++ b/backends/epoc/UIQ2/lldiv.obj
Binary files differ
diff --git a/backends/epoc/UIQ2/llmul.obj b/backends/epoc/UIQ2/llmul.obj
new file mode 100644
index 0000000000..c6416030a3
--- /dev/null
+++ b/backends/epoc/UIQ2/llmul.obj
Binary files differ
diff --git a/backends/epoc/UIQ2/llshl.obj b/backends/epoc/UIQ2/llshl.obj
new file mode 100644
index 0000000000..30c5749d83
--- /dev/null
+++ b/backends/epoc/UIQ2/llshl.obj
Binary files differ
diff --git a/backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2.pkg b/backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2.pkg
new file mode 100644
index 0000000000..9dd919fb31
--- /dev/null
+++ b/backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2.pkg
@@ -0,0 +1,33 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM"},(0x101f9b57),0,80,3
+
+; Platform type
+(0x101F617B), 2, 0, 0, {"UIQ20ProductID"}
+
+; Application file
+"\epoc32\release\armi\urel\ScummVM.app"-"!:\system\apps\ScummVM\ScummVM.app"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg b/backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg
new file mode 100644
index 0000000000..8002d66f20
--- /dev/null
+++ b/backends/epoc/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg
@@ -0,0 +1,38 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM"},(0x101f9b57),0,80,3
+
+; Platform type
+(0x101F617B), 2, 0, 0, {"UIQ20ProductID"}
+
+; Application file
+"\epoc32\release\armi\urel\ScummVM.app"-"!:\system\apps\ScummVM\ScummVM.app"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall.
+
+; add extra Vibration lib for P800, will be ignored during all other installs
+IF MachineUID = 0x101F408B
+@"Vibration.sis", (0x101F94A3)
+ENDIF \ No newline at end of file
diff --git a/backends/epoc/UIQ3/ScummVM.rss b/backends/epoc/UIQ3/ScummVM.rss
new file mode 100644
index 0000000000..58f3aeede7
--- /dev/null
+++ b/backends/epoc/UIQ3/ScummVM.rss
@@ -0,0 +1,45 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+// ScummVM.RSS
+
+NAME SCUM
+
+// Include definitions of resource STRUCTS used by this
+// resource script
+#include <eikon.rh>
+#include "..\src\Scummvm.hrh"
+// Include the standard Eikon resource ids
+#include <eikon.rsg>
+
+
+RESOURCE RSS_SIGNATURE
+ {
+ }
+
+RESOURCE TBUF16 { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ }
+
diff --git a/backends/epoc/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/epoc/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
new file mode 100644
index 0000000000..9dd919fb31
--- /dev/null
+++ b/backends/epoc/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
@@ -0,0 +1,33 @@
+;;;
+;;; ScummVM .PKG file for .SIS gegeration
+;;;
+
+; Languages
+;&EN
+
+; UID is the app's UID
+#{"ScummVM"},(0x101f9b57),0,80,3
+
+; Platform type
+(0x101F617B), 2, 0, 0, {"UIQ20ProductID"}
+
+; Application file
+"\epoc32\release\armi\urel\ScummVM.app"-"!:\system\apps\ScummVM\ScummVM.app"
+
+; AIF application information file
+"\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif"
+
+; Resource file
+"\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc"
+
+; Empty .placeholder file, ensures creation of c:\documents\ScummVM\ for future file saves
+"..\.placeholder"-"c:\documents\ScummVM\.placeholder"
+
+; Config/log files: 'empty' will automagically be removed on uninstall
+""-"c:\documents\ScummVM\scummvm.ini",FILENULL
+""-"c:\documents\ScummVM\scummvm.stdout.txt",FILENULL
+""-"c:\documents\ScummVM\scummvm.stderr.txt",FILENULL
+""-"!:\system\apps\ScummVM\sdl.ini",FILENULL
+
+; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini.
+; It will remove the config file, std***.txt files & dirs on uninstall. \ No newline at end of file
diff --git a/backends/epoc/mmp/initial_mmps.zip b/backends/epoc/mmp/initial_mmps.zip
new file mode 100644
index 0000000000..d0989a62be
--- /dev/null
+++ b/backends/epoc/mmp/initial_mmps.zip
Binary files differ
diff --git a/backends/epoc/res/ScummS.bmp b/backends/epoc/res/ScummS.bmp
new file mode 100644
index 0000000000..d5993a0288
--- /dev/null
+++ b/backends/epoc/res/ScummS.bmp
Binary files differ
diff --git a/backends/epoc/res/ScummVmAif.rss b/backends/epoc/res/ScummVmAif.rss
new file mode 100644
index 0000000000..0842fac3c8
--- /dev/null
+++ b/backends/epoc/res/ScummVmAif.rss
@@ -0,0 +1,44 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header:
+ */
+
+#include <aiftool.rh>
+
+
+RESOURCE AIF_DATA
+ {
+ app_uid= 0x101f9b57;
+ //
+ hidden=KAppNotHidden;
+ embeddability=KAppNotEmbeddable;
+ caption_list=
+ {
+ CAPTION { code=ELangEnglish; caption="ScummVM"; },
+ CAPTION { code=ELangAmerican; caption="ScummVM"; },
+ CAPTION { code=ELangOther; caption="ScummVM"; }
+ };
+ //
+ num_icons=2;
+ }
+
+
+
diff --git a/backends/epoc/res/scummL.bmp b/backends/epoc/res/scummL.bmp
new file mode 100644
index 0000000000..025dc38581
--- /dev/null
+++ b/backends/epoc/res/scummL.bmp
Binary files differ
diff --git a/backends/epoc/res/scummLm.bmp b/backends/epoc/res/scummLm.bmp
new file mode 100644
index 0000000000..fc635b3f99
--- /dev/null
+++ b/backends/epoc/res/scummLm.bmp
Binary files differ
diff --git a/backends/epoc/res/scummSm.bmp b/backends/epoc/res/scummSm.bmp
new file mode 100644
index 0000000000..ba976066db
--- /dev/null
+++ b/backends/epoc/res/scummSm.bmp
Binary files differ
diff --git a/backends/epoc/src/ScummApp.cpp b/backends/epoc/src/ScummApp.cpp
new file mode 100644
index 0000000000..9e53587a40
--- /dev/null
+++ b/backends/epoc/src/ScummApp.cpp
@@ -0,0 +1,92 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#include "backends/epoc/src/ScummApp.h"
+
+#include "backends/epoc/src/ScummVM.hrh"
+#define _PAGESIZE_ 0x1000
+
+#if defined (__WINS__)
+extern "C" int _chkstk(int /*a*/) {
+_asm {
+ push ecx
+ cmp eax,_PAGESIZE_
+ lea ecx,[esp] + 8
+ jb short lastpage
+
+ probepages:
+ sub ecx,_PAGESIZE_
+ sub eax,_PAGESIZE_
+
+ test dword ptr [ecx],eax
+
+ cmp eax,_PAGESIZE_
+ jae short probepages
+
+ lastpage:
+ sub ecx,eax
+ mov eax,esp
+
+ test dword ptr [ecx],eax
+
+ mov esp,ecx
+
+ mov ecx,dword ptr [eax]
+ mov eax,dword ptr [eax + 4]
+
+ push eax
+ ret
+ }
+ return 1;
+}
+#endif
+
+#ifdef EPOC_AS_APP
+// this function is called by Symbian to deliver the new CApaApplication object
+EXPORT_C CApaApplication *NewApplication() {
+ // Return pointer to newly created CQMApp
+ return (new CScummApp);
+}
+#endif
+
+GLDEF_C TInt E32Dll(TDllReason) {
+ return KErrNone;
+}
+
+CScummApp::CScummApp() {
+}
+
+CScummApp::~CScummApp() {
+}
+
+/**
+ * Responsible for returning the unique UID of this application
+ * @return unique UID for this application in a TUid
+ **/
+TUid CScummApp::AppDllUid() const {
+ return TUid::Uid(ScummUid);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/backends/epoc/src/ScummApp.h b/backends/epoc/src/ScummApp.h
new file mode 100644
index 0000000000..92e643cd30
--- /dev/null
+++ b/backends/epoc/src/ScummApp.h
@@ -0,0 +1,44 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#ifndef ScummAPPH
+#define ScummAPPH
+
+#include <eikapp.h>
+#include <e32base.h>
+#include <sdlapp.h>
+#ifdef EPOC_AS_APP
+#include "ECompXL.h"
+#endif
+
+class CScummApp : public CSDLApp {
+public:
+ CScummApp();
+ ~CScummApp();
+
+ TUid AppDllUid() const;
+#ifdef EPOC_AS_APP
+ TECompXL iECompXL;
+#endif
+};
+#endif
diff --git a/backends/epoc/src/ScummVm.hrh b/backends/epoc/src/ScummVm.hrh
new file mode 100644
index 0000000000..f62ef1b789
--- /dev/null
+++ b/backends/epoc/src/ScummVm.hrh
@@ -0,0 +1,29 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+#ifndef ScummHRH
+#define ScummHRH
+
+#define ScummUid 0x101f9b57
+
+#endif
diff --git a/backends/epoc/src/SymbianActions.cpp b/backends/epoc/src/SymbianActions.cpp
new file mode 100644
index 0000000000..43e457727d
--- /dev/null
+++ b/backends/epoc/src/SymbianActions.cpp
@@ -0,0 +1,187 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001-2005 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#include "common/stdafx.h"
+#include "backends/epoc/src/SymbianActions.h"
+
+#include "gui/message.h"
+#include "scumm/scumm.h"
+#include "common/config-manager.h"
+
+#include <sdl.h>
+
+namespace GUI {
+
+// SumthinWicked says: we either split our Actions like WinCE did with Pocket/Smartphone
+// or we put them in this file separated by #ifdefs, this one is up to you, AnotherGuest :)
+
+const Common::String actionNames[] = {
+ "Up",
+ "Down",
+ "Left",
+ "Right",
+ "Left Click",
+ "Right Click",
+ "Save",
+ "Skip",
+ "Zone",
+ "FT Cheat",
+ "Swap character",
+ "Skip text",
+ "Pause",
+ "Quit"
+};
+
+#ifdef UIQ
+static const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0x11a, 0x11b, SDLK_MENU, SDLK_PAGEDOWN, 0, 0,SDLK_PAGEUP,0,0};
+#elif defined (S60)
+const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0, 0, '*', '#', '9',0,0,0,0,0};
+#elif defined (S90)
+const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0, 0, SDLK_MENU, SDLK_ESCAPE, 0, 0,0,0,0,0};
+#else
+const int ACTIONS_DEFAULT[ACTION_LAST] = { 0, 0, 0, 0, 0x11a, 0x11b, SDLK_MENU, SDLK_ESCAPE, 0, 0,0,0,0,0};
+#endif
+
+// creator function according to Factory Pattern
+void SymbianActions::init(GameDetector &detector) {
+ _instance = new SymbianActions(detector);
+}
+
+
+Common::String SymbianActions::actionName(ActionType action) {
+ return actionNames[action];
+}
+
+int SymbianActions::size() {
+ return ACTION_LAST;
+}
+
+Common::String SymbianActions::domain() {
+ return "symbian";
+}
+
+int SymbianActions::version() {
+ return ACTION_VERSION;
+}
+
+SymbianActions::SymbianActions(GameDetector &detector) :
+ Actions(detector) {
+ int i;
+
+ for (i = 0; i < ACTION_LAST; i++) {
+ _action_mapping[i] = ACTIONS_DEFAULT[i];
+ _action_enabled[i] = false;
+ }
+
+}
+
+void SymbianActions::initInstanceMain(OSystem *mainSystem) {
+ Actions::initInstanceMain(mainSystem);
+
+ // Mouse Up
+ _action_enabled[ACTION_UP] = true;
+
+ // Mouse Down
+ _action_enabled[ACTION_DOWN] = true;
+
+ // Mouse Left
+ _action_enabled[ACTION_LEFT] = true;
+
+ // Mouse Right
+ _action_enabled[ACTION_RIGHT] = true;
+
+ // Left Click
+ _action_enabled[ACTION_LEFTCLICK] = true;
+
+ // Right Click
+ _action_enabled[ACTION_RIGHTCLICK] = true;
+
+ // Skip
+ _action_enabled[ACTION_SKIP] = true;
+ _key_action[ACTION_SKIP].setAscii(SDLK_ESCAPE);
+}
+
+void SymbianActions::initInstanceGame() {
+ bool is_simon = (strncmp(_detector->_targetName.c_str(), "simon", 5) == 0);
+ bool is_sky = (_detector->_targetName == "sky");
+ bool is_queen = (_detector->_targetName == "queen");
+ bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0);
+ bool is_ite = ((strncmp(_detector->_targetName.c_str(), "ite", 3) == 0) ||
+ (strncmp(_detector->_targetName.c_str(), "ihnm", 4) == 0));
+
+ Actions::initInstanceGame();
+
+ // See if a right click mapping could be needed
+ if (is_sky || _detector->_targetName == "samnmax" || is_gob)
+ _right_click_needed = true;
+
+ // Initialize keys for different actions
+ // Save
+ if (is_simon || is_gob)
+ _action_enabled[ACTION_SAVE] = false;
+ else if (is_queen) {
+ _action_enabled[ACTION_SAVE] = true;
+ _key_action[ACTION_SAVE].setAscii(SDLK_F1); // F1 key for FOTAQ or F5??!?
+ } else if (is_sky) {
+ _action_enabled[ACTION_SAVE] = true;
+ _key_action[ACTION_SAVE].setAscii(63);
+ } else {
+ _action_enabled[ACTION_SAVE] = true;
+ _key_action[ACTION_SAVE].setAscii(SDLK_F5); // F5 key
+ }
+
+ // Swap character
+ _action_enabled[ACTION_SWAPCHAR] = true;
+ _key_action[ACTION_SWAPCHAR].setAscii('b'); // b
+
+ // Zone
+ _action_enabled[ACTION_ZONE] = true;
+
+ // FT Cheat
+ _action_enabled[ACTION_FT_CHEAT] = true;
+ _key_action[ACTION_FT_CHEAT].setAscii(86); // shift-V
+
+ // Skip text
+ _action_enabled[ACTION_SKIP_TEXT] = true;
+ if (is_queen) {
+ _key_action[ACTION_SKIP_TEXT].setAscii(SDLK_SPACE);
+ } else {
+ _key_action[ACTION_SKIP_TEXT].setAscii(SDLK_PERIOD);
+ }
+
+ // Pause
+ _key_action[ACTION_PAUSE].setAscii(' ');
+ _action_enabled[ACTION_PAUSE] = true;
+
+ // Quit
+ _action_enabled[ACTION_QUIT] = true;
+}
+
+
+SymbianActions::~SymbianActions() {
+}
+
+bool SymbianActions::perform(ActionType /*action*/, bool /*pushed*/) {
+
+ return false;
+}
+
+} // namespace GUI
diff --git a/backends/epoc/src/SymbianActions.h b/backends/epoc/src/SymbianActions.h
new file mode 100644
index 0000000000..b9ed582c82
--- /dev/null
+++ b/backends/epoc/src/SymbianActions.h
@@ -0,0 +1,77 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001-2005 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#ifndef SYMBIANACTIONS_H
+#define SYMBIANACTIONS_H
+
+#include "common/stdafx.h"
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "base/gameDetector.h"
+#include "gui/Key.h"
+#include "gui/Actions.h"
+
+namespace GUI {
+
+#define ACTION_VERSION 6
+
+enum actionType {
+ ACTION_UP = 0,
+ ACTION_DOWN,
+ ACTION_LEFT,
+ ACTION_RIGHT,
+ ACTION_LEFTCLICK,
+ ACTION_RIGHTCLICK,
+ ACTION_SAVE,
+ ACTION_SKIP,
+ ACTION_ZONE,
+ ACTION_FT_CHEAT,
+ ACTION_SWAPCHAR,
+ ACTION_SKIP_TEXT,
+ ACTION_PAUSE,
+ ACTION_QUIT,
+ ACTION_LAST
+};
+
+class SymbianActions : public Actions {
+public:
+ // Actions
+ bool perform(ActionType action, bool pushed = true);
+ Common::String actionName(ActionType action);
+ int size();
+ static void init(GameDetector &detector);
+ void initInstanceMain(OSystem *mainSystem);
+ void initInstanceGame();
+
+ // Action domain
+ Common::String domain();
+ int version();
+
+ ~SymbianActions();
+
+private:
+ SymbianActions(GameDetector &detector);
+ bool _right_click_needed;
+};
+
+} // namespace GUI
+
+#endif
diff --git a/backends/epoc/src/SymbianOS.cpp b/backends/epoc/src/SymbianOS.cpp
new file mode 100644
index 0000000000..6a775957d4
--- /dev/null
+++ b/backends/epoc/src/SymbianOS.cpp
@@ -0,0 +1,400 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#include "backends/epoc/src/SymbianOS.h"
+#include "backends/epoc/src/SymbianActions.h"
+#include "gui/Actions.h"
+#include "gui/Key.h"
+#include "gui/message.h"
+
+#include <eikenv.h> // for CEikonEnv::Static() @ SymbianFatalError()
+
+#include "common/config-manager.h"
+
+extern Common::ConfigManager *g_config;
+
+static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
+ {"1x", "Fullscreen", GFX_NORMAL},
+ {0, 0, 0}
+};
+
+OSystem *OSystem_SymbianOS_create() {
+ return new OSystem_SDL_Symbian();
+}
+
+// Show a simple Symbian Info win with Msg & exit
+void SymbianFatalError(const char *msg) {
+ TPtrC8 msgPtr((const TUint8 *)msg);
+ TBuf<512> msg16Bit;
+ msg16Bit.Copy(msgPtr);
+ CEikonEnv::Static()->InfoWinL(_L("ScummVM Fatal Error"), msg16Bit);
+
+ if (g_system)
+ g_system->quit();
+}
+
+bool OSystem_SDL_Symbian::hasFeature(Feature f) {
+ switch(f) {
+ case kFeatureFullscreenMode:
+ case kFeatureAspectRatioCorrection:
+ case kFeatureAutoComputeDirtyRects:
+ case kFeatureCursorHasPalette:
+#ifdef USE_VIBRA_SE_PXXX
+ case kFeatureVibration:
+#endif
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+OSystem_SDL_Symbian::zoneDesc OSystem_SDL_Symbian::_zones[TOTAL_ZONES] = {
+ { 0, 0, 320, 145 },
+ { 0, 145, 150, 55 },
+ { 150, 145, 170, 55 }
+};
+OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0)
+{
+ ConfMan.set("FM_high_quality", false);
+#ifndef S60 // S60 has low quality as default
+ ConfMan.set("FM_medium_quality", true);
+#else
+ ConfMan.set("FM_medium_quality", false);
+#endif
+ ConfMan.set("joystick_num", 0); // Symbian OS should have joystick_num set to 0 in the ini file , but uiq devices might refuse opening the joystick
+ ConfMan.flushToDisk();
+ // Initialize global key mapping for Smartphones
+ GUI::Actions* actions = GUI::Actions::Instance();
+ actions->initInstanceMain(this);
+ actions->loadMapping();
+ initZones();
+}
+
+OSystem_SDL_Symbian::~OSystem_SDL_Symbian() {
+ delete []_stereo_mix_buffer;
+}
+
+int OSystem_SDL_Symbian::getDefaultGraphicsMode() const {
+ return GFX_NORMAL;
+}
+
+const OSystem::GraphicsMode *OSystem_SDL_Symbian::getSupportedGraphicsModes() const {
+ return s_supportedGraphicsModes;
+}
+
+// make sure we always go to normal, even if the string might be set wrong!
+bool OSystem_SDL_Symbian::setGraphicsMode(const char * /*name*/) {
+ // let parent OSystem_SDL handle it
+ return OSystem_SDL::setGraphicsMode(getDefaultGraphicsMode());
+}
+
+void OSystem_SDL_Symbian::quitWithErrorMsg(const char *msg) {
+
+ CEikonEnv::Static()->AlertWin(_L("quitWithErrorMsg()")) ;
+
+ if (g_system)
+ g_system->quit();
+}
+
+/*
+ * SumthinWicked says: the stuff below is copied from common/scaler.cpp,
+ * so we can skip compiling the scalers. ESDL still needs 1x and the scaler
+ * architecture because we inherit from OSystem_SDL.
+ */
+int gBitFormat = 565;
+void InitScalers(uint32 /*BitFormat*/) {} // called by OSystem_SDL functions, not relevant for ESDL
+
+/**
+ * Trivial 'scaler' - in fact it doesn't do any scaling but just copies the
+ * source to the destination.
+ */
+void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height) {
+ while (height--) {
+ memcpy(dstPtr, srcPtr, 2 * width);
+ srcPtr += srcPitch;
+ dstPtr += dstPitch;
+ }
+}
+
+bool OSystem_SDL_Symbian::setSoundCallback(SoundProc proc, void *param) {
+
+ // First save the proc and param
+ _sound_proc_param = param;
+ _sound_proc = proc;
+ SDL_AudioSpec desired;
+ SDL_AudioSpec obtained;
+
+ memset(&desired, 0, sizeof(desired));
+
+ _samplesPerSec = 0;
+
+ if (ConfMan.hasKey("output_rate"))
+ _samplesPerSec = ConfMan.getInt("output_rate");
+
+ if (_samplesPerSec <= 0)
+ _samplesPerSec = SAMPLES_PER_SEC;
+
+ // Originally, we always used 2048 samples. This loop will produce the
+ // same result at 22050 Hz, and should hopefully produce something
+ // sensible for other frequencies. Note that it must be a power of two.
+
+ uint32 samples = 0x8000;
+
+ for (;;) {
+ if ((1000 * samples) / _samplesPerSec < 100)
+ break;
+ samples >>= 1;
+ }
+
+ desired.freq = _samplesPerSec;
+ desired.format = AUDIO_S16SYS;
+ desired.channels = 2;
+ desired.samples = (uint16)samples;
+#ifdef S60
+ desired.callback = symbianMixCallback;
+ desired.userdata = this;
+#else
+ desired.callback = proc;
+ desired.userdata = param;
+#endif
+ if (SDL_OpenAudio(&desired, &obtained) != 0) {
+ warning("Could not open audio device: %s", SDL_GetError());
+ return false;
+ }
+ // Note: This should be the obtained output rate, but it seems that at
+ // least on some platforms SDL will lie and claim it did get the rate
+ // even if it didn't. Probably only happens for "weird" rates, though.
+ _samplesPerSec = obtained.freq;
+ _channels = obtained.channels;
+
+ // Need to create mixbuffer for stereo mix to downmix
+ if(_channels != 2) {
+ _stereo_mix_buffer = new byte [obtained.size*2];//*2 for stereo values
+ }
+
+ SDL_PauseAudio(0);
+ return true;
+}
+
+/**
+ * The mixer callback function, passed on to OSystem::setSoundCallback().
+ * This simply calls the mix() method.
+ */
+void OSystem_SDL_Symbian::symbianMixCallback(void *s, byte *samples, int len) {
+ static_cast <OSystem_SDL_Symbian*>(s)->symbianMix(samples,len);
+}
+
+
+/**
+ * Actual mixing implementation
+ */
+void OSystem_SDL_Symbian::symbianMix(byte *samples, int len) {
+ // If not stereo then we need to downmix
+ if (_channels != 2) {
+ _sound_proc(_sound_proc_param, _stereo_mix_buffer, len * 2);
+ int16 *bitmixDst = (int16 *)samples;
+ int16 *bitmixSrc = (int16 *)_stereo_mix_buffer;
+
+ for (int loop = len / 2; loop >= 0; loop --) {
+ *bitmixDst = (*bitmixSrc + *(bitmixSrc + 1)) >> 1;
+ bitmixDst++;
+ bitmixSrc += 2;
+ }
+ } else
+ _sound_proc(_sound_proc_param, samples, len);
+}
+
+/**
+ * This is an implementation by the remapKey function
+ * @param SDL_Event to remap
+ * @param ScumVM event to modify if special result is requested
+ * @return true if Event has a valid return status
+ */
+bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev, Event &event) {
+ if (GUI::Actions::Instance()->mappingActive() || ev.key.keysym.sym <= SDLK_UNKNOWN)
+ return false;
+
+ for (TInt loop = 0; loop < GUI::ACTION_LAST; loop++) {
+ if (GUI::Actions::Instance()->getMapping(loop) == ev.key.keysym.sym &&
+ GUI::Actions::Instance()->isEnabled(loop)) {
+ // Create proper event instead
+ switch(loop) {
+ case GUI::ACTION_UP:
+ if (ev.type == SDL_KEYDOWN) {
+ _km.y_vel = -1;
+ _km.y_down_count = 1;
+ } else {
+ _km.y_vel = 0;
+ _km.y_down_count = 0;
+ }
+ event.type = EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+
+ return true;
+
+ case GUI::ACTION_DOWN:
+ if(ev.type == SDL_KEYDOWN) {
+ _km.y_vel = 1;
+ _km.y_down_count = 1;
+ } else {
+ _km.y_vel = 0;
+ _km.y_down_count = 0;
+ }
+ event.type = EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+
+ return true;
+
+ case GUI::ACTION_LEFT:
+ if(ev.type == SDL_KEYDOWN) {
+ _km.x_vel = -1;
+ _km.x_down_count = 1;
+ } else {
+ _km.x_vel = 0;
+ _km.x_down_count = 0;
+ }
+ event.type = EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+
+ return true;
+
+ case GUI::ACTION_RIGHT:
+ if(ev.type == SDL_KEYDOWN) {
+ _km.x_vel = 1;
+ _km.x_down_count = 1;
+ } else {
+ _km.x_vel = 0;
+ _km.x_down_count = 0;
+ }
+ event.type = EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _km.x, _km.y);
+
+ return true;
+
+ case GUI::ACTION_LEFTCLICK:
+ event.type = (ev.type == SDL_KEYDOWN ? EVENT_LBUTTONDOWN : EVENT_LBUTTONUP);
+ fillMouseEvent(event, _km.x, _km.y);
+
+ return true;
+
+ case GUI::ACTION_RIGHTCLICK:
+ event.type = (ev.type == SDL_KEYDOWN ? EVENT_RBUTTONDOWN : EVENT_RBUTTONUP);
+ fillMouseEvent(event, _km.x, _km.y);
+
+ return true;
+
+ case GUI::ACTION_ZONE:
+ if(ev.type == SDL_KEYDOWN) {
+ int i;
+
+ for (i=0; i < TOTAL_ZONES; i++)
+ if (_km.x >= _zones[i].x && _km.y >= _zones[i].y &&
+ _km.x <= _zones[i].x + _zones[i].width && _km.y <= _zones[i].y + _zones[i].height
+ ) {
+ _mouseXZone[i] = _km.x;
+ _mouseYZone[i] = _km.y;
+ break;
+ }
+ _currentZone++;
+ if (_currentZone >= TOTAL_ZONES)
+ _currentZone = 0;
+ event.type = EVENT_MOUSEMOVE;
+ fillMouseEvent(event, _mouseXZone[_currentZone], _mouseYZone[_currentZone]);
+ SDL_WarpMouse(event.mouse.x, event.mouse.y);
+ }
+
+ return true;
+
+ case GUI::ACTION_SAVE:
+ case GUI::ACTION_SKIP:
+ case GUI::ACTION_FT_CHEAT:
+ case GUI::ACTION_SKIP_TEXT:
+ case GUI::ACTION_PAUSE:
+ {
+ GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop);
+ ev.key.keysym.sym = (SDLKey)key.ascii();
+ ev.key.keysym.scancode= key.keycode();
+ ev.key.keysym.mod = (SDLMod)key.flags();
+
+ return false;
+ }
+
+ case GUI::ACTION_QUIT:
+ {
+ GUI::MessageDialog alert("Do you want to quit ?", "Yes", "No");
+ if (alert.runModal() == GUI::kMessageOK)
+ quit();
+
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+void OSystem_SDL_Symbian::setWindowCaption(const char *caption) {
+ OSystem_SDL::setWindowCaption(caption);
+ check_mappings();
+}
+
+void OSystem_SDL_Symbian::check_mappings() {
+ if (!GUI::Actions::Instance()->gameDetector()._targetName.size() || GUI::Actions::Instance()->initialized())
+ return;
+
+ GUI::Actions::Instance()->initInstanceGame();
+}
+
+void OSystem_SDL_Symbian::initZones() {
+ int i;
+
+ _currentZone = 0;
+
+ for (i = 0; i < TOTAL_ZONES; i++) {
+ _mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2));
+ _mouseYZone[i] = (_zones[i].y + (_zones[i].height / 2));
+ }
+}
+
+
+/** Vibration support */
+#ifdef USE_VIBRA_SE_PXXX
+void OSystem_SDL_Symbian::initializeVibration() {
+ _vibrationApi = SonyEricsson::CVibration::NewL();
+}
+
+void OSystem_SDL_Symbian::vibrationOn(int vibraLength) {
+ // initialize?
+ if (!_vibrationApi) _vibrationApi = SonyEricsson::CVibration::NewL();
+ // do it!
+ _vibrationApi->VibrationOn(1, 1, vibraLength);
+}
+
+void OSystem_SDL_Symbian::vibrationOff() {
+ _vibrationApi->VibrationOff();
+}
+#endif // USE_SE_PXX_VIBRA
+
diff --git a/backends/epoc/src/SymbianOS.h b/backends/epoc/src/SymbianOS.h
new file mode 100644
index 0000000000..7573a9e4b3
--- /dev/null
+++ b/backends/epoc/src/SymbianOS.h
@@ -0,0 +1,130 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ */
+
+#ifndef SDLSYMBIANH
+#define SDLSYMBIANH
+
+#include "backends/sdl/sdl-common.h"
+
+/** Vibration support */
+#ifdef USE_VIBRA_SE_PXXX
+#include <vibration.h>
+#endif
+
+#define TOTAL_ZONES 3
+
+class OSystem_SDL_Symbian : public OSystem_SDL {
+public:
+ OSystem_SDL_Symbian();
+ ~OSystem_SDL_Symbian();
+ int getDefaultGraphicsMode() const;
+ const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
+ bool setGraphicsMode(const char *name);
+ void quitWithErrorMsg(const char *msg);
+ virtual bool hasFeature(Feature f);
+
+ // Set function that generates samples
+ //
+ // This function is overridden by the symbian port in order to provide MONO audio
+ // downmix is done by supplying our own audiocallback
+ //
+ virtual bool setSoundCallback(SoundProc proc, void *param); // overloaded by CE backend
+
+protected:
+ //
+ // The mixer callback function, passed on to OSystem::setSoundCallback().
+ // This simply calls the mix() method.
+ // and then does downmixing for symbian if needed
+ //
+ static void symbianMixCallback(void *s, byte *samples, int len);
+
+ //
+ // Actual mixing implementation
+ //
+ void symbianMix(byte *samples, int len);
+
+public:
+ // vibration support
+#ifdef USE_VIBRA_SE_PXXX
+ //
+ // Intialize the vibration api used if present and supported
+ //
+ void initializeVibration();
+
+ //
+ // Turn vibration on, repeat no time
+ // @param vibraLength number of repetitions
+ //
+ void vibrationOn(int vibraLength);
+
+ //
+ // Turns the vibration off
+ //
+ void vibrationOff();
+
+protected:
+ SonyEricsson::CVibration* _vibrationApi;
+#endif // USE_VIBRA_SE_PXXX
+
+protected:
+
+ //
+ // This is an implementation by the remapKey function
+ // @param SDL_Event to remap
+ // @param ScumVM event to modify if special result is requested
+ // @return true if Event has a valid return status
+ //
+ bool remapKey(SDL_Event &ev, Event &event);
+
+ void setWindowCaption(const char *caption);
+
+ //
+ // Used to intialized special game mappings
+ //
+ void check_mappings();
+
+ void initZones();
+
+ // Audio
+ int _channels;
+
+ SoundProc _sound_proc;
+ void *_sound_proc_param;
+ byte *_stereo_mix_buffer;
+
+ // Used to handle joystick navi zones
+ int _mouseXZone[TOTAL_ZONES];
+ int _mouseYZone[TOTAL_ZONES];
+ int _currentZone;
+
+ typedef struct zoneDesc {
+ int x;
+ int y;
+ int width;
+ int height;
+ } zoneDesc;
+
+ static zoneDesc _zones[TOTAL_ZONES];
+};
+
+#endif
diff --git a/backends/epoc/src/portdefs.h b/backends/epoc/src/portdefs.h
new file mode 100644
index 0000000000..faf55f98d9
--- /dev/null
+++ b/backends/epoc/src/portdefs.h
@@ -0,0 +1,143 @@
+/* ScummVM - Scumm Interpreter
+ * 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 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.
+ *
+ * $Header$
+ */
+
+#include <assert.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <e32def.h>
+
+#include <e32std.h>
+#include <math.h>
+
+// the place in Symbian FS where scummvm.ini & std***.txt are saved
+#define SYMBIAN32_DOC_DIR "C:\\documents\\ScummVM\\" // includes final \\!
+#define DISABLE_SCALERS // we only need 1x
+
+#if defined(USE_TREMOR) && !defined(USE_VORBIS)
+#define USE_VORBIS // make sure this one is defined together with USE_TREMOR!
+#endif
+
+// hack in some tricks to work around not having these fcns for Symbian
+// and we _really_ don't wanna link with any other windows LIBC library!
+#ifdef __GCC32__
+
+ #define snprintf(buf,len,args...) sprintf(buf,args)
+ #define vsnprintf snprintf
+
+ // taken from public domain http://www.opensource.apple.com/darwinsource/WWDC2004/gcc_legacy-939/gcc/floatlib.c
+ #define SIGNBIT 0x80000000
+ #define HIDDEN (1 << 23)
+ #define EXCESSD 1022
+ #define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
+ #define SIGND(fp) ((fp.l.upper) & SIGNBIT)
+ #define HIDDEND_LL ((long long)1 << 52)
+ #define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
+
+ union double_long {
+ double d;
+ struct {
+ long upper;
+ unsigned long lower;
+ } l;
+ long long ll;
+ };
+
+ /* convert double float to double int (dfdi) */
+ long long inline
+ scumm_fixdfdi (double a1) // __fixdfdi (double a1)
+ {
+ register union double_long dl1;
+ register int exp;
+ register long long l;
+
+ dl1.d = a1;
+
+ if (!dl1.l.upper && !dl1.l.lower)
+ return (0);
+
+ exp = EXPD (dl1) - EXCESSD - 64;
+ l = MANTD_LL(dl1);
+
+ if (exp > 0) {
+ l = (long long)1<<63;
+ if (!SIGND(dl1))
+ l--;
+ return l;
+ }
+
+ /* shift down until exp = 0 or l = 0 */
+ if (exp < 0 && exp > -64 && l)
+ l >>= -exp;
+ else
+ return (0);
+
+ return (SIGND (dl1) ? -l : l);
+ }
+
+ /* okay, okay: I admit it: I absolutely have _NO_ idea why __fixdfdi does not get linked in by gcc from libgcc.a
+ because I know it's in there: I checked with `ar x _fixdfdi.o libgcc.a` and the symbol is in there, so I'm lost
+ and had to fix it this way. I tried all gcc and ld options I could find: no hope :( If someone can enlighten me:
+ feel free to let me know at sumthinwicked@users.sf.net! Much obliged.
+ PS1. I think for __fixunsdfdi they have made a circumvention by having to add STATICLIBRARY EGCC.LIB
+ PS2. http://gcc.gnu.org/ml/gcc-bugs/2004-01/msg01596.html might have found out the same problem there
+ */
+
+#else // WINS
+
+ // let's just blatantly ignore this for now and just get it to work :P but does n't work from the debug function
+ int inline scumm_snprintf (char *str, unsigned long /*n*/, char const *fmt, ...)
+ {
+ va_list args;
+ va_start(args, fmt);
+ vsprintf(str, fmt, args);
+ va_end(args);
+ return strlen(str);
+ }
+
+ #define snprintf scumm_snprintf
+ #define vsnprintf scumm_snprintf
+
+#endif
+
+// somehow nobody has this function...
+#define hypot(a, b) sqrt((a)*(a) + (b)*(b))
+
+// Symbian bsearch implementation is flawed
+void inline *scumm_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
+ size_t i;
+
+ for (i=0; i<nmemb; i++)
+ if (compar(key, (void*)((size_t)base + size * i)) == 0)
+ return (void*)((size_t)base + size * i);
+ return NULL;
+}
+#define bsearch scumm_bsearch
+
+// make sure SymbianFatalError() @ SymbianOS.cpp is known in error() @ engine.cpp
+extern void SymbianFatalError(const char *msg) ;
+
+
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index a1bee1f6ff..d23fbe402a 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -16,7 +16,7 @@
*
* 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.
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header$
*/
@@ -83,9 +83,6 @@ SymbianFilesystemNode::SymbianFilesystemNode(bool aIsRoot) {
}
-// SumthinWicked says: added next function myself, since it was not in 0.7.1.
-// might still be a little buggy, or simply the reason ScummVM can't run any
-// games on the phone yet :P
SymbianFilesystemNode::SymbianFilesystemNode(const String &path) {
if (path.size() == 0)
_isPseudoRoot = true;
@@ -113,23 +110,35 @@ FSList SymbianFilesystemNode::listDir(ListMode mode) const {
if (_isPseudoRoot) {
// Drives enumeration
- TDriveList drivelist;
- CEikonEnv::Static()->FsSession().DriveList(drivelist);
- for (int loop=0;loop<KMaxDrives;loop++) {
- if(drivelist[loop]>0) {
- SymbianFilesystemNode entry(false);
- char drive_name[2];
- drive_name[0] = loop+'A';
- drive_name[1] = '\0';
- entry._displayName = drive_name;
- entry._isDirectory = true;
- entry._isValid = true;
- entry._isPseudoRoot = false;
- char path[10];
- sprintf(path,"%c:\\",loop+'A');
- entry._path=path;
- myList.push_back(wrap(new SymbianFilesystemNode(&entry)));
+ RFs fs = CEikonEnv::Static()->FsSession();
+ TInt driveNumber;
+ TChar driveLetter;
+ TVolumeInfo volumeInfo;
+ TBuf8<30> driveLabel8;
+ TBuf8<30> driveString8;
+
+ for (driveNumber=EDriveA; driveNumber<=EDriveZ; driveNumber++) {
+ TInt err = fs.Volume(volumeInfo, driveNumber);
+ if (err != KErrNone)
+ continue;
+ User::LeaveIfError(fs.DriveToChar(driveNumber,driveLetter));
+ if(volumeInfo.iName.Length() > 0) {
+ driveLabel8.Copy(volumeInfo.iName); // 16 to 8bit des // enabling this line alone gives KERN-EXEC 3 with non-optimized GCC? WHY? grrr
+ driveString8.Format(_L8("Drive %c: (%S)"), driveLetter, &driveLabel8);
+ } else {
+ driveString8.Format(_L8("Drive %c:"), driveLetter);
}
+
+ char path[10];
+ sprintf(path,"%c:\\", driveNumber+'A');
+
+ SymbianFilesystemNode entry(false);
+ entry._displayName = (char*)driveString8.PtrZ(); // drive_name
+ entry._isDirectory = true;
+ entry._isValid = true;
+ entry._isPseudoRoot = false;
+ entry._path = path;
+ myList.push_back(wrap(new SymbianFilesystemNode(&entry)));
}
} else {
TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size());