aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohn Willis2008-06-29 10:16:20 +0000
committerJohn Willis2008-06-29 10:16:20 +0000
commit86706eb7d7c4a208925beebe5da59c02b8a6f34d (patch)
tree4836238d7a11c7a047089798694d675a490dfa30 /backends
parent206485ffc676c64134774b9873cd8d333deddfee (diff)
downloadscummvm-rg350-86706eb7d7c4a208925beebe5da59c02b8a6f34d.tar.gz
scummvm-rg350-86706eb7d7c4a208925beebe5da59c02b8a6f34d.tar.bz2
scummvm-rg350-86706eb7d7c4a208925beebe5da59c02b8a6f34d.zip
Small GP2X tidy (mostly svn:executable on scripts) and fixes needed to reflect "Patch ##1956946 (Audio::Mixer internal API revision)"
svn-id: r32835
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/gp2x/build/README-GP2X2
-rw-r--r--backends/platform/gp2x/build/README-GP2X.html147
-rwxr-xr-x[-rw-r--r--]backends/platform/gp2x/build/build.sh0
-rwxr-xr-x[-rw-r--r--]backends/platform/gp2x/build/bundle.sh0
-rwxr-xr-x[-rw-r--r--]backends/platform/gp2x/build/clean.sh0
-rwxr-xr-x[-rw-r--r--]backends/platform/gp2x/build/config.sh4
-rwxr-xr-x[-rw-r--r--]backends/platform/gp2x/build/scummvm.gpe0
-rw-r--r--backends/platform/gp2x/gp2x-common.h5
-rw-r--r--backends/platform/gp2x/gp2x.cpp54
9 files changed, 147 insertions, 65 deletions
diff --git a/backends/platform/gp2x/build/README-GP2X b/backends/platform/gp2x/build/README-GP2X
index cb1d043500..7e10fc484e 100644
--- a/backends/platform/gp2x/build/README-GP2X
+++ b/backends/platform/gp2x/build/README-GP2X
@@ -1,4 +1,4 @@
-ScummVM - GP2X SPECIFIC README - 0.10.0 SVN
+ScummVM - GP2X SPECIFIC README - HEAD SVN
------------------------------------------------------------------------
Contents:
diff --git a/backends/platform/gp2x/build/README-GP2X.html b/backends/platform/gp2x/build/README-GP2X.html
index 5289d3d36c..1b5f1a4173 100644
--- a/backends/platform/gp2x/build/README-GP2X.html
+++ b/backends/platform/gp2x/build/README-GP2X.html
@@ -2,12 +2,15 @@
<html>
<head>
<title>ScummVM - GP2X SPECIFIC README</title>
+
+
</head>
<body>
-<span style="font-weight: bold;">ScummVM - GP2X&nbsp;SPECIFIC README - 0.10.0 SVN<br>
+<span style="font-weight: bold;">ScummVM -
+GP2X&nbsp;SPECIFIC README - HEAD SVN<br>
</span>
<hr style="width: 100%; height: 2px;"><br>
@@ -16,52 +19,65 @@
<ul>
- <li><a href="#About_the_backendport">About the backend/port</a></li>
+ <li><a href="#About_the_backendport">About the
+backend/port</a></li>
- <li><a href="#Game_compatibility">Game compatability</a></li>
+ <li><a href="#Game_compatibility">Game
+compatability</a></li>
<li><a href="#Included_engines">Included engines</a></li>
- <li><a href="#Supported_audio_options">Supported audio options</a></li>
+ <li><a href="#Supported_audio_options">Supported
+audio options</a></li>
- <li><a href="#Supported_cut-scene_options">Supported cut-scene options</a></li>
+ <li><a href="#Supported_cut-scene_options">Supported
+cut-scene options</a></li>
<li><a href="#Recent_changes">Recent changes</a></li>
<li><a href="#How_to_save">How to save</a></li>
- <li><a href="#Controller_mappings">Controller mappings</a></li>
+ <li><a href="#Controller_mappings">Controller
+mappings</a></li>
<li><a href="#Know_issues">Know issues</a></li>
<li><a href="#Major_TODOs">Major TODO's</a></li>
- <li><a href="#Additional_resourceslinks">Additional resources/links</a></li>
+ <li><a href="#Additional_resourceslinks">Additional
+resources/links</a></li>
<li><a href="#Credits">Credits</a></li>
</ul>
+
<br>
+
<hr style="width: 100%; height: 2px;"><a style="font-weight: bold;" name="About_the_backendport"></a><span style="font-weight: bold;">About the backend/port</span><br>
<br>
-This is the readme for the offficial GP2X ScummVM backend (also known as the GP2X port).<br>
+This is the readme for the offficial GP2X ScummVM backend (also known
+as the GP2X port).<br>
<br>
-This is an SVN test release of ScummVM for the GP2X, it would be appreciated
+This is an SVN test release of ScummVM for the GP2X, it would be
+appreciated
if this SVN test distribution was not mirrored and that people be
-directed to <a href="http://www.distant-earth.com/scummvm">http://www.distant-earth.com/scummvm</a> instead for updated SVN builds.<br>
+directed to <a href="http://www.distant-earth.com/scummvm">http://www.distant-earth.com/scummvm</a>
+instead for updated SVN builds.<br>
<br>
Full supported official releases of the GP2X ScummVM backend are made
-in line with main official releases and are avalalble from the <a href="http://www.scummvm.org/downloads.php">ScummVM downloads page</a>.<br>
+in line with main official releases and are avalalble from the <a href="http://www.scummvm.org/downloads.php">ScummVM
+downloads page</a>.<br>
<br>
-This build is in an active state of development and as such no &lsquo;expected&rsquo; behavior can be guaranteed ;).<br>
+This build is in an active state of development and as such no
+&lsquo;expected&rsquo; behavior can be guaranteed ;).<br>
<br>
@@ -69,47 +85,59 @@ SVN builds are quickly tested with firmware 2.0.0 for reference.<br>
<br>
-Please refer to the <a href="http://forums.scummvm.org/viewforum.php?f=14">GP2X ScummVM forum</a> and <a href="http://wiki.scummvm.org/index.php/GP2X">WiKi</a> for the latest information on the port.<br>
+Please refer to the <a href="http://forums.scummvm.org/viewforum.php?f=14">GP2X
+ScummVM forum</a> and <a href="http://wiki.scummvm.org/index.php/GP2X">WiKi</a>
+for the latest information on the port.<br>
+
<br>
<hr style="width: 100%; height: 2px;"><a style="font-weight: bold;" name="Game_compatibility"></a><span style="font-weight: bold;">Game compatibility</span><br>
<br>
-For information on the compatability of a specific game please refer to the <a href="http://wiki.scummvm.org/index.php/GP2X#Compatibility_List">GP2X compatability section of the ScummVM WiKi</a>.<br>
+For information on the compatability of a specific game please refer to
+the <a href="http://wiki.scummvm.org/index.php/GP2X#Compatibility_List">GP2X
+compatability section of the ScummVM WiKi</a>.<br>
<br>
-Please note the version and date of the ScummVM build you are running when reviewing the above list.<br>
+Please note the version and date of the ScummVM build you are running
+when reviewing the above list.<br>
<br>
<hr style="width: 100%; height: 2px;"><a style="font-weight: bold;" name="Included_engines"></a><span style="font-weight: bold;">Included engines</span><br>
<br>
+
Just because an engine is included does not mean any/all of its games
are supported. Please check game compatability for more infomation.<br>
+
<ul>
- <li>
-Scumm - (All games supported by ScummVM should work to some extent, using the hardware scalar if needed)</li>
+
+ <li>Scumm - (All games supported by ScummVM should work to some
+extent, using the hardware scalar if needed)</li>
+
<li>AGOS (AKA Simon) - (Simon the Sorcerer one and two).</li>
+
<li>Sky - (Beneath a Steel Sky)</li>
- <li>
-Sword - (Broken Sword 1) - This engine uses the hardware scalar to
+
+ <li>Sword - (Broken Sword 1) - This engine uses the hardware
+scalar to
downsize the graphics to fix on the GP2X. It is NOT very nice to look
at.</li>
- <li>
-Sword2 - (Broken Sword 2) - This engine uses the hardware
+
+ <li>Sword2 - (Broken Sword 2) - This engine uses the hardware
scalar to downsize the graphics to fix on the GP2X. It is NOT very nice
to look at.</li>
- <li>
-Gob - (Goblins one)</li>
- <li>
-Queen - (Flight of the Amazon Queen)</li>
- <li>
-Kyra - (The Legend of Kyrandia)</li>
-</ul>
+ <li>Gob - (Goblins one)</li>
+
+ <li>Queen - (Flight of the Amazon Queen)</li>
+
+ <li>Kyra - (The Legend of Kyrandia)</li>
+
+</ul>
All other game engines are disabled in this release.<br>
@@ -155,13 +183,18 @@ DXA video support will be added as soon as it is stable.<br>
Enabled hardware scalar code.<br>
-Now built using SDL 1.2.9 for the parts of the port that use SDL (some parts now hit the hardware directly).<br>
+Now built using SDL 1.2.9 for the parts of the port that use SDL (some
+parts now hit the hardware directly).<br>
-Enabled new launcher - (Ensure defaulttheme.zip is in the same folder as the executable).<br>
+Enabled new launcher - (Ensure defaulttheme.zip is in the same folder
+as the executable).<br>
-Aspect Ratio Correction can now be disabled &lsquo;per game&rsquo;. When adding a game you can find this option on the GFX tab. <br>
+Aspect Ratio Correction can now be disabled &lsquo;per
+game&rsquo;. When adding a game you can find this option on the GFX
+tab. <br>
-Note: This will cause the game to run with a black border at the bottom as it will be rendered to a 320*200 frame.<br>
+Note: This will cause the game to run with a black border at the bottom
+as it will be rendered to a 320*200 frame.<br>
<br>
@@ -169,7 +202,9 @@ Note: This will cause the game to run with a black border at the bottom as it wi
<br>
-<span style="font-weight: bold;">NOTE:</span> Everything is saved to the SD card, saves are stored in the <span style="font-weight: bold;">saves</span> folder under your main ScummVM executable unless you set another save location.<br>
+<span style="font-weight: bold;">NOTE:</span>
+Everything is saved to the SD card, saves are stored in the <span style="font-weight: bold;">saves</span> folder under
+your main ScummVM executable unless you set another save location.<br>
<br>
@@ -178,7 +213,8 @@ same place as the ScummVM executable.<br>
<br>
-The save process below is&nbsp;for Scumm engine games but the principle is the same for all.<br>
+The save process below is&nbsp;for Scumm engine games but the
+principle is the same for all.<br>
<br>
@@ -198,11 +234,13 @@ In Game.<br>
<br>
-Basically the emulated keys you can use are equivelent to the values buttons are mapped to, <br>
+Basically the emulated keys you can use are equivelent to the values
+buttons are mapped to, <br>
<br>
-I have a virtual keyboard like the GP32 one (left/right on the stick to pick chars) to add in at some point ;-)<br>
+I have a virtual keyboard like the GP32 one (left/right on the stick to
+pick chars) to add in at some point ;-)<br>
<br>
@@ -262,9 +300,11 @@ Select: Exit ScummVM completely (and gracefully)<br>
<br>
-Possible random crash (well SegFault). I have had this happen twice and have not tracked down the cause. <br>
+Possible random crash (well SegFault). I have had this happen twice and
+have not tracked down the cause. <br>
-It happens very infrequently, both times it was in the DOTT CD intro. Saving often is never a bad idea anyhow.<br>
+It happens very infrequently, both times it was in the DOTT CD intro.
+Saving often is never a bad idea anyhow.<br>
<br>
@@ -272,11 +312,14 @@ It happens very infrequently, both times it was in the DOTT CD intro. Saving oft
<br>
-Fix save support when using the Sky engine (Beneath a Steel Sky) - You CAN'T save at the moment but auto save works.<br>
+Fix save support when using the Sky engine (Beneath a Steel Sky) - You
+CAN'T save at the moment but auto save works.<br>
-Look into inconsistencies with AGOS engine and map Y key to a button combination to allow clean quitting (Simon 1/2).<br>
+Look into inconsistencies with AGOS engine and map Y key to a button
+combination to allow clean quitting (Simon 1/2).<br>
-Add splash-screen and pre-ScummVM config menu (CPU speed, LCD timings etc.) - Partly done.<br>
+Add splash-screen and pre-ScummVM config menu (CPU speed, LCD timings
+etc.) - Partly done.<br>
Fix TV out, maybe make it an option in the pre-ScummVM config menu.<br>
@@ -284,17 +327,29 @@ Any help appreciated :).<br>
<br style="font-weight: bold;">
-<hr style="width: 100%; height: 2px;"><a style="font-weight: bold;" name="Additional_resourceslinks"></a><span style="font-weight: bold;">Additional resources/links</span><br>
+<hr style="width: 100%; height: 2px;"><a style="font-weight: bold;" name="Additional_resourceslinks"></a><span style="font-weight: bold;">Additional resources/links<br>
+
+<br>
+
+</span><span style="font-weight: bold;">Note:</span>
+When providing feedback,
+requests, forum posts, bug reports or anything like that always include
+a mention of the version of ScummVM you are using (the build version,
+date and time can be seen in the main game launcher window).<br>
<ul>
- <li><a href="http://wiki.scummvm.org/index.php/GP2X">ScummVM WiKi GP2X page</a></li>
+ <li><a href="http://wiki.scummvm.org/index.php/GP2X">ScummVM
+WiKi GP2X page</a></li>
- <li><a href="http://forums.scummvm.org/viewforum.php?f=14">ScummVM forums GP2X forum</a></li>
+ <li><a href="http://forums.scummvm.org/viewforum.php?f=14">ScummVM
+forums GP2X forum</a></li>
- <li><a href="http://www.distant-earth.com/scummvm">My own ScummVM page</a> (for SVN/test builds)</li>
+ <li><a href="http://www.distant-earth.com/scummvm">My
+own ScummVM page</a> (for SVN/test builds)</li>
- <li><a href="http://www.scummvm.org">Main ScummVM site</a> (for official supported release builds)</li>
+ <li><a href="http://www.scummvm.org">Main ScummVM
+site</a> (for official supported release builds)</li>
</ul>
diff --git a/backends/platform/gp2x/build/build.sh b/backends/platform/gp2x/build/build.sh
index 1ea77f4937..1ea77f4937 100644..100755
--- a/backends/platform/gp2x/build/build.sh
+++ b/backends/platform/gp2x/build/build.sh
diff --git a/backends/platform/gp2x/build/bundle.sh b/backends/platform/gp2x/build/bundle.sh
index 9824c9b451..9824c9b451 100644..100755
--- a/backends/platform/gp2x/build/bundle.sh
+++ b/backends/platform/gp2x/build/bundle.sh
diff --git a/backends/platform/gp2x/build/clean.sh b/backends/platform/gp2x/build/clean.sh
index 0979f6c7d6..0979f6c7d6 100644..100755
--- a/backends/platform/gp2x/build/clean.sh
+++ b/backends/platform/gp2x/build/clean.sh
diff --git a/backends/platform/gp2x/build/config.sh b/backends/platform/gp2x/build/config.sh
index 4a30ed4a31..17083d1ea4 100644..100755
--- a/backends/platform/gp2x/build/config.sh
+++ b/backends/platform/gp2x/build/config.sh
@@ -17,7 +17,7 @@ export DEFINES=-DNDEBUG
# Edit the configure line to suit.
cd ../../../..
-./configure --backend=gp2x --disable-mt32emu --host=gp2x --disable-flac --disable-nasm --disable-hq-scalers --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin --with-mpeg2-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6
-#--enable-plugins
+./configure --backend=gp2x --disable-mt32emu --host=gp2x --disable-flac --disable-nasm --disable-hq-scalers --with-sdl-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin --with-mpeg2-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-tremor --with-tremor-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-zlib --with-zlib-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-mad --with-mad-prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --enable-made --enable-m4
+#--enable-plugins --default-dynamic
echo Generating config for GP2X complete. Check for errors.
diff --git a/backends/platform/gp2x/build/scummvm.gpe b/backends/platform/gp2x/build/scummvm.gpe
index 1e69c149b9..1e69c149b9 100644..100755
--- a/backends/platform/gp2x/build/scummvm.gpe
+++ b/backends/platform/gp2x/build/scummvm.gpe
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h
index 7e0ea88e0b..92f625bdc4 100644
--- a/backends/platform/gp2x/gp2x-common.h
+++ b/backends/platform/gp2x/gp2x-common.h
@@ -128,8 +128,8 @@ public:
virtual bool pollEvent(Common::Event &event); // overloaded by CE backend
// Set function that generates samples
- typedef void (*SoundProc)(void *param, byte *buf, int len);
- virtual bool setSoundCallback(SoundProc proc, void *param); // overloaded by CE backend
+ void setupMixer();
+ static void mixCallback(void *s, byte *samples, int len);
virtual Audio::Mixer *getMixer();
// Poll CD status
@@ -179,7 +179,6 @@ public:
int getGraphicsMode() const;
bool openCD(int drive);
- int getOutputSampleRate() const;
bool hasFeature(Feature f);
void setFeatureState(Feature f, bool enable);
diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp
index 1f330cf2d4..c138f6c54d 100644
--- a/backends/platform/gp2x/gp2x.cpp
+++ b/backends/platform/gp2x/gp2x.cpp
@@ -444,41 +444,69 @@ void OSystem_GP2X::deleteMutex(MutexRef mutex) {
#pragma mark --- Audio ---
#pragma mark -
+void OSystem_GP2X::mixCallback(void *sys, byte *samples, int len) {
+ OSystem_GP2X *this_ = (OSystem_GP2X *)sys;
+ assert(this_);
+
+ if (this_->_mixer)
+ this_->_mixer->mixCallback(samples, len);
+}
+
void OSystem_GP2X::setupMixer() {
SDL_AudioSpec desired;
SDL_AudioSpec obtained;
- memset(&desired, 0, sizeof(desired));
+ //memset(&desired, 0, sizeof(desired));
+ // Determine the desired output sampling frequency.
_samplesPerSec = 0;
-
if (ConfMan.hasKey("output_rate"))
_samplesPerSec = ConfMan.getInt("output_rate");
-
if (_samplesPerSec <= 0)
_samplesPerSec = SAMPLES_PER_SEC;
+
//Quick EVIL Hack - DJWillis
_samplesPerSec = 11025;
+ // Determine the sample buffer size. We want it to store enough data for
+ // about 1/16th of a second. Note that it must be a power of two.
+ // So e.g. at 22050 Hz, we request a sample buffer size of 2048.
+ int samples = 8192;
+ while (16 * samples >= _samplesPerSec) {
+ samples >>= 1;
+ }
+
+ memset(&desired, 0, sizeof(desired));
desired.freq = _samplesPerSec;
desired.format = AUDIO_S16SYS;
desired.channels = 2;
//desired.samples = (uint16)samples;
desired.samples = 128; // Samples hack
- desired.callback = proc;
- desired.userdata = param;
+ desired.callback = mixCallback;
+ desired.userdata = this;
+
+ // Create the mixer instance
+ assert(!_mixer);
+ _mixer = new Audio::MixerImpl(this);
+ assert(_mixer);
+
if (SDL_OpenAudio(&desired, &obtained) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
- return false;
+ _samplesPerSec = 0;
+ _mixer->setReady(false);
+ } else {
+ // 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;
+ debug(1, "Output sample rate: %d Hz", _samplesPerSec);
+
+ // Tell the mixer that we are ready and start the sound processing
+ _mixer->setOutputRate(_samplesPerSec);
+ _mixer->setReady(true);
+ SDL_PauseAudio(0);
}
- _samplesPerSec = obtained.freq;
- SDL_PauseAudio(0);
- return true;
-}
-
-int OSystem_GP2X::getOutputSampleRate() const {
- return _samplesPerSec;
}
Audio::Mixer *OSystem_GP2X::getMixer() {