diff options
Diffstat (limited to 'backends/platform')
23 files changed, 199 insertions, 359 deletions
diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile index 56848504e1..db5861903b 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -75,7 +75,7 @@ SCUMMVM.BIN : scummvm.bin plugin_dist : for p in plugins/*.plg; do \ - sh-elf-strip -g -o "`basename \"$$p\" | tr '[:lower:]' '[:upper:]'`" "$$p"; \ + sh-elf-strip -g -o "`basename \"$$p\" | LC_CTYPE=C tr '[:lower:]' '[:upper:]'`" "$$p"; \ done dist : SCUMMVM.BIN plugins plugin_dist diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp index f4dc4037df..0da77e317e 100644 --- a/backends/platform/dc/dc-fs.cpp +++ b/backends/platform/dc/dc-fs.cpp @@ -34,18 +34,15 @@ * * Parts of this class are documented in the base interface class, AbstractFilesystemNode. */ - -/* A file */ class RoninCDFileNode : public AbstractFilesystemNode { protected: String _path; - static const char *lastPathComponent(const Common::String &str); public: RoninCDFileNode(const String &path) : _path(path) {}; virtual bool exists() const { return true; } - virtual String getName() const { return lastPathComponent(_path); } + virtual String getName() const { return lastPathComponent(_path, '/'); } virtual String getPath() const { return _path; } virtual bool isDirectory() const { return false; } virtual bool isReadable() const { return true; } @@ -61,7 +58,7 @@ public: /* A directory */ class RoninCDDirectoryNode : public RoninCDFileNode { public: - RoninCDDirectoryNode(const String &path) : RoninCDFileNode(path) {}; + RoninCDDirectoryNode(const String &path) : RoninCDFileNode(path) {}; virtual bool isDirectory() const { return true; } virtual AbstractFilesystemNode *getChild(const String &n) const; @@ -77,32 +74,7 @@ public: virtual bool isReadable() const { return false; } }; -/** - * Returns the last component of a given path. - * - * Examples: - * /foo/bar.txt would return /bar.txt - * /foo/bar/ would return /bar/ - * - * @param str String containing the path. - * @return Pointer to the first char of the last component inside str. - */ -const char *RoninCDFileNode::lastPathComponent(const Common::String &str) { - if(str.empty()) - return ""; - - const char *start = str.c_str(); - const char *cur = start + str.size() - 2; - - while (cur >= start && *cur != '/') { - --cur; - } - - return cur + 1; -} - -AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String &path) -{ +AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String &path) { assert(path.size() > 0); int fd; @@ -110,12 +82,10 @@ AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String & if ((fd = open(path.c_str(), O_RDONLY)) >= 0) { close(fd); return new RoninCDFileNode(path); - } - else if ((fd = open(path.c_str(), O_DIR|O_RDONLY)) >= 0) { + } else if ((fd = open(path.c_str(), O_DIR|O_RDONLY)) >= 0) { close(fd); return new RoninCDDirectoryNode(path); - } - else { + } else { return NULL; } } @@ -168,7 +138,7 @@ AbstractFilesystemNode *RoninCDFileNode::getParent() const { return 0; const char *start = _path.c_str(); - const char *end = lastPathComponent(_path); + const char *end = lastPathComponent(_path, '/'); return new RoninCDDirectoryNode(String(start, end - start)); } diff --git a/backends/platform/ds/arm9/source/blitters_arm.s b/backends/platform/ds/arm9/source/blitters_arm.s index 5f7df298b4..48ec316675 100644 --- a/backends/platform/ds/arm9/source/blitters_arm.s +++ b/backends/platform/ds/arm9/source/blitters_arm.s @@ -20,149 +20,12 @@ @ @ @author Robin Watts (robin@wss.co.uk) - .global asmDrawStripToScreen - .global asmCopy8Col .global Rescale_320x256xPAL8_To_256x256x1555 .global Rescale_320x256x1555_To_256x256x1555 .section .itcm,"ax", %progbits .align 2 .code 32 - @ ARM implementation of asmDrawStripToScreen. - @ - @ C prototype would be: - @ - @ extern "C" void asmDrawStripToScreen(int height, - @ int width, - @ byte const *text, - @ byte const *src, - @ byte *dst, - @ int vsPitch, - @ int vsScreenWidth, - @ int textSurfacePitch); - @ - @ In addition, we assume that text, src and dst are all word (4 byte) - @ aligned. This is the same assumption that the old 'inline' version - @ made. -asmDrawStripToScreen: - @ r0 = height - @ r1 = width - @ r2 = text - @ r3 = src - MOV r12,r13 - STMFD r13!,{r4-r7,r9-r11,R14} - LDMIA r12,{r4,r5,r6,r7} - @ r4 = dst - @ r5 = vsPitch - @ r6 = vmScreenWidth - @ r7 = textSurfacePitch - - CMP r0,#0 @ If height<=0 - MOVLE r0,#1 @ height=1 - CMP r1,#4 @ If width<4 - BLT end @ return - - @ Width &= ~4 ? What's that about then? Width &= ~3 I could have - @ understood... - BIC r1,r1,#4 - - SUB r5,r5,r1 @ vsPitch -= width - SUB r6,r6,r1 @ vmScreenWidth -= width - SUB r7,r7,r1 @ textSurfacePitch -= width - MOV r10,#253 - ORR r10,r10,r10,LSL #8 - ORR r10,r10,r10,LSL #16 @ r10 = mask -yLoop: - MOV r14,r1 @ r14 = width -xLoop: - LDR r12,[r2],#4 @ r12 = [text] - LDR r11,[r3],#4 @ r11 = [src] - CMP r12,r10 - BNE singleByteCompare - SUBS r14,r14,#4 - STR r11,[r4], #4 @ r4 = [dst] - BGT xLoop - - ADD r2,r2,r7 @ text += textSurfacePitch - ADD r3,r3,r5 @ src += vsPitch - ADD r4,r4,r6 @ dst += vmScreenWidth - SUBS r0,r0,#1 - BGT yLoop - LDMFD r13!,{r4-r7,r9-r11,PC} - -singleByteCompare: - MOV r9,r12,LSR #24 @ r9 = 1st byte of [text] - CMP r9,r10,LSR #24 @ if (r9 == mask) - MOVEQ r9,r11,LSR #24 @ r9 = 1st byte of [src] - ORR r12,r9,r12,LSL #8 @ r12 = combine r9 and r12 - - MOV r9,r12,LSR #24 @ r9 = 1st byte of [text] - CMP r9,r10,LSR #24 @ if (r9 == mask) - MOVEQ r9,r11,LSR #24 @ r9 = 1st byte of [src] - ORR r12,r9,r12,LSL #8 @ r12 = combine r9 and r12 - - MOV r9,r12,LSR #24 @ r9 = 1st byte of [text] - CMP r9,r10,LSR #24 @ if (r9 == mask) - MOVEQ r9,r11,LSR #24 @ r9 = 1st byte of [src] - ORR r12,r9,r12,LSL #8 @ r12 = combine r9 and r12 - - MOV r9,r12,LSR #24 @ r9 = 1st byte of [text] - CMP r9,r10,LSR #24 @ if (r9 == mask) - MOVEQ r9,r11,LSR #24 @ r9 = 1st byte of [src] - ORR r12,r9,r12,LSL #8 @ r12 = combine r9 and r12 - - STR r12,[r4],#4 - SUBS r14,r14,#4 - BGT xLoop - - ADD r2,r2,r7 @ text += textSurfacePitch - ADD r3,r3,r5 @ src += vsPitch - ADD r4,r4,r6 @ dst += vmScreenWidth - SUBS r0,r0,#1 - BGT yLoop -end: - LDMFD r13!,{r4-r7,r9-r11,PC} - - - @ ARM implementation of asmCopy8Col - @ - @ C prototype would be: - @ - @ extern "C" void asmCopy8Col(byte *dst, - @ int dstPitch, - @ const byte *src, - @ int height); - @ - @ In addition, we assume that src and dst are both word (4 byte) - @ aligned. This is the same assumption that the old 'inline' version - @ made. -asmCopy8Col: - @ r0 = dst - @ r1 = dstPitch - @ r2 = src - @ r3 = height - STMFD r13!,{r14} - SUB r1,r1,#4 - - TST r3,#1 - ADDNE r3,r3,#1 - BNE roll2 -yLoop2: - LDR r12,[r2],#4 - LDR r14,[r2],r1 - STR r12,[r0],#4 - STR r14,[r0],r1 -roll2: - LDR r12,[r2],#4 - LDR r14,[r2],r1 - SUBS r3,r3,#2 - STR r12,[r0],#4 - STR r14,[r0],r1 - BNE yLoop2 - - LDMFD r13!,{PC} - - @ ARM implementation of Rescale_320x256x1555_To_256x256x1555 @ @ C prototype would be: diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 5c3b87309d..9abaa3c6fb 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -196,6 +196,7 @@ OSystem_SDL::OSystem_SDL() _soundMutex(0), _soundCond(0), _soundThread(0), _soundThreadIsRunning(false), _soundThreadShouldQuit(false), #endif + _fsFactory(0), _savefile(0), _mixer(0), _timer(0), @@ -213,6 +214,19 @@ OSystem_SDL::OSystem_SDL() memset(&_mouseCurState, 0, sizeof(_mouseCurState)); _inited = false; + + + #if defined(__amigaos4__) + _fsFactory = new AmigaOSFilesystemFactory(); + #elif defined(UNIX) + _fsFactory = new POSIXFilesystemFactory(); + #elif defined(WIN32) + _fsFactory = new WindowsFilesystemFactory(); + #elif defined(__SYMBIAN32__) + // Do nothing since its handled by the Symbian SDL inheritance + #else + #error Unknown and unsupported FS backend + #endif } OSystem_SDL::~OSystem_SDL() { @@ -254,17 +268,8 @@ Common::SaveFileManager *OSystem_SDL::getSavefileManager() { } FilesystemFactory *OSystem_SDL::getFilesystemFactory() { - #if defined(__amigaos4__) - return &AmigaOSFilesystemFactory::instance(); - #elif defined(UNIX) - return &POSIXFilesystemFactory::instance(); - #elif defined(WIN32) - return &WindowsFilesystemFactory::instance(); - #elif defined(__SYMBIAN32__) - // Do nothing since its handled by the Symbian SDL inheritance - #else - #error Unknown and unsupported backend in OSystem_SDL::getFilesystemFactory - #endif + assert(_fsFactory); + return _fsFactory; } static Common::String getDefaultConfigFileName() { @@ -292,20 +297,19 @@ static Common::String getDefaultConfigFileName() { CreateDirectory(configFile, NULL); strcat(configFile, "\\" DEFAULT_CONFIG_FILE); - if (fopen(configFile, "r") == NULL) { + FILE *tmp = NULL; + if ((tmp = fopen(configFile, "r")) == NULL) { // Check windows directory char oldConfigFile[MAXPATHLEN]; GetWindowsDirectory(oldConfigFile, MAXPATHLEN); strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE); - if (fopen(oldConfigFile, "r")) { - printf("The default location of the config file (scummvm.ini) in ScummVM has changed,\n"); - printf("under Windows NT4/2000/XP/Vista. You may want to consider moving your config\n"); - printf("file from the old default location:\n"); - printf("%s\n", oldConfigFile); - printf("to the new default location:\n"); - printf("%s\n\n", configFile); + if ((tmp = fopen(oldConfigFile, "r"))) { strcpy(configFile, oldConfigFile); + + fclose(tmp); } + } else { + fclose(tmp); } } else { // Check windows directory @@ -334,23 +338,13 @@ static Common::String getDefaultConfigFileName() { } Common::SeekableReadStream *OSystem_SDL::openConfigFileForReading() { - Common::File *confFile = new Common::File(); - assert(confFile); - if (!confFile->open(getDefaultConfigFileName())) { - delete confFile; - confFile = 0; - } - return confFile; + FilesystemNode file(getDefaultConfigFileName()); + return file.openForReading(); } Common::WriteStream *OSystem_SDL::openConfigFileForWriting() { - Common::DumpFile *confFile = new Common::DumpFile(); - assert(confFile); - if (!confFile->open(getDefaultConfigFileName())) { - delete confFile; - confFile = 0; - } - return confFile; + FilesystemNode file(getDefaultConfigFileName()); + return file.openForWriting(); } void OSystem_SDL::setWindowCaption(const char *caption) { @@ -435,15 +429,21 @@ void OSystem_SDL::quit() { } void OSystem_SDL::setupIcon() { - int w, h, ncols, nbytes, i; - unsigned int rgba[256], icon[32 * 32]; - unsigned char mask[32][4]; + int x, y, w, h, ncols, nbytes, i; + unsigned int rgba[256]; + unsigned int *icon; sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); - if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { - warning("Could not load the icon (%d %d %d %d)", w, h, ncols, nbytes); + if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) { + warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes); + return; + } + icon = (unsigned int*)malloc(w*h*sizeof(unsigned int)); + if (!icon) { + warning("Could not allocate temp storage for the built-in icon"); return; } + for (i = 0; i < ncols; i++) { unsigned char code; char color[32]; @@ -457,26 +457,27 @@ void OSystem_SDL::setupIcon() { sscanf(color + 1, "%06x", &col); col |= 0xFF000000; } else { - warning("Could not load the icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); + warning("Could not load the built-in icon (%d %s - %s) ", code, color, scummvm_icon[1 + i]); + free(icon); return; } rgba[code] = col; } - memset(mask, 0, sizeof(mask)); - for (h = 0; h < 32; h++) { - const char *line = scummvm_icon[1 + ncols + h]; - for (w = 0; w < 32; w++) { - icon[w + 32 * h] = rgba[(int)line[w]]; - if (rgba[(int)line[w]] & 0xFF000000) { - mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); - } + for (y = 0; y < h; y++) { + const char *line = scummvm_icon[1 + ncols + y]; + for (x = 0; x < w; x++) { + icon[x + w * y] = rgba[(int)line[x]]; } } - SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); - SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); + SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, w, h, 32, w * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); + if (!sdl_surf) { + warning("SDL_CreateRGBSurfaceFrom(icon) failed"); + } + SDL_WM_SetIcon(sdl_surf, NULL); SDL_FreeSurface(sdl_surf); + free(icon); } OSystem::MutexRef OSystem_SDL::createMutex(void) { diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 1c1381ec5c..d07dcee679 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -400,14 +400,13 @@ protected: void deinitThreadedMixer(); #endif - + FilesystemFactory *_fsFactory; Common::SaveFileManager *_savefile; Audio::MixerImpl *_mixer; SDL_TimerID _timerID; Common::TimerManager *_timer; - protected: void addDirtyRgnAuto(const byte *buf); void makeChecksums(const byte *buf); diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl index 12e5f8f0c4..d575a1de38 100644 --- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl +++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl @@ -3,10 +3,10 @@ @WorkingEngines = qw( scumm agos sky queen gob saga drascula - kyra lure agi touche parallaction + kyra lure agi touche parallaction cine ); @TestingEngines = qw( - cruise igor made m4 cine + cruise igor made m4 ); @BrokenEngines = qw( sword1 diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg index 67d9d83160..bf3c69ae08 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg @@ -16,7 +16,7 @@ ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; ; $URL:$ -; $Id$ +; $Id:$ ; ; diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg index 3afb7a094c..3f88ec918c 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg @@ -52,6 +52,7 @@ "..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" "..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat" +"..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg index 32df2aee8b..6bd1fbd047 100644 --- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg +++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg @@ -63,6 +63,7 @@ "..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt" "..\..\..\..\dists\engine-data\igor.tbl"-"c:\data\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat" +"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\drascula.dat" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"c:\data\scummvm\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg index 94d457b93a..29e318a479 100644 --- a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg +++ b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg @@ -53,6 +53,7 @@ "..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" "..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat" +"..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg index ca7f08d85f..0173da7699 100644 --- a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg +++ b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg @@ -53,6 +53,7 @@ "..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" "..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat" +"..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg index 8a121227bc..aca927eadd 100644 --- a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg +++ b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg @@ -16,7 +16,7 @@ ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; ; $URL:$ -; $Id$ +; $Id:$ ; ; diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg index 5aad403074..0883c88a21 100644 --- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg +++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg @@ -61,6 +61,7 @@ "..\..\..\..\dists\engine-data\sky.cpt"-"c:\shared\scummvm\sky.cpt" "..\..\..\..\dists\engine-data\igor.tbl"-"c:\shared\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"c:\shared\scummvm\lure.dat" +"..\..\..\..\dists\engine-data\drascula.dat"-"c:\shared\scummvm\drascula.dat" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"c:\shared\scummvm\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp index 60e402632f..e71b242329 100644 --- a/backends/platform/symbian/src/SymbianActions.cpp +++ b/backends/platform/symbian/src/SymbianActions.cpp @@ -153,7 +153,7 @@ void SymbianActions::initInstanceGame() { // Save - if (is_simon || is_sword2 || is_gob || is_kyra || is_touche || is_feeble) + if (is_simon || is_sword2 || is_gob || is_kyra || is_feeble) _action_enabled[ACTION_SAVE] = false; else { _action_enabled[ACTION_SAVE] = true; diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 0ce44d1704..90bd99fa7d 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -123,10 +123,6 @@ void OSystem_SDL_Symbian::setFeatureState(Feature f, bool enable) { } } -FilesystemFactory *OSystem_SDL_Symbian::getFilesystemFactory() { - return &SymbianFilesystemFactory::instance(); -} - static Common::String getDefaultConfigFileName() { char configFile[MAXPATHLEN]; strcpy(configFile, Symbian::GetExecutablePath()); @@ -134,33 +130,13 @@ static Common::String getDefaultConfigFileName() { return configFile; } -Common::SeekableReadStream *OSystem_SDL_Symbian::openConfigFileForReading() { - Common::File *confFile = new Common::File(); - assert(confFile); - if (!confFile->open(getDefaultConfigFileName())) { - delete confFile; - confFile = 0; - } - return confFile; -} - -Common::WriteStream *OSystem_SDL_Symbian::openConfigFileForWriting() { - Common::DumpFile *confFile = new Common::DumpFile(); - assert(confFile); - if (!confFile->open(getDefaultConfigFileName())) { - delete confFile; - confFile = 0; - } - return confFile; -} - - 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) { + _RFs = &CEikonEnv::Static()->FsSession(); } void OSystem_SDL_Symbian::initBackend() { @@ -184,6 +160,8 @@ void OSystem_SDL_Symbian::initBackend() { actions->initInstanceMain(this); actions->loadMapping(); initZones(); + + _fsFactory = new SymbianFilesystemFactory(); } OSystem_SDL_Symbian::~OSystem_SDL_Symbian() { @@ -488,6 +466,10 @@ void OSystem_SDL_Symbian::initZones() { } } +RFs& OSystem_SDL_Symbian::FsSession() { + return *_RFs; +} + FILE* symbian_fopen(const char* name, const char* mode) { TSymbianFileEntry* fileEntry = new TSymbianFileEntry; fileEntry->iInputPos = KErrNotFound; @@ -516,22 +498,22 @@ FILE* symbian_fopen(const char* name, const char* mode) { switch(mode[0]) { case 'a': - if (fileEntry->iFileHandle.Open(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { - if (fileEntry->iFileHandle.Create(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Create(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } } break; case 'r': - if (fileEntry->iFileHandle.Open(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } break; case 'w': - if (fileEntry->iFileHandle.Replace(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { + if (fileEntry->iFileHandle.Replace(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) { delete fileEntry; fileEntry = NULL; } diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h index 68a6fb492f..80329d984e 100644 --- a/backends/platform/symbian/src/SymbianOS.h +++ b/backends/platform/symbian/src/SymbianOS.h @@ -33,6 +33,7 @@ #endif #define TOTAL_ZONES 3 +class RFs; class OSystem_SDL_Symbian : public OSystem_SDL { public: @@ -70,10 +71,6 @@ protected: // static void symbianMixCallback(void *s, byte *samples, int len); - virtual FilesystemFactory *getFilesystemFactory(); - - virtual Common::SeekableReadStream *openConfigFileForReading(); - virtual Common::WriteStream *openConfigFileForWriting(); public: // vibration support #ifdef USE_VIBRA_SE_PXXX @@ -134,6 +131,7 @@ protected: } zoneDesc; static zoneDesc _zones[TOTAL_ZONES]; + RFs* _RFs; }; #endif diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index 4577824b33..02436d7c35 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -134,7 +134,6 @@ #ifndef __WINS__ #define USE_ARM_GFX_ASM -#define ARM_USE_GFX_ASM #define USE_ARM_SMUSH_ASM #define USE_ARM_COSTUME_ASM #define USE_ARM_SOUND_ASM diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 3626c4c10b..7f78517762 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -147,7 +147,7 @@ void CEActionsPocket::initInstanceGame() { _key_action[POCKET_ACTION_PAUSE].setKey(VK_SPACE); _action_enabled[POCKET_ACTION_PAUSE] = true; // Save - if (is_simon || is_sword2 || is_gob || is_kyra || is_touche || is_feeble) + if (is_simon || is_sword2 || is_gob || is_kyra || is_feeble) _action_enabled[POCKET_ACTION_SAVE] = false; else if (is_queen) { _action_enabled[POCKET_ACTION_SAVE] = true; diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index 87f73f5a66..0c4113cc0c 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -130,7 +130,7 @@ void CEActionsSmartphone::initInstanceGame() { // Initialize keys for different actions // Save - if (is_simon || is_sword2 || is_gob || is_kyra || is_touche || is_feeble) + if (is_simon || is_sword2 || is_gob || is_kyra || is_feeble) _action_enabled[SMARTPHONE_ACTION_SAVE] = false; else if (is_queen) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile index 4400d50e3a..9f040bbed1 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -45,8 +45,8 @@ ENABLE_DRASCULA = STATIC_PLUGIN USE_MAD = 1 USE_MPEG2 = 1 -USE_TREMOR = 1 -#USE_TREMOLO = 1 +#USE_TREMOR = 1 +USE_TREMOLO = 1 USE_FLAC = 1 USE_ZLIB = 1 @@ -139,7 +139,7 @@ LIBS += -ltremorce endif ifdef USE_TREMOLO -DEFINES += -DUSE_TREMOR -DUSE_VORBIS +DEFINES += -DUSE_TREMOR -DUSE_VORBIS -DUSE_TREMOLO INCLUDES += -Ilibs/include/tremolo LIBS += -llibTremolo endif diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt index f4cb00dcfa..86c627d764 100644 --- a/backends/platform/wince/README-WinCE.txt +++ b/backends/platform/wince/README-WinCE.txt @@ -1,29 +1,28 @@ ScummVM Windows CE FAQ Last updated: $Date$ -Release version: 0.11.0 +Release version: 0.12.0 ------------------------------------------------------------------------ New in this version ------------------- -0.11.0 -- Redesigned 'Free Look' action (Pocket PCs) -In order to accommodate for the requirements of the lure engine, the -usage characteristics of the 'Free Look' action have been improved. The -new behavior is available for use in all engines, but is is *strongly* -recommended for at least when playing 'Lure of the Temptress'. By using -the new scheme, when in 'Free Look' mode, it is now possible to enter -left clicks by clicking a second time near the current location of the -mouse pointer. Left and Right clicks at the current point location -are also available by using the respective actions' bound key. +0.12.0: +- Improved SMUSH support (deprecated 'Smush_force_redraw' option) +No skipped frames in Full Throttle action sequences. The 'Smush_force_redraw' +option is not needed/honored anymore. -- Reduced optimization build -The ScummVM executable has grown quite large, prohibiting some devices -from running memory demanding games (or any games at all). Code -optimization level has been reduced to offset the growth of the executable. -Games run slightly slower. This will be addressed before next release. +- Fixed MultiFuntion key in Full Throttle -- Several bugfixes +- Improved sound output +Fixed a long standing bug which led to distorted sound output in all games. + +- Switched to faster ogg vorbis library +Robin Watts' libTremolo is used for ogg vorbis (tremor) replay. Info patch +by Lostech. + +- New right click through double tap inhibiting option +Check out the 'no_doubletap_rightclick' option if double-tapping as a right +click input method annoys you. Patch by spookypeanut. ------------------------------------------------------------------------ @@ -109,10 +108,10 @@ and report your success ... How do I install ScummVM for Windows CE ? ----------------------------------------- -Simple! Unpack the release package on your desktop pc, then copy all its contents -to a folder on your device. Typically, you should at least have scummvm.exe, -modern.ini and modern.zip in the same directory. Finally, upload your beloved games -and fire it up :-) +Simple! Unpack the release package on your desktop pc, then copy all its +contents to a folder on your device. Typically, you should at least have +scummvm.exe, modern.ini and modern.zip in the same directory. Finally, upload +your beloved games and fire it up :-) Some devices (like Pocket PC 2000) require GAPI to be present. @@ -184,18 +183,19 @@ The following actions are available : * Right click : acts as a right mouse button click * Cursor : hide or display the mouse cursor * Free look : go in or out of free-look mode. In this mode, you can tap - the screen to look for interesting locations without walking. - Cling a second time near the pointer's location equals to left click. + the screen to look for interesting locations without + walking. Click a second time near the pointer's location + equals to a left click. * Zoom up : magnify the upper part of the screen for 640x480 games rendered on a QVGA device. * Zoom down : magnify the lower part of the screen for 640x480 games rendered on a QVGA device. - * Multi Function : this key performs a different function depending on the game - : Full Throttle -> win an action sequence (cheat) - : Fate of Atlantis -> sucker punch (cheat) - : Bargon -> F1 (start the game) - : All AGI games -> bring up the predictive input dialog - * Bind keys : map a key action to a device button + * Multi Function : performs a different function depending on the game : + Full Throttle -> win an action sequence (cheat) + Fate of Atlantis -> sucker punch (cheat) + Bargon -> F1 (start the game) + All AGI games -> bring up the predictive input dialog + * Bind keys map a key action to a device button * Up,Down,Left : Right, : emulate mouse/stylus behavior Left Click : @@ -245,11 +245,11 @@ the list of available actions for Smartphones: * Skip : skip a non interactive sequence, the current dialog or behaves like the ESC key on a regular keyboard * Zone : switch between the 3 different mouse zones - * Multi Function : this key performs a different function depending on the game - : Full Throttle -> win an action sequence (cheat) - : Fate of Atlantis -> sucker punch (cheat) - : Bargon -> F1 (start the game) - : All AGI games -> bring up the predictive input dialog + * Multi Function : performs a different function depending on the game + Full Throttle -> win an action sequence (cheat) + Fate of Atlantis -> sucker punch (cheat) + Bargon -> F1 (start the game) + All AGI games -> bring up the predictive input dialog * Bind keys : map a key action to a device button * Keyboard : hide or display the virtual keyboard * Rotate : rotate the screen (also rotates dpad keys) @@ -287,32 +287,34 @@ Some parameters are specific to this port : Game specific sections (f.e. [monkey2]) - performance options - * high_sample_rate bool Desktop quality (22 kHz) sound output if set. - 11 kHz otherwise. The default is 11 kHz. - If you have a fast device, you can set this to - true to enjoy better sound effects and music. + * high_sample_rate bool Desktop quality (22 kHz) sound output if + set. The default is 11 kHz. + If you have a fast device, you can set this + to true to enjoy better sound effects and + music. * FM_high_quality bool Desktop quality FM synthesis if set. Lower - quality otherwise. The default is low quality. - You can change this if you have a fast device. - * sound_thread_priority int Set the priority of the sound thread (0, 1, 2). - Depending on the release, this is set to 1 - internally (above normal). If you get sound - stuttering try setting this to a higher value. + quality otherwise. The default is low + quality. You can change this if you have a + fast device. + * sound_thread_priority int Set the priority of the sound thread (0, 1, + 2). Depending on the release, this is set + to 1 internally (above normal). + If you get sound stuttering try setting + this to a higher value. Set to 0 if your device is fast enough or if - you prefer better audio/video synchronization. - * Smush_force_redraw int Force a Smush frame redraw every X missed - frames. Mainly used for Full Throttle action - sequences. Setting it lower gives more - priority to screen redraws. Setting it higher - gives more priority to stylus/keyboard input. - The default is 30. + you prefer better audio/video sync. Game specific sections (f.e. [monkey2]) - game options - * landscape int 0: Portrait, 1: Landscape, 2: Inverse Landscape - You can also use this in the [scummvm] section - in QVGA Pocket PCs to display the launcher in - landscape, for example, at startup. + * landscape int 0: Portrait, 1: Landscape, + 2: Inverse Landscape. + You can also use this in the [scummvm] + section to display the launcher in landscape + for example, at startup. + * no_doubletap_rightclick int 1: Turn off the default behavior of + simulating a right-click when the screen is + double-tapped. + [scummvm] section - keys definition @@ -335,18 +337,18 @@ You can tweak these parameters to customize how the cursor is handled. consider being repeated. * repeatX int Number of key repeat events before changing horizontal cursor behaviour. - * stepX1 int Horizontal cursor offset value when the key is - not repeated. - * stepX2 int Horizontal cursor offset value when the key is - repeated less than repeatX. - * stepX3 int Horizontal cursor offset value when the key is - repeated more than repeatX. + * stepX1 int Horizontal cursor offset value when the key + is not repeated. + * stepX2 int Horizontal cursor offset value when the key + is repeated less than repeatX. + * stepX3 int Horizontal cursor offset value when the key + is repeated more than repeatX. * repeatY int Number of key repeat events before changing - vertical cursor behaviour. + vertical cursor behavior. * stepY1 int Vertical cursor offset value when the key is not repeated. - * stepY2 int Horizontal cursor offset value when the key is - repeated less than repeatY. + * stepY2 int Horizontal cursor offset value when the key + is repeated less than repeatY. * stepY3 int Vertical cursor offset value when the key is repeated more than repeatY. @@ -361,8 +363,8 @@ Game specific questions I need to press a special key ----------------------------- -Bring up the virtual keyboard. On Smartphones take a look at the Keyboard action above. -On Pocket PCs it's easier to double-tap at the top of the screen. +Bring up the virtual keyboard. On Smartphones take a look at the Keyboard +action above. On Pocket PCs it's easier to double-tap at the top of the screen. The panel is obscuring the playfield area ----------------------------------------- @@ -383,17 +385,18 @@ Bind and use the quit action to quit. I cannot rotate the screen to landscape/inverse landscape --------------------------------------------------------- -Depending on the video driver, ScummVM may opt to not provide such functionality. -In general, when ScummVM starts in normal "portrait" orientation, the device driver -reports better display characteristics and you should consider launching from portrait. +Depending on the video driver, ScummVM may opt to not provide such +functionality. In general, when ScummVM starts in normal "portrait" +orientation, the device driver reports better display characteristics and you +should consider launching from portrait. I'm having problems. Is there diagnostic output available ? ----------------------------------------------------------- Insert a line in the [scummvm] section of scummvm.ini with the following: debuglevel=1 -Run ScummVM. When it closes scummvm_stdout.txt and scummvm_stderr.txt files will be -available at the program directory (see section above). +Run ScummVM. When it closes scummvm_stdout.txt and scummvm_stderr.txt files +will be available at the program directory (see section above). ScummVM crashes and returns to desktop -------------------------------------- @@ -548,18 +551,19 @@ Use the Multi Function action. -- AGI engine games -- ---------------------- -Do you expect me to play these games on keyboard less devices ? +Do you expect me to play these games on keyboard-less devices ? --------------------------------------------------------------- Sure we do :-) -If you want to get some mileage on your stylus you can use the virtual keyboard. -There is a very useful alternative though, the AGI engine's predictive input dialog. -It requires a dictionary to be present. Just tap on the command line or use the -Multi Function action to bring it up. On Smartphones, when the dialog is shown -all key mapping is disabled temporarily (including mouse emulation). Input is -performed either by pressing the phone's numeric keypad keys and dpad enter to -close the dialog, or by navigating the buttons using the dpad arrows and pressing -with dpad enter. Check the main Readme file for more information on this. +If you want to get some mileage on your stylus you can use the virtual +keyboard. There is a very useful alternative though, the AGI engine's +predictive input dialog. It requires a dictionary to be present. Just tap on +the command line or use the Multi Function action to bring it up. On +Smartphones, when the dialog is shown all key mapping is disabled temporarily +(including mouse emulation). Input is performed either by pressing the phone's +numeric keypad keys and dpad enter to close the dialog, or by navigating the +buttons using the dpad arrows and pressing with dpad enter. Check the main +Readme file for more information on this. --------------------------- -- Lure of the Temptress -- @@ -595,8 +599,9 @@ I think I found a bug, ScummVM crashes in ... See the "Reporting Bugs" section in ScummVM readme. -If you have a Pocket PC or Handheld PC, be sure to include its resolution (obtained -on the second dialog displayed on the "About" menu) in your bug report. +If you have a Pocket PC or Handheld PC, be sure to include its resolution +(obtained on the second dialog displayed on the "About" menu) in your bug +report. If you cannot reproduce this bug on another ScummVM version, you can cross post your bug report on ScummVM forums. @@ -619,6 +624,26 @@ http://www.scummvm.org/ Old news follow ... ------------------------------------------------------------------------ +0.11.0: +- Redesigned 'Free Look' action (Pocket PCs) +In order to accommodate for the requirements of the lure engine, the +usage characteristics of the 'Free Look' action have been improved. The +new behavior is available for use in all engines, but is is *strongly* +recommended for at least when playing 'Lure of the Temptress'. By using +the new scheme, when in 'Free Look' mode, it is now possible to enter +left clicks by clicking a second time near the current location of the +mouse pointer. Left and Right clicks at the current point location +are also available by using the respective actions' bound key. + +- Reduced optimization build +The ScummVM executable has grown quite large, prohibiting some devices +from running memory demanding games (or any games at all). Code +optimization level has been reduced to offset the growth of the executable. +Games run slightly slower. This will be addressed before next release. + +- Several bugfixes + + 0.10.0: Major improvements have taken place in this version, mostly for behind- the-scenes stuff. First, we have migrated to GCC for building the Windows diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 48f157f6ff..f09a483086 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -461,7 +461,7 @@ OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(), _orientationLandscape(0), _newOrientation(0), _panelInitialized(false), _panelVisible(true), _panelStateForced(false), _forceHideMouse(false), _unfilteredkeys(false), _freeLook(false), _forcePanelInvisible(false), _toolbarHighDrawn(false), _zoomUp(false), _zoomDown(false), - _scalersChanged(false), _lastKeyPressed(0), _tapTime(0), _closeClick(false), + _scalersChanged(false), _lastKeyPressed(0), _tapTime(0), _closeClick(false), _noDoubleTapRMB(false), _saveToolbarState(false), _saveActiveToolbar(NAME_MAIN_PANEL), _rbutton(false), _hasfocus(true), _usesEmulatedMouse(false), _mouseBackupOld(NULL), _mouseBackupToolbar(NULL), _mouseBackupDim(0) { @@ -1059,14 +1059,11 @@ void OSystem_WINCE3::update_game_settings() { panel->setVisible(false); _saveToolbarState = true; - - // Set Smush Force Redraw rate for Full Throttle - if (!ConfMan.hasKey("Smush_force_redraw")) { - ConfMan.setInt("Smush_force_redraw", 30); - ConfMan.flushToDisk(); - } } + if (ConfMan.hasKey("no_doubletap_rightclick")) + _noDoubleTapRMB = ConfMan.getBool("no_doubletap_rightclick"); + compute_sample_rate(); } @@ -2340,7 +2337,7 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) { if (_closeClick && (GetTickCount() - _tapTime < 1000)) { if (event.mouse.y <= 20 && _panelInitialized) { // top of screen (show panel) swap_panel_visibility(); - } else { // right click + } else if (!_noDoubleTapRMB) { // right click event.type = Common::EVENT_RBUTTONDOWN; _rbutton = true; } diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index 8853c156d8..ece8c9b7b1 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -200,6 +200,7 @@ private: bool _zoomUp; // zooming up mode bool _zoomDown; // zooming down mode + bool _noDoubleTapRMB; // disable double tap -> rmb click bool _rbutton; // double tap -> right button simulation bool _closeClick; // flag when taps are spatially close together |