- Merged the new RTL changes into the branch.

- Fixed conflicts.
- Added new RTL dialogs to the Theme Description files.

Full SVNMerge log:
==================
Merged revisions 33928,33930,33932-33936,33938-33940,33942-33943,33948,33950,33953,33967,33973,33976,33978,33980,33985,33991,33993,33999-34000,34006,34009,34011,34013,34015,34019,34021-34023,34025,34027-34028,34030,34032-34034,34036,34038-34039,34041,34046-34048,34050-34055,34057,34059-34065,34067,34072,34074,34076,34078-34081,34084,34086-34087,34089-34090,34093,34096-34102,34104,34107,34113,34116,34119,34122,34124,34126,34128,34131-34132,34135,34138,34141,34144,34146,34149,34152-34154,34156-34157,34160,34163-34164,34169,34173,34179-34194,34196-34198,34200-34201,34205-34206,34208-34217,34219-34225,34227-34228,34234-34237,34239-34249,34251-34279,34281-34284,34286-34288,34290-34320,34323-34324,34326,34328-34329,34332,34334,34336,34338-34340,34343-34353,34356-34357,34359-34371,34373,34375,34378,34381-34382,34384-34385,34389-34391,34393-34394,34396-34397,34399-34405,34407-34409,34411,34413,34415,34417-34420,34423-34426,34428-34438,34440-34454,34456-34458,34460,34462-34469,34472,34474,34479-34481,34483-34498,34501-34505,34508,34511-34518,34520-34524,34526-34563,34566-34569,34571-34590,34592,34595-34599,34602-34603 via svnmerge from 
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk

........
  r33928 | peres001 | 2008-08-16 08:39:58 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Fixed label positioning in BRA.
........
  r33930 | peres001 | 2008-08-16 09:47:44 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Enabled interaction with movable zones - mainly NPCs - which are linked to animations.
........
  r33932 | anotherguest | 2008-08-16 10:49:36 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Enable CINE
........
  r33933 | peres001 | 2008-08-16 10:57:07 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Fixed half-invisible balloons.
........
  r33934 | fingolfin | 2008-08-16 13:37:36 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Replaced ARM_USE_GFX_ASM by USE_ARM_GFX_ASM
........
  r33935 | buddha_ | 2008-08-16 13:38:43 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Changed AdlibRegisterSoundInstrument's member variables from unsigned 16-bit to unsigned 8-bit. Maybe this'll fix the crash in AdlibSoundDriver::setupInstrument() eriktorbjorn was getting in Future Wars when teleporting from the photocopier room to the swamp. There was a OPLWriteReg(_opl, 0x80 | car, reg->sustainRelease) call with sustainRelease = 65452. Now there shouldn't be any such calls made because the sustainRelease value is always 8-bit now. Hopefully this won't break anything.
........
  r33936 | eriktorbjorn | 2008-08-16 13:50:36 +0200 (Sat, 16 Aug 2008) | 2 lines
  
  Removed unused variable.
........
  r33938 | athrxx | 2008-08-16 14:38:37 +0200 (Sat, 16 Aug 2008) | 4 lines
  
  - KYRA: FM-Towns/PC-98 Audio: fixed several bugs and got rid of some floating point arithmetic (or at least replaced some doubles with floats)
  - Improved support for PC-98 music: HOF tracks seem to be fine, KYRA should be okay, too (I can't compare with an emulator since I am missing the floppy boot disk with the executable)
  - There are still tempo issues. Some tracks play way too slow, others way too fast
  - PC-98 sound effects in Kyra 1 don't work (I would need the floppy disk with the executable for that)
........
  r33939 | peres001 | 2008-08-16 14:49:27 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Multiple balloons (answers) are now positioned correctly in BRA.
........
  r33940 | peres001 | 2008-08-16 15:10:54 +0200 (Sat, 16 Aug 2008) | 1 line
  
  Extended balloon manager to handle color constants and fixed color of text in balloons for BRA.
........
  r33942 | athrxx | 2008-08-16 16:25:03 +0200 (Sat, 16 Aug 2008) | 1 line
  
  KYRA: Fm-Towns Audio: fixed music fading
........
  r33943 | athrxx | 2008-08-16 17:24:52 +0200 (Sat, 16 Aug 2008) | 1 line
  
  KYRA: Fm-Towns Audio: fixed crash
........
  r33948 | lordhoto | 2008-08-16 23:51:56 +0200 (Sat, 16 Aug 2008) | 2 lines
  
  Cleanup.
........
  r33950 | buddha_ | 2008-08-17 00:15:57 +0200 (Sun, 17 Aug 2008) | 5 lines
  
  Workaround for bug #2054882 (FW: Impossible to survive entering monastery (regression)):
  For Future Wars o1_compareGlobalVar now compares global variable 255 to be equal to everything.
  The scripts probably tested global variable 255 for equality with some value (Maybe 143?)
  to see whether copy protection was properly passed.
........
  r33953 | lordhoto | 2008-08-17 00:30:47 +0200 (Sun, 17 Aug 2008) | 2 lines
  
  Properly close files opened when checking for config file on WIN32.
........
  r33967 | buddha_ | 2008-08-17 12:43:54 +0200 (Sun, 17 Aug 2008) | 1 line
  
  Forwardport of branch-0-12-0's r33966: Fix to Future Wars's rendering of type 0 overlays (i.e. color sprites). Objects with negative frame values are supposed to be jumped over (Verified with disassembly).
........
  r33973 | sev | 2008-08-17 20:58:23 +0200 (Sun, 17 Aug 2008) | 2 lines
  
  Patch #2045543: Possible fix for Drascula's decodeRLE()
........
  r33976 | buddha_ | 2008-08-17 22:53:18 +0200 (Sun, 17 Aug 2008) | 1 line
  
  Added some documentation about how data is unpacked in gfxConvertSpriteToRaw (Learned this from trying to implement convertPI1_2 i.e. gfxConvertSpriteToRaw myself to see if that was the problem with the Operation Stealth's labyrinth arcade sequence).
........
  r33978 | anotherguest | 2008-08-17 23:16:07 +0200 (Sun, 17 Aug 2008) | 1 line
  
  Improved filehandling for securer and quicker way to get ref to file session
........
  r33980 | athrxx | 2008-08-18 00:49:34 +0200 (Mon, 18 Aug 2008) | 4 lines
  
  KYRA: FM-Towns/PC-98 Audio:
  - improved accuracy
  - complete percussion channel support (does not work atm though, since the instrument data is missing)
  - some cleanup
........
  r33985 | peres001 | 2008-08-18 09:12:05 +0200 (Mon, 18 Aug 2008) | 3 lines
  
  * Split up blt routine (there is room for a ton of improvements)
  * Added scaling as a new blt option
  * Activated scaling for the main character in BRA
........
  r33991 | knakos | 2008-08-18 19:24:25 +0200 (Mon, 18 Aug 2008) | 1 line
  
  do away with the smush force redraw hack
........
  r33993 | athrxx | 2008-08-18 19:42:32 +0200 (Mon, 18 Aug 2008) | 3 lines
  
  KYRA: FM-Towns/PC-98 Audio:
  - adpcm decoding for rhythm channel
  - cleanup
........
  r33999 | knakos | 2008-08-18 20:15:32 +0200 (Mon, 18 Aug 2008) | 1 line
  
  switching to libTremolo
........
  r34000 | anotherguest | 2008-08-18 20:16:24 +0200 (Mon, 18 Aug 2008) | 1 line
  
  Do Deinit of pixel buffer when hiding menu.That saves 600KB in VGA games for low memory devices.
........
  r34006 | robinwatts | 2008-08-18 22:04:15 +0200 (Mon, 18 Aug 2008) | 8 lines
  
  Updates to the scummvm blitting code as discussed on the mailing list.
  
   1) Remove DS version of the ARM blitters in favour of the 'normal' ARM one.
   2) Update normal ARM blitter to use Carlo's clever algorithm.
   3) Update C version with Max Horns patch (slightly tweaked - counting down
  on loops is better, M'kay).
........
  r34009 | tramboi | 2008-08-18 22:43:44 +0200 (Mon, 18 Aug 2008) | 1 line
  
  Compile fix for 34006
........
  r34011 | anotherguest | 2008-08-18 23:09:46 +0200 (Mon, 18 Aug 2008) | 1 line
  
  Enable quick F5 save key for Touche!
........
  r34013 | anotherguest | 2008-08-18 23:19:18 +0200 (Mon, 18 Aug 2008) | 1 line
  
  Enable save game action key in Touche for WinCE devices.
........
  r34015 | athrxx | 2008-08-19 03:00:15 +0200 (Tue, 19 Aug 2008) | 2 lines
  
  fixed bug that caused a lockup in certain configurations when the music was fading
........
  r34019 | athrxx | 2008-08-19 08:31:57 +0200 (Tue, 19 Aug 2008) | 1 line
  
  fixed warnings
........
  r34021 | anotherguest | 2008-08-19 09:44:35 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Remove Deinit when hiding menu! UI infoprints needed the pixelbuffer.
........
  r34022 | peres001 | 2008-08-19 10:08:32 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fixed segfault when quitting BRA.
........
  r34023 | thebluegr | 2008-08-19 10:49:53 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fix for bug #2057194 - "IHNM: -x option crashes ScummVM, if savegame doesn't exist"
........
  r34025 | anotherguest | 2008-08-19 10:54:28 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Don't Use CEikonEnv::Static, get FS from system class instead
........
  r34027 | anotherguest | 2008-08-19 11:26:41 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Use the correct and specified datatype int32 instead of only int.
........
  r34028 | thebluegr | 2008-08-19 12:05:07 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fixed regression from commit #33576. Fixes bug #2056282 - "DRASCULA: can't use inventory objects"
........
  r34030 | thebluegr | 2008-08-19 12:12:35 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fix for bug #2057664 - "DRASCULA: No GUI warning when playing from CD"
........
  r34032 | fingolfin | 2008-08-19 12:52:39 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fixed GCC warning
........
  r34033 | fingolfin | 2008-08-19 12:58:35 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fixed 'make install' when building outside srcdir
........
  r34034 | buddha_ | 2008-08-19 13:55:20 +0200 (Tue, 19 Aug 2008) | 5 lines
  
  Fix for bug #2057637: FW: Spaceship glitches in demo (regression).
  This was caused by assuming in-place decompression is ok, it wasn't,
  although AFAIK the original did decompression in-place too.
  Changed unpacking to be done not in-place and the glitch vanished.
  Also changed the unpacker to also handle uncompressed input data.
........
  r34036 | buddha_ | 2008-08-19 15:05:38 +0200 (Tue, 19 Aug 2008) | 6 lines
  
  Fix for bug #2057656: FW: Assert during demo (regression).
  Future Wars's Amiga demo is trying to load collision data files
  'L8_MK.NEO' and 'L23_MK.NEO' that aren't supplied with the demo.
  Previous code crashed when a file couldn't be found,
  now it gives a warning instead.
........
  r34038 | peres001 | 2008-08-19 16:07:48 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Fixed bug in low-level parser. Block comments weren't interpreted correctly.
........
  r34039 | buddha_ | 2008-08-19 16:19:28 +0200 (Tue, 19 Aug 2008) | 2 lines
  
  Fix for bug #2057619: FW: Glitches in title display of demo (regression).
  Removed incorrect transparency data used for logo. Now it's shown correctly.
........
  r34041 | peres001 | 2008-08-19 16:36:05 +0200 (Tue, 19 Aug 2008) | 1 line
  
  Deleted debug code that slipped in.
........
  r34046 | peres001 | 2008-08-20 05:36:49 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  * Enlarged buffer for frame decoding. Crashes in the introduction were caused by a small buffer and subsequent out-of-bound writes.
  * Disabled debug code.
........
  r34047 | peres001 | 2008-08-20 06:02:12 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Engine now returns to the menu when intro is over.
........
  r34048 | eriktorbjorn | 2008-08-20 11:12:11 +0200 (Wed, 20 Aug 2008) | 4 lines
  
  I believe the setVolume() function has to be guarded by a mutex. (I added this to
  the Tinsel engine a while back to fix mysterious problems, but forgot to add it
  elsewhere.) Maybe this will fix the mysterious IHNM crashes, as well?
........
  r34050 | eriktorbjorn | 2008-08-20 11:15:59 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Moved the mutex locking a bit. (Consistent with how the AGOS engine does it.)
........
  r34051 | fingolfin | 2008-08-20 12:18:59 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Extended HashMap debug output
........
  r34052 | fingolfin | 2008-08-20 13:07:16 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Unified member names in container/storage classes Array, HashMap and String: _storage, _size, _capacity
........
  r34053 | lordhoto | 2008-08-20 16:03:34 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Committed patch #2050337 "KYRA/SCUMM: Thumbnail support/improvement". (Without Max' compressed backward seeking support for now)
........
  r34054 | lordhoto | 2008-08-20 16:24:16 +0200 (Wed, 20 Aug 2008) | 4 lines
  
  - Committed Max' compressed save backseeking support from patch #2050337 "KYRA/SCUMM: Thumbnail support/improvement"
  - Extended SCUMM engine to support savegames without thumbnail header. (Increased savegame version to prevent saves to be loaded from older ScummVM versions)
  - Fixed KYRA to properly support savegames without thumbnail header.
........
  r34055 | lordhoto | 2008-08-20 16:30:40 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Committed patch #2055831 "KYRA: ResFileEntry parent cache optimization".
........
  r34057 | buddha_ | 2008-08-20 16:56:46 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Fix compilation: Changed 'not' to '!'.
........
  r34059 | buddha_ | 2008-08-20 17:06:26 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Added graphics/thumbnail.cpp and graphics/thumbnail.h to MSVC project files.
........
  r34060 | lordhoto | 2008-08-20 17:08:00 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Cleanup of thumbnail saving/loading code.
........
  r34061 | lordhoto | 2008-08-20 17:12:36 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Oops fix save loading after last commit.
........
  r34062 | buddha_ | 2008-08-20 17:17:35 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Removed already deleted file engines/scumm/thumbnail.cpp from MSVC project files.
........
  r34063 | buddha_ | 2008-08-20 17:58:52 +0200 (Wed, 20 Aug 2008) | 1 line
  
  Renamed graphics/scaler/thumbnail.cpp to thumbnail_intern.cpp. Fixes compiling under MSVC.
........
  r34064 | athrxx | 2008-08-20 18:14:10 +0200 (Wed, 20 Aug 2008) | 1 line
  
  tempo fix
........
  r34065 | buddha_ | 2008-08-20 19:31:35 +0200 (Wed, 20 Aug 2008) | 4 lines
  
  Fix font loading:
  Fixes bug #2058539: OS: Assert starting demo (regression).
  May possibly also fix bug #2019344: FW: crash with Amiga Italian version (photocopy room),
  but not sure about that because I couldn't reproduce the bug myself.
........
  r34067 | athrxx | 2008-08-20 21:57:57 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  - add support for Italian floppy version
  - more work on fm-towns music tempo
........
  r34072 | lordhoto | 2008-08-20 23:23:30 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Fixed warning.
........
  r34074 | lordhoto | 2008-08-20 23:28:59 +0200 (Wed, 20 Aug 2008) | 2 lines
  
  Committed patch from bug #2062926 "GCC 4.x versions not detected by configure script".
........
  r34076 | athrxx | 2008-08-21 00:38:36 +0200 (Thu, 21 Aug 2008) | 1 line
  
  KYRA: Towns/PC-98-Audio: fix bug where pitch wheel is processed twice instead of once
........
  r34078 | athrxx | 2008-08-21 04:17:52 +0200 (Thu, 21 Aug 2008) | 1 line
  
  KYRA: Towns/PC-98-Audio: tempo fix for output rates other than 44100 Hz
........
  r34079 | athrxx | 2008-08-21 14:04:55 +0200 (Thu, 21 Aug 2008) | 1 line
  
  KYRA: Towns/PC-98-Audio: increased precision for envelope generator timing and tempo when using "odd" output rates like 48 kHz or 8 kHz
........
  r34080 | peres001 | 2008-08-21 14:11:24 +0200 (Thu, 21 Aug 2008) | 1 line
  
  Removed unused code and structures, and a bit of cleanup.
........
  r34081 | buddha_ | 2008-08-21 16:14:33 +0200 (Thu, 21 Aug 2008) | 4 lines
  
  Fix for bug #2057619: FW: Glitches in title display of demo (regression).
  This fix doesn't seem to break other Future Wars versions like r34039 did.
  Some versions of TITRE.ANI use 15 for transparency color, others use 0.
  Previously only one of the choices was supported, now both are recognized.
........
  r34084 | buddha_ | 2008-08-21 16:43:03 +0200 (Thu, 21 Aug 2008) | 1 line
  
  Fix typo.
........
  r34086 | eriktorbjorn | 2008-08-21 16:52:55 +0200 (Thu, 21 Aug 2008) | 2 lines
  
  Fixed warning.
........
  r34087 | athrxx | 2008-08-21 20:24:52 +0200 (Thu, 21 Aug 2008) | 1 line
  
  KYRA: Towns/PC-98-Audio: fixed bug where notes for which the hold flag was set were turned off nonetheless
........
  r34089 | peres001 | 2008-08-22 02:19:12 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Implement transition when entering a new location for BRA. Not pixel-perfect, but... let's e happy about it.
........
  r34090 | Kirben | 2008-08-22 05:37:43 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Add another 3DO version of Fatty Bear's Birthday Surprise.
........
  r34093 | peres001 | 2008-08-22 08:32:12 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Fixed error in parsing.
........
  r34096 | fingolfin | 2008-08-22 13:17:12 +0200 (Fri, 22 Aug 2008) | 1 line
  
  code formatting cleanup
........
  r34097 | fingolfin | 2008-08-22 13:19:41 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Moved POSIXFilesystemNode class declaration to a new header file, to enable subclassing
........
  r34098 | fingolfin | 2008-08-22 13:36:47 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Turned Windows, AmigaOS and POSIX FSFactories into plain classes; no need for them to be singletons (actually true for all other FS factories)
........
  r34099 | fingolfin | 2008-08-22 13:41:14 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Symbian backend does not have to implement config file methods, as long as they are identical to those in the SDL backend...
........
  r34100 | fingolfin | 2008-08-22 13:45:29 +0200 (Fri, 22 Aug 2008) | 1 line
  
  SDL backend: Simplified openConfigFileForReading/openConfigFileForWriting impl; also init _fsFactory in constructor, as it is needed to load the config file
........
  r34101 | fingolfin | 2008-08-22 13:49:34 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Turned SymbianFilesystemFactory from a singleton into a normal class; adapted symbian backend accordingly
........
  r34102 | buddha_ | 2008-08-22 14:11:51 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Designate fix for bug #2057619 as a hack, as that's what it is.
........
  r34104 | Kirben | 2008-08-22 15:01:23 +0200 (Fri, 22 Aug 2008) | 1 line
  
  Remove warning about change of config file location under Windows, since it is frequently repeated (due to code restructures). The information is mentioned in the README anyway.
........
  r34107 | Kirben | 2008-08-23 08:09:30 +0200 (Sat, 23 Aug 2008) | 1 line
  
  Another French version Humongous Catalog and another English DOS version of Fatty Bear's Birthday Surprise.
........
  r34113 | drmccoy | 2008-08-23 16:18:12 +0200 (Sat, 23 Aug 2008) | 2 lines
  
  Fixing _itemsMap access (bug #2069177)
........
  r34116 | Kirben | 2008-08-24 09:48:44 +0200 (Sun, 24 Aug 2008) | 1 line
  
  Add more versions of HE games.
........
  r34119 | aquadran | 2008-08-24 09:54:36 +0200 (Sun, 24 Aug 2008) | 1 line
  
  remove broken code, but i'll add better feature into compression tool
........
  r34122 | sev | 2008-08-24 23:28:20 +0200 (Sun, 24 Aug 2008) | 2 lines
  
  Fix inventory.
........
  r34124 | sev | 2008-08-24 23:31:20 +0200 (Sun, 24 Aug 2008) | 3 lines
  
  Italian version now has properly translated verbs area as well as numerous
  fixes to object names. So new version of packet.005 was prepared.
........
  r34126 | sev | 2008-08-24 23:32:37 +0200 (Sun, 24 Aug 2008) | 2 lines
  
  Fixes for Italian strings thanks to glorfindel & co.
........
  r34128 | sev | 2008-08-24 23:34:03 +0200 (Sun, 24 Aug 2008) | 2 lines
  
  New drascula.dat with fixed Italian strings
........
  r34131 | wjpalenstijn | 2008-08-25 00:09:55 +0200 (Mon, 25 Aug 2008) | 1 line
  
  new tools
........
  r34132 | buddha_ | 2008-08-25 01:16:37 +0200 (Mon, 25 Aug 2008) | 3 lines
  
  Fix for bug #2055912: FW: incrustSprite fails on savegame loading.
  What little testing I did, this seems to work, but more testing
  would be nice.
........
  r34135 | peres001 | 2008-08-25 08:32:08 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Added workaround for bug 2070751, long standing issue with item matching exposed after revision 32873.
........
  r34138 | knakos | 2008-08-25 10:11:52 +0200 (Mon, 25 Aug 2008) | 1 line
  
  patch 1984130: Add Tremolo info
........
  r34141 | knakos | 2008-08-25 10:48:46 +0200 (Mon, 25 Aug 2008) | 1 line
  
  patch 1868881: ini option to disable doubletap rmb
........
  r34144 | peres001 | 2008-08-25 11:35:22 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Fixed regression: show mouse and enable input in NS Demo.
........
  r34146 | buddha_ | 2008-08-25 14:00:38 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Added a warning to bug #2055912's fix committed in revision 34132.
........
  r34149 | lordhoto | 2008-08-25 15:52:10 +0200 (Mon, 25 Aug 2008) | 2 lines
  
  Added short delay(Millis) call while waiting for text input, should reduce CPU usage a little bit.
........
  r34152 | thebluegr | 2008-08-25 16:55:11 +0200 (Mon, 25 Aug 2008) | 3 lines
  
  Fix for bug #2073159 - "MICKEY: Incomplete computer message".
  
  Random numbers are calculated from 1 onwards in the preAGI engines, but there was an off-by one error. I'm currently hesitant to add this fix to the 0.12.0 branch, as I'm unsure if it has any possible regressions in Troll's Tale or Winnie the Pooh
........
  r34153 | buddha_ | 2008-08-25 17:04:48 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Added Cinematique archive file unpacker and script disassembler to tools. NOT polished code so caveat emptor.
........
  r34154 | thebluegr | 2008-08-25 17:07:05 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Fix for bug #2062024 - "DRASCULA: Error talking with blind man"
........
  r34156 | buddha_ | 2008-08-25 17:14:20 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Added info about cine_tools to tools/README. Also added a couple of FIXMEs to the cine_tools files about missing endian safeness.
........
  r34157 | lordhoto | 2008-08-25 17:14:29 +0200 (Mon, 25 Aug 2008) | 2 lines
  
  Implemented continous screen updating while waiting for text input in v2 GUI. (based on LoK implementation)
........
  r34160 | thebluegr | 2008-08-25 17:58:45 +0200 (Mon, 25 Aug 2008) | 2 lines
  
  Fix for original game bug with the wall plug in chapter 5.
  Fixes bug #2059621 - DRASCULA: Plug bug
........
  r34163 | buddha_ | 2008-08-25 19:41:00 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Reverted revision 34156 and revision 34153 (extract_cine and decine got properly placed in revision 34162).
........
  r34164 | knakos | 2008-08-25 19:43:56 +0200 (Mon, 25 Aug 2008) | 1 line
  
  Update readme
........
  r34169 | eriktorbjorn | 2008-08-25 20:47:27 +0200 (Mon, 25 Aug 2008) | 5 lines
  
  Refined the workaround for wrongly compressed audio. If the sample rate is given
  as 11025 Hz, it should be 11840 Hz. However, a fixed version of compress_queen
  won't necessarily produce files with that sample rate, since LAME will resample
  the sounds to 12000 Hz. I.e. we can only override the rate if it's exactly 11025.
........
  r34173 | wjpalenstijn | 2008-08-25 21:22:16 +0200 (Mon, 25 Aug 2008) | 1 line
  
  package tools_gui as scummvm_tools_gui
........
  r34179 | thebluegr | 2008-08-26 09:48:19 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Cleanup
........
  r34180 | thebluegr | 2008-08-26 10:05:36 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Merged talk_vonBraun and talk_vonBraunpuerta
........
  r34181 | thebluegr | 2008-08-26 10:21:21 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Simplified several calls to copyBackground()
........
  r34182 | thebluegr | 2008-08-26 10:35:02 +0200 (Tue, 26 Aug 2008) | 2 lines
  
  talk_dr_grande -> talk_drascula_big
  talk_baul -> talk_trunk
........
  r34183 | thebluegr | 2008-08-26 12:59:59 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Removed some unneeded sanity checks that have been introduced with the latest cleanups
........
  r34184 | Kirben | 2008-08-26 13:15:01 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Add more versions of HE games.
........
  r34185 | peres001 | 2008-08-26 14:15:11 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Cleanup.
........
  r34186 | thebluegr | 2008-08-26 14:34:05 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Correct fix for bug #2073159 - "MICKEY: Incomplete computer message"
........
  r34187 | lordhoto | 2008-08-26 15:51:26 +0200 (Tue, 26 Aug 2008) | 2 lines
  
  Fixed typo. (Thanks to salty-horse for spotting it).
........
  r34188 | lordhoto | 2008-08-26 15:56:58 +0200 (Tue, 26 Aug 2008) | 2 lines
  
  And for all of those who love recompiling most of ScummVM... fixed typo properly :-P
........
  r34189 | thebluegr | 2008-08-26 16:26:43 +0200 (Tue, 26 Aug 2008) | 1 line
  
  Fix for bug #2057200 - "IHNM: Invisible inventory objects"
........
  r34190 | thebluegr | 2008-08-27 12:00:32 +0200 (Wed, 27 Aug 2008) | 1 line
  
  Document some animations
........
  r34191 | fingolfin | 2008-08-27 19:41:05 +0200 (Wed, 27 Aug 2008) | 1 line
  
  cleanup
........
  r34192 | fingolfin | 2008-08-27 20:21:03 +0200 (Wed, 27 Aug 2008) | 1 line
  
  Slightly cleaned up version of patch #2072006: Enhance OSystem_SDL::setupIcon
........
  r34193 | fingolfin | 2008-08-27 20:38:06 +0200 (Wed, 27 Aug 2008) | 1 line
  
  Slightly modified form of patch #2043093: OS/2 patches for posix-fs
........
  r34194 | fingolfin | 2008-08-27 20:52:21 +0200 (Wed, 27 Aug 2008) | 1 line
  
  Partial commit of patch #2012839: Atari Patch for adding Native MIDI and Fix Compile
........
  r34196 | fingolfin | 2008-08-27 21:29:41 +0200 (Wed, 27 Aug 2008) | 1 line
  
  Fix bug #2078922: DW: Pushing ESC repeatedly at beginning causes odd behavior
........
  r34197 | fingolfin | 2008-08-27 22:31:22 +0200 (Wed, 27 Aug 2008) | 1 line
  
  FSNode code: Merged most versions of lastPathComponent() into one new AbstractFilesystemNode::lastPathComponent() method, with customizable path separator character
........
  r34198 | fingolfin | 2008-08-27 22:41:28 +0200 (Wed, 27 Aug 2008) | 1 line
  
  Removed various uses of scumm_stricmp by the more readable String::equalsIgnoreCase and String:: compareToIgnoreCase
........
  r34200 | fingolfin | 2008-08-28 11:03:43 +0200 (Thu, 28 Aug 2008) | 1 line
  
  Some extra HashMap tests
........
  r34201 | fingolfin | 2008-08-29 11:44:05 +0200 (Fri, 29 Aug 2008) | 1 line
  
  Made out-of-memory error in SCUMM a bit more verbose
........
  r34205 | lordhoto | 2008-08-30 00:04:15 +0200 (Sat, 30 Aug 2008) | 1 line
  
  Updated msvc8 and msvc9 project files for latest FS changes.
........
  r34206 | peres001 | 2008-08-30 12:27:20 +0200 (Sat, 30 Aug 2008) | 1 line
  
  Moved mouse cursor loading/handling to Input class.
........
  r34208 | eriktorbjorn | 2008-08-30 14:54:54 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  Added a whitespace, just for salty-horse.
........
  r34209 | peres001 | 2008-08-30 17:49:54 +0200 (Sat, 30 Aug 2008) | 1 line
  
  Removed global g_system.
........
  r34210 | fingolfin | 2008-08-30 23:03:15 +0200 (Sat, 30 Aug 2008) | 1 line
  
  TINSEL: Added support for the 3,4 and 5 FLAGS (multi lingual) versions of DW (only 4 flags version has been tested; see also bug #2048383)
........
  r34211 | fingolfin | 2008-08-30 23:43:36 +0200 (Sat, 30 Aug 2008) | 1 line
  
  cleanup
........
  r34212 | fingolfin | 2008-08-30 23:51:13 +0200 (Sat, 30 Aug 2008) | 1 line
  
  TINSEL: Write config changes to disk
........
  r34213 | fingolfin | 2008-08-31 00:09:35 +0200 (Sun, 31 Aug 2008) | 1 line
  
  TINSEL: Remove some unused code; and duplicated the 4-FLAGS version detection entry (one copy for each language) for the user's convenience
........
  r34214 | fingolfin | 2008-08-31 00:10:48 +0200 (Sun, 31 Aug 2008) | 1 line
  
  TINSEL: The engine version is an integer, not a bitfield
........
  r34215 | fingolfin | 2008-08-31 00:16:59 +0200 (Sun, 31 Aug 2008) | 1 line
  
  cleanup
........
  r34216 | fingolfin | 2008-08-31 00:26:16 +0200 (Sun, 31 Aug 2008) | 1 line
  
  Fix (?) Solaris detection in some workaround code in the MT-32 emulator
........
  r34217 | drmccoy | 2008-08-31 01:59:46 +0200 (Sun, 31 Aug 2008) | 2 lines
  
  Added some The Last Dynasty stubs
........
  r34219 | peres001 | 2008-08-31 07:18:25 +0200 (Sun, 31 Aug 2008) | 1 line
  
  Uniformed the interface of Parallaction class (and its hierarchy) with regards of gui code, which is now independent of engine version.
........
  r34220 | peres001 | 2008-08-31 08:14:45 +0200 (Sun, 31 Aug 2008) | 1 line
  
  Moved save/load code into SaveLoad class.
........
  r34221 | peres001 | 2008-08-31 10:27:40 +0200 (Sun, 31 Aug 2008) | 1 line
  
  Removed extra semicolon detected by salty-horse pesky compiler.
........
  r34222 | peres001 | 2008-08-31 11:30:16 +0200 (Sun, 31 Aug 2008) | 2 lines
  
  Cleanup.
........
  r34223 | peres001 | 2008-08-31 12:24:32 +0200 (Sun, 31 Aug 2008) | 1 line
  
  More cleanup.
........
  r34224 | peres001 | 2008-08-31 12:43:32 +0200 (Sun, 31 Aug 2008) | 1 line
  
  Fixed leak with Input class, introduced in commit 34206.
........
  r34225 | drmccoy | 2008-08-31 13:37:07 +0200 (Sun, 31 Aug 2008) | 2 lines
  
  Shutting up a warning on systems where char is signed by default
........
  r34227 | peres001 | 2008-08-31 15:58:17 +0200 (Sun, 31 Aug 2008) | 4 lines
  
  * Added Archive, an interface for searching into file containers.
  * Added FSDirectory, an Archive implementation that models a directory from the filesystem.
  * Added SearchSet, an Archive implementation that allows searching multiple Archives.
  See patch 2034983 on sf.net.
........
  r34228 | fingolfin | 2008-08-31 17:30:07 +0200 (Sun, 31 Aug 2008) | 1 line
  
  Fix warnings
........
  r34234 | lordhoto | 2008-09-01 01:11:55 +0200 (Mon, 01 Sep 2008) | 2 lines
  
  Added newly added archive.cpp to the build system, just in case someone wants to play with the code and wonders about errors while linking.
........
  r34235 | thebluegr | 2008-09-01 12:07:48 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Updated all MSVC project files with the latest changes to the code (gob and parallaction engines and the file system)
........
  r34236 | thebluegr | 2008-09-01 12:09:48 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Silence MSVC warning about potentially uninitialized variable
........
  r34237 | fingolfin | 2008-09-01 12:54:03 +0200 (Mon, 01 Sep 2008) | 1 line
  
  New Queue class, from RTL branch
........
  r34239 | lordhoto | 2008-09-01 17:39:48 +0200 (Mon, 01 Sep 2008) | 2 lines
  
  Fixed warnings.
........
  r34240 | lordhoto | 2008-09-01 18:52:09 +0200 (Mon, 01 Sep 2008) | 3 lines
  
  - Added tests for newly added Common::Queue
  - Changed Common::Queue::front and Common::Queue::back to return references instead of values
........
  r34241 | fingolfin | 2008-09-01 19:30:03 +0200 (Mon, 01 Sep 2008) | 1 line
  
  First part of GSoC2008 RTL branch merge
........
  r34242 | fingolfin | 2008-09-01 19:46:05 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: AGI
........
  r34243 | fingolfin | 2008-09-01 19:46:53 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: AGOS
........
  r34244 | fingolfin | 2008-09-01 19:47:36 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: CINE
........
  r34245 | fingolfin | 2008-09-01 19:50:00 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: GOB
........
  r34246 | fingolfin | 2008-09-01 19:52:50 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: KYRA
........
  r34247 | fingolfin | 2008-09-01 19:55:52 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: QUEEN
........
  r34248 | lordhoto | 2008-09-01 20:14:55 +0200 (Mon, 01 Sep 2008) | 2 lines
  
  Cleanup.
........
  r34249 | lordhoto | 2008-09-01 20:26:28 +0200 (Mon, 01 Sep 2008) | 2 lines
  
  Formatting.
........
  r34251 | fingolfin | 2008-09-01 22:18:17 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: LURE
........
  r34252 | fingolfin | 2008-09-01 22:19:28 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: SAGA
........
  r34253 | fingolfin | 2008-09-01 22:20:20 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: SCUMM
........
  r34254 | fingolfin | 2008-09-01 22:20:57 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: SKY
........
  r34255 | fingolfin | 2008-09-01 22:21:30 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: SWORD1
........
  r34256 | fingolfin | 2008-09-01 22:21:53 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: SWORD2
........
  r34257 | fingolfin | 2008-09-01 22:22:10 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: TINSEL
........
  r34258 | fingolfin | 2008-09-01 22:22:29 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: TOUCHE
........
  r34259 | athrxx | 2008-09-01 22:23:25 +0200 (Mon, 01 Sep 2008) | 1 line
  
  - kyra: fm-towns/pc-98 audio: restructured  driver, added rhythm channel data
........
  r34260 | fingolfin | 2008-09-01 22:31:44 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Clarified some comments
........
  r34261 | fingolfin | 2008-09-01 22:41:43 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Clarified clarification ;)
........
  r34262 | fingolfin | 2008-09-01 23:06:32 +0200 (Mon, 01 Sep 2008) | 1 line
  
  Document each MetaEngineFeature (instead of listing just 'examples'). Wording could be better, feel free to improve it
........
  r34263 | fingolfin | 2008-09-01 23:13:11 +0200 (Mon, 01 Sep 2008) | 1 line
  
  TINSEL: Enabled listSaves support
........
  r34264 | fingolfin | 2008-09-01 23:30:38 +0200 (Mon, 01 Sep 2008) | 1 line
  
  cleanup
........
  r34265 | thebluegr | 2008-09-02 01:36:59 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Silence MSVC warning about empty switch statement
........
  r34266 | thebluegr | 2008-09-02 01:37:24 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Silence MSVC warning about empty switch statement
........
  r34267 | joostp | 2008-09-02 02:31:27 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  fix Virgin logo screen breakage that was introduced in the RTL merge
........
  r34268 | peres001 | 2008-09-02 03:58:55 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Merging more of the GSoC 2008 RTL branch: PARALLACTION
........
  r34269 | thebluegr | 2008-09-02 09:32:09 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Added new files to the MSVC projects (engines/dialogs.* and common/queue.h)
........
  r34270 | thebluegr | 2008-09-02 09:59:52 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Changed the MSVC optimization settings for the release version of all current engines, according to the settings proposed in patch #1877032 - "better optimization settings for msvc9". SSE has NOT been enabled by default though, as it's not available under 64-bit platforms. Updated the MSVC 8 -> MSVC 7/7.1 batch file accordingly
........
  r34271 | thebluegr | 2008-09-02 10:02:40 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Added the missing tinsel engine project files for MSVC 7/7.1
........
  r34272 | fingolfin | 2008-09-02 13:32:38 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Added two new global funcs which ease proper handling of 'path' strings: Common::lastPathComponent() and Common::normalizePath()
........
  r34273 | fingolfin | 2008-09-02 13:34:12 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Revised HashMap implementation
........
  r34274 | thebluegr | 2008-09-02 13:42:15 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Enabled the new optimizations for older versions of MSVC as well
  Also, included the tinsel engine library for the release version as well (fixes compilation of the release version)
........
  r34275 | lordhoto | 2008-09-02 15:05:43 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Added missing include.
........
  r34276 | lordhoto | 2008-09-02 15:11:54 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Handle OSystem::lockScreen fail in default OSystem::clearScreen implementation.
........
  r34277 | lordhoto | 2008-09-02 15:13:02 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Updated NULL backend for FS changes.
........
  r34278 | lordhoto | 2008-09-02 15:16:51 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Fixed copy&paste error when checking y and h of a widget on layout change.
........
  r34279 | lordhoto | 2008-09-02 15:17:40 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Fake 320x200 resolution instead of 200x320.
........
  r34281 | lordhoto | 2008-09-02 15:27:26 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Applied my patch from -devel, which reenables GMM opening via F6.
........
  r34282 | lordhoto | 2008-09-02 16:36:47 +0200 (Tue, 02 Sep 2008) | 4 lines
  
  Cleanup: Remove now unneeded KyraEngine_v1::quitGame.
  
  Peres proposal for this commit log was: 'fixing .... as peres pointed out in his very interesting mail on -devel that everybody should read'.
........
  r34283 | fingolfin | 2008-09-02 17:19:31 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Modified POSIX FSNode implementation to use Common::normalizePath & Common::lastPathComponent; added a TODO regarding relative paths
........
  r34284 | fingolfin | 2008-09-02 18:35:16 +0200 (Tue, 02 Sep 2008) | 1 line
  
  Change FilesystemNode::getChild to new desired behavior: namely, that it should return valid nodes even for names for which no child exists (yet?) -- mail to scummvm-devel pending
........
  r34286 | drmccoy | 2008-09-02 22:15:42 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Urban Runner stubs
........
  r34287 | drmccoy | 2008-09-02 23:29:06 +0200 (Tue, 02 Sep 2008) | 2 lines
  
  Added French Bargon Attack, as supplied by kizkoool in bugreport #2089734
........
  r34288 | athrxx | 2008-09-02 23:31:53 +0200 (Tue, 02 Sep 2008) | 1 line
  
  some minor bug fixes
........
  r34290 | Kirben | 2008-09-03 03:47:01 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Add Nintendo Wii versions of Freddi Fish 1 and Pajama Sam 1.
........
  r34291 | Kirben | 2008-09-03 04:06:11 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Add another Dutch demo of Pajama Sam 1.
........
  r34292 | thebluegr | 2008-09-03 09:32:59 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Updated gob MSVC project files for commit #34286
........
  r34293 | fingolfin | 2008-09-03 10:57:39 +0200 (Wed, 03 Sep 2008) | 1 line
  
  If launching scummvm with no game selected, clear the transient domain (and hence the effect of all command line args) before opening the launcher (may cause regressions)
........
  r34294 | fingolfin | 2008-09-03 10:58:19 +0200 (Wed, 03 Sep 2008) | 1 line
  
  In the launcher load dialog code, store the save_slot in the transient domain (fixing bug #2089740)
........
  r34295 | thebluegr | 2008-09-03 11:03:21 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Cleanup
........
  r34296 | thebluegr | 2008-09-03 11:55:29 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Silence MSVC warning about ambiguous usage of CLIP
........
  r34297 | thebluegr | 2008-09-03 11:58:28 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Commented out currently broken code, adding a FIXME
........
  r34298 | thebluegr | 2008-09-03 12:00:43 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Silence MSVC warning about uninitialized variables
........
  r34299 | thebluegr | 2008-09-03 12:10:45 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Fix for MSVC warning about ambiguous usage of MIN
........
  r34300 | fingolfin | 2008-09-03 12:11:36 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Added new StdioStream class, a thin wrapper around FILE
........
  r34301 | fingolfin | 2008-09-03 12:40:46 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Added new AbstractFilesystemNode::openForReading & ::openForWriting method, based on StdioStream; changed FilesystemNode to use them
........
  r34302 | fingolfin | 2008-09-03 13:22:51 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Moved FilesystemNode / FSList to namespace Common; also got rid of some 'typedef Common::String String;' name aliases
........
  r34303 | fingolfin | 2008-09-03 13:49:02 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Moved StdioStream to its own files inside backends
........
  r34304 | fingolfin | 2008-09-03 14:56:46 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Pushed AbstractFilesystemNode::openForReading() / openForWriting() impls out to backends
........
  r34305 | Kirben | 2008-09-03 15:49:24 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Added more versions of HE games.
........
  r34306 | thebluegr | 2008-09-03 16:06:54 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Updated MSVC project files for commit #34303
........
  r34307 | fingolfin | 2008-09-03 16:55:19 +0200 (Wed, 03 Sep 2008) | 1 line
  
  POSIX FSNode: got rid of Double-slashes in paths for childs of the root; simplified code
........
  r34308 | fingolfin | 2008-09-03 17:22:19 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Some cleanup by peres
........
  r34309 | fingolfin | 2008-09-03 17:58:40 +0200 (Wed, 03 Sep 2008) | 1 line
  
  TODO: bdf_getline seems to duplicate code from SeekableReadStream::readLine(_new) -> fix that
........
  r34310 | fingolfin | 2008-09-03 18:56:40 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Moved check for shouldRTL() from engines to scummvm_main
........
  r34311 | fingolfin | 2008-09-03 19:06:24 +0200 (Wed, 03 Sep 2008) | 1 line
  
  clarified comment
........
  r34312 | fingolfin | 2008-09-03 19:07:13 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Changed Archive::openFile to return a SeekableReadStream* instead of a FilePtr
........
  r34313 | fingolfin | 2008-09-03 19:39:18 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Modified Common::Str to use exponential growth for its storage; also changed the meaning of 'capacity' from 'max length of string' to 'size of storage' (i.e. added one)
........
  r34314 | fingolfin | 2008-09-03 19:46:42 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Removed unused readLine code from the MT-32 emu
........
  r34315 | fingolfin | 2008-09-03 19:53:25 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Renamed SeekableReadStream::readLine to SeekableReadStream::readLine_OLD; added a new alternate SeekableReadStream::readLine() instead
........
  r34316 | fingolfin | 2008-09-03 20:07:31 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Fixed Stream::readLine implementation to match its doxygen comment
........
  r34317 | fingolfin | 2008-09-03 20:38:01 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Fix nasty off-by-one errors
........
  r34318 | fingolfin | 2008-09-03 20:40:49 +0200 (Wed, 03 Sep 2008) | 1 line
  
  Changed some code to use the new Stream::readLine() method
........
  r34319 | lordhoto | 2008-09-03 21:07:38 +0200 (Wed, 03 Sep 2008) | 2 lines
  
  Minor formatting cleanup.
........
  r34320 | mthreepwood | 2008-09-03 23:37:19 +0200 (Wed, 03 Sep 2008) | 1 line
  
  correct a typo (thanks to salty-horse)
........
  r34323 | Kirben | 2008-09-04 10:11:35 +0200 (Thu, 04 Sep 2008) | 1 line
  
  Correct HE version for Wii version of Freddi Fish 1.
........
  r34324 | joostp | 2008-09-04 10:16:39 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  remove deprecated SCUMMVM_SAVEPATH define -- pass default savepath to DefaultSaveFileManager ctor
........
  r34326 | joostp | 2008-09-04 10:34:02 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  move save directory detection/creation from main() to OSystem_PSP::initBackend()
........
  r34328 | Kirben | 2008-09-04 16:12:27 +0200 (Thu, 04 Sep 2008) | 1 line
  
  Add missing case in o100_resourceRoutines.
........
  r34329 | drmccoy | 2008-09-04 19:39:22 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  Ooops, adding Lost in Time and Woodruff
........
  r34332 | drmccoy | 2008-09-04 21:20:51 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  Added another version of Lost in Time CD, as supplied by SiRoCs in bug report #2093672
........
  r34334 | fingolfin | 2008-09-04 22:03:08 +0200 (Thu, 04 Sep 2008) | 1 line
  
  Changed FSDirectory::getSubDirectory to return a FSDirectory pointer instead of a SharedPtr
........
  r34336 | eriktorbjorn | 2008-09-04 23:40:32 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  Use readLine() instead of readLine_OLD().
........
  r34338 | anotherguest | 2008-09-05 13:06:27 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Updated buildscripts to support tinsel
........
  r34339 | anotherguest | 2008-09-05 13:09:29 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Updated package revision no to 0.13. Updated default engine list
........
  r34340 | anotherguest | 2008-09-05 13:31:51 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Updated Symbian OS file actions with ferror and fflush.
........
  r34343 | peres001 | 2008-09-05 13:41:39 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Removed useless dependencies from common/file.h in common code. When complete removal was not possibile, dependency has been pushed to the cpp files from the headers.
........
  r34344 | anotherguest | 2008-09-05 13:55:58 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Added two new files
........
  r34345 | fingolfin | 2008-09-05 13:59:33 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Ported AMIGA specific file buffering 'hack' from class File to StdioStream
........
  r34346 | anotherguest | 2008-09-05 14:02:15 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Updated filehandling for Symbian OS
........
  r34347 | anotherguest | 2008-09-05 14:30:19 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Updated build script with new dialog.cpp
........
  r34348 | anotherguest | 2008-09-05 14:53:43 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Still need to get that build working. Readjust buildscript
........
  r34349 | thebluegr | 2008-09-05 15:02:03 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Hopefully fixed the chaos with the SAGA volume values. This also fixes the broken volume introduced with the introduction of the RTL code in the engine
........
  r34350 | anotherguest | 2008-09-05 15:03:31 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Add missing dialogs.cpp
........
  r34351 | anotherguest | 2008-09-05 15:13:51 +0200 (Fri, 05 Sep 2008) | 1 line
  
  ADded Tinsel as supported engine strings
........
  r34352 | Kirben | 2008-09-05 15:35:27 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Use exact case numbers, to avoid unneeded subtractions.
........
  r34353 | anotherguest | 2008-09-05 16:11:23 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Enum needs to be minimum four chars to compile (32 bit number I guess)
........
  r34356 | fingolfin | 2008-09-05 19:23:44 +0200 (Fri, 05 Sep 2008) | 1 line
  
  whitespace 'fix'
........
  r34357 | eriktorbjorn | 2008-09-05 19:34:38 +0200 (Fri, 05 Sep 2008) | 2 lines
  
  Set the date for 0.12.0.
........
  r34359 | peres001 | 2008-09-05 20:24:41 +0200 (Fri, 05 Sep 2008) | 2 lines
  
  * Implemented a default matchPattern for Archive subclasses (courtesy of Fingolfin).
  * Fixed bug in FSDirectory::matchPattern.
........
  r34360 | peres001 | 2008-09-05 20:28:25 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Made FSDirectory use the default matchPattern implementation.
........
  r34361 | anotherguest | 2008-09-05 20:45:04 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Remove usage of main_features.inl and the file
........
  r34362 | anotherguest | 2008-09-05 20:49:13 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Change location of create fs factory for Symbian!
........
  r34363 | anotherguest | 2008-09-05 21:03:30 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Add symbian implementations to create read/write configfile handles
........
  r34364 | fingolfin | 2008-09-05 22:07:34 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Moved matchString from util.* to str.*; added new String::matchString method; fixed matchString doxygen comment (it confused pattern & string); added unit tests for matchString
........
  r34365 | fingolfin | 2008-09-05 22:08:29 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Make use of String::matchString
........
  r34366 | fingolfin | 2008-09-05 22:26:36 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Fix class FSDirectory (matchPattern would call getAllNames would call matchPattern would call ...); some cleanup
........
  r34367 | fingolfin | 2008-09-05 22:29:03 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Optimized matchString for the common case where there is a trailing * (if that is the case, abort immediately instead of scanning the rest of the string)
........
  r34368 | fingolfin | 2008-09-05 22:42:41 +0200 (Fri, 05 Sep 2008) | 1 line
  
  Some tweaks to help (?) OS/2
........
  r34369 | wjpalenstijn | 2008-09-05 22:53:30 +0200 (Fri, 05 Sep 2008) | 1 line
  
  additional Common::String tests
........
  r34370 | fingolfin | 2008-09-06 00:12:46 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Added simple ZipArchive class, and changed some GUI code to use it, instead of the ugly C API to the unzip code
........
  r34371 | fingolfin | 2008-09-06 00:14:43 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Updated some copyright strings to 2001-2008
........
  r34373 | fingolfin | 2008-09-06 00:16:29 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Added Chris to credits
........
  r34375 | Kirben | 2008-09-06 03:02:45 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Add debugInput opcode for HE 100 games.
........
  r34378 | Kirben | 2008-09-06 09:03:38 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Add Wii version of SPY Fox 1.
........
  r34381 | thebluegr | 2008-09-06 10:37:03 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Added missing common/archive.*
........
  r34382 | anotherguest | 2008-09-06 12:30:05 +0200 (Sat, 06 Sep 2008) | 2 lines
  
  Portdefs cleanup, use snprintf from SDL and not sprintf (Which can cause memory overwrites). 
  Use bsearch implementation from WINCE port.
........
  r34384 | fingolfin | 2008-09-06 18:46:28 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Added some unit tests for Stream::readLine_NEW, and clarified that readLine_NEW is essentially fgets in disguise
........
  r34385 | fingolfin | 2008-09-06 19:00:50 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Unlike ferror, our Stream::ioFailed() is also supposed to return true when the end of stream has been reached
........
  r34389 | fingolfin | 2008-09-06 22:34:21 +0200 (Sat, 06 Sep 2008) | 1 line
  
  ScummFile: Don't use the File::_ioFailed flag, rather track the io status separately;  also, changed eof() -> eos()
........
  r34390 | fingolfin | 2008-09-06 22:36:47 +0200 (Sat, 06 Sep 2008) | 1 line
  
  MT32 emu: eof -> eos
........
  r34391 | fingolfin | 2008-09-06 22:49:48 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Switched class File & DumpFile to use StdioStream internally
........
  r34393 | fingolfin | 2008-09-06 23:04:42 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Removed last traces of fopen / FILE from common/file.cpp
........
  r34394 | fingolfin | 2008-09-06 23:09:34 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Clarified / fixed some Common::Archive doxygen comments
........
  r34396 | fingolfin | 2008-09-06 23:23:08 +0200 (Sat, 06 Sep 2008) | 1 line
  
  Got rid of File::eof()
........
  r34397 | lordhoto | 2008-09-07 00:09:34 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Added hasArchive to SearchSet.
........
  r34399 | anotherguest | 2008-09-07 12:57:28 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Remove symbian defines from stdiostream.cpp
........
  r34400 | anotherguest | 2008-09-07 14:37:14 +0200 (Sun, 07 Sep 2008) | 1 line
  
  StdioStream implemented with Symbian file handling.
........
  r34401 | anotherguest | 2008-09-07 14:38:35 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Updated to include SymbianStream instead of StdioStream
........
  r34402 | anotherguest | 2008-09-07 14:39:56 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Need to have own implementation of snprintf and vsnprintf.
........
  r34403 | anotherguest | 2008-09-07 14:54:26 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Remove SYMBIAN special handing from default handler.
........
  r34404 | drmccoy | 2008-09-07 15:16:58 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Added another demo version of Gobliiins (bug #2098412)
........
  r34405 | anotherguest | 2008-09-07 15:17:21 +0200 (Sun, 07 Sep 2008) | 1 line
  
  H file cleanup, remove old vibra support
........
  r34407 | anotherguest | 2008-09-07 15:40:30 +0200 (Sun, 07 Sep 2008) | 3 lines
  
  Updated readme about usage of snprintf source
  Added vsnprintf implementation.
  Cleanout SymbianOS.cpp from old file functions.
........
  r34408 | fingolfin | 2008-09-07 17:16:45 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Temporary workaround for bug #2098279: ALL: Game path with no trailing backslash fails
........
  r34409 | drmccoy | 2008-09-07 17:21:52 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Clipping setMousePos() parameters to sane values
........
  r34411 | drmccoy | 2008-09-07 17:29:47 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Actually, /now/ the values are sane ^^; (also fixes Ween mouse position bug #2046244)
........
  r34413 | drmccoy | 2008-09-07 17:39:06 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Added a spanish floppy version of Gob3, as supplied by SiRoCs in bug report #2098621
........
  r34415 | drmccoy | 2008-09-07 18:27:04 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Added polish version of Woodruff, as supplied by goodoldgeorg in bug report #2098838
........
  r34417 | anotherguest | 2008-09-07 18:43:03 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Set default save path via save manager.
  Fix bug in symbian-fs GetChild function.
........
  r34418 | anotherguest | 2008-09-07 20:28:58 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Updated with two new variations, scumm and brokensword
........
  r34419 | anotherguest | 2008-09-07 20:30:07 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Slightly updated built script. Faster?
........
  r34420 | sev | 2008-09-07 20:36:40 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Generate drascula.dat by the latest create_drascula
........
  r34423 | anotherguest | 2008-09-07 21:19:45 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Symbian already store all paths with a trailing "\". 
  Quick fix waiting for proper solution
........
  r34424 | fingolfin | 2008-09-07 23:30:55 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Added new OSystem method addSysArchivesToSearchSet() [better name pending, suggestions welcome]
........
  r34425 | fingolfin | 2008-09-07 23:38:53 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Comment out some #defines in skydefs.h as they conflict with other headers (esp. T2 conflicts with some template defs)
........
  r34426 | fingolfin | 2008-09-07 23:43:36 +0200 (Sun, 07 Sep 2008) | 1 line
  
  added two FIXMEs to M4 -- somehow, adding two subdirs of CWD named 'goodstuf' and 'resource' to the list of default dirs doesn't sound very sensible to me ;)
........
  r34428 | lordhoto | 2008-09-07 23:46:37 +0200 (Sun, 07 Sep 2008) | 2 lines
  
  Moved Kyra resource code to a SearchSet/Archive based implementation, this removes dependencies on Common::File.
........
  r34429 | fingolfin | 2008-09-07 23:47:01 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Allow invoking FilesystemNode::getChild on non-dir nodes, by returning an invalid node in that case
........
  r34430 | fingolfin | 2008-09-07 23:47:46 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Made File::addDefaultDirectory(Recursive) ignore FSNodes which are not dirs / are invalid, instead of erroring out
........
  r34431 | fingolfin | 2008-09-07 23:51:59 +0200 (Sun, 07 Sep 2008) | 1 line
  
  oops
........
  r34432 | fingolfin | 2008-09-07 23:59:25 +0200 (Sun, 07 Sep 2008) | 1 line
  
  Add a priority param to OSystem::addSysArchivesToSearchSet (still in search for a better name ;)
........
  r34433 | fingolfin | 2008-09-08 00:00:04 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Fix warning about missing virtual destructor
........
  r34434 | fingolfin | 2008-09-08 00:10:58 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Replaced Engine::_gameDataPath (a String) by Engine::_gameDataDir (an FSNode); adapted code to that (by using getChild() to get subdirs, not string concatenation
........
  r34435 | lordhoto | 2008-09-08 00:30:34 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Got rid of all Common::File usages in Kyra.
........
  r34436 | lordhoto | 2008-09-08 00:35:13 +0200 (Mon, 08 Sep 2008) | 2 lines
  
  - Fixed regression in Resource::unloadPakFile
  - Changed priority value for OSystem::addSysArchivesToSearchSet call
........
  r34437 | fingolfin | 2008-09-08 00:37:27 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Changed md5_file(FSNode) to use FSNode::openForReading
........
  r34438 | lordhoto | 2008-09-08 00:41:57 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Changed priorities for search paths. (Just in case system specific data paths contain an outdated kyra.dat version)
........
  r34440 | thebluegr | 2008-09-08 10:07:06 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Cleanup
........
  r34441 | thebluegr | 2008-09-08 10:09:22 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Added kyra/resource_intern.* to the kyra MSVC project files
........
  r34442 | thebluegr | 2008-09-08 10:26:54 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Free the current voice lookup table a bit earlier in loadGlobalResources()
........
  r34443 | thebluegr | 2008-09-08 12:36:53 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Reduced calls to File::exists()
........
  r34444 | fingolfin | 2008-09-08 13:11:32 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Switched File::open, File::addDefaultDirectory to use a SearchSet internally. Code is a lot shorter & simpler now, far less failing fopen calls (good for NDS and other ports); drawback: regressions :). Good bug hunting to everybody
........
  r34445 | thebluegr | 2008-09-08 13:45:15 +0200 (Mon, 08 Sep 2008) | 1 line
  
  decompiler.cpp is not used anywhere by default. Remove it to prevent a warning under MSVC that the object file is empty (since DUMP_SCRIPT is not defined by default, the whole code in this file is not used)
........
  r34446 | thebluegr | 2008-09-08 13:57:49 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Changed WarnAsError to be true across all engines, in both debug and release builds
........
  r34447 | thebluegr | 2008-09-08 14:38:55 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Removed some unneeded conversions from the MSVC8->MSVC7/7.1 conversion tool
........
  r34448 | thebluegr | 2008-09-08 15:00:43 +0200 (Mon, 08 Sep 2008) | 5 lines
  
  Some more unification of options:
  - AdditionalIncludeDirectories is set to "../../;../../engines"
  - InlineFunctionExpansion is set to "0" for debug and "2" for release builds
  - DisableLanguageExtensions is set to "false" (disabling language extensions leads to some very weird errors)
  - Detect64BitPortabilityProblems is set to "false", as setting it to "true" throws loads of warnings too (mainly related to strlen, when trying to store its result in an integer)
........
  r34449 | thebluegr | 2008-09-08 16:00:26 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Don't use fileName both as a structure and as a function parameter
........
  r34450 | peres001 | 2008-09-08 16:38:07 +0200 (Mon, 08 Sep 2008) | 1 line
  
  Made searching the game path recursive (with the default depth of 4 levels). This is a temporary fix to make some games work, until we decide what to do with the file/directory searching.
........
  r34451 | lordhoto | 2008-09-08 20:48:39 +0200 (Mon, 08 Sep 2008) | 2 lines
  
  Fixed LoL file loading regression.
........
  r34452 | lordhoto | 2008-09-08 20:55:29 +0200 (Mon, 08 Sep 2008) | 2 lines
  
  Made some filenames uppercase for consistency.
........
  r34453 | anotherguest | 2008-09-08 23:54:04 +0200 (Mon, 08 Sep 2008) | 2 lines
  
  Updated/Fixed Symbian Filesystem handling.
  Does not store ending backslash on path, and will list any sub folder properly, by adding '\' when needed.
........
  r34454 | athrxx | 2008-09-08 23:57:38 +0200 (Mon, 08 Sep 2008) | 1 line
  
  HOF: msvc8 compile fix (ARRAYSIZE used with run-time allocated array)
........
  r34456 | peres001 | 2008-09-09 01:24:20 +0200 (Tue, 09 Sep 2008) | 1 line
  
  Documented commit 34450 (game path searched recursively).
........
  r34457 | thebluegr | 2008-09-09 08:47:41 +0200 (Tue, 09 Sep 2008) | 1 line
  
  Fix for bug #2101083 - "ANY - MSVC71 compilation fails due to warnings-as-errors"
........
  r34458 | thebluegr | 2008-09-09 09:05:47 +0200 (Tue, 09 Sep 2008) | 1 line
  
  Committed patch #2100962 - "Saga engine reduced memory usage"
........
  r34460 | thebluegr | 2008-09-09 13:20:34 +0200 (Tue, 09 Sep 2008) | 1 line
  
  Cleanup. Simplified converse()
........
  r34462 | thebluegr | 2008-09-09 14:57:12 +0200 (Tue, 09 Sep 2008) | 1 line
  
  Cleanup
........
  r34463 | thebluegr | 2008-09-09 14:57:57 +0200 (Tue, 09 Sep 2008) | 1 line
  
  Cleanup of exitRoom()
........
  r34464 | thebluegr | 2008-09-09 17:59:06 +0200 (Tue, 09 Sep 2008) | 4 lines
  
  - Cleanup and simplification
  - Moved several simple animations out of animation.cpp
  - Moved some animations with talk sequences inside drascula.dat
  - A new version of drascula.dat is needed (will be uploaded shortly)
........
  r34465 | thebluegr | 2008-09-09 17:59:52 +0200 (Tue, 09 Sep 2008) | 1 line
  
  New version of the create_drascula tool
........
  r34466 | thebluegr | 2008-09-09 18:00:28 +0200 (Tue, 09 Sep 2008) | 1 line
  
  New version of drascula.dat
........
  r34467 | lordhoto | 2008-09-09 20:09:46 +0200 (Tue, 09 Sep 2008) | 2 lines
  
  Changed static resource code to use Streams instead of operating on buffers.
........
  r34468 | thebluegr | 2008-09-10 08:57:32 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Fix in the Igor engine for bug #2101083 - "ANY - MSVC71 compilation fails due to warnings-as-errors"
........
  r34469 | thebluegr | 2008-09-10 08:59:55 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Fix for bug #2102828 - "AGOS - compilation error, uninitialized variable"
........
  r34472 | thebluegr | 2008-09-10 10:25:12 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Reduced game memory usage by about 400KB by only loading the current language strings, not all strings
........
  r34474 | fingolfin | 2008-09-10 11:20:38 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Small fix to help with compile problems on Amiga
........
  r34479 | thebluegr | 2008-09-10 14:03:42 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Merged all the methods to assign and set default palettes
........
  r34480 | thebluegr | 2008-09-10 15:06:40 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Removed the unused variable changeColor
........
  r34481 | lordhoto | 2008-09-10 20:01:02 +0200 (Wed, 10 Sep 2008) | 2 lines
  
  Cleanup.
........
  r34483 | vinterstum | 2008-09-10 21:46:08 +0200 (Wed, 10 Sep 2008) | 1 line
  
  Merged up iPhone backend changes from 0.12 to trunk
........
  r34484 | lordhoto | 2008-09-10 22:47:58 +0200 (Wed, 10 Sep 2008) | 2 lines
  
  Cleanup.
........
  r34485 | fingolfin | 2008-09-11 11:25:13 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Simplify check for a slash in the string *g*
........
  r34486 | fingolfin | 2008-09-11 11:26:27 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Added detection for 4-language floppy version of DW (see report on forum post 39703)
........
  r34487 | fingolfin | 2008-09-11 11:28:14 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Remove obsolete note about fopen
........
  r34488 | thebluegr | 2008-09-11 11:31:45 +0200 (Thu, 11 Sep 2008) | 5 lines
  
  - The game's cursor is now handled via ScummVM's cursor manager, instead of the game itself (this means that there might be regressions where the cursor is visible when it shouldn't be)
  - Removed the textSurface pointer, which was used in the Spanish version. Non-Spanish versions of the game hold the font data in the tableSurface buffer (which contains picture 96). The font data for Spanish versions is in picture 974. Now both versions load their font data from the tableSurface buffer
  - hay_que_load -> loadedDifferentChapter
  - Merged withoutVerb() and selectVerb()
  This is a big change, it might lead to regressions!
........
  r34489 | thebluegr | 2008-09-11 11:33:15 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Fixed the hotspot for the crosshair cursor
........
  r34490 | thebluegr | 2008-09-11 11:37:42 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Cleanup
........
  r34491 | thebluegr | 2008-09-11 14:04:45 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Code optimizations from Fingolfin
........
  r34492 | peres001 | 2008-09-11 15:24:01 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Added first version of the SearchManager, as it is presented in patch tracker item 2093502.
........
  r34493 | thebluegr | 2008-09-11 16:49:04 +0200 (Thu, 11 Sep 2008) | 5 lines
  
  - Merged openDoor() and closeDoor()
  - Cleaned up updateDoor()
  - Bugfixes to exitRoom() and gotoObject()
  - Moved cursor-related functions to interface.cpp
  - alapuertakeva -> roomExits
........
  r34494 | thebluegr | 2008-09-11 17:35:56 +0200 (Thu, 11 Sep 2008) | 1 line
  
  Cleanup
........
  r34495 | lordhoto | 2008-09-11 21:47:45 +0200 (Thu, 11 Sep 2008) | 2 lines
  
  Committed my patch #2105593 "Launcher/MetaEngine: Finnished removeSaveState".
........
  r34496 | lordhoto | 2008-09-11 22:20:02 +0200 (Thu, 11 Sep 2008) | 4 lines
  
  - Moved delete confirm dialog to SaveLoadChooser, allows the user to check which save he was trying to delete
  - Cleaned up the SaveLoadChooser / Launcher code
   -> Should reduce memory usage a little bit
........
  r34497 | lordhoto | 2008-09-11 22:34:46 +0200 (Thu, 11 Sep 2008) | 2 lines
  
  Little more cleanup.
........
  r34498 | anotherguest | 2008-09-11 23:32:40 +0200 (Thu, 11 Sep 2008) | 3 lines
  
  Added SymbianStream.h for SymbianStdioStream definition
  Renamed Symbian stream implementation to
  SymbianStdioStream instead of StdioStream.
........
  r34501 | Kirben | 2008-09-12 03:28:28 +0200 (Fri, 12 Sep 2008) | 1 line
  
  Fix compiling under mingw, when using latest mingw-runtime (3.15).
........
  r34502 | lordhoto | 2008-09-12 14:25:56 +0200 (Fri, 12 Sep 2008) | 2 lines
  
  Fixed slot 0 savefile name in Kyra3. (Now using 'New game' instead of 'German')
........
  r34503 | thebluegr | 2008-09-12 14:54:16 +0200 (Fri, 12 Sep 2008) | 5 lines
  
  - Moved more animation data inside drascula.dat
  - Merged copyRect and copyRectClip
  - Added enums for all the possible character directions and removed duplicate directions
  - Extended the talk sequence commands a bit
  - Removed unnecessary buffer faceBuffer and the unneeded casts between byte * and char * that were used
........
  r34504 | thebluegr | 2008-09-12 14:54:47 +0200 (Fri, 12 Sep 2008) | 1 line
  
  New version of the create_drascula tool
........
  r34505 | thebluegr | 2008-09-12 14:55:25 +0200 (Fri, 12 Sep 2008) | 1 line
  
  New version of drascula.dat
........
  r34508 | Kirben | 2008-09-13 02:33:40 +0200 (Sat, 13 Sep 2008) | 1 line
  
  Add missing targets.
........
  r34511 | anotherguest | 2008-09-13 10:34:38 +0200 (Sat, 13 Sep 2008) | 1 line
  
  Fixed drascula dat path and version nr.
........
  r34512 | anotherguest | 2008-09-13 10:35:38 +0200 (Sat, 13 Sep 2008) | 1 line
  
  Fixed rev nr. 130 will give wrong ver. in installation.
........
  r34513 | eriktorbjorn | 2008-09-13 17:23:23 +0200 (Sat, 13 Sep 2008) | 2 lines
  
  Indentation.
........
  r34514 | fingolfin | 2008-09-13 18:51:46 +0200 (Sat, 13 Sep 2008) | 1 line
  
  Big patch changing the signature of various Stream methods (some ports may need to be slightly tweaked to fix overloading errors/warnings)
........
  r34515 | sev | 2008-09-13 19:41:42 +0200 (Sat, 13 Sep 2008) | 2 lines
  
  Portability fixes.
........
  r34516 | fingolfin | 2008-09-13 22:04:19 +0200 (Sat, 13 Sep 2008) | 1 line
  
  SCUMM: Merged class BaseChunk & Chunk; got rid of MemoryChunk
........
  r34517 | fingolfin | 2008-09-13 22:22:52 +0200 (Sat, 13 Sep 2008) | 1 line
  
  SCUMM: Merged class Chunk & FileChunk
........
  r34518 | fingolfin | 2008-09-14 00:41:30 +0200 (Sun, 14 Sep 2008) | 1 line
  
  SCUMM: Got rid of class Chunk
........
  r34520 | lordhoto | 2008-09-14 16:01:24 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Rename save slots in KyraMetaEngine::removeSaveState, so it matches behavior in GUI_v2::deleteMenu at least a little bit more.
........
  r34521 | lordhoto | 2008-09-14 16:08:14 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Added a hack in KyraMetaEngine::listSaves to prevent slot 0 from being listed. Check comment for additional information.
........
  r34522 | lordhoto | 2008-09-14 16:58:37 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Only setup 'cdaudio' config default for FM-Towns/PC98.
........
  r34523 | lordhoto | 2008-09-14 17:35:40 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Fixed regression introduced with r34522. (Now games without 'cdaudio' config value set should startup again).
........
  r34524 | lordhoto | 2008-09-14 17:36:16 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Implemented opcode 151: o1_resetMaskRegion
........
  r34526 | thebluegr | 2008-09-14 18:21:31 +0200 (Sun, 14 Sep 2008) | 1 line
  
  Fix for bug #2110375 - "DRASCULA: Mouse visible in screen saver", a regression from moving mouse handling to OSystem
........
  r34527 | lordhoto | 2008-09-14 18:29:14 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Fixed thumbnail creation / loading in kyra.
........
  r34528 | lordhoto | 2008-09-14 18:48:20 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Typo.
........
  r34529 | thebluegr | 2008-09-14 20:00:06 +0200 (Sun, 14 Sep 2008) | 1 line
  
  Updated MSVC project files for the SCUMM engine - removed smush/chunk.*
........
  r34530 | lordhoto | 2008-09-14 20:19:22 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Committed patch by [md5] from bug tracker item #2100790 "GUI:Clicking "Load" when no games are added triggers a crash".
........
  r34531 | thebluegr | 2008-09-14 20:30:08 +0200 (Sun, 14 Sep 2008) | 1 line
  
  Slight cleanup of centerText()
........
  r34532 | lordhoto | 2008-09-14 20:59:43 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Fix for bug #2089275: "GUI: Returning to launcher may trigger an error".
........
  r34533 | lordhoto | 2008-09-14 21:05:05 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Fix potentional bug in Screen::setResolution.
........
  r34534 | lordhoto | 2008-09-14 21:16:08 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Fix for bug #2090879 "GUI: Launcher 'Load' dialog should preserve save slot index".
........
  r34535 | lordhoto | 2008-09-14 21:48:40 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Added autosave support in Kyra.
........
  r34536 | lordhoto | 2008-09-14 22:01:01 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Changed message when trying to open the load dialog for games not supporting direct loading.
........
  r34537 | lordhoto | 2008-09-14 22:42:50 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Added ScummVM logo to GMM.
........
  r34538 | lordhoto | 2008-09-14 22:52:40 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Minor improvement for GMM layout.
........
  r34539 | lordhoto | 2008-09-14 23:00:24 +0200 (Sun, 14 Sep 2008) | 3 lines
  
  - Added thumbnail support to launcher load dialog.
  - Adopted KYRA to support displaying thumbnails in load dialog (SCUMM engine has yet to follow)
........
  r34540 | lordhoto | 2008-09-14 23:13:40 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Added thumbnail support for launcher to SCUMM engine.
........
  r34541 | fingolfin | 2008-09-14 23:26:59 +0200 (Sun, 14 Sep 2008) | 1 line
  
  Fixed a typo & clarified a comment
........
  r34542 | fingolfin | 2008-09-14 23:32:45 +0200 (Sun, 14 Sep 2008) | 1 line
  
  Compilation fix for NDS
........
  r34543 | lordhoto | 2008-09-14 23:34:49 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Little cleanup.
........
  r34544 | fingolfin | 2008-09-14 23:39:45 +0200 (Sun, 14 Sep 2008) | 1 line
  
  Changed VPATH to vpath, to allow building NDS port in parallel to another port (for the records, this patch went to Neil in January, and he didn't complain)
........
  r34545 | lordhoto | 2008-09-14 23:41:27 +0200 (Sun, 14 Sep 2008) | 2 lines
  
  Cleanup.
........
  r34546 | fingolfin | 2008-09-15 00:12:59 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Another NDS compilation fix, plus a warning fix
........
  r34547 | fingolfin | 2008-09-15 00:15:13 +0200 (Mon, 15 Sep 2008) | 1 line
  
  NDS: Replaced -I- by modern -iquote
........
  r34548 | fingolfin | 2008-09-15 00:24:35 +0200 (Mon, 15 Sep 2008) | 1 line
  
  DS: Removed legacy GCC 2.x build code (NDS/DevKitPro uses GCC 3 or newer anyway); thinned down INCLUDES some more; added a FIXME to the elf->bin rule
........
  r34549 | wjpalenstijn | 2008-09-15 00:28:53 +0200 (Mon, 15 Sep 2008) | 6 lines
  
  Big patch changing semantics of ReadStream::eos():
  eos() now only returns true _after_ trying to read past the end of the stream.
  
  This has a large potential for regressions. Please test!
........
  r34550 | fingolfin | 2008-09-15 00:44:49 +0200 (Mon, 15 Sep 2008) | 1 line
  
  DS: Some more compile fixes (prope solution would of course be to overload ::openForReading & ::openForWriting)
........
  r34551 | lordhoto | 2008-09-15 01:14:38 +0200 (Mon, 15 Sep 2008) | 2 lines
  
  Fixed regression introduced with latest stream changes (it seems compressed savefiles ioFailed never returned true when only eos was set).
........
  r34552 | wjpalenstijn | 2008-09-15 08:51:15 +0200 (Mon, 15 Sep 2008) | 1 line
  
  fix listSaveGames
........
  r34553 | wjpalenstijn | 2008-09-15 08:52:00 +0200 (Mon, 15 Sep 2008) | 1 line
  
  replace ioFailed by err
........
  r34554 | thebluegr | 2008-09-15 11:17:18 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Proper check for eos(), after the latest changes to OSystem
........
  r34555 | fingolfin | 2008-09-15 12:05:36 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Fix SubReadStream by initing _eos to false in the constructor (spotted thanks to our unit tests)
........
  r34556 | fingolfin | 2008-09-15 14:37:18 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Corrected and shortened some file opening related warnings
........
  r34557 | Kirben | 2008-09-15 14:37:24 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Replace ioFailed by err.
........
  r34558 | thebluegr | 2008-09-15 15:37:28 +0200 (Mon, 15 Sep 2008) | 2 lines
  
  Rewrote the very confusing centerText() function into something that makes more sense, and matches the way that the original printed text on screen (in most cases)
  Fixes bugs #2102657 - "DRASCULA: Crash when talking to the piano player" and #2111820 - "DRASCULA: Dialog texts too long"
........
  r34559 | thebluegr | 2008-09-15 15:45:10 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Fixed the phrase told by the protagonist when he talks to the blind man the second time
........
  r34560 | thebluegr | 2008-09-15 16:17:51 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Remove a workaround in textFitsCentered(). The blind man's dialog is a bit better placed now
........
  r34561 | thebluegr | 2008-09-15 16:35:11 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Show the blind man's dialog text at a bit better place
........
  r34562 | wjpalenstijn | 2008-09-15 21:19:30 +0200 (Mon, 15 Sep 2008) | 1 line
  
  fix eos() behaviour for CompressedInSaveFile
........
  r34563 | wjpalenstijn | 2008-09-15 21:34:06 +0200 (Mon, 15 Sep 2008) | 1 line
  
  also check for premature end-of-stream when loading
........
  r34566 | fingolfin | 2008-09-15 23:55:50 +0200 (Mon, 15 Sep 2008) | 1 line
  
  Turned compressed savefile wrapper into a generic stream wrapper
........
  r34567 | fingolfin | 2008-09-16 00:37:45 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Fixed compiler warnings
........
  r34568 | fingolfin | 2008-09-16 00:43:20 +0200 (Tue, 16 Sep 2008) | 1 line
  
  DS: Backported 0.12 changes to trunk
........
  r34569 | thebluegr | 2008-09-16 09:16:26 +0200 (Tue, 16 Sep 2008) | 2 lines
  
  - Fixed centerText() to print text at the correct height
  - Removed some duplicate code
........
  r34571 | thebluegr | 2008-09-16 10:10:08 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Added a workaround to skip the silence in the beginning and end of file 3.als. Fixes bug #2111815 - "DRASCULA: Voice delayed"
........
  r34572 | thebluegr | 2008-09-16 10:12:13 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Assign _lang to the appropriate enum values
........
  r34573 | thebluegr | 2008-09-16 10:24:42 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Removed the confirmation speech when a game is saved - it's "99.als" instead of "s99.als", but the main problem is that it's not translated in the English version and it's in Spanish (plus it's creepy and annoying...)
........
  r34574 | thebluegr | 2008-09-16 12:44:07 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Cleaned up and fixed the cutscene with Von Braun's story. Fixes bugs #2111804 - "DRASCULA: Cut scene bugs" and #2059648 - "DRASCULA: VonBraun's song"
........
  r34575 | thebluegr | 2008-09-16 12:53:57 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Fixed some glitches in the last part of Von Braun's story
........
  r34576 | fingolfin | 2008-09-16 13:42:21 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Modified uncompress in common/zlib.h to return a bool, so that we don't have to #include the real zlib.h; fixed PSP backend to not run uncompress inside an assert (which would cause it to not be invoked when turning off asserts)
........
  r34577 | thebluegr | 2008-09-16 13:49:40 +0200 (Tue, 16 Sep 2008) | 3 lines
  
  - Moved some includes away from drascula.h
  - Moved grr() to talk.cpp
  - Removed the unnecessary parameter length from isTalkFinished()
........
  r34578 | fingolfin | 2008-09-16 13:50:10 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Merged common/gzip-stream.* and common/zlib.*
........
  r34579 | lordhoto | 2008-09-16 13:54:37 +0200 (Tue, 16 Sep 2008) | 2 lines
  
  Removed assert leftover.
........
  r34580 | fingolfin | 2008-09-16 13:57:45 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Fix sign warnings in unit tests
........
  r34581 | lordhoto | 2008-09-16 16:10:55 +0200 (Tue, 16 Sep 2008) | 6 lines
  
  Added "querySaveMetaInfos" to MetaEngine.
   -> Allows easy addition of save state specific infos like playtime, save date atc.
   -> Removed MetaEngine::loadThumbnailFromSlot, superseded by meta infos
   -> Changed SCUMM / KYRA to implement the newly added functionallity
   -> Removed hack in KYRAs listSavefiles, which is now handled via meta infos
........
  r34582 | lordhoto | 2008-09-16 16:22:51 +0200 (Tue, 16 Sep 2008) | 2 lines
  
  Cleanup.
........
  r34583 | lordhoto | 2008-09-16 16:56:02 +0200 (Tue, 16 Sep 2008) | 2 lines
  
  Added support for SCUMM savestates date/time and playtime info in the launcher load dialog.
........
  r34584 | lordhoto | 2008-09-16 16:59:52 +0200 (Tue, 16 Sep 2008) | 2 lines
  
  Added whitespace in playtime textfield.
........
  r34585 | fingolfin | 2008-09-16 22:12:25 +0200 (Tue, 16 Sep 2008) | 1 line
  
  Removed tons of unused 'length' variables, to silence compiler warnings
........
  r34586 | fingolfin | 2008-09-17 18:31:25 +0200 (Wed, 17 Sep 2008) | 1 line
  
  adding Info.plist to svn:ignore
........
  r34587 | fingolfin | 2008-09-17 18:38:01 +0200 (Wed, 17 Sep 2008) | 1 line
  
  DS: Removing some dead code; merged (parts of) std_cwd into GBAMPSaveFileManager::listSavefiles
........
  r34588 | fingolfin | 2008-09-17 18:50:19 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Adding *.dSYM (generated by gcc on OSX these days) to svn:ignore
........
  r34589 | fingolfin | 2008-09-17 19:31:29 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Moved base/game.* to engines/game.*
........
  r34590 | lordhoto | 2008-09-17 19:46:55 +0200 (Wed, 17 Sep 2008) | 2 lines
  
  Fixed bug in SaveLoadChooser reflowLayout, which prevented widgets from being properly hidden.
........
  r34592 | fingolfin | 2008-09-17 20:16:06 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Patch #2112604: Update for the man page
........
  r34595 | fingolfin | 2008-09-17 20:26:44 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Patch #2043093 (again - new patch): OS/2 patches for posix-fs
........
  r34596 | fingolfin | 2008-09-17 20:56:13 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Patch #2060517: SCUMM: engine sets incorrect talkspeed value
........
  r34597 | fingolfin | 2008-09-17 20:56:54 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Added some noteworthy improvements due to Chris Page & GSoC 2008
........
  r34598 | fingolfin | 2008-09-17 20:59:09 +0200 (Wed, 17 Sep 2008) | 1 line
  
  Simplified & fixed SearchManager
........
  r34599 | fingolfin | 2008-09-18 10:19:00 +0200 (Thu, 18 Sep 2008) | 1 line
  
  Added 'native' implementations for FSDirectory::matchPattern & SearchSet::getAllNames (untested)
........
  r34602 | thebluegr | 2008-09-19 12:25:40 +0200 (Fri, 19 Sep 2008) | 1 line
  
  Updated MSVC project files with the latest changes (moved base/game.* to engines/game.*)
........
  r34603 | thebluegr | 2008-09-19 15:58:09 +0200 (Fri, 19 Sep 2008) | 1 line
  
  Changed tinsel's volume range (0-127) to match ScummVM's (0-255)
........

svn-id: r34606
This commit is contained in:
Vicent Marti 2008-09-20 11:21:35 +00:00
commit 9feb0f5f67
662 changed files with 24561 additions and 13659 deletions

View file

@ -168,9 +168,12 @@ ScummVM Team
Johannes Schickel Johannes Schickel
Miscellaneous: Miscellaneous:
David Corrales-Lopez - Filesystem access improvements David Corrales-Lopez - Filesystem access improvements (GSoC 2007
task)
Jerome Fisher - MT-32 emulator Jerome Fisher - MT-32 emulator
Jochen Hoenicke - Speaker & PCjr sound support, Adlib work Jochen Hoenicke - Speaker & PCjr sound support, Adlib work
Chris Page - Return to launcher, savestate improvements,
leak fixes, ... (GSoC 2008 task)
Robin Watts - ARM assembly routines for nice speedups on Robin Watts - ARM assembly routines for nice speedups on
several ports; improvements to the sound mixer several ports; improvements to the sound mixer

14
NEWS
View file

@ -2,10 +2,22 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
http://scummvm.sourceforge.net/daily/ChangeLog http://scummvm.sourceforge.net/daily/ChangeLog
0.13.0 (????-??-??) 0.13.0 (????-??-??)
General:
- Added MIDI driver for Atari ST / FreeMint.
- Added a 'Load' button to the Launcher (not supported by all engines).
- Added a new global main menu (GMM) dialog usable from all engines.
- Added the ability to return to the launcher from running games (via the GMM).
New Games: New Games:
- Added support for Discworld. - Added support for Discworld.
0.12.0 (????-??-??) KYRA:
- Added support for Auto-save feature.
SCUMM:
- Fixed a long-time bug which caused talkspeed and talkdelay to be mixed up.
0.12.0 (2008-08-31)
New Games: New Games:
- Added support for The Legend of Kyrandia: Book Two: Hand of Fate. - Added support for The Legend of Kyrandia: Book Two: Hand of Fate.
- Added support for The Legend of Kyrandia: Book Three: Malcolm's Revenge. - Added support for The Legend of Kyrandia: Book Three: Malcolm's Revenge.

129
README
View file

@ -39,10 +39,12 @@ Table of Contents:
* 5.1 Command Line Options * 5.1 Command Line Options
* 5.2 Language Options * 5.2 Language Options
* 5.3 Graphics Filters * 5.3 Graphics Filters
* 5.4 Hotkeys * 5.4 Global Menu
* 5.5 Hotkeys
6.0) Savegames 6.0) Savegames
* 6.1 Autosaves * 6.1 Autosaves
* 6.2 Converting savegames * 6.2 Converting savegames
* 6.3 Viewing/Loading savegames from the command line
7.0) Music and Sound 7.0) Music and Sound
* 7.1 Adlib emulation * 7.1 Adlib emulation
* 7.2 FluidSynth MIDI emulation * 7.2 FluidSynth MIDI emulation
@ -182,17 +184,23 @@ GOB Games by Coktel Vision:
Gobliiins [gob1] Gobliiins [gob1]
Gobliins 2 [gob2] Gobliins 2 [gob2]
Goblins 3 [gob3] Goblins 3 [gob3]
Lost in Time [lostintime]
The Bizarre Adventures of Woodruff
and the Schnibble [woodruff]
Ween: The Prophecy [ween] Ween: The Prophecy [ween]
Other Games: Other Games:
Beneath a Steel Sky [sky] Beneath a Steel Sky [sky]
Broken Sword 1: The Shadow of the Templars [sword1] Broken Sword 1: The Shadow of the Templars [sword1]
Broken Sword 2: The Smoking Mirror [sword2] Broken Sword 2: The Smoking Mirror [sword2]
Drascula: The Vampire Strikes Back [drascula]
Flight of the Amazon Queen [queen] Flight of the Amazon Queen [queen]
Future Wars [fw] Future Wars [fw]
Inherit the Earth: Quest for the Orb [ite] Inherit the Earth: Quest for the Orb [ite]
Nippon Safes Inc. [nippon] Nippon Safes Inc. [nippon]
The Legend of Kyrandia [kyra1] The Legend of Kyrandia [kyra1]
The Legend of Kyrandia: The Hand of Fate [kyra2]
The Legend of Kyrandia: Malcolm's Revenge [kyra3]
Touche: The Adventures of the Fifth Touche: The Adventures of the Fifth
Musketeer [touche] Musketeer [touche]
@ -781,6 +789,7 @@ arguments -- see the next section.
-h, --help Display a brief help text and exit -h, --help Display a brief help text and exit
-z, --list-games Display list of supported games and exit -z, --list-games Display list of supported games and exit
-t, --list-targets Display list of configured targets and exit -t, --list-targets Display list of configured targets and exit
--list-saves=TARGET Display a list of savegames for the game (TARGET) specified
-c, --config=CONFIG Use alternate configuration file -c, --config=CONFIG Use alternate configuration file
-p, --path=PATH Path to where the game is installed -p, --path=PATH Path to where the game is installed
@ -968,7 +977,38 @@ Likewise, games that originally were using 640x480 (such as COMI or Broken Sword
will be scaled to 1280x960 and 1920x1440. will be scaled to 1280x960 and 1920x1440.
5.4) Hot Keys: 5.4) Global Menu:
---- ------------
The Global Menu is a general menu which is available to all of the game engines
by pressing F6. From this menu there are the following buttons: Resume,
Options, About, Return to Launcher, and Quit. Selecting 'Options' will display
a dialog where basic audio settings, such as volume levels, can be adjusted.
Selecting 'Return to Launcher' will close the current game and return the user
back to the ScummVM Launcher, where another game may be selected to play.
Note: Returning to the Launcher is not supported by all of the engines,
and the button will be disabled in the Global Menu if it is not supported.
Engines which currently support Returning to the Launcher are:
AGI
AGOS
CINE
GOB
KYRA
LURE
PARALLACTION
QUEEN
SAGA
SCUMM
SKY
SWORD1
SWORD2
TOUCHE
5.5) Hot Keys:
---- --------- ---- ---------
TODO TODO
TODO: Rework this section to clearly state which hotkeys are implemented in *all* TODO: Rework this section to clearly state which hotkeys are implemented in *all*
@ -982,6 +1022,7 @@ ScummVM supports various in-game hotkeys. They differ between SCUMM games and
other games. other games.
Common: Common:
F6 - Displays the Global Menu
Cmd-q - Quit (Mac OS X) Cmd-q - Quit (Mac OS X)
Ctrl-q - Quit (other unices including Linux) Ctrl-q - Quit (other unices including Linux)
Ctrl-z OR Alt-x - Quit (other platforms) Ctrl-z OR Alt-x - Quit (other platforms)
@ -1138,45 +1179,93 @@ The platforms that currently have a different default directory are:
6.1) Autosaves: 6.1) Autosaves:
---- ---------- ---- ----------
For some games (namely "Beneath a Steel Sky", "Flight of the Amazon For some games, (namely "Beneath a Steel Sky", "Flight of the Amazon Queen",
Queen" and all SCUMM games), ScummVM will by default automatically all AGI games, and all SCUMM games), ScummVM will by default automatically
save the current state every five minutes (adjustable via the save the current state every five minutes (adjustable via the "autosave_period"
"autosave_period" config setting). For the SCUMM engine, it will save config setting). For the AGI and SCUMM engines, it will save in Slot 0. For the
in Slot 0. This savestate can then be loaded again via Ctrl-0, or the SCUMM engine, this savestate can then be loaded again via Ctrl-0, or the F5
F5 menu. menu.
6.2) Converting Savegames: 6.2) Converting Savegames:
---- ---------- ---- ---------------------
Using savegames from original versions, isn't supported by all game engines. Only Using savegames from original versions, isn't supported by all game engines.
the following games, can use savedgames from their original versions. Only the following games, can use savegames from their original versions.
Elvira 1 Elvira 1
- Add 8 bytes (savedgame name) to the start of the savegame file - Add 8 bytes (savegame name) to the start of the savegame file
- Rename the savedgame to 'elvira1.xxx' - Rename the savegame to 'elvira1.xxx'
Elvira 2 Elvira 2
- Add 8 bytes (savedgame name) to the start of the savegame file - Add 8 bytes (savegame name) to the start of the savegame file
- Rename the savedgame to 'elvira2-pc.xxx' (DOS version) or - Rename the savegame to 'elvira2-pc.xxx' (DOS version) or
'elvira2.xxx' (Other versions) 'elvira2.xxx' (Other versions)
Waxworks Waxworks
- Add 8 bytes (savedgame name) to the start of the savegame file - Add 8 bytes (savegame name) to the start of the savegame file
- Rename the savedgame to 'waxworks-pc.xxx' (DOS version) or - Rename the savegame to 'waxworks-pc.xxx' (DOS version) or
'waxworks.xxx' (Other versions) 'waxworks.xxx' (Other versions)
Simon the Sorcerer 1 Simon the Sorcerer 1
- Rename the savedgame to 'simon1.xxx' - Rename the savegame to 'simon1.xxx'
Simon the Sorcerer 1 Simon the Sorcerer 1
- Rename the savedgame to 'simon2.xxx' - Rename the savegame to 'simon2.xxx'
The Feeble Files The Feeble Files
- Rename the savedgame to 'feeble.xxx' - Rename the savegame to 'feeble.xxx'
Where 'xxx' is exact the saved game slot (ie 001) under ScummVM Where 'xxx' is exact the saved game slot (ie 001) under ScummVM
6.3) Viewing/Loading savegames from the command line:
---- ------------------------------------------------
--list-saves:
This switch may be used to display a list of the current savegames
of the specified target game and their corresponding save slots.
Usage: --list-saves=[TARGET], where [TARGET] is the target game.
Engines which currently support --list-saves are:
AGI
AGOS
CINE
KYRA
LURE
PARALLACTION
QUEEN
SAGA
SCUMM
SKY
SWORD1
SWORD2
TOUCHE
--save-slot/-x:
This switch may be used to load a savegame directly from the command line.
Usage: --save-slot[SLOT] or -x[SLOT], where [SLOT] is the save slot number.
Engines which currently support --save-slot/-x are:
AGI
CINE
KYRA
LURE
PARALLACTION
QUEEN
SAGA
SCUMM
SKY
SWORD1
SWORD2
TOUCHE
7.0) Music and Sound: 7.0) Music and Sound:
---- ---------------- ---- ----------------

View file

@ -93,7 +93,8 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) :
_boss(boss), _boss(boss),
_buttonState(0), _buttonState(0),
_modifierState(0), _modifierState(0),
_shouldQuit(false) { _shouldQuit(false),
_shouldRTL(false) {
assert(_boss); assert(_boss);
@ -200,6 +201,9 @@ DefaultEventManager::~DefaultEventManager() {
_boss->unlockMutex(_timeMutex); _boss->unlockMutex(_timeMutex);
_boss->unlockMutex(_recorderMutex); _boss->unlockMutex(_recorderMutex);
if (!artificialEventQueue.empty())
artificialEventQueue.clear();
if (_playbackFile != NULL) { if (_playbackFile != NULL) {
delete _playbackFile; delete _playbackFile;
} }
@ -349,7 +353,11 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
uint32 time = _boss->getMillis(); uint32 time = _boss->getMillis();
bool result; bool result;
result = _boss->pollEvent(event); if (!artificialEventQueue.empty()) {
event = artificialEventQueue.pop();
result = true;
} else
result = _boss->pollEvent(event);
if (_recordMode != kPassthrough) { if (_recordMode != kPassthrough) {
@ -375,7 +383,6 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
switch (event.type) { switch (event.type) {
case Common::EVENT_KEYDOWN: case Common::EVENT_KEYDOWN:
_modifierState = event.kbd.flags; _modifierState = event.kbd.flags;
// init continuous event stream // init continuous event stream
// not done on PalmOS because keyboard is emulated and keyup is not generated // not done on PalmOS because keyboard is emulated and keyup is not generated
#if !defined(PALMOS_MODE) #if !defined(PALMOS_MODE)
@ -384,7 +391,41 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
_currentKeyDown.flags = event.kbd.flags; _currentKeyDown.flags = event.kbd.flags;
_keyRepeatTime = time + kKeyRepeatInitialDelay; _keyRepeatTime = time + kKeyRepeatInitialDelay;
#endif #endif
// Global Main Menu
// FIXME: F6 is not the best trigger, it conflicts with some games!!!
if (event.kbd.keycode == Common::KEYCODE_F6) {
if (g_engine && !g_engine->isPaused()) {
Common::Event menuEvent;
menuEvent.type = Common::EVENT_MAINMENU;
// FIXME: GSoC RTL branch passes the F6 key event to the
// engine, and also enqueues a EVENT_MAINMENU. For now,
// we just drop the key event and return an EVENT_MAINMENU
// instead. This way, we don't have to add special cases
// to engines (like it was the case for LURE in the RTL branch).
//
// However, this has other consequences, possibly negative ones.
// Like, what happens with key repeat for the trigger key?
//pushEvent(menuEvent);
event = menuEvent;
// FIXME: Since now we do not push another MAINMENU event onto
// our event stack, the GMM would never open, so we have to do
// that here. Of course when the engine would handle MAINMENU
// as an event now and open up the GMM itself it would open the
// menu twice.
if (g_engine && !g_engine->isPaused())
g_engine->mainMenuDialog();
if (_shouldQuit)
event.type = Common::EVENT_QUIT;
else if (_shouldRTL)
event.type = Common::EVENT_RTL;
}
}
break; break;
case Common::EVENT_KEYUP: case Common::EVENT_KEYUP:
_modifierState = event.kbd.flags; _modifierState = event.kbd.flags;
if (event.kbd.keycode == _currentKeyDown.keycode) { if (event.kbd.keycode == _currentKeyDown.keycode) {
@ -401,6 +442,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
_mousePos = event.mouse; _mousePos = event.mouse;
_buttonState |= LBUTTON; _buttonState |= LBUTTON;
break; break;
case Common::EVENT_LBUTTONUP: case Common::EVENT_LBUTTONUP:
_mousePos = event.mouse; _mousePos = event.mouse;
_buttonState &= ~LBUTTON; _buttonState &= ~LBUTTON;
@ -410,11 +452,26 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
_mousePos = event.mouse; _mousePos = event.mouse;
_buttonState |= RBUTTON; _buttonState |= RBUTTON;
break; break;
case Common::EVENT_RBUTTONUP: case Common::EVENT_RBUTTONUP:
_mousePos = event.mouse; _mousePos = event.mouse;
_buttonState &= ~RBUTTON; _buttonState &= ~RBUTTON;
break; break;
case Common::EVENT_MAINMENU:
if (g_engine && !g_engine->isPaused())
g_engine->mainMenuDialog();
if (_shouldQuit)
event.type = Common::EVENT_QUIT;
else if (_shouldRTL)
event.type = Common::EVENT_RTL;
break;
case Common::EVENT_RTL:
_shouldRTL = true;
break;
case Common::EVENT_QUIT: case Common::EVENT_QUIT:
if (ConfMan.getBool("confirm_exit")) { if (ConfMan.getBool("confirm_exit")) {
if (g_engine) if (g_engine)
@ -425,6 +482,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
g_engine->pauseEngine(false); g_engine->pauseEngine(false);
} else } else
_shouldQuit = true; _shouldQuit = true;
break; break;
default: default:
@ -447,4 +505,14 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
return result; return result;
} }
void DefaultEventManager::pushEvent(Common::Event event) {
// If already received an EVENT_QUIT, don't add another one
if (event.type == Common::EVENT_QUIT) {
if (!_shouldQuit)
artificialEventQueue.push(event);
} else
artificialEventQueue.push(event);
}
#endif // !defined(DISABLE_DEFAULT_EVENTMANAGER) #endif // !defined(DISABLE_DEFAULT_EVENTMANAGER)

View file

@ -48,6 +48,7 @@ class DefaultEventManager : public Common::EventManager {
int _buttonState; int _buttonState;
int _modifierState; int _modifierState;
bool _shouldQuit; bool _shouldQuit;
bool _shouldRTL;
class RandomSourceRecord { class RandomSourceRecord {
public: public:
@ -107,6 +108,7 @@ public:
~DefaultEventManager(); ~DefaultEventManager();
virtual bool pollEvent(Common::Event &event); virtual bool pollEvent(Common::Event &event);
virtual void pushEvent(Common::Event event);
virtual void registerRandomSource(Common::RandomSource &rnd, const char *name); virtual void registerRandomSource(Common::RandomSource &rnd, const char *name);
virtual void processMillis(uint32 &millis); virtual void processMillis(uint32 &millis);
@ -114,6 +116,8 @@ public:
virtual int getButtonState() const { return _buttonState; } virtual int getButtonState() const { return _buttonState; }
virtual int getModifierState() const { return _modifierState; } virtual int getModifierState() const { return _modifierState; }
virtual int shouldQuit() const { return _shouldQuit; } virtual int shouldQuit() const { return _shouldQuit; }
virtual int shouldRTL() const { return _shouldRTL; }
virtual void resetRTL() { _shouldRTL = false; }
}; };
#endif #endif

View file

@ -0,0 +1,40 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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.
*
* $URL$
* $Id$
*/
#include "backends/fs/abstract-fs.h"
const char *AbstractFilesystemNode::lastPathComponent(const Common::String &str, const char sep) {
// TODO: Get rid of this eventually! Use Common::lastPathComponent instead
if(str.empty())
return "";
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
while (cur >= start && *cur != sep) {
--cur;
}
return cur + 1;
}

View file

@ -43,22 +43,21 @@ typedef Common::Array<AbstractFilesystemNode *> AbstractFSList;
*/ */
class AbstractFilesystemNode { class AbstractFilesystemNode {
protected: protected:
friend class FilesystemNode; friend class Common::FilesystemNode;
typedef Common::String String; typedef Common::FilesystemNode::ListMode ListMode;
typedef FilesystemNode::ListMode ListMode;
/** /**
* Returns the child node with the given name. If no child with this name * Returns the child node with the given name. When called on a non-directory
* exists, returns 0. When called on a non-directory node, it should * node, it should handle this gracefully by returning 0.
* handle this gracefully by returning 0. * When called with a name not matching any of the files/dirs contained in this
* directory, a valid node shold be returned, which returns 'false' upon calling
* the exists() method. The idea is that this node can then still can be used to
* create a new file via the openForWriting() method.
* *
* Example: * Example:
* Calling getChild() for a node with path "/foo/bar" using name="file.txt", * Calling getChild() for a node with path "/foo/bar" using name="file.txt",
* would produce a new node with "/foo/bar/file.txt" as path. * would produce a new node with "/foo/bar/file.txt" as path.
* *
* @note This function will append a separator char (\ or /) to the end of the
* path if needed.
*
* @note Handling calls on non-dir nodes gracefully makes it possible to * @note Handling calls on non-dir nodes gracefully makes it possible to
* switch to a lazy type detection scheme in the future. * switch to a lazy type detection scheme in the future.
* *
@ -72,6 +71,19 @@ protected:
*/ */
virtual AbstractFilesystemNode *getParent() const = 0; virtual AbstractFilesystemNode *getParent() const = 0;
/**
* 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.
* @param sep character used to separate path components
* @return Pointer to the first char of the last component inside str.
*/
static const char *lastPathComponent(const Common::String &str, const char sep);
public: public:
/** /**
* Destructor. * Destructor.
@ -149,9 +161,26 @@ public:
*/ */
virtual bool isWritable() const = 0; virtual bool isWritable() const = 0;
/* TODO:
bool isFile(); /**
*/ * Creates a SeekableReadStream instance corresponding to the file
* referred by this node. This assumes that the node actually refers
* to a readable file. If this is not the case, 0 is returned.
*
* @return pointer to the stream object, 0 in case of a failure
*/
virtual Common::SeekableReadStream *openForReading() = 0;
/**
* Creates a WriteStream instance corresponding to the file
* referred by this node. This assumes that the node actually refers
* to a readable file. If this is not the case, 0 is returned.
*
* @return pointer to the stream object, 0 in case of a failure
*/
virtual Common::WriteStream *openForWriting() = 0;
}; };
#endif //BACKENDS_ABSTRACT_FS_H #endif //BACKENDS_ABSTRACT_FS_H

View file

@ -26,8 +26,6 @@
#include "backends/fs/amigaos4/amigaos4-fs-factory.h" #include "backends/fs/amigaos4/amigaos4-fs-factory.h"
#include "backends/fs/amigaos4/amigaos4-fs.cpp" #include "backends/fs/amigaos4/amigaos4-fs.cpp"
DECLARE_SINGLETON(AmigaOSFilesystemFactory);
AbstractFilesystemNode *AmigaOSFilesystemFactory::makeRootFileNode() const { AbstractFilesystemNode *AmigaOSFilesystemFactory::makeRootFileNode() const {
return new AmigaOSFilesystemNode(); return new AmigaOSFilesystemNode();
} }
@ -36,7 +34,7 @@ AbstractFilesystemNode *AmigaOSFilesystemFactory::makeCurrentDirectoryFileNode()
return new AmigaOSFilesystemNode(); return new AmigaOSFilesystemNode();
} }
AbstractFilesystemNode *AmigaOSFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *AmigaOSFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new AmigaOSFilesystemNode(path); return new AmigaOSFilesystemNode(path);
} }
#endif #endif

View file

@ -25,7 +25,6 @@
#ifndef AMIGAOS_FILESYSTEM_FACTORY_H #ifndef AMIGAOS_FILESYSTEM_FACTORY_H
#define AMIGAOS_FILESYSTEM_FACTORY_H #define AMIGAOS_FILESYSTEM_FACTORY_H
#include "common/singleton.h"
#include "backends/fs/fs-factory.h" #include "backends/fs/fs-factory.h"
/** /**
@ -33,19 +32,11 @@
* *
* Parts of this class are documented in the base interface class, FilesystemFactory. * Parts of this class are documented in the base interface class, FilesystemFactory.
*/ */
class AmigaOSFilesystemFactory : public FilesystemFactory, public Common::Singleton<AmigaOSFilesystemFactory> { class AmigaOSFilesystemFactory : public FilesystemFactory {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
AmigaOSFilesystemFactory() {};
private:
friend class Common::Singleton<SingletonBaseType>;
}; };
#endif /*AMIGAOS_FILESYSTEM_FACTORY_H*/ #endif /*AMIGAOS_FILESYSTEM_FACTORY_H*/

View file

@ -36,8 +36,8 @@
#endif #endif
#include "common/util.h" #include "common/util.h"
#include "engines/engine.h"
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
#define ENTER() /* debug(6, "Enter") */ #define ENTER() /* debug(6, "Enter") */
#define LEAVE() /* debug(6, "Leave") */ #define LEAVE() /* debug(6, "Leave") */
@ -52,8 +52,8 @@ const uint32 kExAllBufferSize = 40960; // TODO: is this okay for sure?
class AmigaOSFilesystemNode : public AbstractFilesystemNode { class AmigaOSFilesystemNode : public AbstractFilesystemNode {
protected: protected:
BPTR _pFileLock; BPTR _pFileLock;
String _sDisplayName; Common::String _sDisplayName;
String _sPath; Common::String _sPath;
bool _bIsDirectory; bool _bIsDirectory;
bool _bIsValid; bool _bIsValid;
@ -74,9 +74,9 @@ public:
/** /**
* Creates a AmigaOSFilesystemNode for a given path. * Creates a AmigaOSFilesystemNode for a given path.
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
*/ */
AmigaOSFilesystemNode(const String &p); AmigaOSFilesystemNode(const Common::String &p);
/** /**
* FIXME: document this constructor. * FIXME: document this constructor.
@ -96,17 +96,20 @@ public:
virtual ~AmigaOSFilesystemNode(); virtual ~AmigaOSFilesystemNode();
virtual bool exists() const; virtual bool exists() const;
virtual String getDisplayName() const { return _sDisplayName; }; virtual Common::String getDisplayName() const { return _sDisplayName; };
virtual String getName() const { return _sDisplayName; }; virtual Common::String getName() const { return _sDisplayName; };
virtual String getPath() const { return _sPath; }; virtual Common::String getPath() const { return _sPath; };
virtual bool isDirectory() const { return _bIsDirectory; }; virtual bool isDirectory() const { return _bIsDirectory; };
virtual bool isReadable() const; virtual bool isReadable() const;
virtual bool isWritable() const; virtual bool isWritable() const;
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
/** /**
* Creates a list with all the volumes present in the root node. * Creates a list with all the volumes present in the root node.
*/ */
@ -116,7 +119,7 @@ public:
/** /**
* Returns the last component of a given path. * Returns the last component of a given path.
* *
* @param str String containing the path. * @param str Common::String containing the path.
* @return Pointer to the first char of the last component inside str. * @return Pointer to the first char of the last component inside str.
*/ */
const char *lastPathComponent(const Common::String &str) { const char *lastPathComponent(const Common::String &str) {
@ -148,10 +151,10 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode() {
LEAVE(); LEAVE();
} }
AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) { AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
ENTER(); ENTER();
int len = 0, offset = p.size(); int offset = p.size();
//assert(offset > 0); //assert(offset > 0);
@ -161,7 +164,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) {
} }
_sPath = p; _sPath = p;
_sDisplayName = lastPathComponent(_sPath); _sDisplayName = ::lastPathComponent(_sPath);
_pFileLock = 0; _pFileLock = 0;
_bIsDirectory = false; _bIsDirectory = false;
@ -299,14 +302,14 @@ bool AmigaOSFilesystemNode::exists() const {
return nodeExists; return nodeExists;
} }
AbstractFilesystemNode *AmigaOSFilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *AmigaOSFilesystemNode::getChild(const Common::String &n) const {
ENTER(); ENTER();
if (!_bIsDirectory) { if (!_bIsDirectory) {
debug(6, "Not a directory"); debug(6, "Not a directory");
return 0; return 0;
} }
String newPath(_sPath); Common::String newPath(_sPath);
if (_sPath.lastChar() != '/') if (_sPath.lastChar() != '/')
newPath += '/'; newPath += '/';
@ -368,10 +371,10 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
struct ExAllData *ead = data; struct ExAllData *ead = data;
do { do {
if ((mode == FilesystemNode::kListAll) || if ((mode == Common::FilesystemNode::kListAll) ||
(EAD_IS_DRAWER(ead) && (mode == FilesystemNode::kListDirectoriesOnly)) || (EAD_IS_DRAWER(ead) && (mode == Common::FilesystemNode::kListDirectoriesOnly)) ||
(EAD_IS_FILE(ead) && (mode == FilesystemNode::kListFilesOnly))) { (EAD_IS_FILE(ead) && (mode == Common::FilesystemNode::kListFilesOnly))) {
String full_path = _sPath; Common::String full_path = _sPath;
full_path += (char*)ead->ed_Name; full_path += (char*)ead->ed_Name;
BPTR lock = IDOS->Lock((STRPTR)full_path.c_str(), SHARED_LOCK); BPTR lock = IDOS->Lock((STRPTR)full_path.c_str(), SHARED_LOCK);
@ -566,4 +569,12 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
return myList; return myList;
} }
Common::SeekableReadStream *AmigaOSFilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *AmigaOSFilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
}
#endif //defined(__amigaos4__) #endif //defined(__amigaos4__)

View file

@ -45,7 +45,7 @@ AbstractFilesystemNode *DSFilesystemFactory::makeCurrentDirectoryFileNode() cons
} }
} }
AbstractFilesystemNode *DSFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *DSFilesystemFactory::makeFileNodePath(const Common::String &path) const {
if (DS::isGBAMPAvailable()) { if (DS::isGBAMPAvailable()) {
return new DS::GBAMPFileSystemNode(path); return new DS::GBAMPFileSystemNode(path);
} else { } else {

View file

@ -35,11 +35,9 @@
*/ */
class DSFilesystemFactory : public FilesystemFactory, public Common::Singleton<DSFilesystemFactory> { class DSFilesystemFactory : public FilesystemFactory, public Common::Singleton<DSFilesystemFactory> {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected: protected:
DSFilesystemFactory() {}; DSFilesystemFactory() {};

View file

@ -24,6 +24,7 @@
#include "common/util.h" #include "common/util.h"
//#include <NDS/ARM9/console.h> //basic print funcionality //#include <NDS/ARM9/console.h> //basic print funcionality
#include "backends/fs/ds/ds-fs.h" #include "backends/fs/ds/ds-fs.h"
#include "backends/fs/stdiostream.h"
#include "dsmain.h" #include "dsmain.h"
#include "fat/gba_nds_fat.h" #include "fat/gba_nds_fat.h"
@ -55,7 +56,7 @@ DSFileSystemNode::DSFileSystemNode() {
} }
} }
DSFileSystemNode::DSFileSystemNode(const String& path) { DSFileSystemNode::DSFileSystemNode(const Common::String& path) {
// consolePrintf("--%s ",path.c_str()); // consolePrintf("--%s ",path.c_str());
char disp[128]; char disp[128];
@ -70,7 +71,7 @@ DSFileSystemNode::DSFileSystemNode(const String& path) {
strcpy(disp, pathStr + lastSlash + 1); strcpy(disp, pathStr + lastSlash + 1);
_displayName = String(disp); _displayName = Common::String(disp);
_path = path; _path = path;
// _isValid = true; // _isValid = true;
// _isDirectory = false; // _isDirectory = false;
@ -98,7 +99,7 @@ DSFileSystemNode::DSFileSystemNode(const String& path) {
// consolePrintf("%s - Found: %d, Dir: %d\n", pathStr, _isValid, _isDirectory); // consolePrintf("%s - Found: %d, Dir: %d\n", pathStr, _isValid, _isDirectory);
} }
DSFileSystemNode::DSFileSystemNode(const String& path, bool isDir) { DSFileSystemNode::DSFileSystemNode(const Common::String& path, bool isDir) {
// consolePrintf("--%s ",path.c_str()); // consolePrintf("--%s ",path.c_str());
char disp[128]; char disp[128];
@ -112,7 +113,7 @@ DSFileSystemNode::DSFileSystemNode(const String& path, bool isDir) {
strcpy(disp, pathStr + lastSlash + 1); strcpy(disp, pathStr + lastSlash + 1);
_displayName = String(disp); _displayName = Common::String(disp);
_path = path; _path = path;
_isValid = true; _isValid = true;
_isDirectory = isDir; _isDirectory = isDir;
@ -167,10 +168,10 @@ bool DSFileSystemNode::getChildren(AbstractFSList &dirList, ListMode mode, bool
_zipFile->getFileName(n); _zipFile->getFileName(n);
// consolePrintf("file: %s\n", n); // consolePrintf("file: %s\n", n);
if ( (_zipFile->isDirectory() && ((mode == FilesystemNode::kListDirectoriesOnly) || (mode == FilesystemNode::kListAll)) ) if ( (_zipFile->isDirectory() && ((mode == Common::FilesystemNode::kListDirectoriesOnly) || (mode == Common::FilesystemNode::kListAll)) )
|| (!_zipFile->isDirectory() && ((mode == FilesystemNode::kListFilesOnly) || (mode == FilesystemNode::kListAll)) ) ) || (!_zipFile->isDirectory() && ((mode == Common::FilesystemNode::kListFilesOnly) || (mode == Common::FilesystemNode::kListAll)) ) )
{ {
DSFileSystemNode* dsfsn = new DSFileSystemNode("ds:/" + String(n), _zipFile->isDirectory()); DSFileSystemNode* dsfsn = new DSFileSystemNode("ds:/" + Common::String(n), _zipFile->isDirectory());
dsfsn->_isDirectory = _zipFile->isDirectory(); dsfsn->_isDirectory = _zipFile->isDirectory();
dirList.push_back((dsfsn)); dirList.push_back((dsfsn));
} }
@ -195,7 +196,7 @@ AbstractFilesystemNode* DSFileSystemNode::getParent() const {
} }
} }
p = new DSFileSystemNode(String(path, lastSlash)); p = new DSFileSystemNode(Common::String(path, lastSlash));
((DSFileSystemNode *) (p))->_isDirectory = true; ((DSFileSystemNode *) (p))->_isDirectory = true;
} else { } else {
p = new DSFileSystemNode(); p = new DSFileSystemNode();
@ -204,6 +205,14 @@ AbstractFilesystemNode* DSFileSystemNode::getParent() const {
return p; return p;
} }
Common::SeekableReadStream *DSFileSystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *DSFileSystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
}
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// GBAMPFileSystemNode - File system using GBA Movie Player and CF card // // GBAMPFileSystemNode - File system using GBA Movie Player and CF card //
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -216,7 +225,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode() {
_path = "mp:/"; _path = "mp:/";
} }
GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path) { GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
// consolePrintf("'%s'",path.c_str()); // consolePrintf("'%s'",path.c_str());
char disp[128]; char disp[128];
@ -245,13 +254,13 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path) {
} }
// consolePrintf("Path: %s (%d)\n", check, success); // consolePrintf("Path: %s (%d)\n", check, success);
_displayName = String(disp); _displayName = Common::String(disp);
_path = path; _path = path;
_isValid = success == FT_FILE; _isValid = success == FT_FILE;
_isDirectory = success == FT_DIR; _isDirectory = success == FT_DIR;
} }
GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path, bool isDirectory) { GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path, bool isDirectory) {
// consolePrintf("'%s'",path.c_str()); // consolePrintf("'%s'",path.c_str());
char disp[128]; char disp[128];
@ -265,7 +274,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const String& path, bool isDirectory) {
strcpy(disp, pathStr + lastSlash + 1); strcpy(disp, pathStr + lastSlash + 1);
_displayName = String(disp); _displayName = Common::String(disp);
_path = path; _path = path;
_isValid = true; _isValid = true;
_isDirectory = isDirectory; _isDirectory = isDirectory;
@ -313,8 +322,8 @@ bool GBAMPFileSystemNode::getChildren(AbstractFSList& dirList, ListMode mode, bo
while (entryType != TYPE_NO_MORE) { while (entryType != TYPE_NO_MORE) {
if ( ((entryType == TYPE_DIR) && ((mode == FilesystemNode::kListDirectoriesOnly) || (mode == FilesystemNode::kListAll))) if ( ((entryType == TYPE_DIR) && ((mode == Common::FilesystemNode::kListDirectoriesOnly) || (mode == Common::FilesystemNode::kListAll)))
|| ((entryType == TYPE_FILE) && ((mode == FilesystemNode::kListFilesOnly) || (mode == FilesystemNode::kListAll))) ) { || ((entryType == TYPE_FILE) && ((mode == Common::FilesystemNode::kListFilesOnly) || (mode == Common::FilesystemNode::kListAll))) ) {
GBAMPFileSystemNode* dsfsn; GBAMPFileSystemNode* dsfsn;
consolePrintf("Fname: %s\n", fname); consolePrintf("Fname: %s\n", fname);
@ -322,9 +331,9 @@ bool GBAMPFileSystemNode::getChildren(AbstractFSList& dirList, ListMode mode, bo
if (strcmp(fname, ".") && strcmp(fname, "..")) { if (strcmp(fname, ".") && strcmp(fname, "..")) {
if (!strcmp(path, "/")) { if (!strcmp(path, "/")) {
dsfsn = new GBAMPFileSystemNode("mp:" + String(path) + String(fname), entryType == TYPE_DIR); dsfsn = new GBAMPFileSystemNode("mp:" + Common::String(path) + Common::String(fname), entryType == TYPE_DIR);
} else { } else {
dsfsn = new GBAMPFileSystemNode("mp:" + String(path) + String("/") + String(fname), entryType == TYPE_DIR); dsfsn = new GBAMPFileSystemNode("mp:" + Common::String(path) + Common::String("/") + Common::String(fname), entryType == TYPE_DIR);
} }
// dsfsn->_isDirectory = entryType == DIR; // dsfsn->_isDirectory = entryType == DIR;
@ -358,7 +367,7 @@ AbstractFilesystemNode* GBAMPFileSystemNode::getParent() const {
} }
} }
p = new GBAMPFileSystemNode(String(path, lastSlash)); p = new GBAMPFileSystemNode(Common::String(path, lastSlash));
p->_isDirectory = true; p->_isDirectory = true;
} else { } else {
p = new GBAMPFileSystemNode(); p = new GBAMPFileSystemNode();
@ -367,6 +376,14 @@ AbstractFilesystemNode* GBAMPFileSystemNode::getParent() const {
return p; return p;
} }
Common::SeekableReadStream *GBAMPFileSystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *GBAMPFileSystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
}
// Stdio replacements // Stdio replacements
#define MAX_FILE_HANDLES 32 #define MAX_FILE_HANDLES 32
@ -399,6 +416,7 @@ FILE* std_fopen(const char* name, const char* mode) {
if (DS::isGBAMPAvailable()) { if (DS::isGBAMPAvailable()) {
FAT_chdir("/"); FAT_chdir("/");
// Turn all back slashes into forward slashes for gba_nds_fat
char* p = realName; char* p = realName;
while (*p) { while (*p) {
if (*p == '\\') *p = '/'; if (*p == '\\') *p = '/';
@ -422,8 +440,12 @@ FILE* std_fopen(const char* name, const char* mode) {
// Allocate a file handle // Allocate a file handle
int r = 0; int r = 0;
while (handle[r].used) r++; while (handle[r].used) {
r++;
assert(r < MAX_FILE_HANDLES);
}
#ifdef GBA_SRAM_SAVE
if (strchr(mode, 'w')) { if (strchr(mode, 'w')) {
// consolePrintf("Writing %s\n", realName); // consolePrintf("Writing %s\n", realName);
handle[r].sramFile = (DSSaveFile *) DSSaveFileManager::instance()->openSavefile(realName, true); handle[r].sramFile = (DSSaveFile *) DSSaveFileManager::instance()->openSavefile(realName, true);
@ -431,6 +453,7 @@ FILE* std_fopen(const char* name, const char* mode) {
// consolePrintf("Reading %s\n", realName); // consolePrintf("Reading %s\n", realName);
handle[r].sramFile = (DSSaveFile *) DSSaveFileManager::instance()->openSavefile(realName, false); handle[r].sramFile = (DSSaveFile *) DSSaveFileManager::instance()->openSavefile(realName, false);
} }
#endif
if (handle[r].sramFile) { if (handle[r].sramFile) {
handle[r].used = true; handle[r].used = true;
@ -512,69 +535,6 @@ size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle) {
return bytes / size; return bytes / size;
} }
return numItems; return numItems;
/* int item = 0;
u8* data = (u8 *) ptr;
while ((item < numItems) && (!FAT_feof((FAT_FILE *) handle))) {
int bytes = 0;
while ((bytes < size) && (!FAT_feof((FAT_FILE *) handle))) {
*data++ = FAT_fgetc((FAT_FILE *) handle);
bytes++;
}
item++;
}
return item;
*/
int items = 0;
//for (int r = 0; r < numItems; r++) {
if (!std_feof(handle)) {
/* for (int t = 0; t < size; t++) {
if (feof(handle)) eof = true;
*(((char *) (ptr)) + r * size + t) = getc(handle);
}*/
int left = size * numItems;
int bytesRead = -1;
while ((left > 0) && (!FAT_feof((FAT_FILE *) handle))) {
int amount = left > 8192? 8192: left;
// do {
bytesRead = FAT_fread((void *) ptr, 1, amount, (FAT_FILE *) handle);
/* if (bytesRead == 0) {
consolePrintf("Pos:%d items:%d num:%d amount:%d read:%d\n", ftell(handle), items, numItems, amount, bytesRead);
left++;
int pos = ftell(handle);
fseek(handle, 0, SEEK_SET);
int c = getc(handle);
fseek(handle, pos - 1024, SEEK_SET);
fread(ptr, 1024, 1, handle);
swiWaitForVBlank();
//while (true);
}
} while (bytesRead == 0);
*/
left -= bytesRead;
ptr = ((char *) (ptr)) + bytesRead;
}
items = numItems - (left / size);
// FAT_fread((void *) ptr, size, 1, ((int) (handle)) - 1);
// ptr = ((char *) (ptr)) + size;
}
// }
// consolePrintf("...done %d \n", items)
return items;
} }
if (handle->sramFile) { if (handle->sramFile) {
@ -641,10 +601,6 @@ size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle) {
} }
} }
void std_fprintf(FILE* handle, const char* fmt, ...) {
consolePrintf(fmt);
}
bool std_feof(FILE* handle) { bool std_feof(FILE* handle) {
// consolePrintf("feof "); // consolePrintf("feof ");
@ -660,42 +616,10 @@ bool std_feof(FILE* handle) {
return handle->pos >= handle->size; return handle->pos >= handle->size;
} }
void std_fflush(FILE* handle) { int std_fflush(FILE* handle) {
//FIXME: not implemented? //FIXME: not implemented?
// consolePrintf("fflush "); // consolePrintf("fflush ");
} return 0;
char* std_fgets(char* str, int size, FILE* file) {
// consolePrintf("fgets file=%d ", file);
if (DS::isGBAMPAvailable()) {
char* s = str;
while ((*s++ = std_getc(file)) >= 32) {
// consolePrintf("%d ", *s);
}
*s = 0;
// consolePrintf("Read:%s\n", str);
return str;
}
if (file->sramFile) {
file->pos--;
int p = -1;
do {
file->pos++;
p++;
file->sramFile->read((char *) &str[p], 1);
// consolePrintf("%d,", str[p]);
} while ((str[p] >= 32) && (!std_feof(file)) && (p < size));
str[p + 1] = 0;
file->pos++;
// consolePrintf("Read:%s\n", str);
return str;
}
return NULL;
} }
long int std_ftell(FILE* handle) { long int std_ftell(FILE* handle) {
@ -731,92 +655,20 @@ int std_fseek(FILE* handle, long int offset, int whence) {
return 0; return 0;
} }
int std_ferror(FILE* handle) {
//FIXME: not implemented?
// consolePrintf("ferror ");
return 0;
}
void std_clearerr(FILE* handle) { void std_clearerr(FILE* handle) {
//FIXME: not implemented? //FIXME: not implemented?
// consolePrintf("clearerr "); // consolePrintf("clearerr ");
} }
int std_getc(FILE* handle) { void std_fprintf(FILE* handle, const char* fmt, ...) {
if (DS::isGBAMPAvailable()) { consolePrintf(fmt);
char c;
FAT_fread(&c, 1, 1, (FAT_FILE *) handle);
return c;
}
// consolePrintf("fgetc ");
return 0; // Not supported yet
} }
char* std_getcwd(char* dir, int dunno) {
// consolePrintf("getcwd ");
dir[0] = '\0';
return dir; // Not supported yet
}
void std_cwd(char* dir) {
char buffer[128];
strcpy(buffer, dir);
char* realName = buffer;
if (DS::isGBAMPAvailable()) {
if ((strlen(dir) >= 4) && (dir[0] == 'm') && (dir[1] == 'p') && (dir[2] == ':') && (dir[3] == '/')) {
realName += 4;
}
// consolePrintf("Real cwd:%d\n", realName);
char* p = realName;
while (*p) {
if (*p == '\\') *p = '/';
p++;
}
// consolePrintf("Real cwd:%d\n", realName);
FAT_chdir(realName);
} else {
if ((strlen(dir) >= 4) && (dir[0] == 'd') && (dir[1] == 's') && (dir[2] == ':') && (dir[3] == '/')) {
realName += 4;
}
char* p = realName;
while (*p) {
if (*p == '\\') *p = '/';
p++;
}
strcpy(currentDir, realName);
if (*(currentDir + strlen(currentDir) - 1) == '/') {
*(currentDir + strlen(currentDir) - 1) = '\0';
}
// consolePrintf("CWD: %s\n", currentDir);
}
}
int std_ferror(FILE* handle) {
return 0;
}
} // namespace DS } // namespace DS
/**
* 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 *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
while (cur >= start && *cur != '/' && *cur != '\\') {
--cur;
}
return cur + 1;
}

View file

@ -41,12 +41,10 @@ namespace DS {
*/ */
class DSFileSystemNode : public AbstractFilesystemNode { class DSFileSystemNode : public AbstractFilesystemNode {
protected: protected:
typedef class Common::String String;
static ZipFile* _zipFile; static ZipFile* _zipFile;
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory; bool _isDirectory;
bool _isValid; bool _isValid;
@ -61,7 +59,7 @@ public:
* *
* @param path String with the path the new node should point to. * @param path String with the path the new node should point to.
*/ */
DSFileSystemNode(const String &path); DSFileSystemNode(const Common::String &path);
/** /**
* Creates a DSFilesystemNode for a given path. * Creates a DSFilesystemNode for a given path.
@ -69,7 +67,7 @@ public:
* @param path String with the path the new node should point to. * @param path String with the path the new node should point to.
* @param path true if path is a directory, false otherwise. * @param path true if path is a directory, false otherwise.
*/ */
DSFileSystemNode(const String& path, bool isDir); DSFileSystemNode(const Common::String& path, bool isDir);
/** /**
* Copy constructor. * Copy constructor.
@ -77,9 +75,9 @@ public:
DSFileSystemNode(const DSFileSystemNode *node); DSFileSystemNode(const DSFileSystemNode *node);
virtual bool exists() const { return true; } //FIXME: this is just a stub virtual bool exists() const { return true; } //FIXME: this is just a stub
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return true; } //FIXME: this is just a stub virtual bool isReadable() const { return true; } //FIXME: this is just a stub
virtual bool isWritable() const { return true; } //FIXME: this is just a stub virtual bool isWritable() const { return true; } //FIXME: this is just a stub
@ -89,9 +87,12 @@ public:
*/ */
virtual AbstractFilesystemNode *clone() const { return new DSFileSystemNode(this); } virtual AbstractFilesystemNode *clone() const { return new DSFileSystemNode(this); }
virtual AbstractFilesystemNode *getChild(const Common::String& name) const; virtual AbstractFilesystemNode *getChild(const Common::String& name) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode = FilesystemNode::kListDirectoriesOnly, bool hidden = false) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
/** /**
* Returns the zip file this node points to. * Returns the zip file this node points to.
* TODO: check this documentation. * TODO: check this documentation.
@ -107,10 +108,8 @@ public:
*/ */
class GBAMPFileSystemNode : public AbstractFilesystemNode { class GBAMPFileSystemNode : public AbstractFilesystemNode {
protected: protected:
typedef class Common::String String; Common::String _displayName;
Common::String _path;
String _displayName;
String _path;
bool _isDirectory; bool _isDirectory;
bool _isValid; bool _isValid;
@ -125,7 +124,7 @@ public:
* *
* @param path String with the path the new node should point to. * @param path String with the path the new node should point to.
*/ */
GBAMPFileSystemNode(const String &path); GBAMPFileSystemNode(const Common::String &path);
/** /**
* Creates a DSFilesystemNode for a given path. * Creates a DSFilesystemNode for a given path.
@ -133,7 +132,7 @@ public:
* @param path String with the path the new node should point to. * @param path String with the path the new node should point to.
* @param path true if path is a directory, false otherwise. * @param path true if path is a directory, false otherwise.
*/ */
GBAMPFileSystemNode(const String &path, bool isDirectory); GBAMPFileSystemNode(const Common::String &path, bool isDirectory);
/** /**
* Copy constructor. * Copy constructor.
@ -141,9 +140,9 @@ public:
GBAMPFileSystemNode(const GBAMPFileSystemNode *node); GBAMPFileSystemNode(const GBAMPFileSystemNode *node);
virtual bool exists() const { return _isValid || _isDirectory; } virtual bool exists() const { return _isValid || _isDirectory; }
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return true; } //FIXME: this is just a stub virtual bool isReadable() const { return true; } //FIXME: this is just a stub
virtual bool isWritable() const { return true; } //FIXME: this is just a stub virtual bool isWritable() const { return true; } //FIXME: this is just a stub
@ -153,8 +152,11 @@ public:
*/ */
virtual AbstractFilesystemNode *clone() const { return new GBAMPFileSystemNode(this); } virtual AbstractFilesystemNode *clone() const { return new GBAMPFileSystemNode(this); }
virtual AbstractFilesystemNode *getChild(const Common::String& name) const; virtual AbstractFilesystemNode *getChild(const Common::String& name) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode = FilesystemNode::kListDirectoriesOnly, bool hidden = false) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
}; };
struct fileHandle { struct fileHandle {
@ -179,15 +181,14 @@ struct fileHandle {
// Please do not remove any of these prototypes that appear not to be required. // Please do not remove any of these prototypes that appear not to be required.
FILE* std_fopen(const char* name, const char* mode); FILE* std_fopen(const char* name, const char* mode);
void std_fclose(FILE* handle); void std_fclose(FILE* handle);
int std_getc(FILE* handle);
size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle); size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle);
size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle); size_t std_fwrite(const void* ptr, size_t size, size_t numItems, FILE* handle);
bool std_feof(FILE* handle); bool std_feof(FILE* handle);
long int std_ftell(FILE* handle); long int std_ftell(FILE* handle);
int std_fseek(FILE* handle, long int offset, int whence); int std_fseek(FILE* handle, long int offset, int whence);
void std_clearerr(FILE* handle); void std_clearerr(FILE* handle);
void std_cwd(char* dir); int std_fflush(FILE* handle);
void std_fflush(FILE* handle); int std_ferror(FILE* handle);
} //namespace DS } //namespace DS

View file

@ -36,7 +36,7 @@ AbstractFilesystemNode *PalmOSFilesystemFactory::makeCurrentDirectoryFileNode()
return new PalmOSFilesystemNode(); return new PalmOSFilesystemNode();
} }
AbstractFilesystemNode *PalmOSFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *PalmOSFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new PalmOSFilesystemNode(path); return new PalmOSFilesystemNode(path);
} }
#endif #endif

View file

@ -35,11 +35,9 @@
*/ */
class PalmOSFilesystemFactory : public FilesystemFactory, public Common::Singleton<PalmOSFilesystemFactory> { class PalmOSFilesystemFactory : public FilesystemFactory, public Common::Singleton<PalmOSFilesystemFactory> {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected: protected:
PalmOSFilesystemFactory() {}; PalmOSFilesystemFactory() {};

View file

@ -28,6 +28,7 @@
#include "globals.h" #include "globals.h"
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
/** /**
* Implementation of the ScummVM file system API based on PalmOS VFS API. * Implementation of the ScummVM file system API based on PalmOS VFS API.
@ -36,8 +37,8 @@
*/ */
class PalmOSFilesystemNode : public AbstractFilesystemNode { class PalmOSFilesystemNode : public AbstractFilesystemNode {
protected: protected:
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory; bool _isDirectory;
bool _isValid; bool _isValid;
bool _isPseudoRoot; bool _isPseudoRoot;
@ -51,22 +52,25 @@ public:
/** /**
* Creates a POSIXFilesystemNode for a given path. * Creates a POSIXFilesystemNode for a given path.
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
*/ */
PalmOSFilesystemNode(const String &p); PalmOSFilesystemNode(const Common::String &p);
virtual bool exists() const { return _isValid; } virtual bool exists() const { return _isValid; }
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return true; } //FIXME: this is just a stub virtual bool isReadable() const { return true; } //FIXME: this is just a stub
virtual bool isWritable() const { return true; } //FIXME: this is just a stub virtual bool isWritable() const { return true; } //FIXME: this is just a stub
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
private: private:
/** /**
* Adds a single WindowsFilesystemNode to a given list. * Adds a single WindowsFilesystemNode to a given list.
@ -74,44 +78,20 @@ private:
* *
* @param list List to put the file entry node in. * @param list List to put the file entry node in.
* @param mode Mode to use while adding the file entry to the list. * @param mode Mode to use while adding the file entry to the list.
* @param base String with the directory being listed. * @param base Common::String with the directory being listed.
* @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find. * @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find.
*/ */
static void addFile(AbstractFSList &list, ListMode mode, const Char *base, FileInfoType* find_data); static void addFile(AbstractFSList &list, ListMode mode, const Char *base, FileInfoType* find_data);
}; };
/**
* 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 *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;
}
void PalmOSFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, FileInfoType* find_data) { void PalmOSFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, FileInfoType* find_data) {
PalmOSFilesystemNode entry; PalmOSFilesystemNode entry;
bool isDir; bool isDir;
isDir = (find_data->attributes & vfsFileAttrDirectory); isDir = (find_data->attributes & vfsFileAttrDirectory);
if ((!isDir && mode == FilesystemNode::kListDirectoriesOnly) || if ((!isDir && mode == Common::FilesystemNode::kListDirectoriesOnly) ||
(isDir && mode == FilesystemNode::kListFilesOnly)) (isDir && mode == Common::FilesystemNode::kListFilesOnly))
return; return;
entry._isDirectory = isDir; entry._isDirectory = isDir;
@ -136,9 +116,9 @@ PalmOSFilesystemNode::PalmOSFilesystemNode() {
_isPseudoRoot = false; _isPseudoRoot = false;
} }
PalmOSFilesystemNode::PalmOSFilesystemNode(const String &p) { PalmOSFilesystemNode::PalmOSFilesystemNode(const Common::String &p) {
_path = p; _path = p;
_displayName = lastPathComponent(_path); _displayName = lastPathComponent(_path, '/');
UInt32 attr; UInt32 attr;
FileRef handle; FileRef handle;
@ -159,10 +139,10 @@ PalmOSFilesystemNode::PalmOSFilesystemNode(const String &p) {
_isPseudoRoot = false; _isPseudoRoot = false;
} }
AbstractFilesystemNode *PalmOSFilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *PalmOSFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory); assert(_isDirectory);
String newPath(_path); Common::String newPath(_path);
if (_path.lastChar() != '/') if (_path.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += n; newPath += n;
@ -215,17 +195,25 @@ AbstractFilesystemNode *PalmOSFilesystemNode::getParent() const {
if (!_isPseudoRoot) { if (!_isPseudoRoot) {
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = lastPathComponent(_path, '/');
p = new PalmOSFilesystemNode(); p = new PalmOSFilesystemNode();
p->_path = String(start, end - start); p->_path = Common::String(start, end - start);
p->_isValid = true; p->_isValid = true;
p->_isDirectory = true; p->_isDirectory = true;
p->_displayName = lastPathComponent(p->_path); p->_displayName = lastPathComponent(p->_path, '/');
p->_isPseudoRoot =(p->_path == "/"); p->_isPseudoRoot =(p->_path == "/");
} }
return p; return p;
} }
Common::SeekableReadStream *PalmOSFilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *PalmOSFilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
}
#endif // PALMOS_MODE #endif // PALMOS_MODE

View file

@ -26,19 +26,18 @@
#include "backends/fs/posix/posix-fs-factory.h" #include "backends/fs/posix/posix-fs-factory.h"
#include "backends/fs/posix/posix-fs.cpp" #include "backends/fs/posix/posix-fs.cpp"
DECLARE_SINGLETON(POSIXFilesystemFactory);
AbstractFilesystemNode *POSIXFilesystemFactory::makeRootFileNode() const { AbstractFilesystemNode *POSIXFilesystemFactory::makeRootFileNode() const {
return new POSIXFilesystemNode(); return new POSIXFilesystemNode("/");
} }
AbstractFilesystemNode *POSIXFilesystemFactory::makeCurrentDirectoryFileNode() const { AbstractFilesystemNode *POSIXFilesystemFactory::makeCurrentDirectoryFileNode() const {
char buf[MAXPATHLEN]; char buf[MAXPATHLEN];
getcwd(buf, MAXPATHLEN); getcwd(buf, MAXPATHLEN);
return new POSIXFilesystemNode(buf, true); return new POSIXFilesystemNode(buf);
} }
AbstractFilesystemNode *POSIXFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *POSIXFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new POSIXFilesystemNode(path, true); assert(!path.empty());
return new POSIXFilesystemNode(path);
} }
#endif #endif

View file

@ -25,7 +25,6 @@
#ifndef POSIX_FILESYSTEM_FACTORY_H #ifndef POSIX_FILESYSTEM_FACTORY_H
#define POSIX_FILESYSTEM_FACTORY_H #define POSIX_FILESYSTEM_FACTORY_H
#include "common/singleton.h"
#include "backends/fs/fs-factory.h" #include "backends/fs/fs-factory.h"
/** /**
@ -33,19 +32,10 @@
* *
* Parts of this class are documented in the base interface class, FilesystemFactory. * Parts of this class are documented in the base interface class, FilesystemFactory.
*/ */
class POSIXFilesystemFactory : public FilesystemFactory, public Common::Singleton<POSIXFilesystemFactory> { class POSIXFilesystemFactory : public FilesystemFactory {
public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
POSIXFilesystemFactory() {};
private:
friend class Common::Singleton<SingletonBaseType>;
}; };
#endif /*POSIX_FILESYSTEM_FACTORY_H*/ #endif /*POSIX_FILESYSTEM_FACTORY_H*/

View file

@ -24,85 +24,20 @@
#if defined(UNIX) #if defined(UNIX)
#include "backends/fs/abstract-fs.h" #include "backends/fs/posix/posix-fs.h"
#include "backends/fs/stdiostream.h"
#include "common/algorithm.h"
#ifdef MACOSX
#include <sys/types.h>
#endif
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
/** #ifdef __OS2__
* Implementation of the ScummVM file system API based on POSIX. #define INCL_DOS
* #include <os2.h>
* Parts of this class are documented in the base interface class, AbstractFilesystemNode. #endif
*/
class POSIXFilesystemNode : public AbstractFilesystemNode {
protected:
Common::String _displayName;
Common::String _path;
bool _isDirectory;
bool _isValid;
public:
/**
* Creates a POSIXFilesystemNode with the root node as path.
*/
POSIXFilesystemNode();
/**
* Creates a POSIXFilesystemNode for a given path.
*
* @param path String with the path the new node should point to.
* @param verify true if the isValid and isDirectory flags should be verified during the construction.
*/
POSIXFilesystemNode(const Common::String &path, bool verify);
virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; }
virtual Common::String getDisplayName() const { return _displayName; }
virtual Common::String getName() const { return _displayName; }
virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; }
virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; }
virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
private:
/**
* Tests and sets the _isValid and _isDirectory flags, using the stat() function.
*/
virtual void setFlags();
};
/**
* 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 *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;
}
void POSIXFilesystemNode::setFlags() { void POSIXFilesystemNode::setFlags() {
struct stat st; struct stat st;
@ -111,15 +46,7 @@ void POSIXFilesystemNode::setFlags() {
_isDirectory = _isValid ? S_ISDIR(st.st_mode) : false; _isDirectory = _isValid ? S_ISDIR(st.st_mode) : false;
} }
POSIXFilesystemNode::POSIXFilesystemNode() { POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
// The root dir.
_path = "/";
_displayName = _path;
_isValid = true;
_isDirectory = true;
}
POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p, bool verify) {
assert(p.size() > 0); assert(p.size() > 0);
// Expand "~/" to the value of the HOME env variable // Expand "~/" to the value of the HOME env variable
@ -134,30 +61,85 @@ POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p, bool verify) {
} else { } else {
_path = p; _path = p;
} }
#ifdef __OS2__
// On OS/2, 'X:/' is a root of drive X, so we should not remove that last
// slash.
if (!(_path.size() == 3 && _path.hasSuffix(":/")))
#endif
// Normalize the path (that is, remove unneeded slashes etc.)
_path = Common::normalizePath(_path, '/');
_displayName = Common::lastPathComponent(_path, '/');
_displayName = lastPathComponent(_path); // TODO: should we turn relative paths into absolute ones?
// Pro: Ensures the "getParent" works correctly even for relative dirs.
if (verify) { // Contra: The user may wish to use (and keep!) relative paths in his
setFlags(); // config file, and converting relative to absolute paths may hurt him...
//
// An alternative approach would be to change getParent() to work correctly
// if "_path" is the empty string.
#if 0
if (!_path.hasPrefix("/")) {
char buf[MAXPATHLEN+1];
getcwd(buf, MAXPATHLEN);
strcat(buf, "/");
_path = buf + _path;
} }
#endif
// TODO: Should we enforce that the path is absolute at this point?
//assert(_path.hasPrefix("/"));
setFlags();
} }
AbstractFilesystemNode *POSIXFilesystemNode::getChild(const Common::String &n) const { AbstractFilesystemNode *POSIXFilesystemNode::getChild(const Common::String &n) const {
// FIXME: Pretty lame implementation! We do no error checking to speak assert(!_path.empty());
// of, do not check if this is a special node, etc.
assert(_isDirectory); assert(_isDirectory);
// Make sure the string contains no slashes
assert(!n.contains('/'));
// We assume here that _path is already normalized (hence don't bother to call
// Common::normalizePath on the final path).
Common::String newPath(_path); Common::String newPath(_path);
if (_path.lastChar() != '/') if (_path.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += n; newPath += n;
return new POSIXFilesystemNode(newPath, true); return makeNode(newPath);
} }
bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const { bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const {
assert(_isDirectory); assert(_isDirectory);
#ifdef __OS2__
if (_path == "/") {
// Special case for the root dir: List all DOS drives
ULONG ulDrvNum;
ULONG ulDrvMap;
DosQueryCurrentDisk(&ulDrvNum, &ulDrvMap);
for (int i = 0; i < 26; i++) {
if (ulDrvMap & 1) {
char drive_root[] = "A:/";
drive_root[0] += i;
POSIXFilesystemNode *entry = new POSIXFilesystemNode();
entry->_isDirectory = true;
entry->_isValid = true;
entry->_path = drive_root;
entry->_displayName = "[" + Common::String(drive_root, 2) + "]";
myList.push_back(entry);
}
ulDrvMap >>= 1;
}
return true;
}
#endif
DIR *dirp = opendir(_path.c_str()); DIR *dirp = opendir(_path.c_str());
struct dirent *dp; struct dirent *dp;
@ -175,12 +157,12 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
continue; continue;
} }
Common::String newPath(_path); // Start with a clone of this node, with the correct path set
if (newPath.lastChar() != '/') POSIXFilesystemNode entry(*this);
newPath += '/'; entry._displayName = dp->d_name;
newPath += dp->d_name; if (_path.lastChar() != '/')
entry._path += '/';
POSIXFilesystemNode entry(newPath, false); entry._path += entry._displayName;
#if defined(SYSTEM_NOT_SUPPORTING_D_TYPE) #if defined(SYSTEM_NOT_SUPPORTING_D_TYPE)
/* TODO: d_type is not part of POSIX, so it might not be supported /* TODO: d_type is not part of POSIX, so it might not be supported
@ -215,13 +197,10 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
continue; continue;
// Honor the chosen mode // Honor the chosen mode
if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) || if ((mode == Common::FilesystemNode::kListFilesOnly && entry._isDirectory) ||
(mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory)) (mode == Common::FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue; continue;
if (entry._isDirectory)
entry._path += "/";
myList.push_back(new POSIXFilesystemNode(entry)); myList.push_back(new POSIXFilesystemNode(entry));
} }
closedir(dirp); closedir(dirp);
@ -231,12 +210,39 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
AbstractFilesystemNode *POSIXFilesystemNode::getParent() const { AbstractFilesystemNode *POSIXFilesystemNode::getParent() const {
if (_path == "/") if (_path == "/")
return 0; return 0; // The filesystem root has no parent
#ifdef __OS2__
if (_path.size() == 3 && _path.hasSuffix(":/"))
// This is a root directory of a drive
return makeNode("/"); // return a virtual root for a list of drives
#endif
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = start + _path.size();
// Strip of the last component. We make use of the fact that at this
// point, _path is guaranteed to be normalized
while (end > start && *(end-1) != '/')
end--;
return new POSIXFilesystemNode(Common::String(start, end - start), true); if (end == start) {
// This only happens if we were called with a relative path, for which
// there simply is no parent.
// TODO: We could also resolve this by assuming that the parent is the
// current working directory, and returning a node referring to that.
return 0;
}
return makeNode(Common::String(start, end));
}
Common::SeekableReadStream *POSIXFilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *POSIXFilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
} }
#endif //#if defined(UNIX) #endif //#if defined(UNIX)

View file

@ -0,0 +1,86 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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.
*
* $URL$
* $Id$
*/
#ifndef POSIX_FILESYSTEM_H
#define POSIX_FILESYSTEM_H
#include "backends/fs/abstract-fs.h"
#ifdef MACOSX
#include <sys/types.h>
#endif
#include <unistd.h>
/**
* Implementation of the ScummVM file system API based on POSIX.
*
* Parts of this class are documented in the base interface class, AbstractFilesystemNode.
*/
class POSIXFilesystemNode : public AbstractFilesystemNode {
protected:
Common::String _displayName;
Common::String _path;
bool _isDirectory;
bool _isValid;
virtual AbstractFilesystemNode *makeNode(const Common::String &path) const {
return new POSIXFilesystemNode(path);
}
/**
* Plain constructor, for internal use only (hence protected).
*/
POSIXFilesystemNode() : _isDirectory(false), _isValid(false) {}
public:
/**
* Creates a POSIXFilesystemNode for a given path.
*
* @param path the path the new node should point to.
*/
POSIXFilesystemNode(const Common::String &path);
virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; }
virtual Common::String getDisplayName() const { return _displayName; }
virtual Common::String getName() const { return _displayName; }
virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; }
virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; }
virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
private:
/**
* Tests and sets the _isValid and _isDirectory flags, using the stat() function.
*/
virtual void setFlags();
};
#endif /*POSIX_FILESYSTEM_H*/

View file

@ -36,7 +36,7 @@ AbstractFilesystemNode *Ps2FilesystemFactory::makeCurrentDirectoryFileNode() con
return new Ps2FilesystemNode(); return new Ps2FilesystemNode();
} }
AbstractFilesystemNode *Ps2FilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *Ps2FilesystemFactory::makeFileNodePath(const Common::String &path) const {
// return new Ps2FilesystemNode(path); // return new Ps2FilesystemNode(path);
Ps2FilesystemNode *nf = new Ps2FilesystemNode(path, true); Ps2FilesystemNode *nf = new Ps2FilesystemNode(path, true);

View file

@ -35,11 +35,9 @@
*/ */
class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> { class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected: protected:
Ps2FilesystemFactory() {}; Ps2FilesystemFactory() {};

View file

@ -23,6 +23,7 @@
*/ */
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
#include <kernel.h> #include <kernel.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -47,8 +48,8 @@ class Ps2FilesystemNode : public AbstractFilesystemNode {
friend class Ps2FilesystemFactory; friend class Ps2FilesystemFactory;
protected: protected:
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory; bool _isDirectory;
bool _isRoot; bool _isRoot;
@ -65,10 +66,10 @@ public:
/** /**
* Creates a PS2FilesystemNode for a given path. * Creates a PS2FilesystemNode for a given path.
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
*/ */
Ps2FilesystemNode(const String &path); Ps2FilesystemNode(const Common::String &path);
Ps2FilesystemNode(const String &path, bool verify); Ps2FilesystemNode(const Common::String &path, bool verify);
/** /**
* Copy constructor. * Copy constructor.
@ -77,9 +78,9 @@ public:
virtual bool exists(void) const; virtual bool exists(void) const;
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { virtual bool isDirectory() const {
return _isDirectory; return _isDirectory;
@ -95,33 +96,14 @@ public:
} }
virtual AbstractFilesystemNode *clone() const { return new Ps2FilesystemNode(this); } virtual AbstractFilesystemNode *clone() const { return new Ps2FilesystemNode(this); }
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
}; };
/**
* Returns the last component of a given path.
*
* @param str String containing the path.
* @return Pointer to the first char of the last component inside str.
*/
const char *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 != ':') {
--cur;
}
printf("romeo : lastPathComponent = %s\n", cur + 1);
return cur + 1;
}
Ps2FilesystemNode::Ps2FilesystemNode() { Ps2FilesystemNode::Ps2FilesystemNode() {
_isDirectory = true; _isDirectory = true;
_isRoot = true; _isRoot = true;
@ -129,12 +111,12 @@ Ps2FilesystemNode::Ps2FilesystemNode() {
_path = ""; _path = "";
} }
Ps2FilesystemNode::Ps2FilesystemNode(const String &path) { Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path) {
_path = path; _path = path;
_isDirectory = true; _isDirectory = true;
if (strcmp(path.c_str(), "") == 0) { if (strcmp(path.c_str(), "") == 0) {
_isRoot = true; _isRoot = true;
_displayName = String("PlayStation 2"); _displayName = Common::String("PlayStation 2");
} else { } else {
_isRoot = false; _isRoot = false;
const char *dsplName = NULL, *pos = path.c_str(); const char *dsplName = NULL, *pos = path.c_str();
@ -142,18 +124,18 @@ Ps2FilesystemNode::Ps2FilesystemNode(const String &path) {
if (*pos++ == '/') if (*pos++ == '/')
dsplName = pos; dsplName = pos;
if (dsplName) if (dsplName)
_displayName = String(dsplName); _displayName = Common::String(dsplName);
else else
_displayName = getDeviceDescription(path.c_str()); _displayName = getDeviceDescription(path.c_str());
} }
} }
Ps2FilesystemNode::Ps2FilesystemNode(const String &path, bool verify) { Ps2FilesystemNode::Ps2FilesystemNode(const Common::String &path, bool verify) {
_path = path; _path = path;
if (strcmp(path.c_str(), "") == 0) { if (strcmp(path.c_str(), "") == 0) {
_isRoot = true; /* root is always a dir*/ _isRoot = true; /* root is always a dir*/
_displayName = String("PlayStation 2"); _displayName = Common::String("PlayStation 2");
_isDirectory = true; _isDirectory = true;
} else { } else {
_isRoot = false; _isRoot = false;
@ -163,7 +145,7 @@ Ps2FilesystemNode::Ps2FilesystemNode(const String &path, bool verify) {
dsplName = pos; dsplName = pos;
if (dsplName) { if (dsplName) {
_displayName = String(dsplName); _displayName = Common::String(dsplName);
if (verify) if (verify)
_isDirectory = getDirectoryFlag(path.c_str()); _isDirectory = getDirectoryFlag(path.c_str());
else else
@ -228,7 +210,7 @@ bool Ps2FilesystemNode::getDirectoryFlag(const char *path) {
return false; return false;
} }
AbstractFilesystemNode *Ps2FilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
if (!_isDirectory) if (!_isDirectory)
return NULL; return NULL;
@ -306,9 +288,9 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
while ((dreadRes = fio.dread(fd, &dirent)) > 0) { while ((dreadRes = fio.dread(fd, &dirent)) > 0) {
if (dirent.name[0] == '.') if (dirent.name[0] == '.')
continue; // ignore '.' and '..' continue; // ignore '.' and '..'
if (((mode == FilesystemNode::kListDirectoriesOnly) && (dirent.stat.mode & FIO_S_IFDIR)) || if (((mode == Common::FilesystemNode::kListDirectoriesOnly) && (dirent.stat.mode & FIO_S_IFDIR)) ||
((mode == FilesystemNode::kListFilesOnly) && !(dirent.stat.mode & FIO_S_IFDIR)) || ((mode == Common::FilesystemNode::kListFilesOnly) && !(dirent.stat.mode & FIO_S_IFDIR)) ||
(mode == FilesystemNode::kListAll)) { (mode == Common::FilesystemNode::kListAll)) {
dirEntry._isDirectory = (bool)(dirent.stat.mode & FIO_S_IFDIR); dirEntry._isDirectory = (bool)(dirent.stat.mode & FIO_S_IFDIR);
dirEntry._isRoot = false; dirEntry._isRoot = false;
@ -344,7 +326,7 @@ AbstractFilesystemNode *Ps2FilesystemNode::getParent() const {
} }
if (slash) if (slash)
return new Ps2FilesystemNode(String(_path.c_str(), slash - _path.c_str())); return new Ps2FilesystemNode(Common::String(_path.c_str(), slash - _path.c_str()));
else else
return new Ps2FilesystemNode(); return new Ps2FilesystemNode();
} }
@ -359,3 +341,10 @@ char *Ps2FilesystemNode::getDeviceDescription(const char *path) const {
return "Harddisk"; return "Harddisk";
} }
Common::SeekableReadStream *Ps2FilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *Ps2FilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
}

View file

@ -36,7 +36,7 @@ AbstractFilesystemNode *PSPFilesystemFactory::makeCurrentDirectoryFileNode() con
return new PSPFilesystemNode(); return new PSPFilesystemNode();
} }
AbstractFilesystemNode *PSPFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *PSPFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new PSPFilesystemNode(path, true); return new PSPFilesystemNode(path, true);
} }
#endif #endif

View file

@ -35,11 +35,9 @@
*/ */
class PSPFilesystemFactory : public FilesystemFactory, public Common::Singleton<PSPFilesystemFactory> { class PSPFilesystemFactory : public FilesystemFactory, public Common::Singleton<PSPFilesystemFactory> {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected: protected:
PSPFilesystemFactory() {}; PSPFilesystemFactory() {};

View file

@ -26,6 +26,7 @@
#include "engines/engine.h" #include "engines/engine.h"
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
@ -39,8 +40,8 @@
*/ */
class PSPFilesystemNode : public AbstractFilesystemNode { class PSPFilesystemNode : public AbstractFilesystemNode {
protected: protected:
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory; bool _isDirectory;
bool _isValid; bool _isValid;
@ -53,48 +54,27 @@ public:
/** /**
* Creates a PSPFilesystemNode for a given path. * Creates a PSPFilesystemNode for a given path.
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
* @param verify true if the isValid and isDirectory flags should be verified during the construction. * @param verify true if the isValid and isDirectory flags should be verified during the construction.
*/ */
PSPFilesystemNode(const Common::String &p, bool verify); PSPFilesystemNode(const Common::String &p, bool verify);
virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; } virtual bool exists() const { return access(_path.c_str(), F_OK) == 0; }
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; } virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; }
virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; } virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; }
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
}; };
/**
* 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 *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;
}
PSPFilesystemNode::PSPFilesystemNode() { PSPFilesystemNode::PSPFilesystemNode() {
_isDirectory = true; _isDirectory = true;
_displayName = "Root"; _displayName = "Root";
@ -106,7 +86,7 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p, bool verify) {
assert(p.size() > 0); assert(p.size() > 0);
_path = p; _path = p;
_displayName = lastPathComponent(_path); _displayName = lastPathComponent(_path, '/');
_isValid = true; _isValid = true;
_isDirectory = true; _isDirectory = true;
@ -117,12 +97,12 @@ PSPFilesystemNode::PSPFilesystemNode(const Common::String &p, bool verify) {
} }
} }
AbstractFilesystemNode *PSPFilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *PSPFilesystemNode::getChild(const Common::String &n) const {
// FIXME: Pretty lame implementation! We do no error checking to speak // FIXME: Pretty lame implementation! We do no error checking to speak
// of, do not check if this is a special node, etc. // of, do not check if this is a special node, etc.
assert(_isDirectory); assert(_isDirectory);
String newPath(_path); Common::String newPath(_path);
if (_path.lastChar() != '/') if (_path.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += n; newPath += n;
@ -157,8 +137,8 @@ bool PSPFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
entry._path += "/"; entry._path += "/";
// Honor the chosen mode // Honor the chosen mode
if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) || if ((mode == Common::FilesystemNode::kListFilesOnly && entry._isDirectory) ||
(mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory)) (mode == Common::FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue; continue;
myList.push_back(new PSPFilesystemNode(entry)); myList.push_back(new PSPFilesystemNode(entry));
@ -176,9 +156,17 @@ AbstractFilesystemNode *PSPFilesystemNode::getParent() const {
return 0; return 0;
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = lastPathComponent(_path, '/');
return new PSPFilesystemNode(String(start, end - start), false); return new PSPFilesystemNode(Common::String(start, end - start), false);
}
Common::SeekableReadStream *PSPFilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *PSPFilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
} }
#endif //#ifdef __PSP__ #endif //#ifdef __PSP__

161
backends/fs/stdiostream.cpp Normal file
View file

@ -0,0 +1,161 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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.
*
* $URL$
* $Id$
*
*/
#include "backends/fs/stdiostream.h"
#include <errno.h>
#if defined(MACOSX) || defined(IPHONE)
#include "CoreFoundation/CoreFoundation.h"
#endif
#ifdef __PLAYSTATION2__
// for those replaced fopen/fread/etc functions
typedef unsigned long uint64;
typedef signed long int64;
#include "backends/platform/ps2/fileio.h"
#define fopen(a, b) ps2_fopen(a, b)
#define fclose(a) ps2_fclose(a)
#define fseek(a, b, c) ps2_fseek(a, b, c)
#define ftell(a) ps2_ftell(a)
#define feof(a) ps2_feof(a)
#define fread(a, b, c, d) ps2_fread(a, b, c, d)
#define fwrite(a, b, c, d) ps2_fwrite(a, b, c, d)
//#define fprintf ps2_fprintf // used in common/util.cpp
//#define fflush(a) ps2_fflush(a) // used in common/util.cpp
//#define fgetc(a) ps2_fgetc(a) // not used
//#define fgets(a, b, c) ps2_fgets(a, b, c) // not used
//#define fputc(a, b) ps2_fputc(a, b) // not used
//#define fputs(a, b) ps2_fputs(a, b) // not used
//#define fsize(a) ps2_fsize(a) // not used -- and it is not a standard function either
#endif
#ifdef __DS__
// These functions replace the standard library functions of the same name.
// As this header is included after the standard one, I have the chance to #define
// all of these to my own code.
//
// A #define is the only way, as redefinig the functions would cause linker errors.
// These functions need to be #undef'ed, as their original definition
// in devkitarm is done with #includes (ugh!)
#undef feof
#undef clearerr
//#undef getc
//#undef ferror
#include "backends/fs/ds/ds-fs.h"
// Only functions used in the ScummVM source have been defined here!
#define fopen(name, mode) DS::std_fopen(name, mode)
#define fclose(handle) DS::std_fclose(handle)
#define fread(ptr, size, items, file) DS::std_fread(ptr, size, items, file)
#define fwrite(ptr, size, items, file) DS::std_fwrite(ptr, size, items, file)
#define feof(handle) DS::std_feof(handle)
#define ftell(handle) DS::std_ftell(handle)
#define fseek(handle, offset, whence) DS::std_fseek(handle, offset, whence)
#define clearerr(handle) DS::std_clearerr(handle)
#define fflush(file) DS::std_fflush(file)
#define ferror(handle) DS::std_ferror(handle)
#endif
StdioStream::StdioStream(void *handle) : _handle(handle) {
assert(handle);
}
StdioStream::~StdioStream() {
fclose((FILE *)_handle);
}
bool StdioStream::err() const {
return ferror((FILE *)_handle) != 0;
}
void StdioStream::clearErr() {
clearerr((FILE *)_handle);
}
bool StdioStream::eos() const {
return feof((FILE *)_handle) != 0;
}
int32 StdioStream::pos() const {
return ftell((FILE *)_handle);
}
int32 StdioStream::size() const {
int32 oldPos = ftell((FILE *)_handle);
fseek((FILE *)_handle, 0, SEEK_END);
int32 length = ftell((FILE *)_handle);
fseek((FILE *)_handle, oldPos, SEEK_SET);
return length;
}
bool StdioStream::seek(int32 offs, int whence) {
return fseek((FILE *)_handle, offs, whence) == 0;
}
uint32 StdioStream::read(void *ptr, uint32 len) {
return fread((byte *)ptr, 1, len, (FILE *)_handle);
}
uint32 StdioStream::write(const void *ptr, uint32 len) {
return fwrite(ptr, 1, len, (FILE *)_handle);
}
bool StdioStream::flush() {
return fflush((FILE *)_handle) == 0;
}
StdioStream *StdioStream::makeFromPath(const Common::String &path, bool writeMode) {
FILE *handle = fopen(path.c_str(), writeMode ? "wb" : "rb");
#ifdef __amigaos4__
//
// Work around for possibility that someone uses AmigaOS "newlib" build
// with SmartFileSystem (blocksize 512 bytes), leading to buffer size
// being only 512 bytes. "Clib2" sets the buffer size to 8KB, resulting
// smooth movie playback. This forces the buffer to be enough also when
// using "newlib" compile on SFS.
//
if (handle && !writeMode) {
setvbuf(handle, NULL, _IOFBF, 8192);
}
#endif
if (handle)
return new StdioStream(handle);
return 0;
}

View file

@ -23,70 +23,40 @@
* *
*/ */
#ifndef SCUMM_SMUSH_CHUNK_H #ifndef BACKENDS_FS_STDIOSTREAM_H
#define SCUMM_SMUSH_CHUNK_H #define BACKENDS_FS_STDIOSTREAM_H
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/str.h" #include "common/noncopyable.h"
#include "common/stream.h" #include "common/stream.h"
#include "common/str.h"
namespace Scumm { class StdioStream : public Common::SeekableReadStream, public Common::WriteStream, public Common::NonCopyable {
class BaseScummFile;
class Chunk : public Common::SeekableReadStream {
public:
typedef uint32 type;
virtual type getType() const = 0;
virtual Chunk *subBlock() = 0;
virtual void reseek() = 0;
};
// Common functionality for concrete chunks (FileChunk, MemoryChunk)
class BaseChunk : public Chunk {
protected: protected:
Chunk::type _type; /** File handle to the actual file. */
uint32 _size; void *_handle;
uint32 _curPos;
Common::String _name;
BaseChunk();
public: public:
Chunk::type getType() const; /**
uint32 size() const; * Given a path, invokes fopen on that path and wrap the result in a
* StdioStream instance.
*/
static StdioStream *makeFromPath(const Common::String &path, bool writeMode);
StdioStream(void *handle);
virtual ~StdioStream();
bool err() const;
void clearErr();
bool eos() const; bool eos() const;
uint32 pos() const;
void seek(int32 delta, int dir); virtual uint32 write(const void *dataPtr, uint32 dataSize);
virtual bool flush();
virtual int32 pos() const;
virtual int32 size() const;
bool seek(int32 offs, int whence = SEEK_SET);
uint32 read(void *dataPtr, uint32 dataSize);
}; };
class FileChunk : public BaseChunk {
private:
BaseScummFile *_data;
bool _deleteData;
uint32 _offset;
FileChunk(BaseScummFile *data, int offset);
public:
FileChunk(const Common::String &name, int offset = 0);
virtual ~FileChunk();
Chunk *subBlock();
void reseek();
uint32 read(void *buffer, uint32 size);
};
class MemoryChunk : public BaseChunk {
private:
byte *_data;
public:
MemoryChunk(byte *data);
Chunk *subBlock();
void reseek();
uint32 read(void *buffer, uint32 size);
};
} // End of namespace Scumm
#endif #endif

View file

@ -26,8 +26,6 @@
#include "backends/fs/symbian/symbian-fs-factory.h" #include "backends/fs/symbian/symbian-fs-factory.h"
#include "backends/fs/symbian/symbian-fs.cpp" #include "backends/fs/symbian/symbian-fs.cpp"
DECLARE_SINGLETON(SymbianFilesystemFactory);
AbstractFilesystemNode *SymbianFilesystemFactory::makeRootFileNode() const { AbstractFilesystemNode *SymbianFilesystemFactory::makeRootFileNode() const {
return new SymbianFilesystemNode(true); return new SymbianFilesystemNode(true);
} }
@ -38,7 +36,7 @@ AbstractFilesystemNode *SymbianFilesystemFactory::makeCurrentDirectoryFileNode()
return new SymbianFilesystemNode(path); return new SymbianFilesystemNode(path);
} }
AbstractFilesystemNode *SymbianFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *SymbianFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new SymbianFilesystemNode(path); return new SymbianFilesystemNode(path);
} }
#endif #endif

View file

@ -25,7 +25,6 @@
#ifndef SYMBIAN_FILESYSTEM_FACTORY_H #ifndef SYMBIAN_FILESYSTEM_FACTORY_H
#define SYMBIAN_FILESYSTEM_FACTORY_H #define SYMBIAN_FILESYSTEM_FACTORY_H
#include "common/singleton.h"
#include "backends/fs/fs-factory.h" #include "backends/fs/fs-factory.h"
/** /**
@ -33,19 +32,11 @@
* *
* Parts of this class are documented in the base interface class, FilesystemFactory. * Parts of this class are documented in the base interface class, FilesystemFactory.
*/ */
class SymbianFilesystemFactory : public FilesystemFactory, public Common::Singleton<SymbianFilesystemFactory> { class SymbianFilesystemFactory : public FilesystemFactory {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
SymbianFilesystemFactory() {};
private:
friend class Common::Singleton<SingletonBaseType>;
}; };
#endif /*SYMBIAN_FILESYSTEM_FACTORY_H*/ #endif /*SYMBIAN_FILESYSTEM_FACTORY_H*/

View file

@ -24,12 +24,16 @@
#if defined (__SYMBIAN32__) #if defined (__SYMBIAN32__)
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/symbian/symbianstream.h"
#include "backends/platform/symbian/src/symbianos.h"
#include <dirent.h> #include <dirent.h>
#include <eikenv.h> #include <eikenv.h>
#include <f32file.h> #include <f32file.h>
#include <bautils.h> #include <bautils.h>
#define KDriveLabelSize 30
/** /**
* Implementation of the ScummVM file system API based on POSIX. * Implementation of the ScummVM file system API based on POSIX.
* *
@ -37,12 +41,11 @@
*/ */
class SymbianFilesystemNode : public AbstractFilesystemNode { class SymbianFilesystemNode : public AbstractFilesystemNode {
protected: protected:
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory; TBool _isDirectory;
bool _isValid; TBool _isValid;
bool _isPseudoRoot; TBool _isPseudoRoot;
public: public:
/** /**
* Creates a SymbianFilesystemNode with the root node as path. * Creates a SymbianFilesystemNode with the root node as path.
@ -54,57 +57,36 @@ public:
/** /**
* Creates a SymbianFilesystemNode for a given path. * Creates a SymbianFilesystemNode for a given path.
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
*/ */
SymbianFilesystemNode(const String &path); SymbianFilesystemNode(const Common::String &path);
virtual bool exists() const { virtual bool exists() const {
TFileName fname; TFileName fname;
TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size()); TPtrC8 ptr((const unsigned char*) _path.c_str(), _path.size());
fname.Copy(ptr); fname.Copy(ptr);
TBool fileExists = BaflUtils::FileExists(CEikonEnv::Static()->FsSession(), fname); TBool fileExists = BaflUtils::FileExists(static_cast<OSystem_SDL_Symbian*> (g_system)->FsSession(), fname);
return fileExists; return fileExists;
} }
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; } //FIXME: this is just a stub virtual bool isReadable() const { return access(_path.c_str(), R_OK) == 0; } //FIXME: this is just a stub
virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; } //FIXME: this is just a stub virtual bool isWritable() const { return access(_path.c_str(), W_OK) == 0; } //FIXME: this is just a stub
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
}; };
/**
* Returns the last component of a given path.
*
* Examples:
* c:\foo\bar.txt would return "\bar.txt"
* c:\foo\bar\ would return "\bar\"
*
* @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str.
*/
const char *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;
}
/** /**
* Fixes the path by changing all slashes to backslashes. * Fixes the path by changing all slashes to backslashes.
* *
* @param path String with the path to be fixed. * @param path Common::String with the path to be fixed.
*/ */
static void fixFilePath(Common::String& aPath){ static void fixFilePath(Common::String& aPath){
TInt len = aPath.size(); TInt len = aPath.size();
@ -118,54 +100,47 @@ static void fixFilePath(Common::String& aPath){
SymbianFilesystemNode::SymbianFilesystemNode(bool aIsRoot) { SymbianFilesystemNode::SymbianFilesystemNode(bool aIsRoot) {
_path = ""; _path = "";
_isValid = true; _isValid = ETrue;
_isDirectory = true; _isDirectory = ETrue;
_isPseudoRoot = aIsRoot; _isPseudoRoot = aIsRoot;
_displayName = "Root"; _displayName = "Root";
} }
SymbianFilesystemNode::SymbianFilesystemNode(const String &path) { SymbianFilesystemNode::SymbianFilesystemNode(const Common::String &path) {
if (path.size() == 0) if (path.size() == 0)
_isPseudoRoot = true; _isPseudoRoot = ETrue;
else else
_isPseudoRoot = false; _isPseudoRoot = EFalse;
_path = path; _path = path;
fixFilePath(_path); fixFilePath(_path);
_displayName = lastPathComponent(_path); _displayName = lastPathComponent(_path, '\\');
TEntry fileAttribs; TEntry fileAttribs;
TFileName fname; TFileName fname;
TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size()); TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size());
fname.Copy(ptr); fname.Copy(ptr);
if (CEikonEnv::Static()->FsSession().Entry(fname, fileAttribs) == KErrNone) { if (static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession().Entry(fname, fileAttribs) == KErrNone) {
_isValid = true; _isValid = ETrue;
_isDirectory = fileAttribs.IsDir(); _isDirectory = fileAttribs.IsDir();
} else { } else {
_isValid = false; _isValid = ETrue;
_isDirectory = false; _isDirectory = EFalse;
} }
} }
AbstractFilesystemNode *SymbianFilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *SymbianFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory); assert(_isDirectory);
String newPath(_path); Common::String newPath(_path);
if (_path.lastChar() != '\\') if (_path.lastChar() != '\\')
newPath += '\\'; newPath += '\\';
newPath += n;
TPtrC8 ptr((const unsigned char*) newPath.c_str(), newPath.size()); newPath += n;
TFileName fname;
fname.Copy(ptr);
TBool isFolder = EFalse;
BaflUtils::IsFolder(CEikonEnv::Static()->FsSession(), fname, isFolder);
if (!isFolder)
return 0;
return new SymbianFilesystemNode(newPath); return new SymbianFilesystemNode(newPath);
} }
@ -177,19 +152,19 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
if (_isPseudoRoot) { if (_isPseudoRoot) {
// Drives enumeration // Drives enumeration
RFs fs = CEikonEnv::Static()->FsSession(); RFs& fs = static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession();
TInt driveNumber; TInt driveNumber;
TChar driveLetter; TChar driveLetter;
TUint driveLetterValue; TUint driveLetterValue;
TVolumeInfo volumeInfo; TVolumeInfo volumeInfo;
TBuf8<30> driveLabel8; TBuf8<KDriveLabelSize> driveLabel8;
TBuf8<30> driveString8; TBuf8<KDriveLabelSize> driveString8;
for (driveNumber=EDriveA; driveNumber<=EDriveZ; driveNumber++) { for (driveNumber=EDriveA; driveNumber<=EDriveZ; driveNumber++) {
TInt err = fs.Volume(volumeInfo, driveNumber); TInt err = fs.Volume(volumeInfo, driveNumber);
if (err != KErrNone) if (err != KErrNone)
continue; continue;
if (fs.DriveToChar(driveNumber,driveLetter) != KErrNone) if (fs.DriveToChar(driveNumber, driveLetter) != KErrNone)
continue; continue;
driveLetterValue = driveLetter; driveLetterValue = driveLetter;
@ -205,40 +180,46 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
sprintf(path,"%c:\\", driveNumber+'A'); sprintf(path,"%c:\\", driveNumber+'A');
SymbianFilesystemNode entry(false); SymbianFilesystemNode entry(false);
entry._displayName = (char*)driveString8.PtrZ(); // drive_name entry._displayName = (char*) driveString8.PtrZ(); // drive_name
entry._isDirectory = true; entry._isDirectory = ETrue;
entry._isValid = true; entry._isValid = ETrue;
entry._isPseudoRoot = false; entry._isPseudoRoot = EFalse;
entry._path = path; entry._path = path;
myList.push_back(new SymbianFilesystemNode(entry)); myList.push_back(new SymbianFilesystemNode(entry));
} }
} else { } else {
TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size()); TPtrC8 ptr((const unsigned char*) _path.c_str(), _path.size());
TFileName fname; TFileName fname;
fname.Copy(ptr);
TBuf8<256>nameBuf; TBuf8<256>nameBuf;
CDir* dirPtr; CDir* dirPtr;
if (CEikonEnv::Static()->FsSession().GetDir(fname,KEntryAttNormal|KEntryAttDir,0,dirPtr)==KErrNone) { fname.Copy(ptr);
if (_path.lastChar() != '\\')
fname.Append('\\');
if (static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession().GetDir(fname, KEntryAttNormal|KEntryAttDir, 0, dirPtr) == KErrNone) {
CleanupStack::PushL(dirPtr); CleanupStack::PushL(dirPtr);
TInt cnt=dirPtr->Count(); TInt cnt=dirPtr->Count();
for (TInt loop=0;loop<cnt;loop++) { for (TInt loop=0;loop<cnt;loop++) {
TEntry fileentry=(*dirPtr)[loop]; TEntry fileentry=(*dirPtr)[loop];
nameBuf.Copy(fileentry.iName); nameBuf.Copy(fileentry.iName);
SymbianFilesystemNode entry(false); SymbianFilesystemNode entry(EFalse);
entry._isPseudoRoot = false; entry._isPseudoRoot = EFalse;
entry._displayName =(char*)nameBuf.PtrZ(); entry._displayName =(char*) nameBuf.PtrZ();
entry._path = _path; entry._path = _path;
entry._path +=(char*)nameBuf.PtrZ();
if (entry._path.lastChar() != '\\')
entry._path+= '\\';
entry._path +=(char*) nameBuf.PtrZ();
entry._isDirectory = fileentry.IsDir(); entry._isDirectory = fileentry.IsDir();
// Honor the chosen mode // Honor the chosen mode
if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) || if ((mode == Common::FilesystemNode::kListFilesOnly && entry._isDirectory) ||
(mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory)) (mode == Common::FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue; continue;
if (entry._isDirectory)
entry._path += "\\";
myList.push_back(new SymbianFilesystemNode(entry)); myList.push_back(new SymbianFilesystemNode(entry));
} }
CleanupStack::PopAndDestroy(dirPtr); CleanupStack::PopAndDestroy(dirPtr);
@ -254,21 +235,30 @@ AbstractFilesystemNode *SymbianFilesystemNode::getParent() const {
// Root node is its own parent. Still we can't just return this // Root node is its own parent. Still we can't just return this
// as the GUI code will call delete on the old node. // as the GUI code will call delete on the old node.
if (!_isPseudoRoot && _path.size() > 3) { if (!_isPseudoRoot && _path.size() > 3) {
p = new SymbianFilesystemNode(false); p = new SymbianFilesystemNode(EFalse);
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = lastPathComponent(_path, '\\');
p->_path = String(start, end - start); p->_path = Common::String(start, end - start);
p->_isValid = true; p->_isValid = ETrue;
p->_isDirectory = true; p->_isDirectory = ETrue;
p->_displayName = lastPathComponent(p->_path); p->_displayName = lastPathComponent(p->_path, '\\');
} }
else else
{ {
p = new SymbianFilesystemNode(true); p = new SymbianFilesystemNode(ETrue);
} }
return p; return p;
} }
Common::SeekableReadStream *SymbianFilesystemNode::openForReading() {
return SymbianStdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *SymbianFilesystemNode::openForWriting() {
return SymbianStdioStream::makeFromPath(getPath().c_str(), true);
}
#endif //#if defined (__SYMBIAN32__) #endif //#if defined (__SYMBIAN32__)

View file

@ -0,0 +1,274 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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.
*
* $URL$
* $Id$
*
*/
#include "common/scummsys.h"
#include "backends/fs/symbian/symbianstream.h"
#include "common/system.h"
#include "backends/platform/symbian/src/symbianos.h"
#include <f32file.h>
#define KInputBufferLength 128
// Symbian libc file functionality in order to provide shared file handles
class TSymbianFileEntry {
public:
RFile _fileHandle;
char _inputBuffer[KInputBufferLength];
TInt _inputBufferLen;
TInt _inputPos;
TInt _lastError;
TBool _eofReached;
};
TSymbianFileEntry* CreateSymbianFileEntry(const char* name, const char* mode) {
TSymbianFileEntry* fileEntry = new TSymbianFileEntry;
fileEntry->_inputPos = KErrNotFound;
fileEntry->_lastError = 0;
fileEntry->_eofReached = EFalse;
if (fileEntry != NULL) {
TInt modeLen = strlen(mode);
TPtrC8 namePtr((unsigned char*) name, strlen(name));
TFileName tempFileName;
tempFileName.Copy(namePtr);
TInt fileMode = EFileRead;
if (mode[0] == 'a')
fileMode = EFileWrite;
if (!((modeLen > 1 && mode[1] == 'b') || (modeLen > 2 && mode[2] == 'b'))) {
fileMode |= EFileStreamText;
}
if ((modeLen > 1 && mode[1] == '+') || (modeLen > 2 && mode[2] == '+')) {
fileMode = fileMode| EFileWrite;
}
fileMode = fileMode| EFileShareAny;
switch(mode[0]) {
case 'a':
if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) {
if (fileEntry->_fileHandle.Create(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) {
delete fileEntry;
fileEntry = NULL;
}
}
break;
case 'r':
if (fileEntry->_fileHandle.Open(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) {
delete fileEntry;
fileEntry = NULL;
}
break;
case 'w':
if (fileEntry->_fileHandle.Replace(static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession(), tempFileName, fileMode) != KErrNone) {
delete fileEntry;
fileEntry = NULL;
}
break;
}
}
return fileEntry;
}
size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry* handle) {
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->_inputPos != KErrNotFound) {
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer+entry->_inputPos, entry->_inputBufferLen - entry->_inputPos, KInputBufferLength);
pointer.Append(cacheBuffer);
entry->_inputPos = KErrNotFound;
totLength+=pointer.Length();
pointer.Set(totLength+(unsigned char*) ptr, 0, totsize-totLength);
}
entry->_lastError = entry->_fileHandle.Read(pointer);
totLength+=pointer.Length();
pointer.Set((unsigned char*) ptr, totLength, totsize);
} else {
// Nothing in buffer
if (entry->_inputPos == KErrNotFound) {
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer, KInputBufferLength);
entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
if (cacheBuffer.Length() >= totsize) {
pointer.Copy(cacheBuffer.Left(totsize));
entry->_inputPos = totsize;
entry->_inputBufferLen = cacheBuffer.Length();
} else {
pointer.Copy(cacheBuffer);
entry->_inputPos = KErrNotFound;
}
} else {
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer, entry->_inputBufferLen, KInputBufferLength);
if (entry->_inputPos+totsize < entry->_inputBufferLen) {
pointer.Copy(cacheBuffer.Mid(entry->_inputPos, totsize));
entry->_inputPos+=totsize;
} else {
pointer.Copy(cacheBuffer.Mid(entry->_inputPos, entry->_inputBufferLen-entry->_inputPos));
cacheBuffer.SetLength(0);
entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
if (cacheBuffer.Length() >= totsize-pointer.Length()) {
TUint32 restSize = totsize-pointer.Length();
pointer.Append(cacheBuffer.Left(restSize));
entry->_inputPos = restSize;
entry->_inputBufferLen = cacheBuffer.Length();
} else {
pointer.Append(cacheBuffer);
entry->_inputPos = KErrNotFound;
}
}
}
}
if((numItems * size) != pointer.Length() && entry->_lastError == KErrNone) {
entry->_eofReached = ETrue;
}
return pointer.Length() / size;
}
SymbianStdioStream::SymbianStdioStream(void *handle) : _handle(handle) {
assert(handle);
}
SymbianStdioStream::~SymbianStdioStream() {
((TSymbianFileEntry*)(_handle))->_fileHandle.Close();
delete (TSymbianFileEntry*)(_handle);
}
bool SymbianStdioStream::err() const {
return ((TSymbianFileEntry*)(_handle))->_lastError != 0;
}
void SymbianStdioStream::clearErr() {
((TSymbianFileEntry*)(_handle))->_lastError = 0;
((TSymbianFileEntry*)(_handle))->_eofReached = 0;
}
bool SymbianStdioStream::eos() const {
TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle));
return entry->_eofReached != 0;
}
int32 SymbianStdioStream::pos() const {
TInt pos = 0;
TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle));
entry->_lastError = entry->_fileHandle.Seek(ESeekCurrent, pos);
if (entry->_lastError == KErrNone && entry->_inputPos != KErrNotFound) {
pos += (entry->_inputPos - entry->_inputBufferLen);
}
return pos;
}
int32 SymbianStdioStream::size() const {
TInt length = 0;
((TSymbianFileEntry*)(_handle))->_fileHandle.Size(length);
return length;
}
bool SymbianStdioStream::seek(int32 offs, int whence) {
assert(_handle);
TSeek seekMode = ESeekStart;
TInt pos = offs;
TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle));
switch (whence) {
case SEEK_SET:
seekMode = ESeekStart;
break;
case SEEK_CUR:
seekMode = ESeekCurrent;
if (entry->_inputPos != KErrNotFound) {
pos += (entry->_inputPos - entry->_inputBufferLen);
}
break;
case SEEK_END:
seekMode = ESeekEnd;
break;
}
entry->_inputPos = KErrNotFound;
entry->_eofReached = EFalse;
entry->_fileHandle.Seek(seekMode, pos);
return true; // FIXME: Probably should return a value based on what _fileHandle.Seek returns
}
uint32 SymbianStdioStream::read(void *ptr, uint32 len) {
return (uint32)ReadData((byte *)ptr, 1, len, (TSymbianFileEntry *)_handle);
}
uint32 SymbianStdioStream::write(const void *ptr, uint32 len) {
TPtrC8 pointer( (unsigned char*) ptr, len);
((TSymbianFileEntry*)(_handle))->_inputPos = KErrNotFound;
((TSymbianFileEntry*)(_handle))->_lastError = ((TSymbianFileEntry*)(_handle))->_fileHandle.Write(pointer);
((TSymbianFileEntry*)(_handle))->_eofReached = EFalse;
if (((TSymbianFileEntry*)(_handle))->_lastError == KErrNone) {
return len;
}
return 0;
}
bool SymbianStdioStream::flush() {
((TSymbianFileEntry*)(_handle))->_fileHandle.Flush();
return true;
}
SymbianStdioStream *SymbianStdioStream::makeFromPath(const Common::String &path, bool writeMode) {
void *handle = CreateSymbianFileEntry(path.c_str(), writeMode ? "wb" : "rb");
if (handle)
return new SymbianStdioStream(handle);
return 0;
}

View file

@ -0,0 +1,62 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* 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.
*
* $URL: $
* $Id: $
*
*/
#ifndef BACKENDS_FS_SYMBIANSTDIOSTREAM_H
#define BACKENDS_FS_SYMBIANSTDIOSTREAM_H
#include "common/scummsys.h"
#include "common/noncopyable.h"
#include "common/stream.h"
#include "common/str.h"
class SymbianStdioStream : public Common::SeekableReadStream, public Common::WriteStream, public Common::NonCopyable {
protected:
/** File handle to the actual file. */
void *_handle;
public:
/**
* Given a path, invokes fopen on that path and wrap the result in a
* StdioStream instance.
*/
static SymbianStdioStream *makeFromPath(const Common::String &path, bool writeMode);
SymbianStdioStream(void *handle);
virtual ~SymbianStdioStream();
bool err() const;
void clearErr();
bool eos() const;
virtual uint32 write(const void *dataPtr, uint32 dataSize);
virtual bool flush();
virtual int32 pos() const;
virtual int32 size() const;
bool seek(int32 offs, int whence = SEEK_SET);
uint32 read(void *dataPtr, uint32 dataSize);
};
#endif

View file

@ -42,7 +42,7 @@ AbstractFilesystemNode *WiiFilesystemFactory::makeCurrentDirectoryFileNode() con
return new WiiFilesystemNode(); return new WiiFilesystemNode();
} }
AbstractFilesystemNode *WiiFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *WiiFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new WiiFilesystemNode(path, true); return new WiiFilesystemNode(path, true);
} }
#endif #endif

View file

@ -33,11 +33,9 @@
*/ */
class WiiFilesystemFactory : public FilesystemFactory, public Common::Singleton<WiiFilesystemFactory> { class WiiFilesystemFactory : public FilesystemFactory, public Common::Singleton<WiiFilesystemFactory> {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected: protected:
WiiFilesystemFactory() {}; WiiFilesystemFactory() {};

View file

@ -23,6 +23,7 @@
#if defined(__WII__) #if defined(__WII__)
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
#include <sys/dir.h> #include <sys/dir.h>
@ -37,8 +38,8 @@
*/ */
class WiiFilesystemNode : public AbstractFilesystemNode { class WiiFilesystemNode : public AbstractFilesystemNode {
protected: protected:
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory, _isReadable, _isWritable; bool _isDirectory, _isReadable, _isWritable;
public: public:
@ -50,51 +51,30 @@ public:
/** /**
* Creates a WiiFilesystemNode for a given path. * Creates a WiiFilesystemNode for a given path.
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
* @param verify true if the isValid and isDirectory flags should be verified during the construction. * @param verify true if the isValid and isDirectory flags should be verified during the construction.
*/ */
WiiFilesystemNode(const String &path, bool verify); WiiFilesystemNode(const Common::String &path, bool verify);
virtual bool exists() const; virtual bool exists() const;
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return _isReadable; } virtual bool isReadable() const { return _isReadable; }
virtual bool isWritable() const { return _isWritable; } virtual bool isWritable() const { return _isWritable; }
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
private: private:
virtual void setFlags(); virtual void setFlags();
}; };
/**
* 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 *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;
}
void WiiFilesystemNode::setFlags() { void WiiFilesystemNode::setFlags() {
struct stat st; struct stat st;
@ -118,12 +98,12 @@ WiiFilesystemNode::WiiFilesystemNode() {
setFlags(); setFlags();
} }
WiiFilesystemNode::WiiFilesystemNode(const String &p, bool verify) { WiiFilesystemNode::WiiFilesystemNode(const Common::String &p, bool verify) {
assert(p.size() > 0); assert(p.size() > 0);
_path = p; _path = p;
_displayName = lastPathComponent(_path); _displayName = lastPathComponent(_path, '/');
if (verify) if (verify)
setFlags(); setFlags();
@ -134,10 +114,10 @@ bool WiiFilesystemNode::exists() const {
return stat(_path.c_str (), &st) == 0; return stat(_path.c_str (), &st) == 0;
} }
AbstractFilesystemNode *WiiFilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *WiiFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory); assert(_isDirectory);
String newPath(_path); Common::String newPath(_path);
if (newPath.lastChar() != '/') if (newPath.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += n; newPath += n;
@ -160,15 +140,15 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool
if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0) if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
continue; continue;
String newPath(_path); Common::String newPath(_path);
if (newPath.lastChar() != '/') if (newPath.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += filename; newPath += filename;
bool isDir = S_ISDIR(st.st_mode); bool isDir = S_ISDIR(st.st_mode);
if ((mode == FilesystemNode::kListFilesOnly && isDir) || if ((mode == Common::FilesystemNode::kListFilesOnly && isDir) ||
(mode == FilesystemNode::kListDirectoriesOnly && !isDir)) (mode == Common::FilesystemNode::kListDirectoriesOnly && !isDir))
continue; continue;
if (isDir) if (isDir)
@ -187,9 +167,17 @@ AbstractFilesystemNode *WiiFilesystemNode::getParent() const {
return 0; return 0;
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = lastPathComponent(_path, '/');
return new WiiFilesystemNode(String(start, end - start), true); return new WiiFilesystemNode(Common::String(start, end - start), true);
}
Common::SeekableReadStream *WiiFilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *WiiFilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
} }
#endif //#if defined(__WII__) #endif //#if defined(__WII__)

View file

@ -26,8 +26,6 @@
#include "backends/fs/windows/windows-fs-factory.h" #include "backends/fs/windows/windows-fs-factory.h"
#include "backends/fs/windows/windows-fs.cpp" #include "backends/fs/windows/windows-fs.cpp"
DECLARE_SINGLETON(WindowsFilesystemFactory);
AbstractFilesystemNode *WindowsFilesystemFactory::makeRootFileNode() const { AbstractFilesystemNode *WindowsFilesystemFactory::makeRootFileNode() const {
return new WindowsFilesystemNode(); return new WindowsFilesystemNode();
} }
@ -36,7 +34,7 @@ AbstractFilesystemNode *WindowsFilesystemFactory::makeCurrentDirectoryFileNode()
return new WindowsFilesystemNode("", true); return new WindowsFilesystemNode("", true);
} }
AbstractFilesystemNode *WindowsFilesystemFactory::makeFileNodePath(const String &path) const { AbstractFilesystemNode *WindowsFilesystemFactory::makeFileNodePath(const Common::String &path) const {
return new WindowsFilesystemNode(path, false); return new WindowsFilesystemNode(path, false);
} }
#endif #endif

View file

@ -25,7 +25,6 @@
#ifndef WINDOWS_FILESYSTEM_FACTORY_H #ifndef WINDOWS_FILESYSTEM_FACTORY_H
#define WINDOWS_FILESYSTEM_FACTORY_H #define WINDOWS_FILESYSTEM_FACTORY_H
#include "common/singleton.h"
#include "backends/fs/fs-factory.h" #include "backends/fs/fs-factory.h"
/** /**
@ -33,19 +32,11 @@
* *
* Parts of this class are documented in the base interface class, FilesystemFactory. * Parts of this class are documented in the base interface class, FilesystemFactory.
*/ */
class WindowsFilesystemFactory : public FilesystemFactory, public Common::Singleton<WindowsFilesystemFactory> { class WindowsFilesystemFactory : public FilesystemFactory {
public: public:
typedef Common::String String;
virtual AbstractFilesystemNode *makeRootFileNode() const; virtual AbstractFilesystemNode *makeRootFileNode() const;
virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; virtual AbstractFilesystemNode *makeFileNodePath(const Common::String &path) const;
protected:
WindowsFilesystemFactory() {};
private:
friend class Common::Singleton<SingletonBaseType>;
}; };
#endif /*WINDOWS_FILESYSTEM_FACTORY_H*/ #endif /*WINDOWS_FILESYSTEM_FACTORY_H*/

View file

@ -24,24 +24,17 @@
#ifdef WIN32 #ifdef WIN32
#ifdef ARRAYSIZE
#undef ARRAYSIZE
#endif
#ifdef _WIN32_WCE
#include <windows.h> #include <windows.h>
// winnt.h defines ARRAYSIZE, but we want our own one... // winnt.h defines ARRAYSIZE, but we want our own one...
#undef ARRAYSIZE #undef ARRAYSIZE
#ifdef _WIN32_WCE
#undef GetCurrentDirectory #undef GetCurrentDirectory
#endif #endif
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
#include <io.h> #include <io.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef _WIN32_WCE
#include <windows.h>
// winnt.h defines ARRAYSIZE, but we want our own one...
#undef ARRAYSIZE
#endif
#include <tchar.h> #include <tchar.h>
// F_OK, R_OK and W_OK are not defined under MSVC, so we define them here // F_OK, R_OK and W_OK are not defined under MSVC, so we define them here
@ -66,8 +59,8 @@
*/ */
class WindowsFilesystemNode : public AbstractFilesystemNode { class WindowsFilesystemNode : public AbstractFilesystemNode {
protected: protected:
String _displayName; Common::String _displayName;
String _path; Common::String _path;
bool _isDirectory; bool _isDirectory;
bool _isPseudoRoot; bool _isPseudoRoot;
bool _isValid; bool _isValid;
@ -89,23 +82,26 @@ public:
* path=c:\foo\bar.txt, currentDir=true -> current directory * path=c:\foo\bar.txt, currentDir=true -> current directory
* path=NULL, currentDir=true -> current directory * path=NULL, currentDir=true -> current directory
* *
* @param path String with the path the new node should point to. * @param path Common::String with the path the new node should point to.
* @param currentDir if true, the path parameter will be ignored and the resulting node will point to the current directory. * @param currentDir if true, the path parameter will be ignored and the resulting node will point to the current directory.
*/ */
WindowsFilesystemNode(const String &path, const bool currentDir); WindowsFilesystemNode(const Common::String &path, const bool currentDir);
virtual bool exists() const { return _access(_path.c_str(), F_OK) == 0; } virtual bool exists() const { return _access(_path.c_str(), F_OK) == 0; }
virtual String getDisplayName() const { return _displayName; } virtual Common::String getDisplayName() const { return _displayName; }
virtual String getName() const { return _displayName; } virtual Common::String getName() const { return _displayName; }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return _isDirectory; } virtual bool isDirectory() const { return _isDirectory; }
virtual bool isReadable() const { return _access(_path.c_str(), R_OK) == 0; } virtual bool isReadable() const { return _access(_path.c_str(), R_OK) == 0; }
virtual bool isWritable() const { return _access(_path.c_str(), W_OK) == 0; } virtual bool isWritable() const { return _access(_path.c_str(), W_OK) == 0; }
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
private: private:
/** /**
* Adds a single WindowsFilesystemNode to a given list. * Adds a single WindowsFilesystemNode to a given list.
@ -113,7 +109,7 @@ private:
* *
* @param list List to put the file entry node in. * @param list List to put the file entry node in.
* @param mode Mode to use while adding the file entry to the list. * @param mode Mode to use while adding the file entry to the list.
* @param base String with the directory being listed. * @param base Common::String with the directory being listed.
* @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find. * @param find_data Describes a file that the FindFirstFile, FindFirstFileEx, or FindNextFile functions find.
*/ */
static void addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data); static void addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data);
@ -121,7 +117,7 @@ private:
/** /**
* Converts a Unicode string to Ascii format. * Converts a Unicode string to Ascii format.
* *
* @param str String to convert from Unicode to Ascii. * @param str Common::String to convert from Unicode to Ascii.
* @return str in Ascii format. * @return str in Ascii format.
*/ */
static char *toAscii(TCHAR *str); static char *toAscii(TCHAR *str);
@ -129,36 +125,12 @@ private:
/** /**
* Converts an Ascii string to Unicode format. * Converts an Ascii string to Unicode format.
* *
* @param str String to convert from Ascii to Unicode. * @param str Common::String to convert from Ascii to Unicode.
* @return str in Unicode format. * @return str in Unicode format.
*/ */
static const TCHAR* toUnicode(const char *str); static const TCHAR* toUnicode(const char *str);
}; };
/**
* Returns the last component of a given path.
*
* Examples:
* c:\foo\bar.txt would return "\bar.txt"
* c:\foo\bar\ would return "\bar\"
*
* @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str.
*/
const char *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;
}
void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data) { void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data) {
WindowsFilesystemNode entry; WindowsFilesystemNode entry;
char *asciiName = toAscii(find_data->cFileName); char *asciiName = toAscii(find_data->cFileName);
@ -170,8 +142,8 @@ void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const c
isDirectory = (find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? true : false); isDirectory = (find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? true : false);
if ((!isDirectory && mode == FilesystemNode::kListDirectoriesOnly) || if ((!isDirectory && mode == Common::FilesystemNode::kListDirectoriesOnly) ||
(isDirectory && mode == FilesystemNode::kListFilesOnly)) (isDirectory && mode == Common::FilesystemNode::kListFilesOnly))
return; return;
entry._isDirectory = isDirectory; entry._isDirectory = isDirectory;
@ -222,7 +194,7 @@ WindowsFilesystemNode::WindowsFilesystemNode() {
#endif #endif
} }
WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool currentDir) { WindowsFilesystemNode::WindowsFilesystemNode(const Common::String &p, const bool currentDir) {
if (currentDir) { if (currentDir) {
char path[MAX_PATH]; char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path); GetCurrentDirectory(MAX_PATH, path);
@ -232,7 +204,7 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool current
_path = p; _path = p;
} }
_displayName = lastPathComponent(_path); _displayName = lastPathComponent(_path, '\\');
// Check whether it is a directory, and whether the file actually exists // Check whether it is a directory, and whether the file actually exists
DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str())); DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str()));
@ -251,10 +223,10 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool current
_isPseudoRoot = false; _isPseudoRoot = false;
} }
AbstractFilesystemNode *WindowsFilesystemNode::getChild(const String &n) const { AbstractFilesystemNode *WindowsFilesystemNode::getChild(const Common::String &n) const {
assert(_isDirectory); assert(_isDirectory);
String newPath(_path); Common::String newPath(_path);
if (_path.lastChar() != '\\') if (_path.lastChar() != '\\')
newPath += '\\'; newPath += '\\';
newPath += n; newPath += n;
@ -322,17 +294,25 @@ AbstractFilesystemNode *WindowsFilesystemNode::getParent() const {
WindowsFilesystemNode *p = new WindowsFilesystemNode(); WindowsFilesystemNode *p = new WindowsFilesystemNode();
if (_path.size() > 3) { if (_path.size() > 3) {
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = lastPathComponent(_path, '\\');
p = new WindowsFilesystemNode(); p = new WindowsFilesystemNode();
p->_path = String(start, end - start); p->_path = Common::String(start, end - start);
p->_isValid = true; p->_isValid = true;
p->_isDirectory = true; p->_isDirectory = true;
p->_displayName = lastPathComponent(p->_path); p->_displayName = lastPathComponent(p->_path, '\\');
p->_isPseudoRoot = false; p->_isPseudoRoot = false;
} }
return p; return p;
} }
Common::SeekableReadStream *WindowsFilesystemNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *WindowsFilesystemNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
}
#endif //#ifdef WIN32 #endif //#ifdef WIN32

View file

@ -28,7 +28,7 @@
* both the QuickTime support and (vkeybd http://www.alsa-project.org/~iwai/alsa.html) * both the QuickTime support and (vkeybd http://www.alsa-project.org/~iwai/alsa.html)
*/ */
#if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) && !defined(__MINT__)
#include "common/util.h" #include "common/util.h"
#include "sound/musicplugin.h" #include "sound/musicplugin.h"

155
backends/midi/stmidi.cpp Normal file
View file

@ -0,0 +1,155 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
* Copyright (C) 2001-2006 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.
*/
/*
* Raw MIDI output for the Atari ST line of computers.
* Based on the ScummVM SEQ & CoreMIDI drivers.
* Atari code by Keith Scroggins
* We, unfortunately, could not use the SEQ driver because the /dev/midi under
* FreeMiNT (and hence in libc) is considered to be a serial port for machine
* access. So, we just use OS calls then to send the data to the MIDI ports
* directly. The current implementation is sending 1 byte at a time because
* in most cases we are only sending up to 3 bytes, I believe this saves a few
* cycles. I might change so sysex messages are sent the other way later.
*/
#if defined __MINT__
#include <osbind.h>
#include "sound/mpu401.h"
#include "common/util.h"
#include "sound/musicplugin.h"
class MidiDriver_STMIDI : public MidiDriver_MPU401 {
public:
MidiDriver_STMIDI() : _isOpen (false) { }
int open();
void close();
void send(uint32 b);
void sysEx(const byte *msg, uint16 length);
private:
bool _isOpen;
};
int MidiDriver_STMIDI::open() {
if ((_isOpen) && (!Bcostat(4)))
return MERR_ALREADY_OPEN;
warning("ST Midi Port Open");
_isOpen = true;
return 0;
}
void MidiDriver_STMIDI::close() {
MidiDriver_MPU401::close();
_isOpen = false;
}
void MidiDriver_STMIDI::send(uint32 b) {
byte status_byte = (b & 0x000000FF);
byte first_byte = (b & 0x0000FF00) >> 8;
byte second_byte = (b & 0x00FF0000) >> 16;
// warning("ST MIDI Packet sent");
switch (b & 0xF0) {
case 0x80: // Note Off
case 0x90: // Note On
case 0xA0: // Polyphonic Key Pressure
case 0xB0: // Controller
case 0xE0: // Pitch Bend
Bconout(3, status_byte);
Bconout(3, first_byte);
Bconout(3, second_byte);
break;
case 0xC0: // Program Change
case 0xD0: // Aftertouch
Bconout(3, status_byte);
Bconout(3, first_byte);
break;
default:
fprintf(stderr, "Unknown : %08x\n", (int)b);
break;
}
}
void MidiDriver_STMIDI::sysEx (const byte *msg, uint16 length) {
if (length > 254) {
warning ("Cannot send SysEx block - data too large");
return;
}
const byte *chr = msg;
warning("Sending SysEx Message");
Bconout(3, '0xF0');
for (; length; --length, ++chr) {
Bconout(3,((unsigned char) *chr & 0x7F));
}
Bconout(3, '0xF7');
}
// Plugin interface
class StMidiMusicPlugin : public MusicPluginObject {
public:
const char *getName() const {
return "STMIDI";
}
const char *getId() const {
return "stmidi";
}
MusicDevices getDevices() const;
PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver)
const;
};
MusicDevices StMidiMusicPlugin::getDevices() const {
MusicDevices devices;
// TODO: Return a different music type depending on the configuration
// TODO: List the available devices
devices.push_back(MusicDevice(this, "", MT_GM));
return devices;
}
PluginError StMidiMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
*mididriver = new MidiDriver_STMIDI();
return kNoError;
}
MidiDriver *MidiDriver_STMIDI_create(Audio::Mixer *mixer) {
MidiDriver *mididriver;
StMidiMusicPlugin p;
p.createInstance(mixer, &mididriver);
return mididriver;
}
//#if PLUGIN_ENABLED_DYNAMIC(STMIDI)
//REGISTER_PLUGIN_DYNAMIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin);
//#else
REGISTER_PLUGIN_STATIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin);
//#endif
#endif

View file

@ -1,6 +1,8 @@
MODULE := backends MODULE := backends
MODULE_OBJS := \ MODULE_OBJS := \
fs/abstract-fs.o \
fs/stdiostream.o \
fs/amigaos4/amigaos4-fs-factory.o \ fs/amigaos4/amigaos4-fs-factory.o \
fs/ds/ds-fs-factory.o \ fs/ds/ds-fs-factory.o \
fs/palmos/palmos-fs-factory.o \ fs/palmos/palmos-fs-factory.o \
@ -17,6 +19,7 @@ MODULE_OBJS := \
midi/coremidi.o \ midi/coremidi.o \
midi/quicktime.o \ midi/quicktime.o \
midi/seq.o \ midi/seq.o \
midi/stmidi.o \
midi/timidity.o \ midi/timidity.o \
midi/dmedia.o \ midi/dmedia.o \
midi/windows.o \ midi/windows.o \

View file

@ -24,6 +24,7 @@
#include "dc.h" #include "dc.h"
#include "backends/fs/abstract-fs.h" #include "backends/fs/abstract-fs.h"
#include "backends/fs/stdiostream.h"
#include <ronin/cdfs.h> #include <ronin/cdfs.h>
#include <stdio.h> #include <stdio.h>
@ -34,75 +35,50 @@
* *
* Parts of this class are documented in the base interface class, AbstractFilesystemNode. * Parts of this class are documented in the base interface class, AbstractFilesystemNode.
*/ */
/* A file */
class RoninCDFileNode : public AbstractFilesystemNode { class RoninCDFileNode : public AbstractFilesystemNode {
protected: protected:
String _path; Common::String _path;
static const char *lastPathComponent(const Common::String &str);
public: public:
RoninCDFileNode(const String &path) : _path(path) {}; RoninCDFileNode(const Common::String &path) : _path(path) {};
virtual bool exists() const { return true; } virtual bool exists() const { return true; }
virtual String getName() const { return lastPathComponent(_path); } virtual Common::String getName() const { return lastPathComponent(_path, '/'); }
virtual String getPath() const { return _path; } virtual Common::String getPath() const { return _path; }
virtual bool isDirectory() const { return false; } virtual bool isDirectory() const { return false; }
virtual bool isReadable() const { return true; } virtual bool isReadable() const { return true; }
virtual bool isWritable() const { return false; } virtual bool isWritable() const { return false; }
virtual AbstractFilesystemNode *getChild(const String &n) const { return NULL; } virtual AbstractFilesystemNode *getChild(const Common::String &n) const { return NULL; }
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const { return false; } virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const { return false; }
virtual AbstractFilesystemNode *getParent() const; virtual AbstractFilesystemNode *getParent() const;
virtual Common::SeekableReadStream *openForReading();
virtual Common::WriteStream *openForWriting();
static AbstractFilesystemNode *makeFileNodePath(const Common::String &path); static AbstractFilesystemNode *makeFileNodePath(const Common::String &path);
}; };
/* A directory */ /* A directory */
class RoninCDDirectoryNode : public RoninCDFileNode { class RoninCDDirectoryNode : public RoninCDFileNode {
public: public:
RoninCDDirectoryNode(const String &path) : RoninCDFileNode(path) {}; RoninCDDirectoryNode(const Common::String &path) : RoninCDFileNode(path) {};
virtual bool isDirectory() const { return true; } virtual bool isDirectory() const { return true; }
virtual AbstractFilesystemNode *getChild(const String &n) const; virtual AbstractFilesystemNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
}; };
/* A file/directory which does not exist */ /* A file/directory which does not exist */
class RoninCDNonexistingNode : public RoninCDFileNode { class RoninCDNonexistingNode : public RoninCDFileNode {
public: public:
RoninCDNonexistingNode(const String &path) : RoninCDFileNode(path) {}; RoninCDNonexistingNode(const Common::String &path) : RoninCDFileNode(path) {};
virtual bool exists() const { return false; } virtual bool exists() const { return false; }
virtual bool isReadable() const { return false; } virtual bool isReadable() const { return false; }
}; };
/** AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String &path) {
* 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)
{
assert(path.size() > 0); assert(path.size() > 0);
int fd; int fd;
@ -110,18 +86,16 @@ AbstractFilesystemNode *RoninCDFileNode::makeFileNodePath(const Common::String &
if ((fd = open(path.c_str(), O_RDONLY)) >= 0) { if ((fd = open(path.c_str(), O_RDONLY)) >= 0) {
close(fd); close(fd);
return new RoninCDFileNode(path); 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); close(fd);
return new RoninCDDirectoryNode(path); return new RoninCDDirectoryNode(path);
} } else {
else {
return NULL; return NULL;
} }
} }
AbstractFilesystemNode *RoninCDDirectoryNode::getChild(const String &n) const { AbstractFilesystemNode *RoninCDDirectoryNode::getChild(const Common::String &n) const {
String newPath(_path); Common::String newPath(_path);
if (_path.lastChar() != '/') if (_path.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += n; newPath += n;
@ -139,20 +113,20 @@ bool RoninCDDirectoryNode::getChildren(AbstractFSList &myList, ListMode mode, bo
// ... loop over dir entries using readdir // ... loop over dir entries using readdir
while ((dp = readdir(dirp)) != NULL) { while ((dp = readdir(dirp)) != NULL) {
String newPath(_path); Common::String newPath(_path);
if (newPath.lastChar() != '/') if (newPath.lastChar() != '/')
newPath += '/'; newPath += '/';
newPath += dp->d_name; newPath += dp->d_name;
if (dp->d_size < 0) { if (dp->d_size < 0) {
// Honor the chosen mode // Honor the chosen mode
if (mode == FilesystemNode::kListFilesOnly) if (mode == Common::FilesystemNode::kListFilesOnly)
continue; continue;
myList.push_back(new RoninCDDirectoryNode(newPath+"/")); myList.push_back(new RoninCDDirectoryNode(newPath+"/"));
} else { } else {
// Honor the chosen mode // Honor the chosen mode
if (mode == FilesystemNode::kListDirectoriesOnly) if (mode == Common::FilesystemNode::kListDirectoriesOnly)
continue; continue;
myList.push_back(new RoninCDFileNode(newPath)); myList.push_back(new RoninCDFileNode(newPath));
@ -168,9 +142,18 @@ AbstractFilesystemNode *RoninCDFileNode::getParent() const {
return 0; return 0;
const char *start = _path.c_str(); const char *start = _path.c_str();
const char *end = lastPathComponent(_path); const char *end = lastPathComponent(_path, '/');
return new RoninCDDirectoryNode(String(start, end - start)); return new RoninCDDirectoryNode(Common::String(start, end - start));
}
Common::SeekableReadStream *RoninCDFileNode::openForReading() {
return StdioStream::makeFromPath(getPath().c_str(), false);
}
Common::WriteStream *RoninCDFileNode::openForWriting() {
return StdioStream::makeFromPath(getPath().c_str(), true);
} }
AbstractFilesystemNode *OSystem_Dreamcast::makeRootFileNode() const { AbstractFilesystemNode *OSystem_Dreamcast::makeRootFileNode() const {

View file

@ -146,12 +146,12 @@ struct Dir
{ {
char name[252]; char name[252];
char deficon[256]; char deficon[256];
FilesystemNode node; Common::FilesystemNode node;
}; };
static Game the_game; static Game the_game;
static bool isIcon(const FilesystemNode &entry) static bool isIcon(const Common::FilesystemNode &entry)
{ {
int l = entry.getDisplayName().size(); int l = entry.getDisplayName().size();
if (l>4 && !strcasecmp(entry.getDisplayName().c_str()+l-4, ".ICO")) if (l>4 && !strcasecmp(entry.getDisplayName().c_str()+l-4, ".ICO"))
@ -198,14 +198,14 @@ static int findGames(Game *games, int max)
{ {
Dir *dirs = new Dir[MAX_DIR]; Dir *dirs = new Dir[MAX_DIR];
int curr_game = 0, curr_dir = 0, num_dirs = 1; int curr_game = 0, curr_dir = 0, num_dirs = 1;
dirs[0].node = FilesystemNode(""); dirs[0].node = Common::FilesystemNode("");
while (curr_game < max && curr_dir < num_dirs) { while (curr_game < max && curr_dir < num_dirs) {
strncpy(dirs[curr_dir].name, dirs[curr_dir].node.getPath().c_str(), 252); strncpy(dirs[curr_dir].name, dirs[curr_dir].node.getPath().c_str(), 252);
dirs[curr_dir].name[251] = '\0'; dirs[curr_dir].name[251] = '\0';
dirs[curr_dir].deficon[0] = '\0'; dirs[curr_dir].deficon[0] = '\0';
FSList files, fslist; Common::FSList files, fslist;
dirs[curr_dir++].node.getChildren(fslist, FilesystemNode::kListAll); dirs[curr_dir++].node.getChildren(fslist, Common::FilesystemNode::kListAll);
for (FSList::const_iterator entry = fslist.begin(); entry != fslist.end(); for (Common::FSList::const_iterator entry = fslist.begin(); entry != fslist.end();
++entry) { ++entry) {
if (entry->isDirectory()) { if (entry->isDirectory()) {
if (num_dirs < MAX_DIR && strcasecmp(entry->getDisplayName().c_str(), if (num_dirs < MAX_DIR && strcasecmp(entry->getDisplayName().c_str(),

View file

@ -269,14 +269,15 @@ class InVMSave : public Common::InSaveFile {
private: private:
char *buffer; char *buffer;
int _pos, _size; int _pos, _size;
bool _eos;
uint32 read(void *buf, uint32 cnt); uint32 read(void *buf, uint32 cnt);
void skip(uint32 offset); bool skip(uint32 offset);
void seek(int32 offs, int whence); bool seek(int32 offs, int whence);
public: public:
InVMSave() InVMSave()
: _pos(0), buffer(NULL) : _pos(0), buffer(NULL), _eos(false)
{ } { }
~InVMSave() ~InVMSave()
@ -285,9 +286,10 @@ public:
delete[] buffer; delete[] buffer;
} }
bool eos() const { return _pos >= _size; } bool eos() const { return _eos; }
uint32 pos() const { return _pos; } void clearErr() { _eos = false; }
uint32 size() const { return _size; } int32 pos() const { return _pos; }
int32 size() const { return _size; }
bool readSaveGame(const char *filename) bool readSaveGame(const char *filename)
{ return ::readSaveGame(buffer, _size, filename); } { return ::readSaveGame(buffer, _size, filename); }
@ -312,8 +314,8 @@ public:
~OutVMSave(); ~OutVMSave();
bool ioFailed() const { return iofailed; } bool err() const { return iofailed; }
void clearIOFailed() { iofailed = false; } void clearErr() { iofailed = false; }
void finalize(); void finalize();
}; };
@ -370,6 +372,7 @@ uint32 InVMSave::read(void *buf, uint32 cnt)
int nbyt = cnt; int nbyt = cnt;
if (_pos + nbyt > _size) { if (_pos + nbyt > _size) {
cnt = (_size - _pos); cnt = (_size - _pos);
_eos = true;
nbyt = cnt; nbyt = cnt;
} }
if (nbyt) if (nbyt)
@ -378,15 +381,16 @@ uint32 InVMSave::read(void *buf, uint32 cnt)
return cnt; return cnt;
} }
void InVMSave::skip(uint32 offset) bool InVMSave::skip(uint32 offset)
{ {
int nbyt = offset; int nbyt = offset;
if (_pos + nbyt > _size) if (_pos + nbyt > _size)
nbyt = (_size - _pos); nbyt = (_size - _pos);
_pos += nbyt; _pos += nbyt;
return true;
} }
void InVMSave::seek(int32 offs, int whence) bool InVMSave::seek(int32 offs, int whence)
{ {
switch(whence) { switch(whence) {
case SEEK_SET: case SEEK_SET:
@ -403,6 +407,8 @@ void InVMSave::seek(int32 offs, int whence)
_pos = 0; _pos = 0;
else if (_pos > _size) else if (_pos > _size)
_pos = _size; _pos = _size;
_eos = false;
return true;
} }
uint32 OutVMSave::write(const void *buf, uint32 cnt) uint32 OutVMSave::write(const void *buf, uint32 cnt)

View file

@ -107,7 +107,7 @@ MAPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.map)))
export OFILES := $(MAPFILES:.map=.o) $(RAWFILES:.raw=.o) $(PALFILES:.pal=.o) $(BINFILES:.bin=.o) $(PCXFILES:.pcx=.o)\ export OFILES := $(MAPFILES:.map=.o) $(RAWFILES:.raw=.o) $(PALFILES:.pal=.o) $(BINFILES:.bin=.o) $(PCXFILES:.pcx=.o)\
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) -I- -I$(CURDIR)/../commoninclude\ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) -Iquote -I$(CURDIR)/../commoninclude\
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include/nds)\ $(foreach dir,$(LIBDIRS),-I$(dir)/include/nds)\
-I$(CURDIR)/$(BUILD) -I$(CURDIR)/source/libcartreset -I$(CURDIR)/$(BUILD) -I$(CURDIR)/source/libcartreset

View file

@ -233,7 +233,7 @@ void DummyHandler() {
REG_IF = REG_IF; REG_IF = REG_IF;
} }
uint16 powerManagerWrite(uint32 command, u32 data, bool enable) { void powerManagerWrite(uint32 command, u32 data, bool enable) {
uint16 result; uint16 result;
SerialWaitBusy(); SerialWaitBusy();
@ -261,9 +261,6 @@ uint16 powerManagerWrite(uint32 command, u32 data, bool enable) {
REG_SPICNT = SPI_ENABLE | SPI_BAUD_1MHz; REG_SPICNT = SPI_ENABLE | SPI_BAUD_1MHz;
REG_SPIDATA = enable? (result | data): (result & ~data); REG_SPIDATA = enable? (result | data): (result & ~data);
SerialWaitBusy(); SerialWaitBusy();
// FIXME: This function should either return something, or have a comment
// explaining why it is valid for it to not return something. :-)
} }
/* /*

View file

@ -0,0 +1,840 @@
The official port of ScummVM
to the Nintendo DS handheld console
by Neil Millstone (agentq)
http://scummvm.drunkencoders.com
------------------------------------------------------------------------
Visit the main ScummVM website <http://www.scummvm.org>
Contents
------------------------------------------------------------------------
* What's New?
* What is ScummVM DS?
* Features
* Screenshots
* How to Get ScummVM DS Onto Your DS - Simple Explanation
o Using a CF/SD/Mini SD/Micro SD card reader and a DLDI driver
o Instructions for specific card readers
* What to do if saving doesn't work or your card gets corruped -
force SRAM saves
* How to use ScummVM DS
* Game Specific Controls
* DS Options Screen
* Which games are compatible with ScummVM DS
* Predictive dictionary for Sierra AGI games
* Converting your CD audio
* Converting speech to MP3 format
* Frequently Asked Questions
* Downloads
* Contributors
* Donations and Getting Help
* Building from Sources
What's New?
------------------------------------------------------------------------
ScummVM DS 0.12.0
* New games supported: Lure of the Temptress, Nippon Safes, Lost in Time.
* New laptop-style trackpad input method. Uses relative movement when you
drag on the touch screen.
* New option which allows you to drag to hover, tap the touch screen to
click, and double tap the screen to right click.
* Reorganised DS Options screen into three tabs for clearer navigation
* New top screen scaling options let you choose the scaling factor used
on startup.
* The usual round of bug fixes.
ScummVM DS 0.11.1
* Bugfix release - No new DS port features
ScummVM DS 0.11.0
* New games supported: Elvira 1 and 2, Waxworks (Amiga version)
* Software scaler for improved image quality. Turn it on using the DS options
screen (press select during the game). Thanks to Tramboi and Robin Watts for
this feature!
* Function keys added to virtual keyboard (used in AGI games)
* Plenty of bug fixes
What is ScummVM DS?
------------------------------------------------------------------------
ScummVM DS is a part of the ScummVM project. The ScummVM project is an
attempt to re-engineer many classic point and click adventure games of the
80s and 90s to run on modern computer hardware. Technology has changed a
lot since these games were written, and so ScummVM attempts to replicate the
gameplay of the original games in exacting details, without any of the original
code that the game ran on. ScummVM needs a copy of the original game, in order
to take the graphics, sound, and scripts that made the game work.
ScummVM is written in such a way that it can be 'ported' from one type of
machine to another, and ScummVM DS is a port of ScummVM to the Nintendo DS
handheld games console.
Features
------------------------------------------------------------------------
* Runs nearly all of Lucasarts' SCUMM games up to and including Sam
& Max Hit the Road
* Runs many non-Lucasarts point-and-click adventures too
* Supports sound
* Provides a GUI to change settings and choose games
* Supports using the DS touch screen for controls
* Suports saving games to compatible flash cards
* All games run at pretty much full speed
How to Get ScummVM DS Onto Your DS - Simple Explanation
------------------------------------------------------------------------
Nintendo don't want you to run ScummVM on your DS. They control
which companies can make games on the DS, and there is an expensive
process to go through in order to be licenced. Having to pay for
this would prevent me from giving away ScummVM for free.
So, the result is that to run ScummVM on your DS you'll need an
unofficial card reader. There are many of these, and all are different.
Popular models at the time of writing are the R4DS and the M3DS Real,
but many different models work. You need to buy one of these, and at
MicroSD card to go with it.
There are also slot-2 card readers which fit into the bottom slot on
your DS, usually used for Game Boy Advance games. These are less common
these days, and although they have certain advantages, the details of
these are beyond the scope of this website. Information on these is
quite easy to find by searching.
Once you have your card reader and a MicroSD card, you will also need
a copy of the game you want to run. ScummVM can run a large variety
of games, but you must own a real boxed copy of the game. These games
are still under copyright, and it is illegal to copy them from a friend
or download them from the Internet without paying. The exception to
this are the three Revolution Software games. These are 'Beneath a
Steel Sky', 'Lure of the Temptress' and 'Flight of the Amazon Queen'.
Revolution have kindly allowed us to give these games away for free.
You can download them from the main ScummVM site at
<http://www.scummvm.org/downloads.php>
NOTE: Previous version of ScummVM DS supported a method which used a
zip file to run games on unsupported flash card readers. This method
is no longer supported.
How to Get ScummVM DS Onto Your DS - Using a CF/SD/Mini SD/Micro
SD card reader and a DLDI driver
------------------------------------------------------------------------
ScummVM DS needs something called a DLDI driver to run on each make
and model of card reader. Many modern card readers (R4DS, M3 DS Real)
handle this autmatically and for those, you don't have to do anything.
Just running ScummVM on the card will handle this step for you.
For others, you will need to follow the steps in this section before
ScummVM DS will work.
All DS card readers are different in the way that they work. In order to
support many different card readers, ScummVM DS uses a DLDI driver installed
into the ScummVM DS code. This is done using a program called DLDITool
which you can download and run on your computer. Each DLDI driver is
designed to tell ScummVM DS how to use a specific type of card reader.
These drivers can be used with any homebrew program which supports the
DLDI interface.
While each card reader should work with these instructions, there are
some exceptions. Please read the card reader notes
section to see if there is any specific information about your card reader.
Here is what you need to do:
* Visit the DLDI page <http://dldi.drunkencoders.com/> and
download the executable for DLDITool for your operating system
(versions are available for Windows, Linux, and MacOS)
* Download the DLDI for your card reader. This is the big table at
the top of the page. The first column marked DLDI is the one you
want. You should get a single file with a .dldi extension.
* Extract DLDITool into a folder, and put the DLDI of your choice in
the same folder.
* If you're using the command line version of DLDITool enter the
following at a command prompt:
dlditool <dldiname> <scummvm nds name>
If you're using the Windows GUI version, double click on
dlditool32.exe, select your card reader from the box, drag your
ScummVM binaries (either the .nds, or the .ds.gba version
depending on your card reader. I think only Supercards use the
.ds.gba files) into the lower box, then click patch.
Either way, you should see 'Patched Successfully'. If you don't,
you're doing something wrong.
You need to patch one of the builds labeled A - F depending on
which game you want to run. See the table on the ScummVM DS
website to see which games are supported by which build.
* Put the patched .nds or .ds.gba files on your flash card. If
you're using the Supercard, you will need to use the .ds.gba
files, but rename them to .nds.
* Put your game data in any folder on the card. Do NOT use a zip file.
* Boot up your DS and run ScummVM.
* Click 'Add Game', browse to the folder with your game data, click
'Choose', then 'OK'. Click 'Start' to run the game.
If your copy of ScummVM DS has been successfully patched, you will get a
message on the top screen that looks like this:
DLDI Device:
GBA Movie Player (Compact Flash)
The message should show the name of your card reader. If it is wrong,
you have used the wrong DLDI file.
If you haven't patched your .nds file, you will get the following message
DLDI Driver not patched!
DLDI Initialise failed.
In this case, you've made a mistake following the above instructions, or
have patched the wrong file.
You may also see the following message:
DLDI Device:
GBA Movie Player (Compact Flash)
DLDI Initialise failed.
In this case, the driver did not start up correctly. The driver is
probably broken, or you've used the wrong one for your card reader.
In the case of the Supercard, M3 Lite and DS Link, there are several
drivers available. You might want to try one of the others.
This version of ScummVM DS will run on any card reader that has a DLDI
driver available. If yours doesn't, you need to pressure your card
reader manufacturer to release one.
DO NOT EMAIL ME TO ASK ME TO CREATE A DRIVER FOR YOUR CARD READER, I
CANNOT DO THIS.
How to Get ScummVM DS Onto Your DS - Instructions for specific
card readers
------------------------------------------------------------------------
* *GBAMP CF:* You need to upload replacement firmware to your card
reader before it will work. You can download the firmware program
here <http://chishm.drunkencoders.com/NDSMP/index.html>. Name your
.nds file _BOOT_MP.nds.
* *M3 CF/SD:* Copy the .nds file to your card with the M3 Game
Manager in order to avoid an annoying message when you boot your
M3. Use the default options to copy the file. Be sure to press 'A'
in the M3 browser to start the .nds file, and not 'Start', or it
won't work.
* *M3 CF/SD:* Copy the .nds file to your card with the M3 Game
Manager in order to avoid an annoying message when you boot your
M3. Use the default options to copy the file. Be sure to press 'A'
in the M3 browser to start the .nds file, and not 'Start', or it
won't work.
* *Supercard CF/SD (slot-2):* Use the .ds.gba files to run ScummVM
on the Supercard. Other than that, just follow the instructions as
normal.
* *Supercard Lite (slot-2):* It has been reported that only the
standard Supercard driver and the Moonshell version work with
ScummVM DS.
* *Datel Max Media Dock: * If you haven't already, upgrade your
firmware to the latest version. The firmware that came with my Max
Media Dock was unable to run ScummVM DS at all. Click here to
visit Datel's support page and download the latest firmware
<http://us.codejunkies.com/mpds/support.htm>
* *NinjaDS*: There are firmware upgrades for this device, but for
me, ScummVM DS ran straight out of the box. Visit this page
<http://www.ninjads.com/news.html> to download the latest firmware
if you want. If you have installed FlashMe on your DS, it will
make your DS crash on boot when the NinjaDS is inserted. You can
hold the 'select' button during boot to disable FlashMe, which
will allow the NinjaDS to work. Due to this, it is not recommended
to install FlashMe if you use a NinjaDS.
* *EZ-Flash*: This card reader uses .ds.gba files from the ScummVM
archive. Rename them to .nds before patching them with the DLDI
patcher.
* *R4DS*: If you upgrade the firmware for your R4DS to version 1.10
or later, the card will autmatically DLDI patch the game, meaning
you don't have to use dlditool to patch the .NDS file. This makes
things a lot easier!
* *M3DS Real*: This card autmatically DLDI patches the game, meaning
that you do not need to do this yourself.
Which games are compatible with ScummVM DS?
------------------------------------------------------------------------
I'm glad you asked. Here is a list of the compatible games in version
0.12.0. Demo versions of the games listed should work too.
Flight of the Amazon Queen, Beneath a Steel Sky, and Lure of the
Temptress have generously been released as freeware by the original
authors, Revolution Software <http://www.revolution.co.uk/>. This is a
great thing and we should support Revolution for being so kind to us.
You can download the game data from the official ScummVM download page
<http://www.scummvm.org/downloads.php>.
The other games on this list are commercial, and still under copyright,
which means downloading them without paying for it is illegal. You can
probably find a second-hand copy on eBay. Please don't email me to ask
for a copy, as I am unable to send it to you.
Game Build Notes
Manic Mansion A
Zak McKracken and the Alien Mindbenders A
Indiana Jones and the Last Crusade A
Loom A
Passport to Adventure A
The Secret of Monkey Island A
Monkey Island 2: LeChuck's Revenge A
Indiana Jones and the Fate of Atlantis A
Day of the Tentacle A
Sam & Max Hit the Road A Some slowdown in a few scenes
when MP3 audio is enabled
Bear Stormin' (DOS) A
Fatty Bear's Birthday Surprise (DOS) A
Fatty Bear's Fun Pack (DOS) A
Putt-Putt's Fun Pack (DOS) A
Putt-Putt Goes to the Moon (DOS) A
Putt-Putt Joins the Parade (DOS) A Can sometimes crash due to low memory
Beneath a Steel Sky B
Flight of the Amazon Queen B
Simon the Sorcerer 1 C Zoomed view does not follow the
speaking character
Simon the Sorcerer 2 C Zoomed view does not follow the
speaking character
Elvira 1 C
Elvira 2 C
Waxworks (Amiga version) C
Gobliiins D
Gobliins 2 D
Goblins 3 D
Ween: The Prophecy D
Bargon Attack D
Lost in Time D
Future Wars D
All Sierra AGI games.
For a complete list, see this page
<http://wiki.scummvm.org/index.php/AGI> D
Inherit the Earth E
The Legend of Kyrandia F Zoomed view does not follow the
speaking character
Lure of the Temptress G
Nippon Safes G
There is no support for Full Throttle, The Dig, or The Curse of Monkey
Island because of memory issues. There simply is not enough RAM on the
DS to run these games. Sorry. Also there is no support for Windows Humongous
Entertainment games. The extra code required to make this work uses up
too much RAM.
What to do when saving doesn't work or your card gets corrupted -
forcing SRAM Saves
------------------------------------------------------------------------
This method only works for cards which use the Game Boy Advance slot on the
bottom of your DS.
If ScummVM DS cannot save games to your SD card, or it causes corruption
when it does, you can force it to use GBA SRAM to save the game. This
uses your flash cart reader's GBA features to save the game to a .sav or
.dat file (depending on the reader). Only slot-2 devices can use SRAM saves,
and only ones with support for GBA games.
If you want to use SRAM save, just create a text file called scummvm.ini
(or scummvmb.ini, scummvmc.ini for builds B or C) in the root of your
card which contains the following:
[ds]
forcesramsave=true
When you boot your game, ScummVM DS will not save games to your SD card
directly, instead it will save to GBA SRAM. On most cards, you need to
transfer the data to your SD card by rebooting and using your card
reader's boot-up menu. Using this method, around four saves can me made.
One disadvantage of forcing SRAM saves is that your settings won't be
saved. You can add games manually to the ini file so that you don't have
to select them on each boot. Just add a section like the following on
for each game on your card.
[monkey2]
description=Monkey Island 2: LeChuck's Revenge (English/DOS)
path=mp:/MONKEY2
How to Use ScummVM
------------------------------------------------------------------------
Once you've booted up ScummVM, you'll see the start up screen.
1. Tap the 'Add' button with the pen, then browse to the folder
containing your game data. Once you have clicked on your folder, you will
not see any files inside. This is normal, as the folder selector only shows
folders!
2. Click the 'Choose' button.
3. You will get some options for the game. You can usually just click 'Ok' to
this.
4. Now click on the name of the game you want to play from the list and
click 'Start'. Your game will start!
You can use the B button to skip cutscenes, and the select button to
show an options menu which will let you tweak the DS contols, including
switch between scaled and unscaled video modes. The text is clearer in
the unscaled mode, but the whole game doesn't fit on the screen. To
scroll around, hold either shoulder button and use the D-pad or drag the
screen around with the stylus. Even in scaled mode, a small amount is
missing from the top and bottom of the screen. You can scroll around to
see those areas. The top screen shows a zoomed-in view. This scrolls
around to focus on the character who's speaking, and also follows where
the pen touches the screen. You can change the zoom level by holding one
of the shoulder buttons and pressing B to zoom in and A to zoom out.
Press the start button for the in-game menu where you can load or save
your game (this works in Lucasarts games, other games vary). Saves will
write directly to your flash card. You can choose the folder where they
are stored using the GUI that appears when you boot up. If you're using
a GBA Flash Cartridge, or an unsupported flash card adaptor, you will be
using GBA SRAM to save your game. Four or five save game will fit in
save RAM. If you save more games than will fit, a warning will appear on
the top screen. When you turn your DS off, the new save will be lost,
and only the first ones you saved will be present.
Many of the games use both mouse buttons. Usually the right button often
performs the default action on any object you click on. To simulate this
with the DS pen, you can switch the input into one of three modes. Press
left on the D-pad to enable the left mouse button. Press right on the
D-pad to enable the right mouse button. Press up on the D-pad to enable
hover mode. In this mode, you won't click on anything, just hover the
mouse cursor over it. This lets you pick out active objects in the scene.
An icon on the top screen will show you which mode you're in.
In hover mode, there are some additional controls. While holding the pen
on the screen, tapping D-pad left or D-pad right (or A/Y in left handed
mode) will click the left or right mouse button.
There is an alternative method of control which doesn't require you to
change modes with the D-pad. Press 'Select' to bring up the DS options,
and choose 'Tap for left click, double tap for right click'. In this
mode, you can quickly tap the screen to left click the mouse, and tap twice
to right click the mouse.
Here is a complete list of controls in right-handed mode (the default
setting):
Key Usage
Pad Left Left mouse button
Pad Right Right mouse button
Pad Up Hover mouse (no mouse button)
Pad Down Skip dialogue line (for some Lucasarts games), Show inventory
(for Beneath a Steel Sky), Show active objects (for Simon the Sorceror)
Start Pause/game menu (works in some games)
Select DS Options
B Skip cutscenes
A Swap main screen and zoomed screen
Y Show/Hide debug console
X Show/Hide on-screen keyboard
L + D-pad or L + Pen Scroll touch screen view
L + B Zoom in
L + A Zoom out
And here's left-handed mode:
Key Usage
Y Left mouse button
A Right mouse button
X Hover mouse (no mouse button)
B Skip dialogue line (for some Lucasarts games), Show inventory (for
Beneath a Steel Sky), Show active objects (for Simon the Sorceror)
Start Pause/game menu (works in some games)
Select DS Options
D-pad down Skip cutscenes
D-pad up Swap main screen and zoomed screen
D-pad left Show/Hide debug console
D-pad right Show/Hide on-screen keyboard
R + D-pad or R + Pen Scroll touch screen view
R + D-pad down Zoom in
R + d-pad right Zoom out
Game-specific controls
------------------------------------------------------------------------
* Sam and Max Hit the Road: The current cursor mode is displayed on
the top screen. Use d-pad right to switch mode.
* Indiana Jones games: If you get into a fight, press Select, and
check the box marked 'Use Indy Fighting Controls'.
Return to the game, then use the following controls to fight:
D-pad left: move left
D-pad right: move right
D-pad up: guard up
D-pad down: guard down
Y: guard middle
X: Punch high
A: Punch middle
B: Punch low
Left shoulder: Fight towards the left
Right shoulder: Fight towards the right
The icon on the top screen shows which way you're currently
facing. Remember to turn the option off when the fight ends, or
the normal controls won't work!
* Beneath a Steel Sky: Press D-pad down to show your inventory.
* Simon the Sorcerer 1/2: Press D-pad down to show active objects.
* AGI games: Press Start to show the menu bar.
* Bargon Attack: Press Start to hit F1 when you need to start the
game. Use the on-screen keyboard (hit X) to press other function keys.
DS Options Screen
------------------------------------------------------------------------
Pressing the 'select' button during any game to show the DS options
screen. This screen shows options specific to the Nintendo DS version
of ScummVM.
Controls tab
Indy Fight Controls - Enable fighting controls for the Indiana Jones
games. See 'Game Specific Controls' for more information.
Left handed Mode - Switch the controls on the D-pad with the controls
on the A/B/X/Y buttons.
Show mouse cursor - Shows the game's mouse cursor on the bottom screen.
Snap to edges - makes it easier for the mouse controls to reach the edges
of the screen. Useful for Beneath a Steel Sky and Goblins 3.
Touch X offset - if your screen doesn't perform properly, this setting
allows you to adjust when the cursor appears left or right relative to
the screen's measured touch position.
Touch Y offset - if your screen doesn't perform properly, this setting
allows you to adjust when the cursor appears higher or lower relative to
the screen's measured touch position.
Use Laptop Trackpad-style cursor control - In this mode, use the lower
screen to drag the cursor around, a bit like using a trackpad on a laptop.
When this option is enabled, the following option is also enabled.
Tap for left click, double tap for right click - In this mode, you can
quickly tap on the screen to left click the mouse, or quickly
double tap on the screen to right click the mouse. If you find clicking
or double-clicking difficult, try and make a firmer touch on the screen,
and keep the pen down for longer.
Sensitivity - this bar adjusts the speed of cursor movement when laptop
trackpad-style cursor control is enabled (see above).
Graphics Tab
Scaling options:
Three scaling options are available for the main screen.
Harware Scale - Scales using the DS hardware scaler using a flicker method.
Produces lower quality graphics but doesn't slow the game down.
Software Scale - Scales using the CPU. A much higher quality image is
produced, but at the expense of speed in some games.
Unscaled - Allows you to see the graphics as originaly displayed. This
doesn't fit on the DS screen, but you can scroll the screen around by holding
the left shoulder button and using the D-pad or touch screen.
Top screen zoom - These three options control the zoom level of the top
screen when ScummVM is started up. Changing this option will set the zoom
to the specified level immediately.
Initial top screen scale:
This option controls the scaling level of the zoomed screen. In ScummVM
DS, one screen shows a zoomed-in view of the action, and this option controls
how zoomed in it is. You can also adjust this in the game by holding L and
pressing A/B.
General Tab
High Quality Audio - Enhance the sound quality, at the expense of some
slowdown during some games.
Disable power off - ScummVM DS turns the power off when the game quits.
This option disables that feature.
Auto completion dictionary for Sierra AGI games
------------------------------------------------------------------------
If you are playing a Sierra AGI game, you will be using the on-screen
keyboard quite a lot (press X to show it). To reduce the amount you have
to type, the game can automatically complete long words for you. To use
this feature, simply copy the PRED.DIC file from the ScummVM DS archive
into your game folder on your card. Now, when you use the keyboard,
possible words will be shown underneith it. To type one of those words,
simply double click on it with your stylus.
Converting your CD audio
------------------------------------------------------------------------
ScummVM supports playing CD audio for specific games which came with
music stored as standard music CD tracks. To use this music in ScummVM
DS, they need to be ripped from the CD and stored in a specific format.
This can only be done for the CD versions of certain games, such as
Monkey Island 1, Loom, and Gobliiins. All the floppy games and CD games
that didn't have CD audio tracks for music don't require any conversion,
and will work unmodified on ScummVM DS. MP3 audio files for CD music are
not supported.
Cdex can do the conversion very well and I recommend using it to convert
your audio files, although any CD ripping software can be used, so feel
free to use your favourite program. The format you need to use is
IMA-ADPCM 4-bit Mono. You may use any sample rate. All other formats
will be rejected, including uncompressed WAV files.
Now I will to describe how to rip your CD tracks with Cdex, which can be
found here: Cdex Homepage <http://sourceforge.net/projects/cdexos/>.
Other software can be used to create IMA ADPCM files under Linux or
MacOS.
To set this up in Cdex, select Settings from the Options menu. On the
Encoder tab, select 'WAV Output Encoder'. Under 'Encoder Options',
choose the following:
Format: WAV
Compression: IMA ADPCM
Samplerate: 22050 Hz
Channels: Mono
On the fly encoding: On
Next, go to the 'Filenames' tab and select the folder you want to save
your Wav files to. Under 'Filename format', enter 'track%3'. This should
name your WAV files in the correct way. Click OK.
Now select all the tracks on your CD, and click 'Extract CD tracks to a
compressed audio file'. Cdex should rip all the audio off your CD.
Now all you have to do is copy the newly created WAV files into the same
directory that your other game data is stored on your CompactFlash card.
Next time your run ScummVM DS, it should play with music!
*Important Note:* Do not select 'Extract CD tracks to a WAV file'. This
creates uncompressed WAVs only. You want 'Extract CD tracks to a
compressed audio file'.
Converting Speech files to MP3 format
------------------------------------------------------------------------
ScummVM supports playing back speech for talkie games in MP3 format.
Unfortunately, the DS CPU is not quite up to the task, and MP3 audio
will sometimes cause slowdown in your game. However, if your flash card
isn't big enough to fit the audio files on, you will have no choice!
To convert your audio you will need a copy of the ScummVM Tools package
<http://sourceforge.net/project/showfiles.php?group_id=37116&package_id=67433>.
You will also need a copy of the LAME MP3 encoder
<http://www.free-codecs.com/Lame_Encoder_download.htm>.
Once this is all installed and set up, the process to encode your audio
varies from game to game, but the Lucasarts games can all be compressed
using the following command line:
compress_scumm_sou --mp3 monster.sou
This produces a monster.so3 file which you can copy to your flash card
and replaces the original monster.sou. Ogg format (monster.sog) and flac
format files are not currently supported by ScummVM DS, and it is
unlikely they will ever be supported. There is no way to convert .sog or
.so3 files back to .sou files. Just dig out your original CD and copy
the file from that.
Frequently Asked Questions
------------------------------------------------------------------------
I get a lot of email about ScummVM DS. Nearly all of them are exactly
the same. Here I'm going to try and answer the questions that everybody
asks me in the hope that I will spend less time answering questions that
are clearly in the documentation and more time helping people who have a
real problem or have discovered a real bug.
*Q:* I can't see the bottom line of inventory items in Day of the
Tentacle, Monkey Island 2, or a few other games! What do I do?
*A:* Hold down the left shoulder button and use D-pad (or the touch
screen) to scroll the screen around.
*Q:* I dont see a menu when I press Start in Flight of the Amazon Queen
or Simon the Sorcerer. Is ScummVM broken?
*A:* No. To save in Simon the Sorcerer, click 'use', then click on the
postcard in your inventory. In Flight of the Amazon Queen, click 'use',
then click on the journal in your inventory.
*Q:* Why does ScummVM crash when I play Monkey Island 1?
*A:* This happens when MP3 audio tracks are present from the PC version
of ScummVM. Delete the MP3 tracks and reencode them to ADPCM WAV files
as described in the CD audio section.
*Q:* When will you support my Mini/Micro SD card reader? I want it!
Pretty please?
*A:* ScummVM uses DLDI drivers. If your card reader manufacturer doesn't
provide a driver, there is nothing I can do about it. The people to ask
are the card reader manufacturers themselves.
*Q:* Can't you use the extra RAM in the M3/Supercard or the official
Opera Expansion Pack to support more games like The Dig and Full
Throttle? DS Linux has done it, so why can't you?
*A:* Not at the moment. The extra RAM has certain differences to the
build in RAM which makes it difficult to use for general programs. As
ScummVM DS is an official port, the changes to the ScummVM code base
must be minimal to avoid making the code difficult to read for other
users. I do have plans to work on this some time in the future, but
don't nag me about when it'll be done. If and when there's progress with
this, I will post on the ScummVM forums about it.
*Q:* ScummVM DS turns off my DS when I hit 'Quit' in the game or quit
from the frontend. Why doesn't it return to the menu?
*A:* Due to bugs in the ScummVM codebase, many of the ScummVM games
cannot quit cleanly leaving the machine in the same state as when it
started. You will notice that no other versions of ScummVM can quit back
to the menu either. This will be fixed at some time in the future.
Contributors
------------------------------------------------------------------------
ScummVM DS uses chishm's GBA Movie Player FAT driver.
The CPU scaler is by Tramboi and Robin Watts
The ARM code was optimised by Robin Watts
Thanks to highpass for the ScummVM DS icons.
Thanks to zhevon for the Sam & Max cursor code.
Thanks to theNinjaBunny for the M3 Adaptor guide on this site.
Thanks also to everyone on the GBADev Forums.
This program was brought to you by caffiene, sugar, and late nights.
Donations and Getting Help
------------------------------------------------------------------------
If you have problems getting ScummVM to work on your hardware, please
read the FAQ first. /Please/ don't ask me questions which are
answered in the FAQ, I get many emails about this program each day, and
I can't help the people who really need help if I'm answering the same
question all the time which is already answered on this page. Other than
that, feel free to post on the ScummVM DS forum <http://forums.scummvm.org>
for help. Please do your research first though. There is no way of
running this on an out-of-the box DS without extra hardware. Most of
these things are fairly inexpensive though.
If you want to contact me, please email me on scummvm at millstone dot
demon dot co dot uk.
If you want to help with the development of ScummVM DS, great! Download
the source code and get building. There are plenty of things left to do.
You can also help by making a donation if you've particularly enjoyed
ScummVM DS. This uses Paypal, and is completely secure. There's no
pressure though, ScummVM DS is completely free. This is just for those
who would like to make a contribution to further development.
Building from Sources
------------------------------------------------------------------------
ScummVM is an open source project. This means that anyone is free to
take the source code to the project and make their own additions and fixes,
contributing them back to the authors for consideration for the next version.
To build ScummVM DS from source, it's probably better to checkout the
latest version of the code from the ScummVM SVN repository. The ScummVM
Sourceforge.net homepage <http://sourceforge.net/projects/scummvm> has
all the information about how to do this.
By default, ScummVM DS expects to find libmad, an MP3 compressor library
targeted for the ARM platform. If you don't have this, you must disable
libmad support by opening 'backends/platform/ds/arm9/makefile' and
commenting out the line which says USE_MAD = 1.
Then, enter the 'backends/platform/ds' folder and type:
make SCUMM_BUILD=a
The executable nds file will build inside 'backends/platform/ds/arm9/SCUMMVM-A'.
For other builds, substitute the letters b - g in the above line.

View file

@ -8,25 +8,29 @@ libndsdir = $(DEVKITPRO)/libnds
# Select the build by setting SCUMM_BUILD to a,b,c,d,e,f or g. # Select the build by setting SCUMM_BUILD to a,b,c,d,e,f or g.
# Anything else gets build a. # Anything else gets build a.
ifeq ($(SCUMM_BUILD),g) ifeq ($(SCUMM_BUILD),h)
DS_BUILD_G = 1 DS_BUILD_H = 1
else
ifeq ($(SCUMM_BUILD),f)
DS_BUILD_F = 1
else else
ifeq ($(SCUMM_BUILD),e) ifeq ($(SCUMM_BUILD),g)
DS_BUILD_E = 1 DS_BUILD_G = 1
else else
ifeq ($(SCUMM_BUILD),d) ifeq ($(SCUMM_BUILD),f)
DS_BUILD_D = 1 DS_BUILD_F = 1
else
ifeq ($(SCUMM_BUILD),e)
DS_BUILD_E = 1
else else
ifeq ($(SCUMM_BUILD),c) ifeq ($(SCUMM_BUILD),d)
DS_BUILD_C = 1 DS_BUILD_D = 1
else else
ifeq ($(SCUMM_BUILD),b) ifeq ($(SCUMM_BUILD),c)
DS_BUILD_B = 1 DS_BUILD_C = 1
else else
ifeq ($(SCUMM_BUILD),b)
DS_BUILD_B = 1
else
DS_BUILD_A = 1 DS_BUILD_A = 1
endif
endif endif
endif endif
endif endif
@ -67,7 +71,12 @@ endif
# NOTE: The header and libs for the debugger is assumed to be in the libnds # NOTE: The header and libs for the debugger is assumed to be in the libnds
# folder. # folder.
VPATH = $(srcdir) vpath %.h $(srcdir)
vpath %.cpp $(srcdir)
vpath %.c $(srcdir)
vpath %.m $(srcdir)
vpath %.asm $(srcdir)
vpath %.s $(srcdir)
# Command to build libmad is: # Command to build libmad is:
# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' # ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
@ -75,8 +84,8 @@ VPATH = $(srcdir)
# I actually had to use # I actually had to use
# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' LDFLAGS='C:/Progra~1/devkitpro/libnds/lib/libnds9.a' --disable-shared --disable-debugging # ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' LDFLAGS='C:/Progra~1/devkitpro/libnds/lib/libnds9.a' --disable-shared --disable-debugging
USE_ARM_SOUND_ASM = 1
ARM = 1 ARM = 1
USE_ARM_SOUND_ASM = 1
USE_ARM_COSTUME_ASM = 1 USE_ARM_COSTUME_ASM = 1
ifdef DS_BUILD_A ifdef DS_BUILD_A
@ -135,6 +144,13 @@ ifdef DS_BUILD_G
BUILD=scummvm-G BUILD=scummvm-G
endif endif
ifdef DS_BUILD_H
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_H
LOGO = logog.bmp
ENABLE_PARALLACTION = STATIC_PLUGIN
BUILD=scummvm-H
endif
ARM7BIN := -7 $(CURDIR)/../../arm7/arm7.bin ARM7BIN := -7 $(CURDIR)/../../arm7/arm7.bin
ICON := -b ../../../logo.bmp "ScummVM;By Neil Millstone;" ICON := -b ../../../logo.bmp "ScummVM;By Neil Millstone;"
@ -147,6 +163,7 @@ CFLAGS = -Wno-multichar -Wall\
-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\ -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
-mthumb-interwork -DUSE_ARM_COSTUME_ASM=1 -mthumb-interwork -DUSE_ARM_COSTUME_ASM=1
# -ffast-math # -ffast-math
ifdef USE_DEBUGGER ifdef USE_DEBUGGER
@ -160,7 +177,7 @@ ifdef USE_PROFILER
endif endif
CXXFLAGS= $(CFLAGS) -Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-reorder \ CXXFLAGS= $(CFLAGS) -Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-reorder \
-fno-exceptions -fno-rtti -mthumb-interwork -fno-exceptions -fno-rtti -mthumb-interwork -ffunction-sections -fdata-sections
# -mthumb # -mthumb
@ -180,12 +197,12 @@ ifdef USE_MAD
endif endif
LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -Wl,--wrap,time -mno-fpu -Wl,-Map,map.txt LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -Wl,--wrap,time -mno-fpu -Wl,-Map,map.txt -Wl,--gc-sections
INCLUDES= -I./ -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/common -I$(portdir)/source \ INCLUDES= -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/engines \
-I$(portdir)/data -I$(libndsdir)/include -I$(portdir)/../commoninclude\ -I$(portdir)/data -I$(portdir)/../commoninclude \
-I$(libndsdir)/include -I$(libndsdir)/include/nds -I$(srcdir)/engines -I$(portdir)/source/mad\ -I$(portdir)/source -I$(portdir)/source/mad -I$(portdir)/source/libcartreset \
-I$(portdir)/source/libcartreset -include $(srcdir)/common/scummsys.h -I$(libndsdir)/include -include $(srcdir)/common/scummsys.h
LIBS = -lm -L$(libndsdir)/lib -L$(portdir)/lib -lnds9 LIBS = -lm -L$(libndsdir)/lib -L$(portdir)/lib -lnds9
@ -232,7 +249,8 @@ endif
DATA_OBJS := $(portdir)/data/icons.o $(portdir)/data/keyboard.o $(portdir)/data/keyboard_pal.o $(portdir)/data/default_font.o $(portdir)/data/8x8font_tga.o DATA_OBJS := $(portdir)/data/icons.o $(portdir)/data/keyboard.o $(portdir)/data/keyboard_pal.o $(portdir)/data/default_font.o $(portdir)/data/8x8font_tga.o
COMPRESSOR_OBJS := $(portdir)/source/compressor/lz.o COMPRESSOR_OBJS :=
#$(portdir)/source/compressor/lz.o
FAT_OBJS := $(portdir)/source/fat/disc_io.o $(portdir)/source/fat/gba_nds_fat.o\ FAT_OBJS := $(portdir)/source/fat/disc_io.o $(portdir)/source/fat/gba_nds_fat.o\
$(portdir)/source/fat/io_fcsr.o $(portdir)/source/fat/io_m3cf.o\ $(portdir)/source/fat/io_fcsr.o $(portdir)/source/fat/io_m3cf.o\
@ -252,14 +270,15 @@ FAT_OBJS := $(portdir)/source/fat/disc_io.o $(portdir)/source/fat/gba_nds_fat.o
# $(portdir)/source/fat/io_sd_common.o $(portdir)/source/fat/io_scsd_s.o \ # $(portdir)/source/fat/io_sd_common.o $(portdir)/source/fat/io_scsd_s.o \
# $(portdir)/source/fat/io_sc_common.o $(portdir)/source/fat/io_sd_common.o # $(portdir)/source/fat/io_sc_common.o $(portdir)/source/fat/io_sd_common.o
LIBCARTRESET_OBJS := $(portdir)/source/libcartreset/cartreset.o LIBCARTRESET_OBJS :=
#$(portdir)/source/libcartreset/cartreset.o
# Files in this list will be optimisied for speed, otherwise they will be optimised for space # Files in this list will be optimisied for speed, otherwise they will be optimised for space
OPTLIST := actor.cpp ds_main.cpp osystem_ds.cpp blitters.cpp fmopl.cpp rate.cpp mixer.cpp isomap.cpp image.cpp gfx.cpp sprite.cpp actor_path.cpp actor_walk.cpp OPTLIST := actor.cpp ds_main.cpp osystem_ds.cpp blitters.cpp fmopl.cpp rate.cpp mixer.cpp isomap.cpp image.cpp gfx.cpp sprite.cpp actor_path.cpp actor_walk.cpp
#OPTLIST := #OPTLIST :=
# Compiler options for files which should be optimised for speed # Compiler options for files which should be optimised for speed
OPT_SPEED := -O2 OPT_SPEED := -O3
# Compiler options for files which should be optimised for space # Compiler options for files which should be optimised for space
OPT_SIZE := -Os OPT_SIZE := -Os
@ -281,7 +300,7 @@ ndsall:
include $(srcdir)/Makefile.common include $(srcdir)/Makefile.common
semiclean: semiclean:
$(RM) $(portdir)/source/dsoptions.o $(portdir)/source/dsmain.o $(FAT_OBJS) $(DATA_OBJS) $(portdir)/source/wordcompletion.o $(RM) $(portdir)/source/dsoptions.o $(portdir)/source/dsmain.o $(FAT_OBJS) $(DATA_OBJS) $(portdir)/source/wordcompletion.o $(portdir)/source/dsoptions.o
clean: clean:
$(RM) $(OBJS) $(EXECUTABLE) $(RM) $(OBJS) $(EXECUTABLE)
@ -333,36 +352,17 @@ endef
############## ##############
# Replacement rule for the one in makefile.common # Replacement rule for the one in makefile.common
############## ##############
ifndef HAVE_GCC3 %.o: %.cpp
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
#.cpp.o:
%.o:%.cpp
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
# $(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
else
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
# Also, with this GCC inserts additional dummy rules for the involved headers,
# which ensures a smooth compilation even if said headers become obsolete.
#.cpp.o:
%.o:%.cpp
# echo !!!!!!!!!!!! $(notdir $<) # echo !!!!!!!!!!!! $(notdir $<)
# ifeq ( $(notdir $<), $(findstring $(notdir $<), $(OPTLIST)) ) # ifeq ( $(notdir $<), $(findstring $(notdir $<), $(OPTLIST)) )
# OPTFLAG=-O3 # OPTFLAG=-O3
# else # else
# OPTFLAG=-Os # OPTFLAG=-Os
# endif # endif
# export OPTFLAG = ; # export OPTFLAG = ;
# echo !!!!!!!! $(OPTFLAG) # echo !!!!!!!! $(OPTFLAG)
$(MKDIR) $(*D)/$(DEPDIR) $(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(if $(findstring $(notdir $<), $(OPTLIST)), $(OPT_SPEED), $(OPT_SIZE)) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(if $(findstring $(notdir $<), $(OPTLIST)), $(OPT_SPEED), $(OPT_SIZE)) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
@ -412,6 +412,7 @@ endif
padbin 16 $(basename $@).ds.gba padbin 16 $(basename $@).ds.gba
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# FIXME: The following rule hardcodes the input & output filename -- shouldn't it use $< and $@ instead?
%.bin: %.elf %.bin: %.elf
$(OBJCOPY) -S scummvm.elf scummvm-stripped.elf $(OBJCOPY) -S scummvm.elf scummvm-stripped.elf
$(OBJCOPY) -O binary scummvm-stripped.elf scummvm.bin $(OBJCOPY) -O binary scummvm-stripped.elf scummvm.bin
@ -419,4 +420,3 @@ endif
#%.o: %.s #%.o: %.s
# $(MKDIR) $(*D)/$(DEPDIR) # $(MKDIR) $(*D)/$(DEPDIR)
# $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o # $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o

View file

@ -20,149 +20,12 @@
@ @
@ @author Robin Watts (robin@wss.co.uk) @ @author Robin Watts (robin@wss.co.uk)
.global asmDrawStripToScreen
.global asmCopy8Col
.global Rescale_320x256xPAL8_To_256x256x1555 .global Rescale_320x256xPAL8_To_256x256x1555
.global Rescale_320x256x1555_To_256x256x1555 .global Rescale_320x256x1555_To_256x256x1555
.section .itcm,"ax", %progbits .section .itcm,"ax", %progbits
.align 2 .align 2
.code 32 .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 @ ARM implementation of Rescale_320x256x1555_To_256x256x1555
@ @
@ C prototype would be: @ C prototype would be:

View file

@ -20,7 +20,7 @@
* *
*/ */
#ifndef _CDAUDIO_H_ #ifndef _CDAUDIO_H_
#define _CDAUDIO_H_ #define _CDAUDIO_H_
namespace DS { namespace DS {

File diff suppressed because it is too large Load diff

View file

@ -38,7 +38,8 @@ enum controlType {
CONT_SIMON, CONT_SIMON,
CONT_FUTURE_WARS, CONT_FUTURE_WARS,
CONT_AGI, CONT_AGI,
CONT_GOBLINS CONT_GOBLINS,
CONT_NIPPON,
}; };
struct gameListType { struct gameListType {
@ -56,6 +57,7 @@ int getPenX();
int getPenY(); int getPenY();
GLvector getPenPos(); GLvector getPenPos();
void consumePenEvents(); void consumePenEvents();
controlType getControlType();
// Pad reading // Pad reading
int getKeysHeld(); int getKeysHeld();
@ -64,6 +66,8 @@ int getKeysDown();
int getKeysReleased(); int getKeysReleased();
void consumeKeys(); void consumeKeys();
int leftHandedSwap(int keys); int leftHandedSwap(int keys);
void setGameScreenSwap(bool enable);
void setSensitivity(int sensitivity);
// Video // Video
void displayMode8Bit(); // Switch to 8-bit mode5 void displayMode8Bit(); // Switch to 8-bit mode5
@ -81,6 +85,7 @@ u16* getScalerBuffer();
void setTalkPos(int x, int y); void setTalkPos(int x, int y);
void setTopScreenTarget(int x, int y); void setTopScreenTarget(int x, int y);
void set200PercentFixedScale(bool on); void set200PercentFixedScale(bool on);
void setTopScreenZoom(int percentage);
// Timers // Timers
void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a callback function at a regular interval void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a callback function at a regular interval
@ -88,7 +93,9 @@ int getMillis(); // Return the current runtime in milliseconds
void doTimerCallback(); // Call callback function if required void doTimerCallback(); // Call callback function if required
// Sound // Sound
void doSoundCallback(); // Call function if sound buffers need more data void doSoundCallback();
void startSound(int freq, int buffer); // Start sound hardware
// Call function if sound buffers need more data
void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound
void stopSound(int channel); void stopSound(int channel);
int getSoundFrequency(); int getSoundFrequency();
@ -131,6 +138,8 @@ void setIndyFightState(bool st);
bool getIndyFightState(); bool getIndyFightState();
bool isCpuScalerEnabled(); bool isCpuScalerEnabled();
void setCpuScalerEnable(bool enable); void setCpuScalerEnable(bool enable);
void setTrackPadStyleEnable(bool enable);
void setTapScreenClicksEnable(bool enable);
// Display // Display
bool getIsDisplayMode8Bit(); bool getIsDisplayMode8Bit();

View file

@ -25,6 +25,7 @@
#include "gui/dialog.h" #include "gui/dialog.h"
#include "gui/newgui.h" #include "gui/newgui.h"
#include "gui/ListWidget.h" #include "gui/ListWidget.h"
#include "gui/TabWidget.h"
#include "osystem_ds.h" #include "osystem_ds.h"
#include "engines/scumm/scumm.h" #include "engines/scumm/scumm.h"
#include "touchkeyboard.h" #include "touchkeyboard.h"
@ -41,8 +42,67 @@ namespace Scumm {
namespace DS { namespace DS {
DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(5, 0, 320 - 5, 230 - 20) { DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(0, 0, 320 - 10, 230 - 40) {
addButton(this, 10, 175, "Close", GUI::kCloseCmd, 'C');
addButton(this, 10, 170, "Close", GUI::kCloseCmd, 'C');
_tab = new GUI::TabWidget(this, 5, 5, 300, 230 - 20 - 40 - 10);
_tab->addTab("Controls");
_leftHandedCheckbox = new GUI::CheckboxWidget(_tab, 5, 5, 130, 20, "Left handed mode", 0, 'L');
_indyFightCheckbox = new GUI::CheckboxWidget(_tab, 5, 20, 140, 20, "Indy fight controls", 0, 'I');
_showCursorCheckbox = new GUI::CheckboxWidget(_tab, 150, 5, 130, 20, "Show mouse cursor", 0, 'T');
_snapToBorderCheckbox = new GUI::CheckboxWidget(_tab, 150, 20, 130, 20, "Snap to edges", 0, 'T');
new GUI::StaticTextWidget(_tab, 20, 35, 100, 15, "Touch X Offset", GUI::kTextAlignLeft);
_touchX = new GUI::SliderWidget(_tab, 130, 35, 130, 12, 1);
_touchX->setMinValue(-8);
_touchX->setMaxValue(+8);
_touchX->setValue(0);
_touchX->setFlags(GUI::WIDGET_CLEARBG);
new GUI::StaticTextWidget(_tab, 20, 50, 100, 15, "Touch Y Offset", GUI::kTextAlignLeft);
_touchY = new GUI::SliderWidget(_tab, 130, 50, 130, 12, 2);
_touchY->setMinValue(-8);
_touchY->setMaxValue(+8);
_touchY->setValue(0);
_touchY->setFlags(GUI::WIDGET_CLEARBG);
new GUI::StaticTextWidget(_tab, 130 + 65 - 10, 65, 20, 15, "0", GUI::kTextAlignCenter);
new GUI::StaticTextWidget(_tab, 130 + 130 - 10, 65, 20, 15, "8", GUI::kTextAlignCenter);
new GUI::StaticTextWidget(_tab, 130 - 20, 65, 20, 15, "-8", GUI::kTextAlignCenter);
_touchPadStyle = new GUI::CheckboxWidget(_tab, 5, 80, 270, 20, "Use laptop trackpad-style cursor control", 0x20000001, 'T');
_screenTaps = new GUI::CheckboxWidget(_tab, 5, 95, 285, 20, "Tap for left click, double tap right click", 0x20000002, 'T');
_sensitivityLabel = new GUI::StaticTextWidget(_tab, 20, 110, 110, 15, "Sensitivity", GUI::kTextAlignLeft);
_sensitivity = new GUI::SliderWidget(_tab, 130, 110, 130, 12, 1);
_sensitivity->setMinValue(4);
_sensitivity->setMaxValue(16);
_sensitivity->setValue(8);
_sensitivity->setFlags(GUI::WIDGET_CLEARBG);
_tab->addTab("Graphics");
new GUI::StaticTextWidget(_tab, 5, 70, 180, 15, "Initial top screen scale:", GUI::kTextAlignLeft);
_100PercentCheckbox = new GUI::CheckboxWidget(_tab, 5, 85, 230, 20, "100%", 0x30000001, 'T');
_150PercentCheckbox = new GUI::CheckboxWidget(_tab, 5, 100, 230, 20, "150%", 0x30000002, 'T');
_200PercentCheckbox = new GUI::CheckboxWidget(_tab, 5, 115, 230, 20, "200%", 0x30000003, 'T');
new GUI::StaticTextWidget(_tab, 5, 5, 180, 15, "Main screen scaling:", GUI::kTextAlignLeft);
_hardScaler = new GUI::CheckboxWidget(_tab, 5, 20, 270, 20, "Hardware scale (fast, but low quality)", 0x10000001, 'T');
_cpuScaler = new GUI::CheckboxWidget(_tab, 5, 35, 270, 20, "Software scale (good quality, but slower)", 0x10000002, 'S');
_unscaledCheckbox = new GUI::CheckboxWidget(_tab, 5, 50, 270, 20, "Unscaled (you must scroll left and right)", 0x10000003, 'S');
_tab->addTab("General");
_highQualityAudioCheckbox = new GUI::CheckboxWidget(_tab, 5, 5, 250, 20, "High quality audio (slower) (reboot)", 0, 'T');
_disablePowerOff = new GUI::CheckboxWidget(_tab, 5, 20, 200, 20, "Disable power off", 0, 'T');
_tab->setActiveTab(0);
_radioButtonMode = false; _radioButtonMode = false;
@ -52,46 +112,17 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(5, 0, 320 - 5, 230 - 20) {
} }
#endif #endif
new GUI::StaticTextWidget(this, 90, 10, 130, 15, "ScummVM DS Options", GUI::kTextAlignCenter); // new GUI::StaticTextWidget(this, 90, 10, 130, 15, "ScummVM DS Options", GUI::kTextAlignCenter);
_leftHandedCheckbox = new GUI::CheckboxWidget(this, 5, 70, 130, 20, "Left handed mode", 0, 'L');
_indyFightCheckbox = new GUI::CheckboxWidget(this, 5, 40, 200, 20, "Indy fighting controls", 0, 'I');
_twoHundredPercentCheckbox = new GUI::CheckboxWidget(this, 5, 55, 230, 20, "Zoomed screen at fixed 200% zoom", 0, 'T');
_highQualityAudioCheckbox = new GUI::CheckboxWidget(this, 5, 25, 250, 20, "High quality audio (slower) (reboot)", 0, 'T');
_disablePowerOff = new GUI::CheckboxWidget(this, 5, 85, 130, 20, "Disable power off", 0, 'T');
_showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 100, 130, 20, "Show mouse cursor", 0, 'T');
//#ifdef ALLOW_CPU_SCALER //#ifdef ALLOW_CPU_SCALER
// _cpuScaler = new GUI::CheckboxWidget(this, 160, 115, 90, 20, "CPU scaler", 0, 'T'); // _cpuScaler = new GUI::CheckboxWidget(this, 160, 115, 90, 20, "CPU scaler", 0, 'T');
//#endif //#endif
new GUI::StaticTextWidget(this, 180, 70, 130, 15, "Main screen:", GUI::kTextAlignLeft);
_hardScaler = new GUI::CheckboxWidget(this, 140, 85, 170, 20, "Hardware scale (fast)", 0x10000001, 'T');
_cpuScaler = new GUI::CheckboxWidget(this, 140, 100, 170, 20, "Software scale (quality)", 0x10000002, 'S');
_unscaledCheckbox = new GUI::CheckboxWidget(this, 140, 115, 170, 20, "Unscaled", 0x10000003, 'S');
_snapToBorderCheckbox = new GUI::CheckboxWidget(this, 5, 115, 120, 20, "Snap to border", 0, 'T');
new GUI::StaticTextWidget(this, 20, 145, 110, 15, "Touch X Offset", GUI::kTextAlignLeft);
_touchX = new GUI::SliderWidget(this, 130, 145, 130, 12, 1);
_touchX->setMinValue(-8);
_touchX->setMaxValue(+8);
_touchX->setValue(0);
_touchX->setFlags(GUI::WIDGET_CLEARBG);
new GUI::StaticTextWidget(this, 20, 160, 110, 15, "Touch Y Offset", GUI::kTextAlignLeft);
_touchY = new GUI::SliderWidget(this, 130, 160, 130, 12, 2);
_touchY->setMinValue(-8);
_touchY->setMaxValue(+8);
_touchY->setValue(0);
_touchY->setFlags(GUI::WIDGET_CLEARBG);
new GUI::StaticTextWidget(this, 130 + 65 - 10, 175, 20, 15, "0", GUI::kTextAlignCenter);
new GUI::StaticTextWidget(this, 130 + 130 - 10, 175, 20, 15, "8", GUI::kTextAlignCenter);
new GUI::StaticTextWidget(this, 130 - 10, 175, 20, 15, "-8", GUI::kTextAlignCenter);
#ifdef DS_SCUMM_BUILD #ifdef DS_SCUMM_BUILD
_delDialog = new Scumm::SaveLoadChooser("Delete game:", "Delete", false, Scumm::g_scumm); _delDialog = new Scumm::SaveLoadChooser("Delete game:", "Delete", false, Scumm::g_scumm);
@ -125,10 +156,36 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(5, 0, 320 - 5, 230 - 20) {
_unscaledCheckbox->setState(false); _unscaledCheckbox->setState(false);
} }
if (ConfMan.hasKey("twohundredpercent", "ds")) {
_twoHundredPercentCheckbox->setState(ConfMan.getBool("twohundredpercent", "ds")); if (ConfMan.hasKey("topscreenzoom", "ds")) {
_100PercentCheckbox->setState(false);
_150PercentCheckbox->setState(false);
_200PercentCheckbox->setState(false);
switch (ConfMan.getInt("topscreenzoom", "ds"))
{
case 100: {
_100PercentCheckbox->setState(true);
break;
}
case 150: {
_150PercentCheckbox->setState(true);
break;
}
case 200: {
_200PercentCheckbox->setState(true);
break;
}
}
} else if (ConfMan.hasKey("twohundredpercent", "ds")) {
_200PercentCheckbox->setState(ConfMan.getBool("twohundredpercent", "ds"));
} else { } else {
_twoHundredPercentCheckbox->setState(false); // No setting
_150PercentCheckbox->setState(true);
} }
if (ConfMan.hasKey("22khzaudio", "ds")) { if (ConfMan.hasKey("22khzaudio", "ds")) {
@ -165,6 +222,29 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(5, 0, 320 - 5, 230 - 20) {
_touchY->setValue(0); _touchY->setValue(0);
} }
if (ConfMan.hasKey("sensitivity", "ds")) {
_sensitivity->setValue(ConfMan.getInt("sensitivity", "ds"));
} else {
_sensitivity->setValue(8);
}
if (ConfMan.hasKey("touchpad", "ds")) {
_touchPadStyle->setState(ConfMan.getBool("touchpad", "ds"));
} else {
_touchPadStyle->setState(0);
}
if (ConfMan.hasKey("screentaps", "ds")) {
_screenTaps->setState(ConfMan.getBool("screentaps", "ds"));
} else {
_screenTaps->setState(0);
}
_screenTaps->setEnabled(!_touchPadStyle->getState());
_sensitivity->setEnabled(_touchPadStyle->getState());
_sensitivityLabel->setEnabled(_touchPadStyle->getState());
_sensitivityLabel->draw();
if (!_cpuScaler->getState() && !_unscaledCheckbox->getState()) { if (!_cpuScaler->getState() && !_unscaledCheckbox->getState()) {
_hardScaler->setState(true); _hardScaler->setState(true);
} }
@ -180,7 +260,7 @@ DSOptionsDialog::~DSOptionsDialog() {
void DSOptionsDialog::updateConfigManager() { void DSOptionsDialog::updateConfigManager() {
ConfMan.setBool("lefthanded", _leftHandedCheckbox->getState(), "ds"); ConfMan.setBool("lefthanded", _leftHandedCheckbox->getState(), "ds");
ConfMan.setBool("unscaled", _unscaledCheckbox->getState(), "ds"); ConfMan.setBool("unscaled", _unscaledCheckbox->getState(), "ds");
ConfMan.setBool("twohundredpercent", _twoHundredPercentCheckbox->getState(), "ds"); // ConfMan.setBool("twohundredpercent", _twoHundredPercentCheckbox->getState(), "ds");
ConfMan.setBool("22khzaudio", _highQualityAudioCheckbox->getState(), "ds"); ConfMan.setBool("22khzaudio", _highQualityAudioCheckbox->getState(), "ds");
ConfMan.setBool("disablepoweroff", _disablePowerOff->getState(), "ds"); ConfMan.setBool("disablepoweroff", _disablePowerOff->getState(), "ds");
#ifdef ALLOW_CPU_SCALER #ifdef ALLOW_CPU_SCALER
@ -190,6 +270,24 @@ void DSOptionsDialog::updateConfigManager() {
ConfMan.setInt("yoffset", _touchY->getValue(), "ds"); ConfMan.setInt("yoffset", _touchY->getValue(), "ds");
ConfMan.setBool("showcursor", _showCursorCheckbox->getState(), "ds"); ConfMan.setBool("showcursor", _showCursorCheckbox->getState(), "ds");
ConfMan.setBool("snaptoborder", _snapToBorderCheckbox->getState(), "ds"); ConfMan.setBool("snaptoborder", _snapToBorderCheckbox->getState(), "ds");
ConfMan.setBool("touchpad", _touchPadStyle->getState(), "ds");
ConfMan.setBool("screentaps", _screenTaps->getState(), "ds");
ConfMan.setInt("sensitivity", _sensitivity->getValue(), "ds");
u32 zoomLevel = 150;
if (_100PercentCheckbox->getState()) {
zoomLevel = 100;
} else if (_150PercentCheckbox->getState()) {
zoomLevel = 150;
} else if (_200PercentCheckbox->getState()) {
zoomLevel = 200;
}
consolePrintf("Saved zoom: %d\n", zoomLevel);
ConfMan.setInt("topscreenzoom", zoomLevel, "ds");
DS::setOptions(); DS::setOptions();
} }
@ -227,6 +325,70 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint
} }
if ((!guard) && (_radioButtonMode))
{
guard = true;
if ((sender == _touchPadStyle) && (cmd == 0x20000001)) {
if (_touchPadStyle->getState()) {
// Swap screens when turning on trackpad style, it feels
// much more natural!
DS::setGameScreenSwap(true);
_screenTaps->setState(true);
_screenTaps->setEnabled(false);
_screenTaps->draw();
_sensitivity->setEnabled(true);
_sensitivityLabel->setEnabled(true);
_sensitivityLabel->draw();
_sensitivity->draw();
} else {
DS::setGameScreenSwap(false);
_screenTaps->setEnabled(true);
_screenTaps->setState(false);
_screenTaps->draw();
_sensitivity->setEnabled(false);
_sensitivityLabel->setEnabled(false);
_sensitivityLabel->draw();
_sensitivity->draw();
}
}
guard = false;
}
if ((!guard) && (_radioButtonMode)) {
guard = true;
if (cmd == 0x30000001) {
_100PercentCheckbox->setState(true);
_150PercentCheckbox->setState(false);
_200PercentCheckbox->setState(false);
DS::setTopScreenZoom(100);
}
if (cmd == 0x30000002) {
_100PercentCheckbox->setState(false);
_150PercentCheckbox->setState(true);
_200PercentCheckbox->setState(false);
DS::setTopScreenZoom(150);
}
if (cmd == 0x30000003) {
_100PercentCheckbox->setState(false);
_150PercentCheckbox->setState(false);
_200PercentCheckbox->setState(true);
DS::setTopScreenZoom(200);
}
guard = false;
}
if (cmd == GUI::kCloseCmd) { if (cmd == GUI::kCloseCmd) {
updateConfigManager(); updateConfigManager();
close(); close();
@ -297,6 +459,8 @@ void showOptionsDialog() {
} }
void setOptions() { void setOptions() {
static bool firstLoad = true;
ConfMan.addGameDomain("ds"); ConfMan.addGameDomain("ds");
if (ConfMan.hasKey("lefthanded", "ds")) { if (ConfMan.hasKey("lefthanded", "ds")) {
@ -327,10 +491,16 @@ void setOptions() {
DS::setUnscaledMode(false); DS::setUnscaledMode(false);
} }
if (ConfMan.hasKey("twohundredpercent", "ds")) { if (firstLoad) {
DS::set200PercentFixedScale(ConfMan.getBool("twohundredpercent", "ds")); if (ConfMan.hasKey("topscreenzoom", "ds")) {
} else { DS::setTopScreenZoom(ConfMan.getInt("topscreenzoom", "ds"));
DS::set200PercentFixedScale(false); } else {
if (ConfMan.hasKey("twohundredpercent", "ds")) {
DS::setTopScreenZoom(200);
} else {
DS::setTopScreenZoom(150);
}
}
} }
if (ConfMan.hasKey("xoffset", "ds")) { if (ConfMan.hasKey("xoffset", "ds")) {
@ -345,6 +515,12 @@ void setOptions() {
DS::setTouchXOffset(0); DS::setTouchXOffset(0);
} }
if (ConfMan.hasKey("sensitivity", "ds")) {
DS::setSensitivity(ConfMan.getInt("sensitivity", "ds"));
} else {
DS::setSensitivity(8);
}
#ifdef ALLOW_CPU_SCALER #ifdef ALLOW_CPU_SCALER
if (ConfMan.hasKey("cpu_scaler", "ds")) { if (ConfMan.hasKey("cpu_scaler", "ds")) {
DS::setCpuScalerEnable(ConfMan.getBool("cpu_scaler", "ds")); DS::setCpuScalerEnable(ConfMan.getBool("cpu_scaler", "ds"));
@ -353,6 +529,33 @@ void setOptions() {
} }
#endif #endif
if (ConfMan.hasKey("screentaps", "ds")) {
DS::setTapScreenClicksEnable(ConfMan.getBool("screentaps", "ds"));
} else {
DS::setTapScreenClicksEnable(false);
}
if (ConfMan.hasKey("touchpad", "ds")) {
bool enable = ConfMan.getBool("touchpad", "ds");
DS::setTrackPadStyleEnable(enable);
if ((enable) and (firstLoad)) {
// If we've just booted up, want to swap screens when trackpad mode is in use
// but not every time we enter the options dialog.
DS::setGameScreenSwap(true);
}
if (enable) {
DS::setTapScreenClicksEnable(true);
}
} else {
DS::setTrackPadStyleEnable(false);
}
firstLoad = false;
} }
} }

View file

@ -30,6 +30,7 @@
#include "gui/object.h" #include "gui/object.h"
#include "gui/widget.h" #include "gui/widget.h"
#include "gui/dialog.h" #include "gui/dialog.h"
#include "gui/TabWidget.h"
#include "scumm/dialogs.h" #include "scumm/dialogs.h"
namespace DS { namespace DS {
@ -45,11 +46,18 @@ protected:
void togglePause(); void togglePause();
void updateConfigManager(); void updateConfigManager();
GUI::TabWidget* _tab;
GUI::StaticTextWidget* _sensitivityLabel;
GUI::SliderWidget* _touchX; GUI::SliderWidget* _touchX;
GUI::SliderWidget* _touchY; GUI::SliderWidget* _touchY;
GUI::SliderWidget* _sensitivity;
GUI::CheckboxWidget* _leftHandedCheckbox; GUI::CheckboxWidget* _leftHandedCheckbox;
GUI::CheckboxWidget* _unscaledCheckbox; GUI::CheckboxWidget* _unscaledCheckbox;
GUI::CheckboxWidget* _twoHundredPercentCheckbox; GUI::CheckboxWidget* _100PercentCheckbox;
GUI::CheckboxWidget* _150PercentCheckbox;
GUI::CheckboxWidget* _200PercentCheckbox;
GUI::CheckboxWidget* _indyFightCheckbox; GUI::CheckboxWidget* _indyFightCheckbox;
GUI::CheckboxWidget* _highQualityAudioCheckbox; GUI::CheckboxWidget* _highQualityAudioCheckbox;
GUI::CheckboxWidget* _disablePowerOff; GUI::CheckboxWidget* _disablePowerOff;
@ -59,6 +67,9 @@ protected:
GUI::CheckboxWidget* _hardScaler; GUI::CheckboxWidget* _hardScaler;
GUI::CheckboxWidget* _cpuScaler; GUI::CheckboxWidget* _cpuScaler;
GUI::CheckboxWidget* _touchPadStyle;
GUI::CheckboxWidget* _screenTaps;
#ifdef DS_SCUMM_BUILD #ifdef DS_SCUMM_BUILD
Scumm::SaveLoadChooser* _delDialog; Scumm::SaveLoadChooser* _delDialog;
#endif #endif

View file

@ -54,8 +54,8 @@ bool GBAMPSaveFile::eos() const {
return DS::std_feof(handle); return DS::std_feof(handle);
} }
void GBAMPSaveFile::skip(uint32 bytes) { bool GBAMPSaveFile::skip(uint32 bytes) {
DS::std_fseek(handle, bytes, SEEK_CUR); return DS::std_fseek(handle, bytes, SEEK_CUR) == 0;
} }
void GBAMPSaveFile::flushSaveBuffer() { void GBAMPSaveFile::flushSaveBuffer() {
@ -67,11 +67,11 @@ void GBAMPSaveFile::flushSaveBuffer() {
} }
} }
uint32 GBAMPSaveFile::pos() const { int32 GBAMPSaveFile::pos() const {
return DS::std_ftell(handle); return DS::std_ftell(handle);
} }
uint32 GBAMPSaveFile::size() const { int32 GBAMPSaveFile::size() const {
int position = pos(); int position = pos();
DS::std_fseek(handle, 0, SEEK_END); DS::std_fseek(handle, 0, SEEK_END);
int size = DS::std_ftell(handle); int size = DS::std_ftell(handle);
@ -79,8 +79,8 @@ uint32 GBAMPSaveFile::size() const {
return size; return size;
} }
void GBAMPSaveFile::seek(int32 pos, int whence) { bool GBAMPSaveFile::seek(int32 pos, int whence) {
DS::std_fseek(handle, pos, whence); return DS::std_fseek(handle, pos, whence) == 0;
} }
@ -155,11 +155,13 @@ GBAMPSaveFile* GBAMPSaveFileManager::openSavefile(char const* name, bool saveOrL
sprintf(fileSpec, "%s/%s", getSavePath(), name); sprintf(fileSpec, "%s/%s", getSavePath(), name);
} }
// consolePrintf(fileSpec); // consolePrintf("Opening the file: %s\n", fileSpec);
GBAMPSaveFile* sf = new GBAMPSaveFile(fileSpec, saveOrLoad); GBAMPSaveFile* sf = new GBAMPSaveFile(fileSpec, saveOrLoad);
if (sf->isOpen()) { if (sf->isOpen()) {
// consolePrintf("Ok");
return sf; return sf;
} else { } else {
// consolePrintf("Fail");
delete sf; delete sf;
return NULL; return NULL;
} }
@ -192,8 +194,29 @@ Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 }; enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 };
char name[256]; char name[256];
DS::std_cwd((char*)getSavePath()); //TODO : Check this suspicious const-cast {
// consolePrintf("Save path: '%s', pattern: '%s'\n", getSavePath(),pattern); char dir[128];
strcpy(dir, getSavePath());
char *realName = dir;
if ((strlen(dir) >= 4) && (dir[0] == 'm') && (dir[1] == 'p') && (dir[2] == ':') && (dir[3] == '/')) {
realName += 4;
}
// consolePrintf("Real cwd:%d\n", realName);
char* p = realName;
while (*p) {
if (*p == '\\') *p = '/';
p++;
}
// consolePrintf("Real cwd:%d\n", realName);
FAT_chdir(realName);
}
// consolePrintf("Save path: '%s', pattern: '%s'\n", getSavePath(), pattern);
int fileType = FAT_FindFirstFileLFN(name); int fileType = FAT_FindFirstFileLFN(name);
@ -206,7 +229,7 @@ Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
FAT_GetLongFilename(name); FAT_GetLongFilename(name);
for (int r = 0; r < strlen(name); r++) { for (int r = 0; name[r] != 0; r++) {
name[r] = tolower(name[r]); name[r] = tolower(name[r]);
} }

View file

@ -43,11 +43,11 @@ public:
virtual uint32 write(const void *buf, uint32 size); virtual uint32 write(const void *buf, uint32 size);
virtual bool eos() const; virtual bool eos() const;
virtual void skip(uint32 bytes); virtual bool skip(uint32 bytes);
virtual uint32 pos() const; virtual int32 pos() const;
virtual uint32 size() const; virtual int32 size() const;
virtual void seek(int32 pos, int whence); virtual bool seek(int32 pos, int whence);
void flushSaveBuffer(); void flushSaveBuffer();

View file

@ -41,7 +41,8 @@
OSystem_DS* OSystem_DS::_instance = NULL; OSystem_DS* OSystem_DS::_instance = NULL;
OSystem_DS::OSystem_DS() OSystem_DS::OSystem_DS()
: eventNum(0), lastPenFrame(0), queuePos(0), _mixer(NULL), _timer(NULL), _frameBufferExists(false) : eventNum(0), lastPenFrame(0), queuePos(0), _mixer(NULL), _timer(NULL), _frameBufferExists(false),
_disableCursorPalette(true), _graphicsEnable(true)
{ {
// eventNum = 0; // eventNum = 0;
// lastPenFrame = 0; // lastPenFrame = 0;
@ -71,7 +72,13 @@ void OSystem_DS::initBackend() {
_timer = new DSTimerManager(); _timer = new DSTimerManager();
DS::setTimerCallback(&OSystem_DS::timerHandler, 10); DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
_mixer->setOutputRate(11025 /*DS::getSoundFrequency()*/); if (ConfMan.hasKey("22khzaudio", "ds") && ConfMan.getBool("22khzaudio", "ds")) {
DS::startSound(22050, 8192);
} else {
DS::startSound(11025, 4096);
}
_mixer->setOutputRate(DS::getSoundFrequency());
_mixer->setReady(true); _mixer->setReady(true);
OSystem::initBackend(); OSystem::initBackend();
@ -79,7 +86,7 @@ void OSystem_DS::initBackend() {
bool OSystem_DS::hasFeature(Feature f) { bool OSystem_DS::hasFeature(Feature f) {
// consolePrintf("hasfeature\n"); // consolePrintf("hasfeature\n");
return (f == kFeatureVirtualKeyboard); return (f == kFeatureVirtualKeyboard) || (f == kFeatureCursorHasPalette);
} }
void OSystem_DS::setFeatureState(Feature f, bool enable) { void OSystem_DS::setFeatureState(Feature f, bool enable) {
@ -107,7 +114,7 @@ bool OSystem_DS::setGraphicsMode(int mode) {
} }
bool OSystem_DS::setGraphicsMode(const char *name) { bool OSystem_DS::setGraphicsMode(const char *name) {
// consolePrintf("Set gfx mode %s\n", name); consolePrintf("Set gfx mode %s\n", name);
return true; return true;
} }
@ -116,8 +123,15 @@ int OSystem_DS::getGraphicsMode() const {
} }
void OSystem_DS::initSize(uint width, uint height) { void OSystem_DS::initSize(uint width, uint height) {
// consolePrintf("Set gfx mode %d x %d\n", width, height); // For Lost in Time, the title screen is displayed in 640x400.
DS::setGameSize(width, height); // In order to support this game, the screen mode is set, but
// all draw calls are ignored until the game switches to 320x200.
if ((width == 640) && (height == 400)) {
_graphicsEnable = false;
} else {
_graphicsEnable = true;
DS::setGameSize(width, height);
}
} }
int16 OSystem_DS::getHeight() { int16 OSystem_DS::getHeight() {
@ -129,9 +143,8 @@ int16 OSystem_DS::getWidth() {
} }
void OSystem_DS::setPalette(const byte *colors, uint start, uint num) { void OSystem_DS::setPalette(const byte *colors, uint start, uint num) {
// consolePrintf("Set palette %d, %d colours\n", start, num); // consolePrintf("Setpal %d, %d\n", start, num);
//return;
if (!DS::getIsDisplayMode8Bit()) return;
for (unsigned int r = start; r < start + num; r++) { for (unsigned int r = start; r < start + num; r++) {
int red = *colors; int red = *colors;
int green = *(colors + 1); int green = *(colors + 1);
@ -141,19 +154,46 @@ void OSystem_DS::setPalette(const byte *colors, uint start, uint num) {
green >>= 3; green >>= 3;
blue >>= 3; blue >>= 3;
if (r != 255) // if (r != 255)
{ {
BG_PALETTE[r] = red | (green << 5) | (blue << 10); u16 paletteValue = red | (green << 5) | (blue << 10);
if (!DS::getKeyboardEnable()) {
BG_PALETTE_SUB[r] = red | (green << 5) | (blue << 10); if (DS::getIsDisplayMode8Bit()) {
BG_PALETTE[r] = paletteValue;
if (!DS::getKeyboardEnable()) {
BG_PALETTE_SUB[r] = paletteValue;
}
} }
_palette[r] = paletteValue;
} }
// if (num == 16) consolePrintf("pal:%d r:%d g:%d b:%d\n", r, red, green, blue); // if (num == 255) consolePrintf("pal:%d r:%d g:%d b:%d\n", r, red, green, blue);
colors += 4; colors += 4;
} }
} }
void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) {
// consolePrintf("Cursor palette set: start: %d, cols: %d\n", start, num);
for (unsigned int r = start; r < start + num; r++) {
int red = *colors;
int green = *(colors + 1);
int blue = *(colors + 2);
red >>= 3;
green >>= 3;
blue >>= 3;
u16 paletteValue = red | (green << 5) | (blue << 10);
_cursorPalette[r] = paletteValue;
colors += 4;
}
_disableCursorPalette = false;
}
bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) { bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
@ -184,9 +224,11 @@ void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
} }
#define MISALIGNED16(ptr) (((u32) (ptr) & 1) != 0)
void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
// consolePrintf("Copy rect %d, %d %d, %d ", x, y, w, h); //consolePrintf("Copy rect %d, %d %d, %d ", x, y, w, h);
if (!_graphicsEnable) return;
if (w <= 1) return; if (w <= 1) return;
if (h < 0) return; if (h < 0) return;
if (!DS::getIsDisplayMode8Bit()) return; if (!DS::getIsDisplayMode8Bit()) return;
@ -195,6 +237,9 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
s32 stride; s32 stride;
u16* bgSub = (u16 *) BG_GFX_SUB; u16* bgSub = (u16 *) BG_GFX_SUB;
// The DS video RAM doesn't support 8-bit writes because Nintendo wanted
// to save a few pennies/euro cents on the hardware.
if (_frameBufferExists) { if (_frameBufferExists) {
bg = (u16 *) _framebuffer.pixels; bg = (u16 *) _framebuffer.pixels;
stride = _framebuffer.pitch; stride = _framebuffer.pitch;
@ -203,46 +248,117 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int
stride = DS::get8BitBackBufferStride(); stride = DS::get8BitBackBufferStride();
} }
u16* src = (u16 *) buf; if (((pitch & 1) != 0) || ((w & 1) != 0) || (((int) (buf) & 1) != 0)) {
if (DS::getKeyboardEnable()) { // Something is misaligned, so we have to use the slow but sure method
int by = 0;
for (int dy = y; dy < y + h; dy++) { for (int dy = y; dy < y + h; dy++) {
u16* dest = bg + (dy * (stride >> 1)) + (x >> 1); u8* dest = ((u8 *) (bg)) + (dy * stride) + x;
u8* destSub = ((u8 *) (bgSub)) + (dy * 512) + x;
DC_FlushRange(src, w << 1); u8* src = (u8 *) buf + (pitch * by);
DC_FlushRange(dest, w << 1);
dmaCopyHalfWords(3, src, dest, w);
src += pitch >> 1;
}
} else {
for (int dy = y; dy < y + h; dy++) {
u16* dest1 = bg + (dy * (stride >> 1)) + (x >> 1);
u16* dest2 = bgSub + (dy << 8) + (x >> 1);
DC_FlushRange(src, w << 1); u32 dx;
DC_FlushRange(dest1, w << 1);
DC_FlushRange(dest2, w << 1); u32 pixelsLeft = w;
dmaCopyHalfWords(3, src, dest1, w); if (MISALIGNED16(dest)) {
dmaCopyHalfWords(3, src, dest2, w); // Read modify write
src += pitch >> 1; dest--;
u16 mix = *((u16 *) dest);
mix = (mix & 0x00FF) | (*src++ << 8);
*dest = mix;
*destSub = mix;
dest += 2;
destSub += 2;
pixelsLeft--;
}
// We can now assume dest is aligned
u16* dest16 = (u16 *) dest;
u16* destSub16 = (u16 *) destSub;
for (dx = 0; dx < pixelsLeft; dx+=2) {
u16 mix;
mix = *src + (*(src + 1) << 8);
*dest16++ = mix;
*destSub16++ = mix;
src += 2;
}
pixelsLeft -= dx;
// At the end we may have one pixel left over
if (pixelsLeft != 0) {
u16 mix = *dest16;
mix = (mix & 0x00FF) | ((*src++) << 8);
*dest16 = mix;
*destSub16 = mix;
}
by++;
}
// consolePrintf("Slow method used!\n");
} else {
// Stuff is aligned to 16-bit boundaries, so it's safe to do DMA.
u16* src = (u16 *) buf;
if (DS::getKeyboardEnable()) {
for (int dy = y; dy < y + h; dy++) {
u16* dest = bg + (dy * (stride >> 1)) + (x >> 1);
DC_FlushRange(src, w << 1);
DC_FlushRange(dest, w << 1);
dmaCopyHalfWords(3, src, dest, w);
while (dmaBusy(3));
src += pitch >> 1;
}
} else {
for (int dy = y; dy < y + h; dy++) {
u16* dest1 = bg + (dy * (stride >> 1)) + (x >> 1);
u16* dest2 = bgSub + (dy << 8) + (x >> 1);
DC_FlushRange(src, w << 1);
DC_FlushRange(dest1, w << 1);
DC_FlushRange(dest2, w << 1);
dmaCopyHalfWords(3, src, dest1, w);
if ((!_frameBufferExists) || (buf == _framebuffer.pixels)) {
dmaCopyHalfWords(2, src, dest2, w);
}
while (dmaBusy(2) || dmaBusy(3));
src += pitch >> 1;
}
} }
} }
// consolePrintf("Done\n"); // consolePrintf("Done\n");
} }
void OSystem_DS::updateScreen() { void OSystem_DS::updateScreen() {
if ((_frameBufferExists) && (DS::getIsDisplayMode8Bit())) if ((_frameBufferExists) && (DS::getIsDisplayMode8Bit())) {
{
_frameBufferExists = false; _frameBufferExists = false;
// Copy temp framebuffer back to screen // Copy temp framebuffer back to screen
@ -253,6 +369,12 @@ void OSystem_DS::updateScreen() {
DS::doSoundCallback(); DS::doSoundCallback();
// DS::doTimerCallback(); // DS::doTimerCallback();
DS::addEventsToQueue(); DS::addEventsToQueue();
// Force back buffer usage for Nippon Safes, as it doesn't double buffer it's output
if (DS::getControlType() == DS::CONT_NIPPON) {
OSystem_DS::instance()->lockScreen();
OSystem_DS::instance()->unlockScreen();
}
} }
void OSystem_DS::setShakePos(int shakeOffset) { void OSystem_DS::setShakePos(int shakeOffset) {
@ -334,7 +456,21 @@ void OSystem_DS::warpMouse(int x, int y) {
} }
void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetCursorScale) { void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetCursorScale) {
DS::setCursorIcon(buf, w, h, keycolor, hotspotX, hotspotY); if ((w > 0) && (w < 64) && (h > 0) && (h < 64))
{
memcpy(_cursorImage, buf, w * h);
_cursorW = w;
_cursorH = h;
_cursorHotX = hotspotX;
_cursorHotY = hotspotY;
_cursorKey = keycolor;
_cursorScale = targetCursorScale;
refreshCursor();
}
}
void OSystem_DS::refreshCursor() {
DS::setCursorIcon(_cursorImage, _cursorW, _cursorH, _cursorKey, _cursorHotX, _cursorHotY);
} }
void OSystem_DS::addEvent(Common::Event& e) { void OSystem_DS::addEvent(Common::Event& e) {
@ -489,7 +625,11 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager() {
if (DS::isGBAMPAvailable() && (!forceSram)) { if (DS::isGBAMPAvailable() && (!forceSram)) {
return &mpSaveManager; return &mpSaveManager;
} else { } else {
#ifdef GBA_SRAM_SAVE
return &saveManager; return &saveManager;
#else
return NULL;
#endif
} }
} }

View file

@ -52,17 +52,32 @@ protected:
Common::Event eventQueue[96]; Common::Event eventQueue[96];
int queuePos; int queuePos;
#ifdef GBA_SRAM_SAVE
DSSaveFileManager saveManager; DSSaveFileManager saveManager;
#endif
GBAMPSaveFileManager mpSaveManager; GBAMPSaveFileManager mpSaveManager;
DSAudioMixer* _mixer; DSAudioMixer* _mixer;
DSTimerManager* _timer; DSTimerManager* _timer;
Graphics::Surface _framebuffer; Graphics::Surface _framebuffer;
bool _frameBufferExists; bool _frameBufferExists;
bool _graphicsEnable;
static OSystem_DS* _instance; static OSystem_DS* _instance;
u16 _palette[256];
u16 _cursorPalette[256];
u8 _cursorImage[64 * 64];
uint _cursorW;
uint _cursorH;
int _cursorHotX;
int _cursorHotY;
byte _cursorKey;
int _cursorScale;
Graphics::Surface* createTempFrameBuffer(); Graphics::Surface* createTempFrameBuffer();
bool _disableCursorPalette;
public: public:
typedef void (*SoundProc)(byte *buf, int len); typedef void (*SoundProc)(byte *buf, int len);
@ -159,7 +174,16 @@ public:
virtual void clearAutoComplete(); virtual void clearAutoComplete();
virtual void setCharactersEntered(int count); virtual void setCharactersEntered(int count);
u16 getDSPaletteEntry(u32 entry) { return _palette[entry]; }
u16 getDSCursorPaletteEntry(u32 entry) { return !_disableCursorPalette? _cursorPalette[entry]: _palette[entry]; }
virtual void setCursorPalette(const byte *colors, uint start, uint num);
virtual void disableCursorPalette(bool dis) { _disableCursorPalette = dis; refreshCursor(); }
FilesystemFactory *getFilesystemFactory(); FilesystemFactory *getFilesystemFactory();
void refreshCursor();
}; };
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {

View file

@ -81,7 +81,10 @@ void consolePrintf(const char* s, ...);
#define ITCM_DATA __attribute__((section(".itcm"))) #define ITCM_DATA __attribute__((section(".itcm")))
// Since I can't change the engine at the moment (post lockdown) this define can go here.
// This define changes the mouse-relative motion which doesn't make sense on a touch screen to
// a more conventional form of input where the menus can be clicked on.
#define LURE_CLICKABLE_MENUS
//#include "common/array.h" //#include "common/array.h"
//#include "common/str.h" //#include "common/str.h"

View file

@ -19,7 +19,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
*/ */
// Save in order 1,2,3,4,larger 2,5 #ifdef GBA_SRAM_SAVE
#include "ramsave.h" #include "ramsave.h"
#include "nds.h" #include "nds.h"
#include "compressor/lz.h" #include "compressor/lz.h"
@ -64,6 +66,7 @@ DSSaveFile::DSSaveFile(SCUMMSave* s, bool compressed, u8* data) {
} }
isTempFile = false; isTempFile = false;
eosReached = false;
} }
DSSaveFile::~DSSaveFile() { DSSaveFile::~DSSaveFile() {
@ -167,11 +170,13 @@ int DSSaveFile::saveToSaveRAM(vu8* address) {
void DSSaveFile::reset() { void DSSaveFile::reset() {
ptr = 0; ptr = 0;
eosReached = false;
} }
uint32 DSSaveFile::read(void *buf, uint32 size) { uint32 DSSaveFile::read(void *buf, uint32 size) {
if (ptr + size > save.size) { if (ptr + size > save.size) {
size = save.size - ptr; size = save.size - ptr;
eosReached = true;
if (size < 0) size = 0; if (size < 0) size = 0;
} }
memcpy(buf, saveData + ptr, size); memcpy(buf, saveData + ptr, size);
@ -181,15 +186,15 @@ uint32 DSSaveFile::read(void *buf, uint32 size) {
return size; return size;
} }
uint32 DSSaveFile::pos() const { int32 DSSaveFile::pos() const {
return ptr; return ptr;
} }
uint32 DSSaveFile::size() const { int32 DSSaveFile::size() const {
return save.size; return save.size;
} }
void DSSaveFile::seek(int32 pos, int whence) { bool DSSaveFile::seek(int32 pos, int whence) {
switch (whence) { switch (whence) {
case SEEK_SET: { case SEEK_SET: {
ptr = pos; ptr = pos;
@ -204,15 +209,22 @@ void DSSaveFile::seek(int32 pos, int whence) {
break; break;
} }
} }
eosReached = false;
return true;
} }
bool DSSaveFile::eos() const { bool DSSaveFile::eos() const {
return ptr >= (int) save.size; return eosReached;
} }
void DSSaveFile::skip(uint32 bytes) { void DSSaveFile::clearErr() {
eosReached = false;
}
bool DSSaveFile::skip(uint32 bytes) {
ptr = ptr + bytes; ptr = ptr + bytes;
if (ptr > (int) save.size) ptr = save.size; if (ptr > (int) save.size) ptr = save.size;
return true;
} }
uint32 DSSaveFile::write(const void *buf, uint32 size) { uint32 DSSaveFile::write(const void *buf, uint32 size) {
@ -227,7 +239,7 @@ uint32 DSSaveFile::write(const void *buf, uint32 size) {
return size; return size;
} }
bool DSSaveFile::matches(char* prefix, int num) { bool DSSaveFile::matches(const char *prefix, int num) {
char str[16]; char str[16];
if (isValid()) { if (isValid()) {
sprintf(str, "%s%02d", prefix, num); sprintf(str, "%s%02d", prefix, num);
@ -241,7 +253,7 @@ bool DSSaveFile::matches(char* prefix, int num) {
} }
} }
bool DSSaveFile::matches(char* filename) { bool DSSaveFile::matches(const char *filename) {
if (isValid()) { if (isValid()) {
return !strcmp(save.name, filename); return !strcmp(save.name, filename);
} else { } else {
@ -522,3 +534,5 @@ int DSSaveFileManager::getExtraData() {
return 0; return 0;
} }
} }
#endif

View file

@ -52,6 +52,7 @@ class DSSaveFile : public Common::InSaveFile, public Common::OutSaveFile {
SCUMMSave* origHeader; SCUMMSave* origHeader;
bool isOpenFlag; bool isOpenFlag;
bool isTempFile; bool isTempFile;
bool eosReached;
public: public:
DSSaveFile(); DSSaveFile();
@ -62,11 +63,12 @@ public:
bool isOpen() const { return isOpenFlag; } bool isOpen() const { return isOpenFlag; }
virtual bool eos() const; virtual bool eos() const;
virtual void skip(uint32 size); virtual void clearErr();
virtual bool skip(uint32 size);
virtual uint32 pos() const; virtual int32 pos() const;
virtual uint32 size() const; virtual int32 size() const;
virtual void seek(int32 pos, int whence); virtual bool seek(int32 pos, int whence);
uint32 read(void *buf, uint32 size); uint32 read(void *buf, uint32 size);
uint32 write(const void *buf, uint32 size); uint32 write(const void *buf, uint32 size);
@ -76,8 +78,8 @@ public:
bool isValid() { return save.isValid; } bool isValid() { return save.isValid; }
bool isTemp() { return isTempFile; } bool isTemp() { return isTempFile; }
bool matches(char* prefix, int num); bool matches(const char *prefix, int num);
bool matches(char* filename); bool matches(const char *filename);
void clearData(); void clearData();
void compress(); void compress();

View file

@ -402,6 +402,23 @@ void createKeyEvent(int keyNum, Common::Event& event)
} }
} }
void releaseAllKeys() {
for (int r = 0; r < DS_NUM_KEYS; r++) {
if (keys[r].pressed) {
DS::setKeyHighlight(r, false);
OSystem_DS* system = OSystem_DS::instance();
Common::Event event;
createKeyEvent(r, event);
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
keys[r].pressed = false;
}
}
}
void addKeyboardEvents() { void addKeyboardEvents() {
bool resetShift = false; bool resetShift = false;
@ -446,7 +463,7 @@ void addKeyboardEvents() {
// consolePrintf("Key: %d\n", r); // consolePrintf("Key: %d\n", r);
if ((keys[r].character == Common::KEYCODE_INVALID)) { if ((keys[r].character == Common::KEYCODE_INVALID)) {
// Close button // Close button
DS::closed = true; //DS::closed = true;
} else { } else {
createKeyEvent(r, event); createKeyEvent(r, event);
} }
@ -492,9 +509,14 @@ void addKeyboardEvents() {
OSystem_DS* system = OSystem_DS::instance(); OSystem_DS* system = OSystem_DS::instance();
Common::Event event; Common::Event event;
createKeyEvent(r, event); if ((keys[r].character == Common::KEYCODE_INVALID)) {
event.type = Common::EVENT_KEYUP; // Close button
system->addEvent(event); DS::closed = true;
} else {
createKeyEvent(r, event);
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
}
keys[r].pressed = false; keys[r].pressed = false;

View file

@ -40,6 +40,7 @@ bool getKeyboardClosed();
void addAutoComplete(char* word); void addAutoComplete(char* word);
void clearAutoComplete(); void clearAutoComplete();
void setCharactersEntered(int count); void setCharactersEntered(int count);
void releaseAllKeys();
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

View file

@ -36,3 +36,23 @@ allbuilds:
make all SCUMM_BUILD=f make all SCUMM_BUILD=f
make semiclean make semiclean
make all SCUMM_BUILD=g make all SCUMM_BUILD=g
make semiclean
make all SCUMM_BUILD=h
allbuildssafe:
make clean SCUMM_BUILD=a
make all SCUMM_BUILD=a
make clean SCUMM_BUILD=b
make all SCUMM_BUILD=b
make clean SCUMM_BUILD=c
make all SCUMM_BUILD=c
make clean SCUMM_BUILD=d
make all SCUMM_BUILD=d
make clean SCUMM_BUILD=e
make all SCUMM_BUILD=e
make clean SCUMM_BUILD=f
make all SCUMM_BUILD=f
make clean SCUMM_BUILD=g
make all SCUMM_BUILD=g
make clean SCUMM_BUILD=h
make all SCUMM_BUILD=h

View file

@ -54,8 +54,7 @@
@implementation SoftKeyboard @implementation SoftKeyboard
- (id)initWithFrame:(CGRect)frame { - (id)initWithFrame:(CGRect)frame {
//self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
inputDelegate = nil; inputDelegate = nil;
inputView = [[TextInputHandler alloc] initWithKeyboard:self]; inputView = [[TextInputHandler alloc] initWithKeyboard:self];
return self; return self;

View file

@ -79,10 +79,7 @@ int main(int argc, char** argv) {
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// hide the status bar // hide the status bar
[UIHardware _setStatusBarHeight:0.0f]; [UIHardware _setStatusBarHeight:0.0f];
//[self setStatusBarMode:2 orientation:0 duration:0.0f fenceID:0]; [self setStatusBarHidden:YES animated:NO];
//[self setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
[self setStatusBarHidden:YES animated:YES];
_window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]]; _window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];
[_window retain]; [_window retain];
@ -103,9 +100,13 @@ int main(int argc, char** argv) {
- (void)applicationResume:(GSEventRef)event { - (void)applicationResume:(GSEventRef)event {
[self removeApplicationBadge]; [self removeApplicationBadge];
[UIHardware _setStatusBarHeight:0.0f];
[self setStatusBarHidden:YES animated:YES];
[_view applicationResume]; [_view applicationResume];
// Workaround, need to "hide" and unhide the statusbar to properly remove it,
// since the Springboard has put it back without apparently flagging our application.
[self setStatusBarHidden:NO animated:NO]; // hide status bar
[UIHardware _setStatusBarHeight:0.0f];
[self setStatusBarHidden:YES animated:NO]; // hide status bar
} }
- (void)deviceOrientationChanged:(GSEvent *)event { - (void)deviceOrientationChanged:(GSEvent *)event {

View file

@ -169,10 +169,6 @@ bool getLocalMouseCoords(CGPoint *point) {
nil nil
]; ];
if (_screenSurface != nil) {
//[[sharedInstance _layer] removeSublayer: screenLayer];
}
//("Allocating surface: %d\n", allocSize); //("Allocating surface: %d\n", allocSize);
_screenSurface = CoreSurfaceBufferCreate((CFDictionaryRef)dict); _screenSurface = CoreSurfaceBufferCreate((CFDictionaryRef)dict);
//printf("Surface created.\n"); //printf("Surface created.\n");
@ -205,10 +201,13 @@ bool getLocalMouseCoords(CGPoint *point) {
[screenLayer setFrame: _screenRect]; [screenLayer setFrame: _screenRect];
} else { } else {
float ratio = (float)_height / (float)_width; float ratio = (float)_height / (float)_width;
_screenRect = CGRectMake(0, 0, _fullWidth, _fullWidth * ratio); int height = _fullWidth * ratio;
//printf("Making rect (%u, %u)\n", _fullWidth, height);
_screenRect = CGRectMake(0, 0, _fullWidth - 1, height - 1);
[screenLayer setFrame: _screenRect]; [screenLayer setFrame: _screenRect];
CGRect keyFrame = CGRectMake(0.0f, _screenRect.size.height, _fullWidth, _fullHeight - _screenRect.size.height); //CGRect keyFrame = CGRectMake(0.0f, _screenRect.size.height, _fullWidth, _fullHeight - _screenRect.size.height);
CGRect keyFrame = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f);
if (_keyboardView == nil) { if (_keyboardView == nil) {
_keyboardView = [[SoftKeyboard alloc] initWithFrame:keyFrame]; _keyboardView = [[SoftKeyboard alloc] initWithFrame:keyFrame];
[_keyboardView setInputDelegate:self]; [_keyboardView setInputDelegate:self];
@ -250,9 +249,6 @@ bool getLocalMouseCoords(CGPoint *point) {
[self lock]; [self lock];
id event = [_events objectAtIndex: 0]; id event = [_events objectAtIndex: 0];
if (event == nil) {
return nil;
}
[_events removeObjectAtIndex: 0]; [_events removeObjectAtIndex: 0];
[self unlock]; [self unlock];

View file

@ -56,24 +56,27 @@ const OSystem::GraphicsMode OSystem_IPHONE::s_supportedGraphicsModes[] = {
AQCallbackStruct OSystem_IPHONE::s_AudioQueue; AQCallbackStruct OSystem_IPHONE::s_AudioQueue;
SoundProc OSystem_IPHONE::s_soundCallback = NULL; SoundProc OSystem_IPHONE::s_soundCallback = NULL;
void *OSystem_IPHONE::s_soundParam = NULL; void *OSystem_IPHONE::s_soundParam = NULL;
bool OSystem_IPHONE::s_is113OrHigher = false;
OSystem_IPHONE::OSystem_IPHONE() : OSystem_IPHONE::OSystem_IPHONE() :
_savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL), _savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL),
_overlayVisible(false), _overlayBuffer(NULL), _fullscreen(NULL), _overlayVisible(false), _overlayBuffer(NULL), _fullscreen(NULL),
_mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0),
_secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape), _secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape),
_needEventRestPeriod(false), _mouseClickAndDragEnabled(false), _needEventRestPeriod(false), _mouseClickAndDragEnabled(false), _touchpadModeEnabled(false),
_gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false),
_mouseDirty(false), _timeSuspended(0) _mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1)
{ {
_queuedInputEvent.type = (Common::EventType)0; _queuedInputEvent.type = (Common::EventType)0;
_lastDrawnMouseRect = Common::Rect(0, 0, 0, 0); _lastDrawnMouseRect = Common::Rect(0, 0, 0, 0);
_fsFactory = new POSIXFilesystemFactory();
} }
OSystem_IPHONE::~OSystem_IPHONE() { OSystem_IPHONE::~OSystem_IPHONE() {
AudioQueueDispose(s_AudioQueue.queue, true); AudioQueueDispose(s_AudioQueue.queue, true);
delete _fsFactory;
delete _savefile; delete _savefile;
delete _mixer; delete _mixer;
delete _timer; delete _timer;
@ -665,8 +668,8 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
float xUnit, yUnit; float xUnit, yUnit;
if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit)) { if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit)) {
int x; int x = 0;
int y; int y = 0;
switch (_screenOrientation) { switch (_screenOrientation) {
case kScreenOrientationPortrait: case kScreenOrientationPortrait:
x = (int)(xUnit * _screenWidth); x = (int)(xUnit * _screenWidth);
@ -684,326 +687,50 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
switch ((InputEvent)eventType) { switch ((InputEvent)eventType) {
case kInputMouseDown: case kInputMouseDown:
//printf("Mouse down at (%u, %u)\n", x, y); if (!handleEvent_mouseDown(event, x, y))
return false;
// Workaround: kInputMouseSecondToggled isn't always sent when the
// secondary finger is lifted. Need to make sure we get out of that mode.
_secondaryTapped = false;
warpMouse(x, y);
// event.type = Common::EVENT_MOUSEMOVE;
// event.mouse.x = _mouseX;
// event.mouse.y = _mouseY;
if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_LBUTTONDOWN;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
return true;
} else {
_lastMouseDown = curTime;
}
return false;
break; break;
case kInputMouseUp: case kInputMouseUp:
//printf("Mouse up at (%u, %u)\n", x, y); if (!handleEvent_mouseUp(event, x, y))
if (_mouseClickAndDragEnabled) { return false;
event.type = Common::EVENT_LBUTTONUP;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
} else {
if (curTime - _lastMouseDown < 250) {
event.type = Common::EVENT_LBUTTONDOWN;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
_queuedInputEvent.type = Common::EVENT_LBUTTONUP;
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
_lastMouseTap = curTime;
_needEventRestPeriod = true;
} else
return false;
}
break; break;
case kInputMouseDragged: case kInputMouseDragged:
//printf("Mouse dragged at (%u, %u)\n", x, y); if (!handleEvent_mouseDragged(event, x, y))
if (_secondaryTapped) { return false;
if (_gestureStartX == -1 || _gestureStartY == -1) {
return false;
}
int vecX = (x - _gestureStartX);
int vecY = (y - _gestureStartY);
int lengthSq = vecX * vecX + vecY * vecY;
//printf("Lengthsq: %u\n", lengthSq);
if (lengthSq > 15000) { // Long enough gesture to react upon.
_gestureStartX = -1;
_gestureStartY = -1;
float vecLength = sqrt(lengthSq);
float vecXNorm = vecX / vecLength;
float vecYNorm = vecY / vecLength;
//printf("Swipe vector: (%.2f, %.2f)\n", vecXNorm, vecYNorm);
if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm > 0.75) {
// Swipe down
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5;
_needEventRestPeriod = true;
} else if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm < -0.75) {
// Swipe up
_mouseClickAndDragEnabled = !_mouseClickAndDragEnabled;
const char *dialogMsg;
if (_mouseClickAndDragEnabled)
dialogMsg = "Mouse-click-and-drag mode enabled.";
else
dialogMsg = "Mouse-click-and-drag mode disabled.";
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
return false;
} else if (vecXNorm > 0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe right
// _secondaryTapped = !_secondaryTapped;
// _gestureStartX = x;
// _gestureStartY = y;
//
// GUI::TimedMessageDialog dialog("Forcing toggle of pressed state.", 1500);
// dialog.runModal();
return false;
} else if (vecXNorm < -0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe left
return false;
} else
return false;
} else
return false;
} else {
event.type = Common::EVENT_MOUSEMOVE;
event.mouse.x = x;
event.mouse.y = y;
warpMouse(x, y);
}
break; break;
case kInputMouseSecondToggled: case kInputMouseSecondToggled:
_secondaryTapped = !_secondaryTapped; _secondaryTapped = !_secondaryTapped;
//printf("Mouse second at (%u, %u). State now %s.\n", x, y, _secondaryTapped ? "on" : "off"); //printf("Mouse second at (%u, %u). State now %s.\n", x, y, _secondaryTapped ? "on" : "off");
if (_secondaryTapped) { if (_secondaryTapped) {
_lastSecondaryDown = curTime; if (!handleEvent_secondMouseDown(event, x, y))
_gestureStartX = x;
_gestureStartY = y;
if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_LBUTTONUP;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
_queuedInputEvent.type = Common::EVENT_RBUTTONDOWN;
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
}
else
return false; return false;
} else { } else {
if (curTime - _lastSecondaryDown < 250 ) { if (!handleEvent_secondMouseUp(event, x, y))
if (curTime - _lastSecondaryTap < 250 && !_overlayVisible) {
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE;
_needEventRestPeriod = true;
_lastSecondaryTap = 0;
} else if (!_mouseClickAndDragEnabled) {
event.type = Common::EVENT_RBUTTONDOWN;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
_queuedInputEvent.type = Common::EVENT_RBUTTONUP;
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
_lastSecondaryTap = curTime;
_needEventRestPeriod = true;
}
}
if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_RBUTTONUP;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
}
}
break;
case kInputOrientationChanged:
//printf("Orientation: %i", (int)xUnit);
ScreenOrientation newOrientation;
switch ((int)xUnit) {
case 1:
newOrientation = kScreenOrientationPortrait;
break;
case 3:
newOrientation = kScreenOrientationLandscape;
break;
case 4:
newOrientation = kScreenOrientationFlippedLandscape;
break;
default:
return false; return false;
} }
break;
case kInputOrientationChanged:
if (_screenOrientation != newOrientation) { handleEvent_orientationChanged((int)xUnit);
_screenOrientation = newOrientation; return false;
if (_screenOrientation != kScreenOrientationPortrait)
iPhone_initSurface(_screenHeight, _screenWidth, true);
else
iPhone_initSurface(_screenWidth, _screenHeight, false);
dirtyFullScreen();
updateScreen();
}
break; break;
case kInputApplicationSuspended: case kInputApplicationSuspended:
suspendLoop(); suspendLoop();
return false;
break; break;
case kInputKeyPressed: { case kInputKeyPressed:
int keyPressed = (int)xUnit; handleEvent_keyPressed(event, (int)xUnit);
int ascii = keyPressed;
//printf("key: %i\n", keyPressed);
// We remap some of the iPhone keyboard keys.
// The first ten here are the row of symbols below the numeric keys.
switch (keyPressed) {
case 45:
keyPressed = Common::KEYCODE_F1;
ascii = Common::ASCII_F1;
break;
case 47:
keyPressed = Common::KEYCODE_F2;
ascii = Common::ASCII_F2;
break;
case 58:
keyPressed = Common::KEYCODE_F3;
ascii = Common::ASCII_F3;
break;
case 59:
keyPressed = Common::KEYCODE_F4;
ascii = Common::ASCII_F4;
break;
case 40:
keyPressed = Common::KEYCODE_F5;
ascii = Common::ASCII_F5;
break;
case 41:
keyPressed = Common::KEYCODE_F6;
ascii = Common::ASCII_F6;
break;
case 36:
keyPressed = Common::KEYCODE_F7;
ascii = Common::ASCII_F7;
break;
case 38:
keyPressed = Common::KEYCODE_F8;
ascii = Common::ASCII_F8;
break;
case 64:
keyPressed = Common::KEYCODE_F9;
ascii = Common::ASCII_F9;
break;
case 34:
keyPressed = Common::KEYCODE_F10;
ascii = Common::ASCII_F10;
break;
case 10:
keyPressed = Common::KEYCODE_RETURN;
ascii = Common::ASCII_RETURN;
break;
}
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii;
_needEventRestPeriod = true;
break; break;
}
case kInputSwipe: { case kInputSwipe:
Common::KeyCode keycode = Common::KEYCODE_INVALID; if (!handleEvent_swipe(event, (int)xUnit))
switch (_screenOrientation) { return false;
case kScreenOrientationPortrait:
switch ((UIViewSwipeDirection)xUnit) {
case kUIViewSwipeUp:
keycode = Common::KEYCODE_UP;
break;
case kUIViewSwipeDown:
keycode = Common::KEYCODE_DOWN;
break;
case kUIViewSwipeLeft:
keycode = Common::KEYCODE_LEFT;
break;
case kUIViewSwipeRight:
keycode = Common::KEYCODE_RIGHT;
break;
default:
return false;
}
break;
case kScreenOrientationLandscape:
switch ((UIViewSwipeDirection)xUnit) {
case kUIViewSwipeUp:
keycode = Common::KEYCODE_LEFT;
break;
case kUIViewSwipeDown:
keycode = Common::KEYCODE_RIGHT;
break;
case kUIViewSwipeLeft:
keycode = Common::KEYCODE_DOWN;
break;
case kUIViewSwipeRight:
keycode = Common::KEYCODE_UP;
break;
default:
return false;
}
break;
case kScreenOrientationFlippedLandscape:
switch ((UIViewSwipeDirection)xUnit) {
case kUIViewSwipeUp:
keycode = Common::KEYCODE_RIGHT;
break;
case kUIViewSwipeDown:
keycode = Common::KEYCODE_LEFT;
break;
case kUIViewSwipeLeft:
keycode = Common::KEYCODE_UP;
break;
case kUIViewSwipeRight:
keycode = Common::KEYCODE_DOWN;
break;
default:
return false;
}
break;
}
event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = 0;
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
_needEventRestPeriod = true;
break; break;
}
default: default:
break; break;
@ -1014,22 +741,401 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
return false; return false;
} }
bool OSystem_IPHONE::handleEvent_mouseDown(Common::Event &event, int x, int y) {
printf("Mouse down at (%u, %u)\n", x, y);
// Workaround: kInputMouseSecondToggled isn't always sent when the
// secondary finger is lifted. Need to make sure we get out of that mode.
_secondaryTapped = false;
if (_touchpadModeEnabled) {
_lastPadX = x;
_lastPadY = y;
} else
warpMouse(x, y);
if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_LBUTTONDOWN;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
return true;
} else {
_lastMouseDown = getMillis();
}
return false;
}
bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) {
//printf("Mouse up at (%u, %u)\n", x, y);
if (_secondaryTapped) {
_secondaryTapped = false;
if (!handleEvent_secondMouseUp(event, x, y))
return false;
}
else if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_LBUTTONUP;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
} else {
if (getMillis() - _lastMouseDown < 250) {
event.type = Common::EVENT_LBUTTONDOWN;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
_queuedInputEvent.type = Common::EVENT_LBUTTONUP;
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
_lastMouseTap = getMillis();
_needEventRestPeriod = true;
} else
return false;
}
return true;
}
bool OSystem_IPHONE::handleEvent_secondMouseDown(Common::Event &event, int x, int y) {
_lastSecondaryDown = getMillis();
_gestureStartX = x;
_gestureStartY = y;
if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_LBUTTONUP;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
_queuedInputEvent.type = Common::EVENT_RBUTTONDOWN;
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
}
else
return false;
return true;
}
bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int y) {
int curTime = getMillis();
if (curTime - _lastSecondaryDown < 400 ) {
//printf("Right tap!\n");
if (curTime - _lastSecondaryTap < 400 && !_overlayVisible) {
//printf("Right escape!\n");
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE;
_needEventRestPeriod = true;
_lastSecondaryTap = 0;
} else if (!_mouseClickAndDragEnabled) {
//printf("Rightclick!\n");
event.type = Common::EVENT_RBUTTONDOWN;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
_queuedInputEvent.type = Common::EVENT_RBUTTONUP;
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
_lastSecondaryTap = curTime;
_needEventRestPeriod = true;
} else {
//printf("Right nothing!\n");
return false;
}
}
if (_mouseClickAndDragEnabled) {
event.type = Common::EVENT_RBUTTONUP;
event.mouse.x = _mouseX;
event.mouse.y = _mouseY;
}
return true;
}
bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y) {
if (_lastDragPosX == x && _lastDragPosY == y)
return false;
_lastDragPosX = x;
_lastDragPosY = y;
//printf("Mouse dragged at (%u, %u)\n", x, y);
if (_secondaryTapped) {
if (_gestureStartX == -1 || _gestureStartY == -1) {
return false;
}
int vecX = (x - _gestureStartX);
int vecY = (y - _gestureStartY);
int lengthSq = vecX * vecX + vecY * vecY;
//printf("Lengthsq: %u\n", lengthSq);
if (lengthSq > 15000) { // Long enough gesture to react upon.
_gestureStartX = -1;
_gestureStartY = -1;
float vecLength = sqrt(lengthSq);
float vecXNorm = vecX / vecLength;
float vecYNorm = vecY / vecLength;
//printf("Swipe vector: (%.2f, %.2f)\n", vecXNorm, vecYNorm);
if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm > 0.75) {
// Swipe down
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5;
_needEventRestPeriod = true;
} else if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm < -0.75) {
// Swipe up
_mouseClickAndDragEnabled = !_mouseClickAndDragEnabled;
const char *dialogMsg;
if (_mouseClickAndDragEnabled)
dialogMsg = "Mouse-click-and-drag mode enabled.";
else
dialogMsg = "Mouse-click-and-drag mode disabled.";
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
return false;
} else if (vecXNorm > 0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe right
_touchpadModeEnabled = !_touchpadModeEnabled;
const char *dialogMsg;
if (_touchpadModeEnabled)
dialogMsg = "Touchpad mode enabled.";
else
dialogMsg = "Touchpad mode disabled.";
GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal();
return false;
} else if (vecXNorm < -0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe left
return false;
} else
return false;
} else
return false;
} else {
int mouseNewPosX;
int mouseNewPosY;
if (_touchpadModeEnabled ) {
int deltaX = _lastPadX - x;
int deltaY = _lastPadY - y;
_lastPadX = x;
_lastPadY = y;
mouseNewPosX = (int)(_mouseX - deltaX / 0.5f);
mouseNewPosY = (int)(_mouseY - deltaY / 0.5f);
if (mouseNewPosX < 0)
mouseNewPosX = 0;
else if (mouseNewPosX > _screenWidth)
mouseNewPosX = _screenWidth;
if (mouseNewPosY < 0)
mouseNewPosY = 0;
else if (mouseNewPosY > _screenHeight)
mouseNewPosY = _screenHeight;
} else {
mouseNewPosX = x;
mouseNewPosY = y;
}
event.type = Common::EVENT_MOUSEMOVE;
event.mouse.x = mouseNewPosX;
event.mouse.y = mouseNewPosY;
warpMouse(mouseNewPosX, mouseNewPosY);
}
return true;
}
void OSystem_IPHONE::handleEvent_orientationChanged(int orientation) {
//printf("Orientation: %i\n", orientation);
ScreenOrientation newOrientation;
switch (orientation) {
case 1:
newOrientation = kScreenOrientationPortrait;
break;
case 3:
newOrientation = kScreenOrientationLandscape;
break;
case 4:
newOrientation = kScreenOrientationFlippedLandscape;
break;
default:
return;
}
if (_screenOrientation != newOrientation) {
_screenOrientation = newOrientation;
if (_screenOrientation != kScreenOrientationPortrait)
iPhone_initSurface(_screenHeight, _screenWidth, true);
else
iPhone_initSurface(_screenWidth, _screenHeight, false);
dirtyFullScreen();
updateScreen();
}
}
void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPressed) {
int ascii = keyPressed;
//printf("key: %i\n", keyPressed);
// We remap some of the iPhone keyboard keys.
// The first ten here are the row of symbols below the numeric keys.
switch (keyPressed) {
case 45:
keyPressed = Common::KEYCODE_F1;
ascii = Common::ASCII_F1;
break;
case 47:
keyPressed = Common::KEYCODE_F2;
ascii = Common::ASCII_F2;
break;
case 58:
keyPressed = Common::KEYCODE_F3;
ascii = Common::ASCII_F3;
break;
case 59:
keyPressed = Common::KEYCODE_F4;
ascii = Common::ASCII_F4;
break;
case 40:
keyPressed = Common::KEYCODE_F5;
ascii = Common::ASCII_F5;
break;
case 41:
keyPressed = Common::KEYCODE_F6;
ascii = Common::ASCII_F6;
break;
case 36:
keyPressed = Common::KEYCODE_F7;
ascii = Common::ASCII_F7;
break;
case 38:
keyPressed = Common::KEYCODE_F8;
ascii = Common::ASCII_F8;
break;
case 64:
keyPressed = Common::KEYCODE_F9;
ascii = Common::ASCII_F9;
break;
case 34:
keyPressed = Common::KEYCODE_F10;
ascii = Common::ASCII_F10;
break;
case 10:
keyPressed = Common::KEYCODE_RETURN;
ascii = Common::ASCII_RETURN;
break;
}
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii;
_needEventRestPeriod = true;
}
bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) {
Common::KeyCode keycode = Common::KEYCODE_INVALID;
switch (_screenOrientation) {
case kScreenOrientationPortrait:
switch ((UIViewSwipeDirection)direction) {
case kUIViewSwipeUp:
keycode = Common::KEYCODE_UP;
break;
case kUIViewSwipeDown:
keycode = Common::KEYCODE_DOWN;
break;
case kUIViewSwipeLeft:
keycode = Common::KEYCODE_LEFT;
break;
case kUIViewSwipeRight:
keycode = Common::KEYCODE_RIGHT;
break;
default:
return false;
}
break;
case kScreenOrientationLandscape:
switch ((UIViewSwipeDirection)direction) {
case kUIViewSwipeUp:
keycode = Common::KEYCODE_LEFT;
break;
case kUIViewSwipeDown:
keycode = Common::KEYCODE_RIGHT;
break;
case kUIViewSwipeLeft:
keycode = Common::KEYCODE_DOWN;
break;
case kUIViewSwipeRight:
keycode = Common::KEYCODE_UP;
break;
default:
return false;
}
break;
case kScreenOrientationFlippedLandscape:
switch ((UIViewSwipeDirection)direction) {
case kUIViewSwipeUp:
keycode = Common::KEYCODE_RIGHT;
break;
case kUIViewSwipeDown:
keycode = Common::KEYCODE_LEFT;
break;
case kUIViewSwipeLeft:
keycode = Common::KEYCODE_UP;
break;
case kUIViewSwipeRight:
keycode = Common::KEYCODE_DOWN;
break;
default:
return false;
}
break;
}
event.kbd.keycode = _queuedInputEvent.kbd.keycode = keycode;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = 0;
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
_needEventRestPeriod = true;
return true;
}
void OSystem_IPHONE::suspendLoop() { void OSystem_IPHONE::suspendLoop() {
bool done = false; bool done = false;
int eventType; int eventType;
float xUnit, yUnit; float xUnit, yUnit;
uint32 startTime = getMillis(); uint32 startTime = getMillis();
AudioQueueStop(s_AudioQueue.queue, true); stopSoundsystem();
while (!done) { while (!done) {
if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit)) if (iPhone_fetchEvent(&eventType, &xUnit, &yUnit))
if ((InputEvent)eventType == kInputApplicationResumed) if ((InputEvent)eventType == kInputApplicationResumed)
done = true; done = true;
usleep(100000); usleep(100000);
} }
startSoundsystem();
AudioQueueStart(s_AudioQueue.queue, NULL);
_timeSuspended += getMillis() - startTime; _timeSuspended += getMillis() - startTime;
} }
@ -1107,7 +1213,10 @@ void OSystem_IPHONE::setupMixer() {
s_soundCallback = mixCallback; s_soundCallback = mixCallback;
s_soundParam = this; s_soundParam = this;
startSoundsystem();
}
void OSystem_IPHONE::startSoundsystem() {
s_AudioQueue.dataFormat.mSampleRate = AUDIO_SAMPLE_RATE; s_AudioQueue.dataFormat.mSampleRate = AUDIO_SAMPLE_RATE;
s_AudioQueue.dataFormat.mFormatID = kAudioFormatLinearPCM; s_AudioQueue.dataFormat.mFormatID = kAudioFormatLinearPCM;
s_AudioQueue.dataFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; s_AudioQueue.dataFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
@ -1147,6 +1256,17 @@ void OSystem_IPHONE::setupMixer() {
_mixer->setReady(true); _mixer->setReady(true);
} }
void OSystem_IPHONE::stopSoundsystem() {
AudioQueueStop(s_AudioQueue.queue, true);
for (int i = 0; i < AUDIO_BUFFERS; i++) {
AudioQueueFreeBuffer(s_AudioQueue.queue, s_AudioQueue.buffers[i]);
}
AudioQueueDispose(s_AudioQueue.queue, true);
_mixer->setReady(false);
}
int OSystem_IPHONE::getOutputSampleRate() const { int OSystem_IPHONE::getOutputSampleRate() const {
return AUDIO_SAMPLE_RATE; return AUDIO_SAMPLE_RATE;
} }
@ -1196,29 +1316,6 @@ const char* OSystem_IPHONE::getConfigPath() {
return SCUMMVM_PREFS_PATH; return SCUMMVM_PREFS_PATH;
} }
void OSystem_IPHONE::migrateApp() {
// Migrate to the new 1.1.3 directory structure, if needed.
FilesystemNode file("/var/mobile");
if (file.exists() && file.isDirectory()) {
// We have 1.1.3 or above.
s_is113OrHigher = true;
file = FilesystemNode(SCUMMVM_ROOT_PATH);
if (!file.exists()) {
system("mkdir " SCUMMVM_ROOT_PATH);
system("mkdir " SCUMMVM_SAVE_PATH);
// Copy over the prefs file
system("cp " SCUMMVM_OLD_PREFS_PATH " " SCUMMVM_PREFS_PATH);
file = FilesystemNode(SCUMMVM_OLD_SAVE_PATH);
// Copy over old savegames to the new directory.
if (file.exists() && file.isDirectory())
system("cp " SCUMMVM_OLD_SAVE_PATH "/* " SCUMMVM_SAVE_PATH "/");
}
}
}
void iphone_main(int argc, char *argv[]) { void iphone_main(int argc, char *argv[]) {
//OSystem_IPHONE::migrateApp(); //OSystem_IPHONE::migrateApp();
@ -1239,6 +1336,8 @@ void iphone_main(int argc, char *argv[]) {
system("mkdir " SCUMMVM_ROOT_PATH); system("mkdir " SCUMMVM_ROOT_PATH);
system("mkdir " SCUMMVM_SAVE_PATH); system("mkdir " SCUMMVM_SAVE_PATH);
chdir("/var/mobile/");
g_system = OSystem_IPHONE_create(); g_system = OSystem_IPHONE_create();
assert(g_system); assert(g_system);

View file

@ -35,14 +35,12 @@
#include <AudioToolbox/AudioQueue.h> #include <AudioToolbox/AudioQueue.h>
#define AUDIO_BUFFERS 3 #define AUDIO_BUFFERS 3
#define WAVE_BUFFER_SIZE 8192 #define WAVE_BUFFER_SIZE 2048
#define AUDIO_SAMPLE_RATE 44100 #define AUDIO_SAMPLE_RATE 44100
#define SCUMMVM_ROOT_PATH "/var/mobile/Library/ScummVM" #define SCUMMVM_ROOT_PATH "/var/mobile/Library/ScummVM"
#define SCUMMVM_SAVE_PATH SCUMMVM_ROOT_PATH "/Savegames" #define SCUMMVM_SAVE_PATH SCUMMVM_ROOT_PATH "/Savegames"
#define SCUMMVM_OLD_SAVE_PATH "/var/root/.scummvm"
#define SCUMMVM_PREFS_PATH SCUMMVM_ROOT_PATH "/Preferences" #define SCUMMVM_PREFS_PATH SCUMMVM_ROOT_PATH "/Preferences"
#define SCUMMVM_OLD_PREFS_PATH "/var/root/.scummvmrc"
typedef void (*SoundProc)(void *param, byte *buf, int len); typedef void (*SoundProc)(void *param, byte *buf, int len);
typedef int (*TimerProc)(int interval); typedef int (*TimerProc)(int interval);
@ -61,7 +59,6 @@ protected:
static AQCallbackStruct s_AudioQueue; static AQCallbackStruct s_AudioQueue;
static SoundProc s_soundCallback; static SoundProc s_soundCallback;
static void *s_soundParam; static void *s_soundParam;
static bool s_is113OrHigher;
Common::SaveFileManager *_savefile; Common::SaveFileManager *_savefile;
Audio::MixerImpl *_mixer; Audio::MixerImpl *_mixer;
@ -97,6 +94,11 @@ protected:
long _lastSecondaryTap; long _lastSecondaryTap;
int _gestureStartX, _gestureStartY; int _gestureStartX, _gestureStartY;
bool _mouseClickAndDragEnabled; bool _mouseClickAndDragEnabled;
bool _touchpadModeEnabled;
int _lastPadX;
int _lastPadY;
int _lastDragPosX;
int _lastDragPosY;
int _timerCallbackNext; int _timerCallbackNext;
int _timerCallbackTimer; int _timerCallbackTimer;
@ -106,6 +108,8 @@ protected:
ScreenOrientation _screenOrientation; ScreenOrientation _screenOrientation;
bool _fullScreenIsDirty; bool _fullScreenIsDirty;
FilesystemFactory *_fsFactory;
public: public:
OSystem_IPHONE(); OSystem_IPHONE();
@ -161,7 +165,7 @@ public:
virtual void quit(); virtual void quit();
FilesystemFactory *getFilesystemFactory() { return &POSIXFilesystemFactory::instance(); } FilesystemFactory *getFilesystemFactory() { return _fsFactory; }
virtual void getTimeAndDate(struct tm &t) const; virtual void getTimeAndDate(struct tm &t) const;
virtual void setWindowCaption(const char *caption); virtual void setWindowCaption(const char *caption);
@ -170,7 +174,9 @@ public:
virtual Audio::Mixer *getMixer(); virtual Audio::Mixer *getMixer();
virtual Common::TimerManager *getTimerManager(); virtual Common::TimerManager *getTimerManager();
static void migrateApp(); void startSoundsystem();
void stopSoundsystem();
static const char* getConfigPath(); static const char* getConfigPath();
protected: protected:
@ -182,6 +188,18 @@ protected:
void suspendLoop(); void suspendLoop();
static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB); static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB);
static int timerHandler(int t); static int timerHandler(int t);
bool handleEvent_swipe(Common::Event &event, int direction);
void handleEvent_keyPressed(Common::Event &event, int keyPressed);
void handleEvent_orientationChanged(int orientation);
bool handleEvent_mouseDown(Common::Event &event, int x, int y);
bool handleEvent_mouseUp(Common::Event &event, int x, int y);
bool handleEvent_secondMouseDown(Common::Event &event, int x, int y);
bool handleEvent_secondMouseUp(Common::Event &event, int x, int y);
bool handleEvent_mouseDragged(Common::Event &event, int x, int y);
}; };
#endif #endif

View file

@ -50,13 +50,12 @@
#include "backends/fs/windows/windows-fs-factory.h" #include "backends/fs/windows/windows-fs-factory.h"
#endif #endif
class OSystem_NULL : public OSystem { class OSystem_NULL : public OSystem {
protected: protected:
Common::SaveFileManager *_savefile; Common::SaveFileManager *_savefile;
Audio::MixerImpl *_mixer; Audio::MixerImpl *_mixer;
Common::TimerManager *_timer; Common::TimerManager *_timer;
FilesystemFactory *_fsFactory;
timeval _startTime; timeval _startTime;
public: public:
@ -133,12 +132,23 @@ OSystem_NULL::OSystem_NULL() {
_savefile = 0; _savefile = 0;
_mixer = 0; _mixer = 0;
_timer = 0; _timer = 0;
#if defined(__amigaos4__)
_fsFactory = new AmigaOSFilesystemFactory();
#elif defined(UNIX)
_fsFactory = new POSIXFilesystemFactory();
#elif defined(WIN32)
_fsFactory = new WindowsFilesystemFactory();
#else
#error Unknown and unsupported FS backend
#endif
} }
OSystem_NULL::~OSystem_NULL() { OSystem_NULL::~OSystem_NULL() {
delete _savefile; delete _savefile;
delete _mixer; delete _mixer;
delete _timer; delete _timer;
delete _fsFactory;
} }
void OSystem_NULL::initBackend() { void OSystem_NULL::initBackend() {
@ -194,11 +204,11 @@ void OSystem_NULL::initSize(uint width, uint height) {
} }
int16 OSystem_NULL::getHeight() { int16 OSystem_NULL::getHeight() {
return 320; return 200;
} }
int16 OSystem_NULL::getWidth() { int16 OSystem_NULL::getWidth() {
return 200; return 320;
} }
void OSystem_NULL::setPalette(const byte *colors, uint start, uint num) { void OSystem_NULL::setPalette(const byte *colors, uint start, uint num) {
@ -327,18 +337,9 @@ void OSystem_NULL::getTimeAndDate(struct tm &t) const {
} }
FilesystemFactory *OSystem_NULL::getFilesystemFactory() { FilesystemFactory *OSystem_NULL::getFilesystemFactory() {
#if defined(__amigaos4__) return _fsFactory;
return &AmigaOSFilesystemFactory::instance();
#elif defined(UNIX)
return &POSIXFilesystemFactory::instance();
#elif defined(WIN32)
return &WindowsFilesystemFactory::instance();
#else
#error Unknown and unsupported backend in OSystem_NULL::getFilesystemFactory
#endif
} }
OSystem *OSystem_NULL_create() { OSystem *OSystem_NULL_create() {
return new OSystem_NULL(); return new OSystem_NULL();
} }

View file

@ -31,6 +31,7 @@ RawReadFile::RawReadFile(McAccess *mcAccess) {
_size = -1; _size = -1;
_pos = 0; _pos = 0;
_buf = NULL; _buf = NULL;
_eof = false;
} }
RawReadFile::~RawReadFile(void) { RawReadFile::~RawReadFile(void) {
@ -79,12 +80,16 @@ int RawReadFile::bufSeek(int ofs, int whence) {
_pos = 0; _pos = 0;
else if (_pos > _size) else if (_pos > _size)
_pos = _size; _pos = _size;
_eof = false;
return _pos; return _pos;
} }
int RawReadFile::bufRead(void *dest, int size) { int RawReadFile::bufRead(void *dest, int size) {
if (_pos + size > _size) if (_pos + size > _size) {
size = _size - _pos; size = _size - _pos;
_eof = true;
}
memcpy(dest, _buf + _pos, size); memcpy(dest, _buf + _pos, size);
_pos += size; _pos += size;
return size; return size;
@ -94,7 +99,13 @@ int RawReadFile::bufSize(void) const {
return _size; return _size;
} }
bool RawReadFile::bufEof(void) const {
return _eof;
}
void RawReadFile::bufClearErr(void) const {
_eof = false;
}
RawWriteFile::RawWriteFile(McAccess *mcAccess) { RawWriteFile::RawWriteFile(McAccess *mcAccess) {
_mcAccess = mcAccess; _mcAccess = mcAccess;

View file

@ -40,11 +40,14 @@ public:
int bufTell(void) const; int bufTell(void) const;
int bufSeek(int ofs, int whence); int bufSeek(int ofs, int whence);
int bufSize(void) const; int bufSize(void) const;
bool bufEof(void) const;
void bufClearErr(void);
protected: protected:
McAccess *_mcAccess; McAccess *_mcAccess;
int _size; int _size;
uint8 *_buf; uint8 *_buf;
int _pos; int _pos;
bool _eof;
}; };
class RawWriteFile { class RawWriteFile {

View file

@ -71,7 +71,7 @@ uint32 AutoSaveFile::write(const void *ptr, uint32 size) {
UclInSaveFile::UclInSaveFile(const char *filename, Gs2dScreen *screen, McAccess *mcAccess) : RawReadFile(mcAccess) { UclInSaveFile::UclInSaveFile(const char *filename, Gs2dScreen *screen, McAccess *mcAccess) : RawReadFile(mcAccess) {
_screen = screen; _screen = screen;
_ioFailed = true; _err = true;
if (bufOpen(filename)) { if (bufOpen(filename)) {
if ((_size > 8) && (*(uint32 *)_buf == UCL_MAGIC)) { if ((_size > 8) && (*(uint32 *)_buf == UCL_MAGIC)) {
@ -82,13 +82,13 @@ UclInSaveFile::UclInSaveFile(const char *filename, Gs2dScreen *screen, McAccess
free(_buf); free(_buf);
_buf = decBuf; _buf = decBuf;
_size = resSize; _size = resSize;
_ioFailed = false; _err = false;
_pos = 0; _pos = 0;
} else } else
free(decBuf); free(decBuf);
} }
} }
if (_ioFailed) { if (_err) {
if (_buf) if (_buf)
free(_buf); free(_buf);
_buf = NULL; _buf = NULL;
@ -100,36 +100,39 @@ UclInSaveFile::~UclInSaveFile(void) {
_screen->wantAnim(false); _screen->wantAnim(false);
} }
bool UclInSaveFile::ioFailed(void) const { bool UclInSaveFile::err(void) const {
return _ioFailed; return _err;
} }
void UclInSaveFile::clearIOFailed(void) { void UclInSaveFile::clearErr(void) {
_ioFailed = false; _err = false;
bufClearErr();
} }
bool UclInSaveFile::eos(void) const { bool UclInSaveFile::eos(void) const {
return bufTell() == bufSize(); return bufEof();
} }
uint32 UclInSaveFile::pos(void) const { int32 UclInSaveFile::pos(void) const {
return bufTell(); return bufTell();
} }
uint32 UclInSaveFile::size(void) const { int32 UclInSaveFile::size(void) const {
return bufSize(); return bufSize();
} }
void UclInSaveFile::seek(int pos, int whence) { bool UclInSaveFile::seek(int pos, int whence) {
bufSeek(pos, whence); bufSeek(pos, whence);
return true;
} }
uint32 UclInSaveFile::read(void *ptr, uint32 size) { uint32 UclInSaveFile::read(void *ptr, uint32 size) {
return (uint32)bufRead(ptr, (int)size); return (uint32)bufRead(ptr, (int)size);
} }
void UclInSaveFile::skip(uint32 offset) { bool UclInSaveFile::skip(uint32 offset) {
bufSeek(offset, SEEK_CUR); bufSeek(offset, SEEK_CUR);
return true;
} }
UclOutSaveFile::UclOutSaveFile(const char *filename, OSystem_PS2 *system, Gs2dScreen *screen, McAccess *mc) : RawWriteFile(mc) { UclOutSaveFile::UclOutSaveFile(const char *filename, OSystem_PS2 *system, Gs2dScreen *screen, McAccess *mc) : RawWriteFile(mc) {
@ -137,7 +140,7 @@ UclOutSaveFile::UclOutSaveFile(const char *filename, OSystem_PS2 *system, Gs2dSc
_system = system; _system = system;
strcpy(_fileName, filename); strcpy(_fileName, filename);
_ioFailed = !bufOpen(filename); _err = !bufOpen(filename);
_wasFlushed = false; _wasFlushed = false;
} }
@ -146,7 +149,7 @@ UclOutSaveFile::~UclOutSaveFile(void) {
if (_pos != 0) { if (_pos != 0) {
printf("Engine didn't call SaveFile::flush()\n"); printf("Engine didn't call SaveFile::flush()\n");
flush(); flush();
if (ioFailed()) { if (err()) {
// unable to save to memory card and it's too late to return an error code to the engine // unable to save to memory card and it's too late to return an error code to the engine
_system->msgPrintf(5000, "!WARNING!\nCan't write to memory card.\nGame was NOT saved."); _system->msgPrintf(5000, "!WARNING!\nCan't write to memory card.\nGame was NOT saved.");
printf("~UclOutSaveFile: Flush failed!\n"); printf("~UclOutSaveFile: Flush failed!\n");
@ -160,20 +163,20 @@ uint32 UclOutSaveFile::write(const void *ptr, uint32 size) {
return size; return size;
} }
bool UclOutSaveFile::ioFailed(void) const { bool UclOutSaveFile::err(void) const {
return _ioFailed; return _err;
} }
void UclOutSaveFile::clearIOFailed(void) { void UclOutSaveFile::clearErr(void) {
_ioFailed = false; _err = false;
} }
void UclOutSaveFile::flush(void) { bool UclOutSaveFile::flush(void) {
if (_pos != 0) { if (_pos != 0) {
if (_wasFlushed) { if (_wasFlushed) {
printf("Multiple calls to UclOutSaveFile::flush!\n"); printf("Multiple calls to UclOutSaveFile::flush!\n");
_ioFailed = true; _err = true;
return; return false;
} }
uint32 compSize = _pos * 2; uint32 compSize = _pos * 2;
uint8 *compBuf = (uint8*)memalign(64, compSize + 8); uint8 *compBuf = (uint8*)memalign(64, compSize + 8);
@ -188,11 +191,12 @@ void UclOutSaveFile::flush(void) {
_pos = compSize + 8; _pos = compSize + 8;
if (!bufFlush()) { if (!bufFlush()) {
printf("UclOutSaveFile::flush failed!\n"); printf("UclOutSaveFile::flush failed!\n");
_ioFailed = true; _err = true;
removeFile(); removeFile();
} }
_wasFlushed = true; _wasFlushed = true;
} }
return true;
} }
/* ----------------------------------------- Glue Classes for POSIX Memory Card Access ----------------------------------------- */ /* ----------------------------------------- Glue Classes for POSIX Memory Card Access ----------------------------------------- */
@ -216,11 +220,11 @@ uint32 Ps2McReadFile::write(const void *src, uint32 len) {
return 0; return 0;
} }
uint32 Ps2McReadFile::tell(void) { int32 Ps2McReadFile::tell(void) {
return bufTell(); return bufTell();
} }
uint32 Ps2McReadFile::size(void) { int32 Ps2McReadFile::size(void) {
return bufSize(); return bufSize();
} }
@ -253,11 +257,11 @@ uint32 Ps2McWriteFile::write(const void *src, uint32 len) {
return len; return len;
} }
uint32 Ps2McWriteFile::tell(void) { int32 Ps2McWriteFile::tell(void) {
return bufTell(); return bufTell();
} }
uint32 Ps2McWriteFile::size(void) { int32 Ps2McWriteFile::size(void) {
return bufTell(); return bufTell();
} }
@ -267,6 +271,3 @@ int Ps2McWriteFile::seek(int32 offset, int origin) {
return 0; return 0;
} }
bool Ps2McWriteFile::eof(void) {
return true;
}

View file

@ -41,14 +41,14 @@ public:
UclOutSaveFile(const char *filename, OSystem_PS2 *system, Gs2dScreen *screen, McAccess *mc); UclOutSaveFile(const char *filename, OSystem_PS2 *system, Gs2dScreen *screen, McAccess *mc);
virtual ~UclOutSaveFile(void); virtual ~UclOutSaveFile(void);
virtual uint32 write(const void *ptr, uint32 size); virtual uint32 write(const void *ptr, uint32 size);
virtual void flush(void); virtual bool flush(void);
virtual bool ioFailed(void) const; virtual bool err(void) const;
virtual void clearIOFailed(void); virtual void clearErr(void);
private: private:
OSystem_PS2 *_system; OSystem_PS2 *_system;
Gs2dScreen *_screen; Gs2dScreen *_screen;
bool _ioFailed, _wasFlushed; bool _err, _wasFlushed;
char _fileName[128]; char _fileName[128];
}; };
@ -58,16 +58,16 @@ public:
virtual ~UclInSaveFile(void); virtual ~UclInSaveFile(void);
virtual bool eos(void) const; virtual bool eos(void) const;
virtual uint32 read(void *ptr, uint32 size); virtual uint32 read(void *ptr, uint32 size);
virtual bool ioFailed(void) const; virtual bool err(void) const;
virtual void clearIOFailed(void); virtual void clearErr(void);
virtual void skip(uint32 offset); virtual bool skip(uint32 offset);
virtual uint32 pos(void) const; virtual int32 pos(void) const;
virtual uint32 size(void) const; virtual int32 size(void) const;
virtual void seek(int pos, int whence = SEEK_SET); virtual bool seek(int pos, int whence = SEEK_SET);
private: private:
Gs2dScreen *_screen; Gs2dScreen *_screen;
bool _ioFailed; bool _err;
}; };
class AutoSaveFile : public Common::OutSaveFile { class AutoSaveFile : public Common::OutSaveFile {
@ -75,9 +75,9 @@ public:
AutoSaveFile(Ps2SaveFileManager *saveMan, const char *filename); AutoSaveFile(Ps2SaveFileManager *saveMan, const char *filename);
~AutoSaveFile(void); ~AutoSaveFile(void);
virtual uint32 write(const void *ptr, uint32 size); virtual uint32 write(const void *ptr, uint32 size);
virtual void flush(void) {} virtual bool flush(void) {}
virtual bool ioFailed(void) { return false; }; virtual bool err(void) const { return false; }
virtual void clearIOFailed(void) {} virtual void clearErr(void) {}
private: private:
Ps2SaveFileManager *_saveMan; Ps2SaveFileManager *_saveMan;
char _fileName[256]; char _fileName[256];
@ -95,8 +95,8 @@ public:
virtual bool open(const char *name); virtual bool open(const char *name);
virtual uint32 read(void *dest, uint32 len); virtual uint32 read(void *dest, uint32 len);
virtual uint32 write(const void *src, uint32 len); virtual uint32 write(const void *src, uint32 len);
virtual uint32 tell(void); virtual int32 tell(void);
virtual uint32 size(void); virtual int32 size(void);
virtual int seek(int32 offset, int origin); virtual int seek(int32 offset, int origin);
virtual bool eof(void); virtual bool eof(void);
}; };
@ -108,10 +108,9 @@ public:
virtual bool open(const char *name); virtual bool open(const char *name);
virtual uint32 read(void *dest, uint32 len); virtual uint32 read(void *dest, uint32 len);
virtual uint32 write(const void *src, uint32 len); virtual uint32 write(const void *src, uint32 len);
virtual uint32 tell(void); virtual int32 tell(void);
virtual uint32 size(void); virtual int32 size(void);
virtual int seek(int32 offset, int origin); virtual int seek(int32 offset, int origin);
virtual bool eof(void);
}; };
#endif // __PS2_SAVEFILE__ #endif // __PS2_SAVEFILE__

View file

@ -98,7 +98,20 @@ OSystem_PSP::~OSystem_PSP() {
void OSystem_PSP::initBackend() { void OSystem_PSP::initBackend() {
_savefile = new DefaultSaveFileManager(); _savefile = new DefaultSaveFileManager("ms0:/scummvm_savegames");
const char *savePath = _savefile->getSavePath().c_str();
//check if the save directory exists
SceUID fd = sceIoDopen(savePath);
if (fd < 0) {
//No? then let's create it.
sceIoMkdir(savePath, 0777);
} else {
//it exists, so close it again.
sceIoDclose(fd);
}
_timer = new DefaultTimerManager(); _timer = new DefaultTimerManager();
setTimerCallback(&timer_handler, 10); setTimerCallback(&timer_handler, 10);

View file

@ -94,19 +94,23 @@ OSystem_PSP_GU::OSystem_PSP_GU() {
//decompress keyboard data //decompress keyboard data
uLongf kbdSize = KBD_DATA_SIZE; uLongf kbdSize = KBD_DATA_SIZE;
keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE); keyboard_letters = (unsigned char *)memalign(16, KBD_DATA_SIZE);
assert(Z_OK == uncompress((Bytef *)keyboard_letters, &kbdSize, (const Bytef *)keyboard_letters_compressed, size_keyboard_letters_compressed)); if (!uncompress((Bytef *)keyboard_letters, &kbdSize, (const Bytef *)keyboard_letters_compressed, size_keyboard_letters_compressed))
error("OSystem_PSP_GU: uncompressing keyboard_letters failed");
kbdSize = KBD_DATA_SIZE; kbdSize = KBD_DATA_SIZE;
keyboard_letters_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE); keyboard_letters_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
assert(Z_OK == uncompress((Bytef *)keyboard_letters_shift, &kbdSize, (const Bytef *)keyboard_letters_shift_compressed, size_keyboard_letters_shift_compressed)); if (!uncompress((Bytef *)keyboard_letters_shift, &kbdSize, (const Bytef *)keyboard_letters_shift_compressed, size_keyboard_letters_shift_compressed))
error("OSystem_PSP_GU: uncompressing keyboard_letters_shift failed");
kbdSize = KBD_DATA_SIZE; kbdSize = KBD_DATA_SIZE;
keyboard_symbols = (unsigned char *)memalign(16, KBD_DATA_SIZE); keyboard_symbols = (unsigned char *)memalign(16, KBD_DATA_SIZE);
assert(Z_OK == uncompress((Bytef *)keyboard_symbols, &kbdSize, (const Bytef *)keyboard_symbols_compressed, size_keyboard_symbols_compressed)); if (!uncompress((Bytef *)keyboard_symbols, &kbdSize, (const Bytef *)keyboard_symbols_compressed, size_keyboard_symbols_compressed))
error("OSystem_PSP_GU: uncompressing keyboard_symbols failed");
kbdSize = KBD_DATA_SIZE; kbdSize = KBD_DATA_SIZE;
keyboard_symbols_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE); keyboard_symbols_shift = (unsigned char *)memalign(16, KBD_DATA_SIZE);
assert(Z_OK == uncompress((Bytef *)keyboard_symbols_shift, &kbdSize, (const Bytef *)keyboard_symbols_shift_compressed, size_keyboard_symbols_shift_compressed)); if (!uncompress((Bytef *)keyboard_symbols_shift, &kbdSize, (const Bytef *)keyboard_symbols_shift_compressed, size_keyboard_symbols_shift_compressed))
error("OSystem_PSP_GU: uncompressing keyboard_symbols_shift failed");
_keyboardVisible = false; _keyboardVisible = false;
_clut = (unsigned short*)(((unsigned int)clut256)|0x40000000); _clut = (unsigned short*)(((unsigned int)clut256)|0x40000000);

View file

@ -43,7 +43,6 @@
#include "trace.h" #include "trace.h"
#define SCUMMVM_SAVEPATH "ms0:/scummvm_savegames"
#define BREAKPOINT asm("break\n") #define BREAKPOINT asm("break\n")

View file

@ -122,16 +122,6 @@ int main(void)
{ {
SetupCallbacks(); SetupCallbacks();
//check if the save directory exists
SceUID fd = sceIoDopen(SCUMMVM_SAVEPATH);
if (fd < 0) {
//No? then let's create it.
sceIoMkdir(SCUMMVM_SAVEPATH, 0777);
} else {
//it exists, so close it again.
sceIoDclose(fd);
}
static char *argv[] = { "scummvm", NULL }; static char *argv[] = { "scummvm", NULL };
static int argc = sizeof(argv)/sizeof(char *)-1; static int argc = sizeof(argv)/sizeof(char *)-1;

View file

@ -32,9 +32,9 @@
#endif #endif
#include "backends/platform/sdl/sdl.h" #include "backends/platform/sdl/sdl.h"
#include "common/archive.h"
#include "common/config-manager.h" #include "common/config-manager.h"
#include "common/events.h" #include "common/events.h"
#include "common/file.h"
#include "common/util.h" #include "common/util.h"
#include "backends/saves/default/default-saves.h" #include "backends/saves/default/default-saves.h"
@ -72,6 +72,9 @@
#define DEFAULT_CONFIG_FILE "scummvm.ini" #define DEFAULT_CONFIG_FILE "scummvm.ini"
#endif #endif
#if defined(MACOSX) || defined(IPHONE)
#include "CoreFoundation/CoreFoundation.h"
#endif
static Uint32 timer_handler(Uint32 interval, void *param) { static Uint32 timer_handler(Uint32 interval, void *param) {
@ -196,6 +199,7 @@ OSystem_SDL::OSystem_SDL()
_soundMutex(0), _soundCond(0), _soundThread(0), _soundMutex(0), _soundCond(0), _soundThread(0),
_soundThreadIsRunning(false), _soundThreadShouldQuit(false), _soundThreadIsRunning(false), _soundThreadShouldQuit(false),
#endif #endif
_fsFactory(0),
_savefile(0), _savefile(0),
_mixer(0), _mixer(0),
_timer(0), _timer(0),
@ -213,6 +217,19 @@ OSystem_SDL::OSystem_SDL()
memset(&_mouseCurState, 0, sizeof(_mouseCurState)); memset(&_mouseCurState, 0, sizeof(_mouseCurState));
_inited = false; _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() { OSystem_SDL::~OSystem_SDL() {
@ -254,19 +271,42 @@ Common::SaveFileManager *OSystem_SDL::getSavefileManager() {
} }
FilesystemFactory *OSystem_SDL::getFilesystemFactory() { FilesystemFactory *OSystem_SDL::getFilesystemFactory() {
#if defined(__amigaos4__) assert(_fsFactory);
return &AmigaOSFilesystemFactory::instance(); return _fsFactory;
#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
} }
void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, uint priority) {
#ifdef DATA_PATH
// Add the global DATA_PATH to the directory search list
// FIXME: We use depth = 4 for now, to match the old code. May want to change that
Common::FilesystemNode dataNode(DATA_PATH);
if (dataNode.exists() && dataNode.isDirectory()) {
Common::ArchivePtr dataArchive(new Common::FSDirectory(dataNode, 4));
s.add(DATA_PATH, dataArchive, priority);
}
#endif
#if defined(MACOSX) || defined(IPHONE)
// Get URL of the Resource directory of the .app bundle
CFURLRef fileUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
if (fileUrl) {
// Try to convert the URL to an absolute path
UInt8 buf[MAXPATHLEN];
if (CFURLGetFileSystemRepresentation(fileUrl, true, buf, sizeof(buf))) {
// Success: Add it to the search path
Common::String bundlePath((const char *)buf);
Common::ArchivePtr bundleArchive(new Common::FSDirectory(bundlePath));
s.add("__OSX_BUNDLE__", bundleArchive, priority);
}
CFRelease(fileUrl);
}
#endif
}
static Common::String getDefaultConfigFileName() { static Common::String getDefaultConfigFileName() {
char configFile[MAXPATHLEN]; char configFile[MAXPATHLEN];
#if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) #if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
@ -292,20 +332,19 @@ static Common::String getDefaultConfigFileName() {
CreateDirectory(configFile, NULL); CreateDirectory(configFile, NULL);
strcat(configFile, "\\" DEFAULT_CONFIG_FILE); strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
if (fopen(configFile, "r") == NULL) { FILE *tmp = NULL;
if ((tmp = fopen(configFile, "r")) == NULL) {
// Check windows directory // Check windows directory
char oldConfigFile[MAXPATHLEN]; char oldConfigFile[MAXPATHLEN];
GetWindowsDirectory(oldConfigFile, MAXPATHLEN); GetWindowsDirectory(oldConfigFile, MAXPATHLEN);
strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE); strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE);
if (fopen(oldConfigFile, "r")) { if ((tmp = 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);
strcpy(configFile, oldConfigFile); strcpy(configFile, oldConfigFile);
fclose(tmp);
} }
} else {
fclose(tmp);
} }
} else { } else {
// Check windows directory // Check windows directory
@ -334,23 +373,13 @@ static Common::String getDefaultConfigFileName() {
} }
Common::SeekableReadStream *OSystem_SDL::openConfigFileForReading() { Common::SeekableReadStream *OSystem_SDL::openConfigFileForReading() {
Common::File *confFile = new Common::File(); Common::FilesystemNode file(getDefaultConfigFileName());
assert(confFile); return file.openForReading();
if (!confFile->open(getDefaultConfigFileName())) {
delete confFile;
confFile = 0;
}
return confFile;
} }
Common::WriteStream *OSystem_SDL::openConfigFileForWriting() { Common::WriteStream *OSystem_SDL::openConfigFileForWriting() {
Common::DumpFile *confFile = new Common::DumpFile(); Common::FilesystemNode file(getDefaultConfigFileName());
assert(confFile); return file.openForWriting();
if (!confFile->open(getDefaultConfigFileName())) {
delete confFile;
confFile = 0;
}
return confFile;
} }
void OSystem_SDL::setWindowCaption(const char *caption) { void OSystem_SDL::setWindowCaption(const char *caption) {
@ -435,15 +464,21 @@ void OSystem_SDL::quit() {
} }
void OSystem_SDL::setupIcon() { void OSystem_SDL::setupIcon() {
int w, h, ncols, nbytes, i; int x, y, w, h, ncols, nbytes, i;
unsigned int rgba[256], icon[32 * 32]; unsigned int rgba[256];
unsigned char mask[32][4]; unsigned int *icon;
sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes);
if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { if ((w > 512) || (h > 512) || (ncols > 255) || (nbytes > 1)) {
warning("Could not load the icon (%d %d %d %d)", w, h, ncols, nbytes); warning("Could not load the built-in icon (%d %d %d %d)", w, h, ncols, nbytes);
return; 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++) { for (i = 0; i < ncols; i++) {
unsigned char code; unsigned char code;
char color[32]; char color[32];
@ -457,26 +492,27 @@ void OSystem_SDL::setupIcon() {
sscanf(color + 1, "%06x", &col); sscanf(color + 1, "%06x", &col);
col |= 0xFF000000; col |= 0xFF000000;
} else { } 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; return;
} }
rgba[code] = col; rgba[code] = col;
} }
memset(mask, 0, sizeof(mask)); for (y = 0; y < h; y++) {
for (h = 0; h < 32; h++) { const char *line = scummvm_icon[1 + ncols + y];
const char *line = scummvm_icon[1 + ncols + h]; for (x = 0; x < w; x++) {
for (w = 0; w < 32; w++) { icon[x + w * y] = rgba[(int)line[x]];
icon[w + 32 * h] = rgba[(int)line[w]];
if (rgba[(int)line[w]] & 0xFF000000) {
mask[h][w >> 3] |= 1 << (7 - (w & 0x07));
}
} }
} }
SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, w, h, 32, w * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000);
SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); if (!sdl_surf) {
warning("SDL_CreateRGBSurfaceFrom(icon) failed");
}
SDL_WM_SetIcon(sdl_surf, NULL);
SDL_FreeSurface(sdl_surf); SDL_FreeSurface(sdl_surf);
free(icon);
} }
OSystem::MutexRef OSystem_SDL::createMutex(void) { OSystem::MutexRef OSystem_SDL::createMutex(void) {
@ -515,7 +551,7 @@ void OSystem_SDL::mixerProducerThread() {
// Generate samples and put them into the next buffer // Generate samples and put them into the next buffer
nextSoundBuffer = _activeSoundBuf ^ 1; nextSoundBuffer = _activeSoundBuf ^ 1;
_mixer->mixCallback(_soundBuffers[nextSoundBuffer], _soundBufSize); _mixer->mixCallback(_soundBuffers[nextSoundBuffer], _soundBufSize);
// Swap buffers // Swap buffers
_activeSoundBuf = nextSoundBuffer; _activeSoundBuf = nextSoundBuffer;
} }
@ -559,7 +595,7 @@ void OSystem_SDL::deinitThreadedMixer() {
SDL_CondBroadcast(_soundCond); SDL_CondBroadcast(_soundCond);
SDL_WaitThread(_soundThread, NULL); SDL_WaitThread(_soundThread, NULL);
// Kill the mutex & cond variables. // Kill the mutex & cond variables.
// Attention: AT this point, the mixer callback must not be running // Attention: AT this point, the mixer callback must not be running
// anymore, else we will crash! // anymore, else we will crash!
SDL_DestroyMutex(_soundMutex); SDL_DestroyMutex(_soundMutex);
@ -582,10 +618,10 @@ void OSystem_SDL::mixCallback(void *arg, byte *samples, int len) {
// Lock mutex, to ensure our data is not overwritten by the producer thread // Lock mutex, to ensure our data is not overwritten by the producer thread
SDL_LockMutex(this_->_soundMutex); SDL_LockMutex(this_->_soundMutex);
// Copy data from the current sound buffer // Copy data from the current sound buffer
memcpy(samples, this_->_soundBuffers[this_->_activeSoundBuf], len); memcpy(samples, this_->_soundBuffers[this_->_activeSoundBuf], len);
// Unlock mutex and wake up the produced thread // Unlock mutex and wake up the produced thread
SDL_UnlockMutex(this_->_soundMutex); SDL_UnlockMutex(this_->_soundMutex);
SDL_CondSignal(this_->_soundCond); SDL_CondSignal(this_->_soundCond);
@ -645,7 +681,7 @@ void OSystem_SDL::setupMixer() {
// even if it didn't. Probably only happens for "weird" rates, though. // even if it didn't. Probably only happens for "weird" rates, though.
_samplesPerSec = obtained.freq; _samplesPerSec = obtained.freq;
debug(1, "Output sample rate: %d Hz", _samplesPerSec); debug(1, "Output sample rate: %d Hz", _samplesPerSec);
// Tell the mixer that we are ready and start the sound processing // Tell the mixer that we are ready and start the sound processing
_mixer->setOutputRate(_samplesPerSec); _mixer->setOutputRate(_samplesPerSec);
_mixer->setReady(true); _mixer->setReady(true);

View file

@ -209,6 +209,7 @@ public:
virtual Common::SaveFileManager *getSavefileManager(); virtual Common::SaveFileManager *getSavefileManager();
virtual FilesystemFactory *getFilesystemFactory(); virtual FilesystemFactory *getFilesystemFactory();
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, uint priority = 0);
virtual Common::SeekableReadStream *openConfigFileForReading(); virtual Common::SeekableReadStream *openConfigFileForReading();
virtual Common::WriteStream *openConfigFileForWriting(); virtual Common::WriteStream *openConfigFileForWriting();
@ -400,14 +401,13 @@ protected:
void deinitThreadedMixer(); void deinitThreadedMixer();
#endif #endif
FilesystemFactory *_fsFactory;
Common::SaveFileManager *_savefile; Common::SaveFileManager *_savefile;
Audio::MixerImpl *_mixer; Audio::MixerImpl *_mixer;
SDL_TimerID _timerID; SDL_TimerID _timerID;
Common::TimerManager *_timer; Common::TimerManager *_timer;
protected: protected:
void addDirtyRgnAuto(const byte *buf); void addDirtyRgnAuto(const byte *buf);
void makeChecksums(const byte *buf); void makeChecksums(const byte *buf);

View file

@ -27,7 +27,7 @@ chdir("../../../");
"mmp/scummvm_sword1.mmp", "mmp/scummvm_sword1.mmp",
"mmp/scummvm_sword2.mmp", "mmp/scummvm_sword2.mmp",
"mmp/scummvm_touche.mmp", "mmp/scummvm_touche.mmp",
"mmp/scummvm_tinsel.mmp",
# Target Platform Project Files # Target Platform Project Files
"S60/ScummVM_S60.mmp", "S60/ScummVM_S60.mmp",
@ -83,6 +83,9 @@ my @excludes_graphics = (
"iff.cpp" "iff.cpp"
); );
my @excludes_gui = (
);
# the USE_ARM_* defines not parsed correctly, exclude manually: # the USE_ARM_* defines not parsed correctly, exclude manually:
my @excludes_scumm = ( my @excludes_scumm = (
".*ARM.*", # the *ARM.s files are added in .mpp files based on WINS/ARM build! ".*ARM.*", # the *ARM.s files are added in .mpp files based on WINS/ARM build!
@ -95,7 +98,7 @@ my @excludes_scumm = (
#arseModule(mmpStr, dirStr, ifdefArray, [exclusionsArray]) #arseModule(mmpStr, dirStr, ifdefArray, [exclusionsArray])
ParseModule("_base", "base", \@section_empty); # now in ./TRG/ScummVM_TRG.mmp, these never change anyways... ParseModule("_base", "base", \@section_empty); # now in ./TRG/ScummVM_TRG.mmp, these never change anyways...
ParseModule("_base", "common", \@section_empty); ParseModule("_base", "common", \@section_empty);
ParseModule("_base", "gui", \@section_empty); ParseModule("_base", "gui", \@section_empty, \@excludes_gui);
ParseModule("_base", "graphics", \@section_empty, \@excludes_graphics); ParseModule("_base", "graphics", \@section_empty, \@excludes_graphics);
ParseModule("_base", "sound", \@section_empty, \@excludes_snd); ParseModule("_base", "sound", \@section_empty, \@excludes_snd);
@ -103,22 +106,23 @@ chdir("engines/");
ParseModule("_scumm", "scumm", \@sections_scumm, \@excludes_scumm ); ParseModule("_scumm", "scumm", \@sections_scumm, \@excludes_scumm );
ParseModule("_queen", "queen", \@section_empty); ParseModule("_queen", "queen", \@section_empty);
ParseModule("_agos", "agos", \@section_empty); ParseModule("_agos", "agos", \@section_empty);
ParseModule("_sky", "sky", \@section_empty); ParseModule("_sky", "sky", \@section_empty);
ParseModule("_gob", "gob", \@section_empty); ParseModule("_gob", "gob", \@section_empty);
ParseModule("_saga", "saga", \@section_empty); ParseModule("_saga", "saga", \@section_empty);
ParseModule("_kyra", "kyra", \@section_empty); ParseModule("_kyra", "kyra", \@section_empty);
ParseModule("_sword1", "sword1", \@section_empty); ParseModule("_sword1", "sword1", \@section_empty);
ParseModule("_sword2", "sword2", \@section_empty); ParseModule("_sword2", "sword2", \@section_empty);
ParseModule("_lure", "lure", \@section_empty); ParseModule("_lure", "lure", \@section_empty);
ParseModule("_cine", "cine", \@section_empty); ParseModule("_cine", "cine", \@section_empty);
ParseModule("_agi", "agi", \@section_empty); ParseModule("_agi", "agi", \@section_empty);
ParseModule("_touche", "touche", \@section_empty); ParseModule("_touche", "touche", \@section_empty);
ParseModule("_parallaction","parallaction",\@section_empty); ParseModule("_parallaction","parallaction",\@section_empty);
ParseModule("_cruise", "cruise", \@section_empty); ParseModule("_cruise", "cruise", \@section_empty);
ParseModule("_drascula","drascula", \@section_empty); ParseModule("_drascula","drascula", \@section_empty);
ParseModule("_igor", "igor", \@section_empty); ParseModule("_igor", "igor", \@section_empty);
ParseModule("_made", "made", \@section_empty); ParseModule("_made", "made", \@section_empty);
ParseModule("_m4", "m4", \@section_empty); ParseModule("_m4", "m4", \@section_empty);
ParseModule("_tinsel", "tinsel", \@section_empty);
print " print "
======================================================================================= =======================================================================================
Done. Enjoy :P Done. Enjoy :P

View file

@ -443,6 +443,10 @@ my $header = "
PrintMessage("Cleaning for $Target") if (!$ReallyQuiet); PrintMessage("Cleaning for $Target") if (!$ReallyQuiet);
system("bldmake bldfiles > NUL 2> NUL"); system("bldmake bldfiles > NUL 2> NUL");
PrintErrorMessage("'bldmake bldfiles' exited with value " . ($? >> 8)) if ($? >> 8); PrintErrorMessage("'bldmake bldfiles' exited with value " . ($? >> 8)) if ($? >> 8);
system("abld MAKEFILE $TargetName > NUL 2> NUL");
PrintErrorMessage("'abld MAKEFILE $TargetName' exited with value " . ($? >> 8)) if ($? >> 8);
system("abld CLEAN $TargetName UREL > NUL 2> NUL"); system("abld CLEAN $TargetName UREL > NUL 2> NUL");
PrintErrorMessage("'abld CLEAN $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8); PrintErrorMessage("'abld CLEAN $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8);
# remove file so we are sure that after .lib generation we have a fresh copy! # remove file so we are sure that after .lib generation we have a fresh copy!
@ -455,10 +459,10 @@ my $header = "
my $OldSize = (-s $build_log_err); my $OldSize = (-s $build_log_err);
$Redirection = ($RedirectSTDERR ? "2>> $build_log_err" : ""); $Redirection = ($RedirectSTDERR ? "2>> $build_log_err" : "");
system("abld BUILD $TargetName UREL $Redirection >> $build_log_out"); system("abld TARGET $TargetName UREL $Redirection >> $build_log_out");
$OK = 0 if ($? >> 8); $OK = 0 if ($? >> 8);
# print " STDERR: ".((-s $build_log_err)-$OldSize)." bytes output written to $build_log_err\n+--------------------------------------------------------------------------------------\n" if ($OldSize != (-s $build_log_err)); # print " STDERR: ".((-s $build_log_err)-$OldSize)." bytes output written to $build_log_err\n+--------------------------------------------------------------------------------------\n" if ($OldSize != (-s $build_log_err));
PrintErrorMessage("'abld BUILD $TargetName UREL' exited with value " . ($? >> 8)) if ($? >> 8); PrintErrorMessage("'abld TARGET $TargetName UREL' exited with value " . ($? >> 8)) if ($? >> 8);
return 0 if (!$OK); # ABLD always returns ok :( grr return 0 if (!$OK); # ABLD always returns ok :( grr
PrintMessage("Done.") if (!$ReallyQuiet); PrintMessage("Done.") if (!$ReallyQuiet);
@ -475,7 +479,7 @@ my $header = "
} }
else else
{ {
PrintErrorMessage("'abld BUILD $TargetName UREL' apparently failed."); PrintErrorMessage("'abld TARGET $TargetName UREL' apparently failed.");
if ($HaltOnError) if ($HaltOnError)
{ {
PrintErrorMessage("Halting on error as requested!"); PrintErrorMessage("Halting on error as requested!");

View file

@ -3,14 +3,15 @@
@WorkingEngines = qw( @WorkingEngines = qw(
scumm agos sky queen gob saga drascula scumm agos sky queen gob saga drascula
kyra lure agi touche parallaction kyra lure agi touche parallaction cine
cruise igor made m4 tinsel sword1 sword2
); );
@TestingEngines = qw( @TestingEngines = qw(
cruise igor made m4 cine
); );
@BrokenEngines = qw(
sword1 @BrokenEngines = qw(
sword2
); );
@EnablableEngines = (@WorkingEngines, @TestingEngines); @EnablableEngines = (@WorkingEngines, @TestingEngines);
@ -29,20 +30,7 @@
# these are normally enabled for each variation # these are normally enabled for each variation
#$DefaultFeatures = qw(zlib,mad); #$DefaultFeatures = qw(zlib,mad);
$DefaultFeatures = qw(zlib,mad,tremor); $DefaultFeatures = qw(zlib,mad,tremor);
# you can use these below for speed & clarity or override with custom settings
$DefaultTopMacros = "
MACRO USE_ZLIB // LIB:zlib.lib
MACRO USE_MAD // LIB:libmad.lib
MACRO USE_TREMOR // LIB:libtremor.lib
";
$DefaultBottomMacros = "
MACRO DISABLE_SWORD1 // LIB:scummvm_sword1.lib
MACRO DISABLE_SWORD2 // LIB:scummvm_sword2.lib
";
################################################################################################################## ##################################################################################################################
## ##
@ -185,6 +173,44 @@
# now you can add $VariationSets only built on this PC below this line :) # now you can add $VariationSets only built on this PC below this line :)
}
elsif ($ENV{'COMPUTERNAME'} eq "EMBEDDEV-LAPE") #################################################################
{
$Producer = "AnotherGuest";
$RedirectSTDERR = 1;
$HaltOnError = 0;
$SkipExistingPackages = 1;
$ReallyQuiet = 1;
#$FTP_Host = "host.com";
#$FTP_User = "ag@host.com";
#$FTP_Pass = "password";
#$FTP_Dir = "cvsbuilds";
#$SDK_RootDirs{'UIQ2'}= "D:\\UIQ2";
$SDK_RootDirs{'UIQ3'}= "G:\\UIQ3";
#$SDK_RootDirs{'S60v1'}= "D:\\S60v1";
#$SDK_RootDirs{'S60v2'}= "D:\\S60v2";
$SDK_RootDirs{'S60v3'}= "G:\\S60_3rd_FP1";
#$SDK_RootDirs{'S80'}= "D:\\S80";
#$SDK_RootDirs{'S90'}= "D:\\S90";
$ECompXL_BinDir= "D:\\ECompXL\\";
if (0) # so we can turn them on/off easily
{
# $SDK_LibraryDirs{'ALL'}{'zlib.lib'} = "C:\\S\\zlib-1.2.2\\epoc";
# $SDK_LibraryDirs{'ALL'}{'libmad.lib'} = "C:\\S\\libmad-0.15.1b\\group";
# $SDK_LibraryDirs{'ALL'}{'libtremor.lib'}= "C:\\tremor\\epoc";
$SDK_LibraryDirs{'UIQ2'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ";
$SDK_LibraryDirs{'S60v1'}{'esdl.lib'} = $SDK_LibraryDirs{'S60v2'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60";
$SDK_LibraryDirs{'S80'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S80";
$SDK_LibraryDirs{'S90'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S90";
$SDK_LibraryDirs{'S60v3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\S60\\S60V3";
$SDK_LibraryDirs{'UIQ3'}{'esdl.lib'} = "E:\\WICKED\\ESDL\\epoc\\UIQ\\UIQ3";
#$SDK_LibraryDirs{'ALL'}{'libmpeg2.lib'} = "C:\\S\\mpeg2dec-0.4.0\\epoc";
}
# now you can add $VariationSets only built on this PC below this line :)
} }
else ######################################################################################################### else #########################################################################################################
{ {
@ -245,15 +271,11 @@
} }
# below here you could specify weird & experimental combinations, non-ready engines # 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) # Separate version for the broken sword engines (1&2)
#$VariationSets{'ALL'}{'saga_mini'} = "saga"; $VariationSets{'ALL'}{'brokensword'} = "$DefaultFeatures sword1 sword2";
# a smaller version of scumm without support for v7, v8 and HE games # Separate version for Scumm games (COMI) since memory usage might be high
#$VariationSets{'ALL'}{'scumm_no78he'} = "$DefaultFeatures scumm"; $VariationSets{'ALL'}{'scumm'} = "$DefaultFeatures scumm scumm_7_8 he";
# maybe you feel lucky and want to test the sword engines? :P
#$VariationSets{'S60v2'}{'test_sword'} = "$DefaultFeatures mpeg2 sword1 sword2";
#$VariationSets{'UIQ2'}{'test_sword'} = "$DefaultFeatures mpeg2 sword1 sword2";
# for mega-fast-testing only plz! Warning: contains to engines! # for mega-fast-testing only plz! Warning: contains to engines!
#$VariationSets{'ALL'}{'fast_empty'} = ""; #$VariationSets{'ALL'}{'fast_empty'} = "";

View file

@ -8,6 +8,18 @@
Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson
$Id$ $Id$
Using parts of snprintf.c by
Mark Martinec <mark.martinec@ijs.si>, April 1999, June 2000
Copyright © 1999,2000,2001,2002 Mark Martinec. All rights reserved.
under these conditions:
"Terms and conditions ...
This program is free software; it is dual licensed, the terms of the "Frontier Artistic License" or
the "GNU General Public License" can be chosen at your discretion.
The chosen license then applies solely and in its entirety.
Both licenses come with this Kit."
About ScummVM About ScummVM
-------------- --------------

View file

@ -93,6 +93,7 @@ SOURCE backends\platform\symbian\src\ScummApp.cpp
SOURCE gui\Key.cpp SOURCE gui\Key.cpp
SOURCE gui\KeysDialog.cpp SOURCE gui\KeysDialog.cpp
SOURCE gui\Actions.cpp SOURCE gui\Actions.cpp
SOURCE gui\Dialog.cpp
// Special for graphics // Special for graphics
source graphics\iff.cpp source graphics\iff.cpp

View file

@ -16,7 +16,7 @@
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
; ;
; $URL:$ ; $URL:$
; $Id:$ ; $Id$
; ;
; ;
@ -28,7 +28,7 @@
;&EN ;&EN
; UID is the app's UID ; UID is the app's UID
#{"ScummVM S60v1"},(0x101f9b57),0,120,0 #{"ScummVM S60v1"},(0x101f9b57),0,130,0
; Platform type ; Platform type
(0x101F6F88), 0, 0, 0, {"Series60ProductID"} (0x101F6F88), 0, 0, 0, {"Series60ProductID"}

View file

@ -27,7 +27,7 @@
;&EN ;&EN
; UID is the app's UID ; UID is the app's UID
#{"ScummVM S60v2"},(0x101f9b57),0,120,0 #{"ScummVM S60v2"},(0x101f9b57),0,130,0
; Platform type ; Platform type
(0x101F6F88), 0, 0, 0, {"Series60ProductID"} (0x101F6F88), 0, 0, 0, {"Series60ProductID"}

View file

@ -116,6 +116,7 @@ SOURCE backends\platform\symbian\src\ScummApp.cpp
SOURCE gui\Key.cpp SOURCE gui\Key.cpp
SOURCE gui\KeysDialog.cpp SOURCE gui\KeysDialog.cpp
SOURCE gui\Actions.cpp SOURCE gui\Actions.cpp
SOURCE gui\Dialog.cpp
// Special for graphics // Special for graphics
source graphics\iff.cpp source graphics\iff.cpp

View file

@ -34,7 +34,7 @@
:"ScummVM" :"ScummVM"
; UID is the app's UID ; UID is the app's UID
#{"ScummVM S60v3"},(0xA0000657),0,120,0 #{"ScummVM S60v3"},(0xA0000657),0,13,0
;Supports Series 60 v 3.0 ;Supports Series 60 v 3.0
[0x101F7961], 0, 0, 0, {"Series60ProductID"} [0x101F7961], 0, 0, 0, {"Series60ProductID"}
@ -63,7 +63,7 @@
"..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt" "..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\igor.tbl"-"c:\data\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\igor.tbl"-"c:\data\scummvm\igor.tbl"
"..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat" "..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat"
"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\drascula.dat" "..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\scummvm\drascula.dat"
; Config/log files: 'empty' will automagically be removed on uninstall ; Config/log files: 'empty' will automagically be removed on uninstall
""-"c:\data\scummvm\scummvm.ini",FILENULL ""-"c:\data\scummvm\scummvm.ini",FILENULL

View file

@ -91,6 +91,7 @@ SOURCE backends\platform\symbian\src\ScummApp.cpp
SOURCE gui\Key.cpp SOURCE gui\Key.cpp
SOURCE gui\KeysDialog.cpp SOURCE gui\KeysDialog.cpp
SOURCE gui\Actions.cpp SOURCE gui\Actions.cpp
SOURCE gui\Dialog.cpp
// Special for graphics // Special for graphics
source graphics\iff.cpp source graphics\iff.cpp

View file

@ -28,7 +28,7 @@
;&EN ;&EN
; UID is the app's UID ; UID is the app's UID
#{"ScummVM S80"},(0x101f9b57),0,120,0 #{"ScummVM S80"},(0x101f9b57),0,130,0
; Platform type -- disabled: seems to be causing trouble ; Platform type -- disabled: seems to be causing trouble
;(0x101F8ED2), 0, 0, 0, {"Series80ProductID"} ;(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}

View file

@ -91,6 +91,7 @@ SOURCE backends\platform\symbian\src\ScummApp.cpp
SOURCE gui\Key.cpp SOURCE gui\Key.cpp
SOURCE gui\KeysDialog.cpp SOURCE gui\KeysDialog.cpp
SOURCE gui\Actions.cpp SOURCE gui\Actions.cpp
SOURCE gui\Dialog.cpp
// Special for graphics // Special for graphics
source graphics\iff.cpp source graphics\iff.cpp

View file

@ -28,7 +28,7 @@
;&EN ;&EN
; UID is the app's UID ; UID is the app's UID
#{"ScummVM S90"},(0x101f9b57),0,120,0 #{"ScummVM S90"},(0x101f9b57),0,130,0
; Platform type -- disabled: seems to be causing trouble ; Platform type -- disabled: seems to be causing trouble
;(0x101FBE04), 0, 0, 0, {"Series90ProductID"} ;(0x101FBE04), 0, 0, 0, {"Series90ProductID"}

View file

@ -89,6 +89,7 @@ SOURCE backends\platform\symbian\src\ScummApp.cpp
SOURCE gui\Key.cpp SOURCE gui\Key.cpp
SOURCE gui\KeysDialog.cpp SOURCE gui\KeysDialog.cpp
SOURCE gui\Actions.cpp SOURCE gui\Actions.cpp
SOURCE gui\Dialog.cpp
// Special for graphics // Special for graphics
source graphics\iff.cpp source graphics\iff.cpp

View file

@ -16,7 +16,7 @@
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
; ;
; $URL:$ ; $URL:$
; $Id:$ ; $Id$
; ;
; ;
@ -28,7 +28,7 @@
;&EN ;&EN
; UID is the app's UID ; UID is the app's UID
#{"ScummVM UIQ2"},(0x101f9b57),0,100,0 #{"ScummVM UIQ2"},(0x101f9b57),0,130,0
; Platform type ; Platform type
(0x101F617B), 2, 0, 0, {"UIQ20ProductID"} (0x101F617B), 2, 0, 0, {"UIQ20ProductID"}

View file

@ -6,7 +6,7 @@
;&EN ;&EN
; UID is the app's UID ; UID is the app's UID
#{"ScummVM SE"},(0x101f9b57),0,110,0 #{"ScummVM SE"},(0x101f9b57),0,130,0
; Platform type ; Platform type
(0x101F617B), 2, 0, 0, {"UIQ20ProductID"} (0x101F617B), 2, 0, 0, {"UIQ20ProductID"}

View file

@ -117,6 +117,7 @@ SOURCE backends\platform\symbian\src\ScummApp.cpp
SOURCE gui\Key.cpp SOURCE gui\Key.cpp
SOURCE gui\KeysDialog.cpp SOURCE gui\KeysDialog.cpp
SOURCE gui\Actions.cpp SOURCE gui\Actions.cpp
SOURCE gui\Dialog.cpp
// Special for graphics // Special for graphics
source graphics\iff.cpp source graphics\iff.cpp

Some files were not shown because too many files have changed in this diff Show more