[Scummvm-cvs-logs] SF.net SVN: scummvm: [32835] scummvm/trunk/backends/platform/gp2x

djwillis at users.sourceforge.net djwillis at users.sourceforge.net
Sun Jun 29 12:16:21 CEST 2008


Revision: 32835
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32835&view=rev
Author:   djwillis
Date:     2008-06-29 03:16:20 -0700 (Sun, 29 Jun 2008)

Log Message:
-----------
Small GP2X tidy (mostly svn:executable on scripts) and fixes needed to reflect "Patch ##1956946 (Audio::Mixer internal API revision)"

Modified Paths:
--------------
    scummvm/trunk/backends/platform/gp2x/build/README-GP2X
    scummvm/trunk/backends/platform/gp2x/build/README-GP2X.html
    scummvm/trunk/backends/platform/gp2x/build/config.sh
    scummvm/trunk/backends/platform/gp2x/gp2x-common.h
    scummvm/trunk/backends/platform/gp2x/gp2x.cpp

Property Changed:
----------------
    scummvm/trunk/backends/platform/gp2x/build/build.sh
    scummvm/trunk/backends/platform/gp2x/build/bundle.sh
    scummvm/trunk/backends/platform/gp2x/build/clean.sh
    scummvm/trunk/backends/platform/gp2x/build/config.sh
    scummvm/trunk/backends/platform/gp2x/build/scummvm.gpe

Modified: scummvm/trunk/backends/platform/gp2x/build/README-GP2X
===================================================================
--- scummvm/trunk/backends/platform/gp2x/build/README-GP2X	2008-06-29 09:56:44 UTC (rev 32834)
+++ scummvm/trunk/backends/platform/gp2x/build/README-GP2X	2008-06-29 10:16:20 UTC (rev 32835)
@@ -1,4 +1,4 @@
-ScummVM - GP2X SPECIFIC README - 0.10.0 SVN
+ScummVM - GP2X SPECIFIC README - HEAD SVN
 ------------------------------------------------------------------------
 
 Contents:

Modified: scummvm/trunk/backends/platform/gp2x/build/README-GP2X.html
===================================================================
--- scummvm/trunk/backends/platform/gp2x/build/README-GP2X.html	2008-06-29 09:56:44 UTC (rev 32834)
+++ scummvm/trunk/backends/platform/gp2x/build/README-GP2X.html	2008-06-29 10:16:20 UTC (rev 32835)
@@ -2,12 +2,15 @@
 <html>
 <head>
   <title>ScummVM - GP2X SPECIFIC README</title>
+
+
 </head>
 
 
 <body>
 
-<span style="font-weight: bold;">ScummVM - GP2X SPECIFIC README - 0.10.0 SVN<br>
+<span style="font-weight: bold;">ScummVM -
+GP2X 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 ‘expected’ behavior can be guaranteed ;).<br>
+This build is in an active state of development and as such no
+‘expected’ behavior can be guaranteed ;).<br>
 
 <br>
 
@@ -69,48 +85,60 @@
 
 <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>
+
+  <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>
 
 <br style="font-weight: bold;">
@@ -155,13 +183,18 @@
 
 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 ‘per game’. When adding a game you can find this option on the GFX tab. <br>
+Aspect Ratio Correction can now be disabled ‘per
+game’. 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 @@
 
 <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 @@
 
 <br>
 
-The save process below is for Scumm engine games but the principle is the same for all.<br>
+The save process below is for Scumm engine games but the
+principle is the same for all.<br>
 
 <br>
 
@@ -198,11 +234,13 @@
 
 <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 @@
 
 <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 @@
 
 <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 @@
 
 <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>
 


Property changes on: scummvm/trunk/backends/platform/gp2x/build/build.sh
___________________________________________________________________
Name: svn:executable
   + *


Property changes on: scummvm/trunk/backends/platform/gp2x/build/bundle.sh
___________________________________________________________________
Name: svn:executable
   + *


Property changes on: scummvm/trunk/backends/platform/gp2x/build/clean.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: scummvm/trunk/backends/platform/gp2x/build/config.sh
===================================================================
--- scummvm/trunk/backends/platform/gp2x/build/config.sh	2008-06-29 09:56:44 UTC (rev 32834)
+++ scummvm/trunk/backends/platform/gp2x/build/config.sh	2008-06-29 10:16:20 UTC (rev 32835)
@@ -17,7 +17,7 @@
 
 # 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.


Property changes on: scummvm/trunk/backends/platform/gp2x/build/config.sh
___________________________________________________________________
Name: svn:executable
   + *


Property changes on: scummvm/trunk/backends/platform/gp2x/build/scummvm.gpe
___________________________________________________________________
Name: svn:executable
   + *

Modified: scummvm/trunk/backends/platform/gp2x/gp2x-common.h
===================================================================
--- scummvm/trunk/backends/platform/gp2x/gp2x-common.h	2008-06-29 09:56:44 UTC (rev 32834)
+++ scummvm/trunk/backends/platform/gp2x/gp2x-common.h	2008-06-29 10:16:20 UTC (rev 32835)
@@ -128,8 +128,8 @@
 	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 @@
 	int getGraphicsMode() const;
 
 	bool openCD(int drive);
-	int getOutputSampleRate() const;
 
 	bool hasFeature(Feature f);
 	void setFeatureState(Feature f, bool enable);

Modified: scummvm/trunk/backends/platform/gp2x/gp2x.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp2x/gp2x.cpp	2008-06-29 09:56:44 UTC (rev 32834)
+++ scummvm/trunk/backends/platform/gp2x/gp2x.cpp	2008-06-29 10:16:20 UTC (rev 32835)
@@ -444,43 +444,71 @@
 #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() {
 	assert(_mixer);
 	return _mixer;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list