diff options
author | Christopher Page | 2008-07-21 22:46:39 +0000 |
---|---|---|
committer | Christopher Page | 2008-07-21 22:46:39 +0000 |
commit | 09f4fd946ee4b3fd6d9780e080b9bc95fbcd0a69 (patch) | |
tree | e4aae52f4e6872f8cd6bed9ddab5de6d0521f7d2 /backends/platform/symbian | |
parent | 0cae5552db214a7e11c552205e03fd5c0c38f6fd (diff) | |
parent | e09eb75ef77d6e76b763b3a47540a530013a887f (diff) | |
download | scummvm-rg350-09f4fd946ee4b3fd6d9780e080b9bc95fbcd0a69.tar.gz scummvm-rg350-09f4fd946ee4b3fd6d9780e080b9bc95fbcd0a69.tar.bz2 scummvm-rg350-09f4fd946ee4b3fd6d9780e080b9bc95fbcd0a69.zip |
Merged revisions 33052-33053,33056-33058,33061-33064,33068,33070,33072,33075,33078-33079,33083,33086-33087,33089,33094-33096,33098-33099,33104,33108-33109,33114-33117,33120,33135-33146,33160,33162,33165,33167-33169 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
svn-id: r33183
Diffstat (limited to 'backends/platform/symbian')
-rw-r--r-- | backends/platform/symbian/BuildPackageUpload_LocalSettings.pl | 17 | ||||
-rw-r--r-- | backends/platform/symbian/src/SymbianOS.cpp | 108 |
2 files changed, 103 insertions, 22 deletions
diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl index 1e5e4dc0c8..5d85fc03a2 100644 --- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl +++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl @@ -226,28 +226,31 @@ $VariationSets{'ALL'}{'all'} = "$DefaultFeatures @WorkingEngines @EnablableSubEngines"; # now one for each ready-for-release engine - + if (0) + { foreach (@WorkingEngines) { $VariationSets{'ALL'}{$_} = "$DefaultFeatures $_"; } # for scumm, we need to add 2 features: - $VariationSets{'ALL'}{'scumm'} .= " scumm_7_8 he"; - + #$VariationSets{'ALL'}{'scumm'} .= " scumm_7_8 he"; + } + # now one for each not-ready-for-release-or-testing engine - + if (0) + { foreach (@TestingEngines) { $VariationSets{'ALL'}{"test_$_"} = "$DefaultFeatures $_"; } - + } # below here you could specify weird & experimental combinations, non-ready engines # a small version of the saga engine, because it is so big (no tremor,mad,zlib) - $VariationSets{'ALL'}{'saga_mini'} = "saga"; + #$VariationSets{'ALL'}{'saga_mini'} = "saga"; # a smaller version of scumm without support for v7, v8 and HE games - $VariationSets{'ALL'}{'scumm_no78he'} = "$DefaultFeatures scumm"; + #$VariationSets{'ALL'}{'scumm_no78he'} = "$DefaultFeatures scumm"; # maybe you feel lucky and want to test the sword engines? :P #$VariationSets{'S60v2'}{'test_sword'} = "$DefaultFeatures mpeg2 sword1 sword2"; diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index dfeb24d825..660b0c69ed 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -33,7 +33,7 @@ #include "gui/Actions.h" #include "gui/Key.h" #include "gui/message.h" - +#include "sound/mixer_intern.h" #include "..\..\sdl\main.cpp" #ifdef SAMPLES_PER_SEC_8000 // the GreanSymbianMMP format cannot handle values for defines :( @@ -42,10 +42,22 @@ #define SAMPLES_PER_SEC 16000 #endif +#define KInputBufferLength 128 +// Symbian libc file functionality in order to provide shared file handles +struct TSymbianFileEntry { + RFile iFileHandle; + char iInputBuffer[KInputBufferLength]; + TInt iInputBufferLen; + TInt iInputPos; +}; + +#define FILE void ////////// extern "C" /////////////////////////////////////////////////// namespace Symbian { + + // Show a simple Symbian Info win with Msg & exit void FatalError(const char *msg) { TPtrC8 msgPtr((const TUint8 *)msg); @@ -246,9 +258,9 @@ void OSystem_SDL_Symbian::symbianMixCallback(void *sys, byte *samples, int len) if (!this_->_mixer) return; -#ifdef S60 +#if defined (S60) && !defined(S60V3) // If not stereo then we need to downmix - if (_channels != 2) { + if (this_->_mixer->_channels != 2) { this_->_mixer->mixCallback(_stereo_mix_buffer, len * 2); int16 *bitmixDst = (int16 *)samples; @@ -443,15 +455,9 @@ void OSystem_SDL_Symbian::initZones() { } } -// Symbian libc file functionality in order to provide shared file handles -struct TSymbianFileEntry { - RFile iFileHandle; -}; - -#define FILE void - FILE* symbian_fopen(const char* name, const char* mode) { TSymbianFileEntry* fileEntry = new TSymbianFileEntry; + fileEntry->iInputPos = KErrNotFound; if (fileEntry != NULL) { TInt modeLen = strlen(mode); @@ -509,9 +515,71 @@ void symbian_fclose(FILE* handle) { } size_t symbian_fread(const void* ptr, size_t size, size_t numItems, FILE* handle) { - TPtr8 pointer( (unsigned char*) ptr, size*numItems); + TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle)); + TUint32 totsize = size*numItems; + TPtr8 pointer ( (unsigned char*) ptr, totsize); + + // Nothing cached and we want to load at least KInputBufferLength bytes + if(totsize >= KInputBufferLength) { + TUint32 totLength = 0; + if(entry->iInputPos != KErrNotFound) + { + TPtr8 cacheBuffer( (unsigned char*) entry->iInputBuffer+entry->iInputPos, entry->iInputBufferLen - entry->iInputPos, KInputBufferLength); + pointer.Append(cacheBuffer); + entry->iInputPos = KErrNotFound; + totLength+=pointer.Length(); + pointer.Set(totLength+(unsigned char*) ptr, 0, totsize-totLength); + } - ((TSymbianFileEntry*)(handle))->iFileHandle.Read(pointer); + entry->iFileHandle.Read(pointer); + totLength+=pointer.Length(); + + pointer.Set((unsigned char*) ptr, totLength, totsize); + + } + else { + // Nothing in buffer + if(entry->iInputPos == KErrNotFound) { + TPtr8 cacheBuffer( (unsigned char*) entry->iInputBuffer, KInputBufferLength); + entry->iFileHandle.Read(cacheBuffer); + + if(cacheBuffer.Length() >= totsize) { + pointer.Copy(cacheBuffer.Left(totsize)); + entry->iInputPos = totsize; + entry->iInputBufferLen = cacheBuffer.Length(); + } + else { + pointer.Copy(cacheBuffer); + entry->iInputPos = KErrNotFound; + } + + } + else { + TPtr8 cacheBuffer( (unsigned char*) entry->iInputBuffer, entry->iInputBufferLen, KInputBufferLength); + + if(entry->iInputPos+totsize < entry->iInputBufferLen) { + pointer.Copy(cacheBuffer.Mid(entry->iInputPos, totsize)); + entry->iInputPos+=totsize; + } + else { + + pointer.Copy(cacheBuffer.Mid(entry->iInputPos, entry->iInputBufferLen-entry->iInputPos)); + cacheBuffer.SetLength(0); + entry->iFileHandle.Read(cacheBuffer); + + if(cacheBuffer.Length() >= totsize-pointer.Length()) { + TUint32 restSize = totsize-pointer.Length(); + pointer.Append(cacheBuffer.Left(restSize)); + entry->iInputPos = restSize; + entry->iInputBufferLen = cacheBuffer.Length(); + } + else { + pointer.Append(cacheBuffer); + entry->iInputPos = KErrNotFound; + } + } + } + } return pointer.Length()/size; } @@ -519,6 +587,7 @@ size_t symbian_fread(const void* ptr, size_t size, size_t numItems, FILE* handle size_t symbian_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle) { TPtrC8 pointer( (unsigned char*) ptr, size*numItems); + ((TSymbianFileEntry*)(handle))->iInputPos = KErrNotFound; if (((TSymbianFileEntry*)(handle))->iFileHandle.Write(pointer) == KErrNone) { return numItems; } @@ -528,12 +597,18 @@ size_t symbian_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handl bool symbian_feof(FILE* handle) { TInt pos = 0; - if (((TSymbianFileEntry*)(handle))->iFileHandle.Seek(ESeekCurrent, pos) == KErrNone) { + TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle)); + + if (entry->iFileHandle.Seek(ESeekCurrent, pos) == KErrNone) { TInt size = 0; - if (((TSymbianFileEntry*)(handle))->iFileHandle.Size(size) == KErrNone) { - if (pos == size) + if (entry->iFileHandle.Size(size) == KErrNone) { + if(entry->iInputPos == KErrNotFound && pos == size) return true; + + if(entry->iInputPos != KErrNotFound && pos == size && entry->iInputPos == entry->iInputBufferLen) + return true; + return false; } } @@ -549,6 +624,7 @@ long int symbian_ftell(FILE* handle) { } int symbian_fseek(FILE* handle, long int offset, int whence) { + TSeek seekMode = ESeekStart; TInt pos = offset; @@ -564,6 +640,8 @@ int symbian_fseek(FILE* handle, long int offset, int whence) { break; } + + ((TSymbianFileEntry*)(handle))->iInputPos = KErrNotFound; return ((TSymbianFileEntry*)(handle))->iFileHandle.Seek(seekMode, pos); } |