diff options
author | Travis Howell | 2009-08-11 02:04:17 +0000 |
---|---|---|
committer | Travis Howell | 2009-08-11 02:04:17 +0000 |
commit | 1b47344cc173ae424e84d8b0eea6e4d0c84f506c (patch) | |
tree | e35bc14e03f954917182af94240a655783dc4732 /backends | |
parent | 773c1a270b682ddc845907a605085f2f7d505d1f (diff) | |
parent | 40c58d4ed06b5f6bfa348be34d879c2180c516ec (diff) | |
download | scummvm-rg350-1b47344cc173ae424e84d8b0eea6e4d0c84f506c.tar.gz scummvm-rg350-1b47344cc173ae424e84d8b0eea6e4d0c84f506c.tar.bz2 scummvm-rg350-1b47344cc173ae424e84d8b0eea6e4d0c84f506c.zip |
Merged revisions 43066,43068,43088,43093,43095,43097,43101-43102,43107,43112,43114,43117,43119-43120,43122-43123,43126,43131,43139,43143,43145,43147,43150,43152,43155-43156,43163,43165,43167,43171-43172,43178-43179,43183,43186-43200,43202,43205-43223,43227-43235,43237-43241 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r43066 | dreammaster | 2009-08-05 20:44:37 +1000 (Wed, 05 Aug 2009) | 1 line
Bugfix for music not being stopped when music volume is set to zero
........
r43068 | scott_t | 2009-08-05 23:57:40 +1000 (Wed, 05 Aug 2009) | 1 line
T7G: Fix bug #2831041 by implementing opcode responsible for starting music partway through a video
........
r43088 | knakos | 2009-08-07 04:05:50 +1000 (Fri, 07 Aug 2009) | 1 line
overload showMouse to kill mouse shadows in kyra
........
r43093 | dreammaster | 2009-08-07 19:25:06 +1000 (Fri, 07 Aug 2009) | 1 line
Bugfix for #2831159 - Palace guards saying !!HIGH STRING!!
........
r43095 | knakos | 2009-08-07 20:44:34 +1000 (Fri, 07 Aug 2009) | 1 line
hint backend about virtual keyboard on save, in LoK
........
r43097 | knakos | 2009-08-07 21:05:58 +1000 (Fri, 07 Aug 2009) | 1 line
show VK in gui_v2 games of kyra
........
r43101 | dhewg | 2009-08-08 04:16:58 +1000 (Sat, 08 Aug 2009) | 3 lines
Merge creation of Info.plist into update-version.pl.
This fixes the static version info after branching (#2820503).
........
r43102 | knakos | 2009-08-08 05:33:39 +1000 (Sat, 08 Aug 2009) | 1 line
mouse up events need the same lovin' as mouse down events do. don't underestimate 'em. fixes bug #2833549
........
r43107 | drmccoy | 2009-08-08 12:23:04 +1000 (Sat, 08 Aug 2009) | 1 line
When opening a data stream, don't read the whole file into memory if not necessary. This vastly improves the loading times of Gob3 on small devices
........
r43112 | dreammaster | 2009-08-08 19:34:23 +1000 (Sat, 08 Aug 2009) | 1 line
Commit of dhewg's patch to fix screen refreshes on the Wii
........
r43114 | knakos | 2009-08-08 19:38:12 +1000 (Sat, 08 Aug 2009) | 1 line
forward port of wince 3.0 fix for paths from branch 0.13.0, r39978
........
r43117 | dhewg | 2009-08-08 21:30:56 +1000 (Sat, 08 Aug 2009) | 1 line
tweaked the mapped keys to reintroduce SHIFT for mass adding games
........
r43119 | lordhoto | 2009-08-08 21:42:29 +1000 (Sat, 08 Aug 2009) | 1 line
Add workaround for bug #2820054 "DW1: No intro music at first start on Wii", which actually happened on all systems, when using the multilanguage version.
........
r43120 | lordhoto | 2009-08-08 21:51:15 +1000 (Sat, 08 Aug 2009) | 1 line
Fix for bug #2412336 "DW2: Voices cut off" (commit on behalf of dreammaster)
........
r43122 | lordhoto | 2009-08-08 22:00:34 +1000 (Sat, 08 Aug 2009) | 1 line
Formatting fix.
........
r43123 | lordhoto | 2009-08-08 22:22:34 +1000 (Sat, 08 Aug 2009) | 1 line
Change workaround for bug #2820054 to apply for all GRA versions.
........
r43126 | lordhoto | 2009-08-08 23:57:21 +1000 (Sat, 08 Aug 2009) | 1 line
Fix XMIDI looping implementation. Now for example the music in the ferret village of ITE plays fine.
........
r43131 | sev | 2009-08-09 04:01:44 +1000 (Sun, 09 Aug 2009) | 2 lines
Implement FR#2821534: "GUI: Mute All disable volume sliders"
........
r43139 | sev | 2009-08-09 06:08:22 +1000 (Sun, 09 Aug 2009) | 2 lines
Add DS version of Atari MM from Bug #2834054
........
r43143 | sev | 2009-08-09 06:16:58 +1000 (Sun, 09 Aug 2009) | 2 lines
Patch #2832247: "GMM: Enable loading & deleting of unnamed savegames"
........
r43145 | sev | 2009-08-09 06:49:13 +1000 (Sun, 09 Aug 2009) | 2 lines
Fix bug #2825565: "Unable to select subtitles in Atlantis and Simon 1"
........
r43147 | drmccoy | 2009-08-09 07:43:07 +1000 (Sun, 09 Aug 2009) | 1 line
Changed the scroll-handling to be more like the original. This fixes bug #2832362 ("GOB3: Scrolling locked after cutscene")
........
r43150 | dreammaster | 2009-08-09 11:05:47 +1000 (Sun, 09 Aug 2009) | 1 line
Changed subtitles display speed to also include the time taken to say voice samples (if voices are turned on). This means subtitles will display for the same time irrespective of whether voices are on or not
........
r43152 | Kirben | 2009-08-09 11:20:08 +1000 (Sun, 09 Aug 2009) | 1 line
Fix bug #2834254 - ELVIRA: Buggy scroll arrows when mixing spells.
........
r43155 | dreammaster | 2009-08-09 11:45:39 +1000 (Sun, 09 Aug 2009) | 1 line
Slight adjustment to Spanish font lookup table, based on mac_es's description of character lookup problems
........
r43156 | Kirben | 2009-08-09 11:55:34 +1000 (Sun, 09 Aug 2009) | 1 line
Fix bug #2834252 - ELVIRA1 Problem with 8-character-long save names.
........
r43163 | Kirben | 2009-08-09 17:16:08 +1000 (Sun, 09 Aug 2009) | 1 line
Fix bug #2834260 - ELVIRA1: Graphic glitch when bird takes off.
........
r43165 | Kirben | 2009-08-09 20:28:11 +1000 (Sun, 09 Aug 2009) | 1 line
Fix glitch when removing arrows from spell book in Elvira 1.
........
r43167 | djwillis | 2009-08-09 22:12:24 +1000 (Sun, 09 Aug 2009) | 1 line
GP2X: Commit local version of backend, contains a 'fix' to work around a GP2X SDL 'feature' that was removing the ability to disable aspect ratio correction. Also misc cleanup and changes to default volume levels to cut down on sample clipping.
........
r43171 | dreammaster | 2009-08-09 22:23:01 +1000 (Sun, 09 Aug 2009) | 1 line
Removed redundant code related to Midi handling
........
r43172 | lordhoto | 2009-08-10 01:37:00 +1000 (Mon, 10 Aug 2009) | 1 line
Fix for bug #2834250 "GUI: Incorrect behavior of sliders".
........
r43178 | knakos | 2009-08-10 04:34:08 +1000 (Mon, 10 Aug 2009) | 1 line
removing support for flac (good riddance) and mpeg2
........
r43179 | knakos | 2009-08-10 04:37:29 +1000 (Mon, 10 Aug 2009) | 1 line
update news files for 1.0.0rc1 release
........
r43183 | lordhoto | 2009-08-10 05:11:10 +1000 (Mon, 10 Aug 2009) | 1 line
Cleanup AMIGA graphics conversion.
........
r43186 | lordhoto | 2009-08-10 08:46:25 +1000 (Mon, 10 Aug 2009) | 1 line
Create a "Font" interface and create a "DOSFont" implementation for handling DOS version fonts.
........
r43187 | lordhoto | 2009-08-10 08:46:43 +1000 (Mon, 10 Aug 2009) | 1 line
Add support for the font format used in Kyrandia 1 Amiga. (font colors are wrong though)
........
r43188 | lordhoto | 2009-08-10 09:23:48 +1000 (Mon, 10 Aug 2009) | 1 line
Unbreak basic Kyra1 amiga in game support, by disabling some palette code for the amiga version.
........
r43189 | lordhoto | 2009-08-10 09:32:52 +1000 (Mon, 10 Aug 2009) | 1 line
Clear the destination page for bitmap loading, this fixes graphics artifacts in Kyra1 amiga.
........
r43190 | waltervn | 2009-08-10 11:08:20 +1000 (Mon, 10 Aug 2009) | 3 lines
SCI: Added detection entries for French versions of Eco Quest 1/2 (reported
by Strangerke).
........
r43191 | lordhoto | 2009-08-10 11:32:22 +1000 (Mon, 10 Aug 2009) | 1 line
Disable menu text fading in kyra1 amiga for now.
........
r43192 | lordhoto | 2009-08-10 11:32:39 +1000 (Mon, 10 Aug 2009) | 1 line
Initial support for correct colors in the interface of Kyra1 AMIGA.
........
r43193 | lordhoto | 2009-08-10 11:32:59 +1000 (Mon, 10 Aug 2009) | 1 line
Fix inventory background color.
........
r43194 | lordhoto | 2009-08-10 11:33:18 +1000 (Mon, 10 Aug 2009) | 1 line
Fix text color in character speeches in Kyra1 amiga.
........
r43195 | lordhoto | 2009-08-10 11:33:36 +1000 (Mon, 10 Aug 2009) | 1 line
Fix interface text color.
........
r43196 | lordhoto | 2009-08-10 11:33:56 +1000 (Mon, 10 Aug 2009) | 1 line
Enable interface text fading in Kyra1 amiga again.
........
r43197 | lordhoto | 2009-08-10 11:34:14 +1000 (Mon, 10 Aug 2009) | 1 line
Use interface palette for mouse cursor in Kyra1 amiga, when it's enabled.
........
r43198 | lordhoto | 2009-08-10 11:34:29 +1000 (Mon, 10 Aug 2009) | 1 line
Cleanup.
........
r43199 | lordhoto | 2009-08-10 11:34:46 +1000 (Mon, 10 Aug 2009) | 1 line
Remove dead code.
........
r43200 | lordhoto | 2009-08-10 12:32:19 +1000 (Mon, 10 Aug 2009) | 1 line
Fix bug when setting up mouse cursor with inventory palette.
........
r43202 | athrxx | 2009-08-10 20:25:53 +1000 (Mon, 10 Aug 2009) | 1 line
LOL: fix main menu in floppy version
........
r43205 | lordhoto | 2009-08-10 23:46:17 +1000 (Mon, 10 Aug 2009) | 1 line
Made font color configuration independend from font style configuration.
........
r43206 | lordhoto | 2009-08-11 00:05:14 +1000 (Tue, 11 Aug 2009) | 1 line
Rename 'font_color' attribute for 'text' draw step to 'text_color'.
........
r43207 | lordhoto | 2009-08-11 00:35:28 +1000 (Tue, 11 Aug 2009) | 1 line
Fix copyright string displaying in Kyra1 amiga. Unlike the DOS version it does not use a second print for creating a shadow look.
........
r43208 | lordhoto | 2009-08-11 02:42:39 +1000 (Tue, 11 Aug 2009) | 4 lines
- Fix extraction of Kyra 1 amiga string tables in kyra.dat
- Fix "taken" string offsets in kyra.dat
- Add temporary workaround for only one "taken" string being present in Kyra 1 amiga.
- Update kyra.dat
........
r43209 | lordhoto | 2009-08-11 03:14:03 +1000 (Tue, 11 Aug 2009) | 1 line
Fix GUI strings in Kyrandia 1 Amiga.
........
r43210 | lordhoto | 2009-08-11 03:14:22 +1000 (Tue, 11 Aug 2009) | 1 line
Implement item to item name list index mapping for Kyrandia 1 Amiga.
........
r43211 | lordhoto | 2009-08-11 03:17:19 +1000 (Tue, 11 Aug 2009) | 1 line
Typo.
........
r43212 | lordhoto | 2009-08-11 04:01:28 +1000 (Tue, 11 Aug 2009) | 1 line
Fix GUI font colors and text drawing in Kyrandia 1 Amiga.
........
r43213 | lordhoto | 2009-08-11 04:03:37 +1000 (Tue, 11 Aug 2009) | 1 line
Fix GUI button outline colors in Kyra1 Amiga.
........
r43214 | tramboi | 2009-08-11 04:03:54 +1000 (Tue, 11 Aug 2009) | 2 lines
Option "desired_screen_aspect_ratio" for fullscreen mode in the SDL backend
Shortcoming: the picture is not centered
........
r43215 | lordhoto | 2009-08-11 04:04:53 +1000 (Tue, 11 Aug 2009) | 1 line
Fix GUI menu colors for Kyrandia 1 Amiga.
........
r43216 | lordhoto | 2009-08-11 04:13:01 +1000 (Tue, 11 Aug 2009) | 1 line
Remove unused variables.
........
r43217 | waltervn | 2009-08-11 04:37:47 +1000 (Tue, 11 Aug 2009) | 2 lines
SCI: Improved multilanguage support for SCI1 and SCI1.1.
........
r43218 | waltervn | 2009-08-11 04:43:15 +1000 (Tue, 11 Aug 2009) | 2 lines
SCI: Fix warnings.
........
r43219 | waltervn | 2009-08-11 04:59:59 +1000 (Tue, 11 Aug 2009) | 2 lines
SCI: Fix vmvars debug command.
........
r43220 | lordhoto | 2009-08-11 05:08:00 +1000 (Tue, 11 Aug 2009) | 2 lines
- Fix AMIGA to DOS palette conversion
- Amiga version uses 13 instead of 12 palette buffers
........
r43221 | lordhoto | 2009-08-11 05:09:13 +1000 (Tue, 11 Aug 2009) | 1 line
Fix incorrect converted colors in Kyra1 Amiga speech text color setup.
........
r43222 | lordhoto | 2009-08-11 05:10:11 +1000 (Tue, 11 Aug 2009) | 1 line
Implement differences for Kyrandia 1 Amiga in o1_setCustomPaletteRange.
........
r43223 | sev | 2009-08-11 05:31:08 +1000 (Tue, 11 Aug 2009) | 2 lines
Add support for Italian MM NES
........
r43227 | strangerke | 2009-08-11 06:57:26 +1000 (Tue, 11 Aug 2009) | 1 line
gob - Add a workaround for files (at least in Playtoons) that are tested on CD only, with the '@' symbol
........
r43228 | strangerke | 2009-08-11 06:58:13 +1000 (Tue, 11 Aug 2009) | 1 line
gob - Add 2 files tested and used by Playtoons and Playtoons CK
........
r43229 | waltervn | 2009-08-11 07:30:16 +1000 (Tue, 11 Aug 2009) | 2 lines
SCI: Added several debug command aliases.
........
r43230 | lordhoto | 2009-08-11 08:18:18 +1000 (Tue, 11 Aug 2009) | 1 line
Cleanup.
........
r43231 | lordhoto | 2009-08-11 08:18:33 +1000 (Tue, 11 Aug 2009) | 1 line
Fix o1_makeAmuletAppear for Kyrandia 1 Amiga.
........
r43232 | lordhoto | 2009-08-11 08:18:47 +1000 (Tue, 11 Aug 2009) | 1 line
Fix WSA movies for final sequence of Kyrandia 1 Amiga. (this is just a theoretical fix, the game isn't yet playable till then)
........
r43233 | lordhoto | 2009-08-11 08:54:25 +1000 (Tue, 11 Aug 2009) | 1 line
Proper implementation of o1_fadeSpecialPalette for Kyrandia 1 Amiga.
........
r43234 | lordhoto | 2009-08-11 08:54:45 +1000 (Tue, 11 Aug 2009) | 1 line
Fix cauldron water color in Zanthia's home in Kyrandia 1 Amiga.
........
r43235 | mthreepwood | 2009-08-11 09:01:11 +1000 (Tue, 11 Aug 2009) | 1 line
Provide a better detection method for Indy3 Mac sound effects. This fixes sounds such as the music that plays when Indy uses the whip on the hook in the giant cork. This also is a proper fix for bug #1852635 -- Sound 54 is actually not a sound effect.
........
r43237 | lordhoto | 2009-08-11 09:34:35 +1000 (Tue, 11 Aug 2009) | 1 line
Implement different in Kyrandia 1 Amiga in o1_setFireberryGlowPalette.
........
r43238 | lordhoto | 2009-08-11 09:35:16 +1000 (Tue, 11 Aug 2009) | 1 line
Fix yet another inventory background color glitch in Kyrandia 1 Amiga.
........
r43239 | lordhoto | 2009-08-11 10:14:24 +1000 (Tue, 11 Aug 2009) | 1 line
Fix a little graphics bug in Kyrandia 1 Amiga, when jewels are enabled.
........
r43240 | lordhoto | 2009-08-11 10:14:40 +1000 (Tue, 11 Aug 2009) | 1 line
Disable Kyragem fading for Kyrandia 1 Amiga.
........
r43241 | lordhoto | 2009-08-11 10:14:54 +1000 (Tue, 11 Aug 2009) | 1 line
Fix regression introduced with r41081.
........
svn-id: r43250
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/gp2x/events.cpp | 2 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-common.h | 26 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-hw.cpp | 2 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-mem.cpp | 2 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-mem.h | 1 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x.cpp | 45 | ||||
-rw-r--r-- | backends/platform/gp2x/graphics.cpp | 225 | ||||
-rw-r--r-- | backends/platform/gp2x/module.mk | 2 | ||||
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 60 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 26 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 14 | ||||
-rw-r--r-- | backends/platform/wii/osystem_events.cpp | 22 | ||||
-rw-r--r-- | backends/platform/wince/Makefile | 4 | ||||
-rw-r--r-- | backends/platform/wince/README-WinCE.txt | 14 | ||||
-rw-r--r-- | backends/platform/wince/missing/missing.cpp | 19 | ||||
-rw-r--r-- | backends/platform/wince/wince-sdl.cpp | 25 | ||||
-rw-r--r-- | backends/platform/wince/wince-sdl.h | 1 |
17 files changed, 246 insertions, 244 deletions
diff --git a/backends/platform/gp2x/events.cpp b/backends/platform/gp2x/events.cpp index 8cd034d2d5..bc9a4ff26c 100644 --- a/backends/platform/gp2x/events.cpp +++ b/backends/platform/gp2x/events.cpp @@ -93,7 +93,7 @@ void OSystem_GP2X::fillMouseEvent(Common::Event &event, int x, int y) { if (!_overlayVisible) { event.mouse.x /= _videoMode.scaleFactor; event.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatio) + if (_videoMode.aspectRatioCorrection) event.mouse.y = aspect2Real(event.mouse.y); } } diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index 7341b0646f..4e6421f353 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -42,18 +42,7 @@ namespace Audio { } enum { - GFX_NORMAL = 0, - GFX_DOUBLESIZE = 1, - GFX_TRIPLESIZE = 2, - GFX_2XSAI = 3, - GFX_SUPER2XSAI = 4, - GFX_SUPEREAGLE = 5, - GFX_ADVMAME2X = 6, - GFX_ADVMAME3X = 7, - GFX_HQ2X = 8, - GFX_HQ3X = 9, - GFX_TV2X = 10, - GFX_DOTMATRIX = 11 + GFX_NORMAL = 0 }; @@ -248,7 +237,7 @@ protected: bool setup; bool fullscreen; - bool aspectRatio; + bool aspectRatioCorrection; int mode; int scaleFactor; @@ -274,16 +263,11 @@ protected: bool _modeChanged; int _screenChangeCount; - /** True if aspect ratio correction is enabled. */ - bool _adjustAspectRatio; - - /** True if zoom on mouse is enabled. (only set by > 240 high games) */ + /* True if zoom on mouse is enabled. (only set by > 240 high games) */ bool _adjustZoomOnMouse; - //_adjustZoomOnMouse = false; enum { NUM_DIRTY_RECT = 100, - MAX_MOUSE_W = 80, MAX_MOUSE_H = 80, MAX_SCALING = 3 @@ -332,7 +316,7 @@ protected: // mouse KbdMouse _km; bool _mouseVisible; - bool _mouseDrawn; + bool _mouseNeedsRedraw; byte *_mouseData; SDL_Rect _mouseBackup; MousePos _mouseCurState; @@ -419,7 +403,7 @@ protected: bool saveScreenshot(const char *filename); int effectiveScreenHeight() const { - return (_videoMode.aspectRatio ? real2Aspect(_videoMode.screenHeight) : _videoMode.screenHeight) + return (_videoMode.aspectRatioCorrection ? real2Aspect(_videoMode.screenHeight) : _videoMode.screenHeight) * _videoMode.scaleFactor; } diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp index 38799ea7ad..2dc5b4f579 100644 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ b/backends/platform/gp2x/gp2x-hw.cpp @@ -56,7 +56,7 @@ enum { VOLUME_UP = 2, VOLUME_CHANGE_RATE = 8, VOLUME_MIN = 0, - VOLUME_INITIAL = 70, + VOLUME_INITIAL = 60, VOLUME_MAX = 100 }; diff --git a/backends/platform/gp2x/gp2x-mem.cpp b/backends/platform/gp2x/gp2x-mem.cpp index ec73922bf7..97a34ffb6a 100644 --- a/backends/platform/gp2x/gp2x-mem.cpp +++ b/backends/platform/gp2x/gp2x-mem.cpp @@ -37,7 +37,7 @@ #include <unistd.h> #include <string.h> -#include "gp2x-mem.h" +#include "backends/platform/gp2x/gp2x-mem.h" void SetClock (unsigned c) { diff --git a/backends/platform/gp2x/gp2x-mem.h b/backends/platform/gp2x/gp2x-mem.h index 2b64cdb802..24b2a3f569 100644 --- a/backends/platform/gp2x/gp2x-mem.h +++ b/backends/platform/gp2x/gp2x-mem.h @@ -35,7 +35,6 @@ extern "C" { #endif - // Use Squidge's MMU patch rather then myown (his is neater). // The effect if not that great but cacheing the upper RAM is no bad thing (tm) ;). diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp index 3d416f8415..21a047b345 100644 --- a/backends/platform/gp2x/gp2x.cpp +++ b/backends/platform/gp2x/gp2x.cpp @@ -131,8 +131,6 @@ void OSystem_GP2X::initBackend() { ConfMan.registerDefault("savepath", savePath); - _savefile = new DefaultSaveFileManager(savePath); - #ifdef DUMP_STDOUT // The GP2X has a serial console but most users do not use this so we // output all our STDOUT and STDERR to files for debug purposes. @@ -186,9 +184,9 @@ void OSystem_GP2X::initBackend() { ConfMan.registerDefault("aspect_ratio", true); /* Up default volume values as we use a seperate system level volume anyway. */ - ConfMan.registerDefault("music_volume", 220); - ConfMan.registerDefault("sfx_volume", 220); - ConfMan.registerDefault("speech_volume", 220); + ConfMan.registerDefault("music_volume", 192); + ConfMan.registerDefault("sfx_volume", 192); + ConfMan.registerDefault("speech_volume", 192); ConfMan.registerDefault("autosave_period", 3 * 60); // Trigger autosave every 3 minutes - On low batts 4 mins is about your warning time. memset(&_oldVideoMode, 0, sizeof(_oldVideoMode)); @@ -199,7 +197,7 @@ void OSystem_GP2X::initBackend() { _videoMode.mode = GFX_NORMAL; _videoMode.scaleFactor = 1; _scalerProc = Normal1x; - _videoMode.aspectRatio = ConfMan.getBool("aspect_ratio"); + _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); _scalerType = 0; _modeFlags = 0; _adjustZoomOnMouse = false; @@ -210,17 +208,13 @@ void OSystem_GP2X::initBackend() { _joystick = SDL_JoystickOpen(joystick_num); } + _savefile = new DefaultSaveFileManager(); // Create and hook up the mixer, if none exists yet (we check for this to // allow subclasses to provide their own). if (_mixer == 0) { setupMixer(); } - // Setup the keymapper with backend's set of keys - // NOTE: must be done before creating TimerManager - // to avoid race conditions in creating EventManager - setupKeymapper(); - // Create and hook up the timer manager, if none exists yet (we check for // this to allow subclasses to provide their own). if (_timer == 0) { @@ -241,27 +235,6 @@ void OSystem_GP2X::initBackend() { /* Set Default hardware mixer volume to a preset level (VOLUME_INITIAL). This is done to 'reset' volume level if set by other apps. */ GP2X_HW::mixerMoveVolume(0); - // Set Default hardware mixer volume to a plesent level. - // This is done to 'reset' volume level if set by other apps. - - //if (SDL_GP2X_MouseType() == 0) { - // // No mouse, F100 default state. - // _gp2xInputType = 0; - // displayMessageOnOSD("F100 GP2X Found"); - //} - - //if (SDL_GP2X_MouseType() == 1) { - // // USB mouse found. - // _gp2xInputType = 1; - // displayMessageOnOSD("USB Mouse Found"); - //} - - //if (SDL_GP2X_MouseType() == 2) { - // // F200 touch screen found. - F200 default state. - // _gp2xInputType = 2; - // displayMessageOnOSD("Touch Screen Found"); - //} - OSystem::initBackend(); _inited = true; @@ -275,7 +248,7 @@ OSystem_GP2X::OSystem_GP2X() _overlayscreen(0), _tmpscreen2(0), _samplesPerSec(0), _cdrom(0), _scalerProc(0), _modeChanged(false), _screenChangeCount(0), _dirtyChecksums(0), - _mouseVisible(false), _mouseDrawn(false), _mouseData(0), _mouseSurface(0), + _mouseVisible(false), _mouseNeedsRedraw(false), _mouseData(0), _mouseSurface(0), _mouseOrigSurface(0), _cursorTargetScale(1), _cursorPaletteDisabled(true), _joystick(0), _currentShakePos(0), _newShakePos(0), @@ -434,7 +407,7 @@ bool OSystem_GP2X::getFeatureState(Feature f) { case kFeatureFullscreenMode: return false; case kFeatureAspectRatioCorrection: - return _videoMode.aspectRatio; + return _videoMode.aspectRatioCorrection; case kFeatureAutoComputeDirtyRects: return _modeFlags & DF_WANT_RECT_OPTIM; default: @@ -458,12 +431,12 @@ void OSystem_GP2X::quit() { free(_cursorPalette); free(_mouseData); - delete _savefile; delete _timer; SDL_ShowCursor(SDL_ENABLE); SDL_Quit(); delete getEventManager(); + delete _savefile; #ifdef DUMP_STDOUT printf("%s\n", "Debug: STDOUT and STDERR text files closed."); @@ -610,7 +583,7 @@ void OSystem_GP2X::setupMixer() { _samplesPerSec = SAMPLES_PER_SEC; //Quick EVIL Hack - DJWillis - _samplesPerSec = 11025; +// _samplesPerSec = 11025; // Determine the sample buffer size. We want it to store enough data for // about 1/16th of a second. Note that it must be a power of two. diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp index a77afd88b7..229f840d11 100644 --- a/backends/platform/gp2x/graphics.cpp +++ b/backends/platform/gp2x/graphics.cpp @@ -37,7 +37,7 @@ #include "graphics/surface.h" static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { - {"GP2X Graphics Mode", "1x", GFX_NORMAL}, + {"Fullscreen", "1x", GFX_NORMAL}, {0, 0, 0} }; @@ -50,14 +50,7 @@ static ScalerProc *scalersMagn[3][3] = { }; static const int s_gfxModeSwitchTable[][4] = { - { GFX_NORMAL, GFX_DOUBLESIZE, GFX_TRIPLESIZE, -1 }, - { GFX_NORMAL, GFX_ADVMAME2X, GFX_ADVMAME3X, -1 }, - { GFX_NORMAL, GFX_HQ2X, GFX_HQ3X, -1 }, - { GFX_NORMAL, GFX_2XSAI, -1, -1 }, - { GFX_NORMAL, GFX_SUPER2XSAI, -1, -1 }, - { GFX_NORMAL, GFX_SUPEREAGLE, -1, -1 }, - { GFX_NORMAL, GFX_TV2X, -1, -1 }, - { GFX_NORMAL, GFX_DOTMATRIX, -1, -1 } + { GFX_NORMAL } }; static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY); @@ -95,10 +88,10 @@ OSystem::TransactionError OSystem_GP2X::endGFXTransaction(void) { errors |= kTransactionFullscreenFailed; _videoMode.fullscreen = _oldVideoMode.fullscreen; - } else if (_videoMode.aspectRatio != _oldVideoMode.aspectRatio) { + } else if (_videoMode.aspectRatioCorrection != _oldVideoMode.aspectRatioCorrection) { errors |= kTransactionAspectRatioFailed; - _videoMode.aspectRatio = _oldVideoMode.aspectRatio; + _videoMode.aspectRatioCorrection = _oldVideoMode.aspectRatioCorrection; } else if (_videoMode.mode != _oldVideoMode.mode) { errors |= kTransactionModeSwitchFailed; @@ -114,7 +107,7 @@ OSystem::TransactionError OSystem_GP2X::endGFXTransaction(void) { } if (_videoMode.fullscreen == _oldVideoMode.fullscreen && - _videoMode.aspectRatio == _oldVideoMode.aspectRatio && + _videoMode.aspectRatioCorrection == _oldVideoMode.aspectRatioCorrection && _videoMode.mode == _oldVideoMode.mode && _videoMode.screenWidth == _oldVideoMode.screenWidth && _videoMode.screenHeight == _oldVideoMode.screenHeight) { @@ -190,45 +183,6 @@ bool OSystem_GP2X::setGraphicsMode(int mode) { case GFX_NORMAL: newScaleFactor = 1; break; -#ifndef DISABLE_SCALERS - case GFX_DOUBLESIZE: - newScaleFactor = 2; - break; - case GFX_TRIPLESIZE: - newScaleFactor = 3; - break; - - case GFX_2XSAI: - newScaleFactor = 2; - break; - case GFX_SUPER2XSAI: - newScaleFactor = 2; - break; - case GFX_SUPEREAGLE: - newScaleFactor = 2; - break; - case GFX_ADVMAME2X: - newScaleFactor = 2; - break; - case GFX_ADVMAME3X: - newScaleFactor = 3; - break; -#ifndef DISABLE_HQ_SCALERS - case GFX_HQ2X: - newScaleFactor = 2; - break; - case GFX_HQ3X: - newScaleFactor = 3; - break; -#endif - case GFX_TV2X: - newScaleFactor = 2; - break; - case GFX_DOTMATRIX: - newScaleFactor = 2; - break; -#endif // DISABLE_SCALERS - default: warning("unknown gfx mode %d", mode); return false; @@ -246,7 +200,6 @@ bool OSystem_GP2X::setGraphicsMode(int mode) { return true; } - void OSystem_GP2X::setGraphicsModeIntern() { Common::StackLock lock(_graphicsMutex); ScalerProc *newScalerProc = 0; @@ -255,44 +208,6 @@ void OSystem_GP2X::setGraphicsModeIntern() { case GFX_NORMAL: newScalerProc = Normal1x; break; -#ifndef DISABLE_SCALERS - case GFX_DOUBLESIZE: - newScalerProc = Normal2x; - break; - case GFX_TRIPLESIZE: - newScalerProc = Normal3x; - break; - - case GFX_2XSAI: - newScalerProc = _2xSaI; - break; - case GFX_SUPER2XSAI: - newScalerProc = Super2xSaI; - break; - case GFX_SUPEREAGLE: - newScalerProc = SuperEagle; - break; - case GFX_ADVMAME2X: - newScalerProc = AdvMame2x; - break; - case GFX_ADVMAME3X: - newScalerProc = AdvMame3x; - break; -#ifndef DISABLE_HQ_SCALERS - case GFX_HQ2X: - newScalerProc = HQ2x; - break; - case GFX_HQ3X: - newScalerProc = HQ3x; - break; -#endif - case GFX_TV2X: - newScalerProc = TV2x; - break; - case GFX_DOTMATRIX: - newScalerProc = DotMatrix; - break; -#endif // DISABLE_SCALERS default: error("Unknown gfx mode %d", _videoMode.mode); @@ -353,18 +268,28 @@ bool OSystem_GP2X::loadGFXMode() { _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400) - _videoMode.aspectRatio = false; + _videoMode.aspectRatioCorrection = false; - if (_videoMode.aspectRatio) + if (_videoMode.aspectRatioCorrection) _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); hwW = _videoMode.screenWidth * _videoMode.scaleFactor; - hwH = effectiveScreenHeight(); + + if (_videoMode.screenHeight == 200) { + hwH = 240; + } else if (_videoMode.screenHeight == 400) { + hwH = 480; + } else { + hwH = _videoMode.screenHeight; + } + + printf ("Game Screen Height: %d\n", hwH); // - // Create the surface that contains the 8 bit game data + // Create the surface that contains the game data // - _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, 8, 0, 0, 0, 0); + + _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, hwH, 8, 0, 0, 0, 0); if (_screen == NULL) error("allocating _screen failed"); @@ -372,9 +297,7 @@ bool OSystem_GP2X::loadGFXMode() { // Create the surface that contains the scaled graphics in 16 bit mode // - _hwscreen = SDL_SetVideoMode(hwW, hwH, 16, - _videoMode.fullscreen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE - ); + _hwscreen = SDL_SetVideoMode(hwW, hwH, 16, SDL_SWSURFACE | SDL_NOFRAME | SDL_FULLSCREEN); if (_hwscreen == NULL) { // DON'T use error(), as this tries to bring up the debug // console, which WON'T WORK now that _hwscreen is hosed. @@ -395,12 +318,6 @@ bool OSystem_GP2X::loadGFXMode() { // Create the surface used for the graphics in 16 bit before scaling, and also the overlay // - // Distinguish 555 and 565 mode - if (_hwscreen->format->Rmask == 0x7C00) - InitScalers(555); - else - InitScalers(565); - // Need some extra bytes around when using 2xSaI _tmpscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth + 3, _videoMode.screenHeight + 3, 16, @@ -462,6 +379,12 @@ bool OSystem_GP2X::loadGFXMode() { _km.delay_time = 25; _km.last_time = 0; + // Distinguish 555 and 565 mode + if (_hwscreen->format->Rmask == 0x7C00) + InitScalers(555); + else + InitScalers(565); + return true; } @@ -571,7 +494,7 @@ void OSystem_GP2X::internUpdateScreen() { if (_currentShakePos != _newShakePos) { SDL_Rect blackrect = {0, 0, _videoMode.screenWidth * _videoMode.scaleFactor, _newShakePos * _videoMode.scaleFactor}; - if (_videoMode.aspectRatio && !_overlayVisible) + if (_videoMode.aspectRatioCorrection && !_overlayVisible) blackrect.h = real2Aspect(blackrect.h - 1) + 1; SDL_FillRect(_hwscreen, &blackrect, 0); @@ -627,6 +550,11 @@ void OSystem_GP2X::internUpdateScreen() { scale1 = 1; } + // Add the area covered by the mouse cursor to the list of dirty rects if + // we have to redraw the mouse. + if (_mouseNeedsRedraw) + undrawMouse(); + // Force a full redraw if requested if (_forceFull) { _numDirtyRects = 1; @@ -634,12 +562,10 @@ void OSystem_GP2X::internUpdateScreen() { _dirtyRectList[0].y = 0; _dirtyRectList[0].w = width; _dirtyRectList[0].h = height; - } else - undrawMouse(); + } // Only draw anything if necessary - if (_numDirtyRects > 0) { - + if (_numDirtyRects > 0 || _mouseNeedsRedraw) { SDL_Rect *r; SDL_Rect dst; uint32 srcPitch, dstPitch; @@ -647,7 +573,7 @@ void OSystem_GP2X::internUpdateScreen() { for (r = _dirtyRectList; r != lastRect; ++r) { dst = *r; - dst.x++; // Shift rect by one since 2xSai needs to acces the data around + dst.x++; // Shift rect by one since 2xSai needs to access the data around dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0) @@ -674,7 +600,7 @@ void OSystem_GP2X::internUpdateScreen() { orig_dst_y = dst_y; dst_y = dst_y * scale1; - if (_videoMode.aspectRatio && !_overlayVisible) + if (_videoMode.aspectRatioCorrection && !_overlayVisible) dst_y = real2Aspect(dst_y); assert(scalerProc != NULL); @@ -687,10 +613,8 @@ void OSystem_GP2X::internUpdateScreen() { r->w = r->w * scale1; r->h = dst_h * scale1; -#ifndef DISABLE_SCALERS - if (_videoMode.aspectRatio && orig_dst_y < height && !_overlayVisible) + if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible) r->h = stretch200To240((uint8 *) _hwscreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1); -#endif } SDL_UnlockSurface(srcSurf); SDL_UnlockSurface(_hwscreen); @@ -710,14 +634,11 @@ void OSystem_GP2X::internUpdateScreen() { // Finally, blit all our changes to the screen SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList); - } else { - drawMouse(); - if (_numDirtyRects) - SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList); } _numDirtyRects = 0; _forceFull = false; + _mouseNeedsRedraw = false; } bool OSystem_GP2X::saveScreenshot(const char *filename) { @@ -740,18 +661,14 @@ void OSystem_GP2X::setFullscreenMode(bool enable) { } void OSystem_GP2X::setAspectRatioCorrection(bool enable) { - if ((_videoMode.screenHeight == 200 && _videoMode.aspectRatio != enable) || - _transactionMode == kTransactionActive) { - - Common::StackLock lock(_graphicsMutex); + Common::StackLock lock(_graphicsMutex); - if (_oldVideoMode.setup && _oldVideoMode.aspectRatio == enable) - return; + if (_oldVideoMode.setup && _oldVideoMode.aspectRatioCorrection == enable) + return; - if (_transactionMode == kTransactionActive) { - _videoMode.aspectRatio = enable; - _transactionDetails.needHotswap = true; - } + if (_transactionMode == kTransactionActive) { + _videoMode.aspectRatioCorrection = enable; + _transactionDetails.needHotswap = true; } } @@ -776,12 +693,12 @@ void OSystem_GP2X::copyRectToScreen(const byte *src, int pitch, int x, int y, in Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends -// assert(x >= 0 && x < _screenWidth); -// assert(y >= 0 && y < _screenHeight); -// assert(h > 0 && y + h <= _screenHeight); -// assert(w > 0 && x + w <= _screenWidth); + assert(x >= 0 && x < _videoMode.screenWidth); + assert(y >= 0 && y < _videoMode.screenHeight); + assert(h > 0 && y + h <= _videoMode.screenHeight); + assert(w > 0 && x + w <= _videoMode.screenWidth); - if (((long)src & 3) == 0 && pitch == _videoMode.screenWidth && x == 0 && y == 0 && + if (IS_ALIGNED(src, 4) && pitch == _videoMode.screenWidth && x == 0 && y == 0 && w == _videoMode.screenWidth && h == _videoMode.screenHeight && _modeFlags & DF_WANT_RECT_OPTIM) { /* Special, optimized case for full screen updates. * It tries to determine what areas were actually changed, @@ -923,7 +840,7 @@ void OSystem_GP2X::addDirtyRect(int x, int y, int w, int h, bool realCoordinates h = height - y; } - if (_videoMode.aspectRatio && !_overlayVisible && !realCoordinates) { + if (_videoMode.aspectRatioCorrection && !_overlayVisible && !realCoordinates) { makeRectStretchable(x, y, w, h); } @@ -982,7 +899,7 @@ void OSystem_GP2X::makeChecksums(const byte *buf) { void OSystem_GP2X::addDirtyRgnAuto(const byte *buf) { assert(buf); - assert(((long)buf & 3) == 0); + assert(IS_ALIGNED(buf, 4)); /* generate a table of the checksums */ makeChecksums(buf); @@ -1115,7 +1032,7 @@ void OSystem_GP2X::showOverlay() { // Since resolution could change, put mouse to adjusted position // Fixes bug #1349059 x = _mouseCurState.x * _videoMode.scaleFactor; - if (_videoMode.aspectRatio) + if (_videoMode.aspectRatioCorrection) y = real2Aspect(_mouseCurState.y) * _videoMode.scaleFactor; else y = _mouseCurState.y * _videoMode.scaleFactor; @@ -1139,7 +1056,7 @@ void OSystem_GP2X::hideOverlay() { // Fixes bug #1349059 x = _mouseCurState.x / _videoMode.scaleFactor; y = _mouseCurState.y / _videoMode.scaleFactor; - if (_videoMode.aspectRatio) + if (_videoMode.aspectRatioCorrection) y = aspect2Real(y); warpMouse(x, y); @@ -1172,7 +1089,7 @@ void OSystem_GP2X::clearOverlay() { (byte *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.screenWidth, _videoMode.screenHeight); #ifndef DISABLE_SCALERS - if (_videoMode.aspectRatio) + if (_videoMode.aspectRatioCorrection) stretch200To240((uint8 *)_overlayscreen->pixels, _overlayscreen->pitch, _videoMode.overlayWidth, _videoMode.screenHeight * _videoMode.scaleFactor, 0, 0, 0); #endif @@ -1259,12 +1176,14 @@ bool OSystem_GP2X::showMouse(bool visible) { bool last = _mouseVisible; _mouseVisible = visible; + _mouseNeedsRedraw = true; return last; } void OSystem_GP2X::setMousePos(int x, int y) { if (x != _mouseCurState.x || y != _mouseCurState.y) { + _mouseNeedsRedraw = true; _mouseCurState.x = x; _mouseCurState.y = y; } @@ -1273,7 +1192,7 @@ void OSystem_GP2X::setMousePos(int x, int y) { void OSystem_GP2X::warpMouse(int x, int y) { int y1 = y; - if (_adjustAspectRatio && !_overlayVisible) + if (_videoMode.aspectRatioCorrection && !_overlayVisible) y1 = real2Aspect(y); if (_mouseCurState.x != x || _mouseCurState.y != y) { @@ -1342,6 +1261,8 @@ void OSystem_GP2X::blitCursor() { if (!_mouseOrigSurface || !_mouseData) return; + _mouseNeedsRedraw = true; + w = _mouseCurState.w; h = _mouseCurState.h; @@ -1422,7 +1343,7 @@ void OSystem_GP2X::blitCursor() { int rH1 = rH; // store original to pass to aspect-correction function later - if (_videoMode.aspectRatio && _cursorTargetScale == 1) { + if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) { rH = real2Aspect(rH - 1) + 1; _mouseCurState.rHotY = real2Aspect(_mouseCurState.rHotY); } @@ -1453,20 +1374,17 @@ void OSystem_GP2X::blitCursor() { ScalerProc *scalerProc; - // If possible, use the same scaler for the cursor as for the rest of - // the game. This only works well with the non-blurring scalers so we - // actually only use the 1x, 1.5x, 2x and AdvMame scalers. - - if (_cursorTargetScale == 1 && (_videoMode.mode == GFX_DOUBLESIZE || _videoMode.mode == GFX_TRIPLESIZE)) - scalerProc = _scalerProc; - else + if (_cursorTargetScale == 1 && _videoMode.screenWidth > 320) { + scalerProc = scalersMagn[_cursorTargetScale + 1][_videoMode.scaleFactor + 1]; + } else { scalerProc = scalersMagn[_cursorTargetScale - 1][_videoMode.scaleFactor - 1]; + } scalerProc((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2, _mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch, _mouseCurState.w, _mouseCurState.h); - if (_videoMode.aspectRatio && _cursorTargetScale == 1) + if (_videoMode.aspectRatioCorrection && _cursorTargetScale == 1) cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, rW, rH1, 0, 0, 0); SDL_UnlockSurface(_mouseSurface); @@ -1506,9 +1424,8 @@ void OSystem_GP2X::undrawMouse() { // When we switch bigger overlay off mouse jumps. Argh! // This is intended to prevent undrawing offscreen mouse - if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) { + if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) return; - } if (_mouseBackup.w != 0 && _mouseBackup.h != 0) addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); @@ -1575,7 +1492,7 @@ void OSystem_GP2X::drawMouse() { dst.y += _currentShakePos; } - if (_videoMode.aspectRatio && !_overlayVisible) + if (_videoMode.aspectRatioCorrection && !_overlayVisible) dst.y = real2Aspect(dst.y); dst.x = scale * dst.x - _mouseCurState.rHotX; @@ -1584,7 +1501,6 @@ void OSystem_GP2X::drawMouse() { dst.h = _mouseCurState.rH; // Hacking about with the zoom around mouse pointer stuff. - if (_adjustZoomOnMouse == true){ zoomdst.w = (tmpScreenWidth / 2); @@ -1623,7 +1539,6 @@ void OSystem_GP2X::drawMouse() { SDL_GP2X_Display(&zoomdst); }; - // Note that SDL_BlitSurface() and addDirtyRect() will both perform any // clipping necessary @@ -1730,10 +1645,10 @@ void OSystem_GP2X::handleScalerHotkeys(const SDL_KeyboardEvent &key) { // Ctrl-Alt-a toggles aspect ratio correction if (key.keysym.sym == 'a') { beginGFXTransaction(); - setFeatureState(kFeatureAspectRatioCorrection, !_videoMode.aspectRatio); + setFeatureState(kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection); endGFXTransaction(); char buffer[128]; - if (_videoMode.aspectRatio) + if (_videoMode.aspectRatioCorrection) sprintf(buffer, "Enabled aspect ratio correction\n%d x %d -> %d x %d", _videoMode.screenWidth, _videoMode.screenHeight, _hwscreen->w, _hwscreen->h diff --git a/backends/platform/gp2x/module.mk b/backends/platform/gp2x/module.mk index 58dfd24ee6..50a771219a 100644 --- a/backends/platform/gp2x/module.mk +++ b/backends/platform/gp2x/module.mk @@ -6,8 +6,6 @@ MODULE_OBJS := \ events.o \ graphics.o \ gp2x.o \ -# gp2x-options.o \ -# overload_help.o \ MODULE_DIRS += \ backends/platform/gp2x/ diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 8768dd90d4..efcade834d 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -475,12 +475,54 @@ void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) _dirtyChecksums = (uint32 *)calloc(_cksumNum * 2, sizeof(uint32)); } + +static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &width, int &height) { + assert(&width != &height); + + if (desiredAspectRatio.isAuto()) + return; + + int kw = desiredAspectRatio.kw(); + int kh = desiredAspectRatio.kh(); + + const int w = width; + const int h = height; + + SDL_Rect const* const*availableModes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_SWSURFACE); //TODO : Maybe specify a pixel format + assert(availableModes); + + const SDL_Rect *bestMode = NULL; + uint bestMetric = (uint)-1; // Metric is wasted space + while (const SDL_Rect *mode = *availableModes++) { + if (mode->w < w) + continue; + if (mode->h < h) + continue; + if (mode->h * kw != mode->w * kh) + continue; + //printf("%d %d\n", mode->w, mode->h); + + uint metric = mode->w * mode->h - w * h; + if (metric > bestMetric) + continue; + + bestMetric = metric; + bestMode = mode; + } + + if (!bestMode) { + warning("Unable to enforce the desired aspect ratio!"); + return; + } + //printf("%d %d\n", bestMode->w, bestMode->h); + width = bestMode->w; + height = bestMode->h; +} + bool OSystem_SDL::loadGFXMode() { assert(_inited); _forceFull = true; - int hwW, hwH; - #if !defined(__MAEMO__) && !defined(GP2XWIZ) _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor; _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor; @@ -491,11 +533,11 @@ bool OSystem_SDL::loadGFXMode() { if (_videoMode.aspectRatioCorrection) _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight); - hwW = _videoMode.screenWidth * _videoMode.scaleFactor; - hwH = effectiveScreenHeight(); + _videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor; + _videoMode.hardwareHeight = effectiveScreenHeight(); #else - hwW = _videoMode.overlayWidth; - hwH = _videoMode.overlayHeight; + _videoMode.hardwareWidth = _videoMode.overlayWidth; + _videoMode.hardwareHeight = _videoMode.overlayHeight; #endif // @@ -521,7 +563,11 @@ bool OSystem_SDL::loadGFXMode() { // Create the surface that contains the scaled graphics in 16 bit mode // - _hwscreen = SDL_SetVideoMode(hwW, hwH, 16, + if(_videoMode.fullscreen) { + fixupResolutionForAspectRatio(_videoMode.desiredAspectRatio, _videoMode.hardwareWidth, _videoMode.hardwareHeight); + } + + _hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 16, _videoMode.fullscreen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE ); if (_hwscreen == NULL) { diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 5abeff3902..b6b46af9d7 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -85,6 +85,31 @@ static Uint32 timer_handler(Uint32 interval, void *param) { return interval; } +AspectRatio::AspectRatio(int w, int h) { + // TODO : Validation and so on... + // Currently, we just ensure the program don't instantiate non-supported aspect ratios + _kw = w; + _kh = h; +} + +static const size_t AR_COUNT = 4; +static const char* desiredAspectRatioAsStrings[AR_COUNT] = { "auto", "4/3", "16/9", "16/10" }; +static const AspectRatio desiredAspectRatios[AR_COUNT] = { AspectRatio(0, 0), AspectRatio(4,3), AspectRatio(16,9), AspectRatio(16,10) }; +static AspectRatio getDesiredAspectRatio() { + //TODO : We could parse an arbitrary string, if we code enough proper validation + Common::String desiredAspectRatio = ConfMan.get("desired_screen_aspect_ratio"); + + for (size_t i = 0; i < AR_COUNT; i++) { + assert(desiredAspectRatioAsStrings[i] != NULL); + + if (!scumm_stricmp(desiredAspectRatio.c_str(), desiredAspectRatioAsStrings[i])) { + return desiredAspectRatios[i]; + } + } + // TODO : Report a warning + return AspectRatio(0, 0); +} + void OSystem_SDL::initBackend() { assert(!_inited); @@ -124,6 +149,7 @@ void OSystem_SDL::initBackend() { _videoMode.mode = GFX_DOUBLESIZE; _videoMode.scaleFactor = 2; _videoMode.aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); + _videoMode.desiredAspectRatio = getDesiredAspectRatio(); _scalerProc = Normal2x; #else // for small screen platforms _videoMode.mode = GFX_NORMAL; diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 3e074a884a..6c8a721701 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -70,6 +70,18 @@ enum { GFX_DOTMATRIX = 11 }; +class AspectRatio { + int _kw, _kh; +public: + AspectRatio() { _kw = _kh = 0; } + AspectRatio(int w, int h); + + bool isAuto() const { return (_kw | _kh) == 0; } + + int kw() const { return _kw; } + int kh() const { return _kh; } +}; + class OSystem_SDL : public BaseBackend { public: @@ -284,6 +296,7 @@ protected: bool fullscreen; bool aspectRatioCorrection; + AspectRatio desiredAspectRatio; int mode; int scaleFactor; @@ -293,6 +306,7 @@ protected: #ifdef ENABLE_RGB_COLOR Graphics::PixelFormat format; #endif + int hardwareWidth, hardwareHeight; }; VideoState _videoMode, _oldVideoMode; diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp index f28e5b547b..0967db1625 100644 --- a/backends/platform/wii/osystem_events.cpp +++ b/backends/platform/wii/osystem_events.cpp @@ -316,13 +316,13 @@ bool OSystem_Wii::pollEvent(Common::Event &event) { #endif if (bd || bu) { - PAD_EVENT(PADS_Z, Common::KEYCODE_RETURN, Common::ASCII_RETURN, 0); - PAD_EVENT(PADS_X, Common::KEYCODE_ESCAPE, Common::ASCII_ESCAPE, 0); - PAD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.', 0); - PAD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5, 0); - PAD_EVENT(PADS_UP, Common::KEYCODE_F5, Common::ASCII_F5, Common::KBD_CTRL); - PAD_EVENT(PADS_DOWN, Common::KEYCODE_F7, Common::ASCII_F7, 0); - //PAD_EVENT(PADS_LEFT, Common::KEYCODE_F8, Common::ASCII_F8, 0); + byte flags = 0; + + if (bh & PADS_UP) { + PAD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5, Common::KBD_CTRL); + + flags = Common::KBD_SHIFT; + } if (bd & PADS_RIGHT) { event.type = Common::EVENT_PREDICTIVE_DIALOG; @@ -330,6 +330,14 @@ bool OSystem_Wii::pollEvent(Common::Event &event) { return true; } + PAD_EVENT(PADS_Z, Common::KEYCODE_RETURN, Common::ASCII_RETURN, flags); + PAD_EVENT(PADS_X, Common::KEYCODE_ESCAPE, Common::ASCII_ESCAPE, flags); + PAD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.', flags); + PAD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5, flags); + PAD_EVENT(PADS_UP, Common::KEYCODE_LSHIFT, 0, flags); + PAD_EVENT(PADS_DOWN, Common::KEYCODE_F7, Common::ASCII_F7, flags); + //PAD_EVENT(PADS_LEFT, Common::KEYCODE_F8, Common::ASCII_F8, 0); + if ((bd | bu) & (PADS_A | PADS_B)) { if (bd & PADS_A) event.type = Common::EVENT_LBUTTONDOWN; diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile index acade8ac9a..49101dcb27 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -50,10 +50,10 @@ ENABLE_MADE = STATIC_PLUGIN ## Pick which libraries you want to use here USE_MAD = 1 -USE_MPEG2 = 1 +#USE_MPEG2 = 1 #USE_TREMOR = 1 USE_TREMOLO = 1 -USE_FLAC = 1 +#USE_FLAC = 1 USE_ZLIB = 1 ######################################################################## diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt index 5b3215e34e..21c62fb47f 100644 --- a/backends/platform/wince/README-WinCE.txt +++ b/backends/platform/wince/README-WinCE.txt @@ -1,6 +1,6 @@ ScummVM Windows CE FAQ Last updated: $Date$ -Release version: 0.13.0 +Release version: 1.0.0rc1 ------------------------------------------------------------------------ New in this version @@ -20,6 +20,18 @@ Be aware that Discworld 2 tries to allocate a big chunk of memory (10 MB) and this will fail on many devices (file under the not enough memory category). +From this version on, we're dropping support for FLAC and MPEG-2. The first +is a pain to maintain, while the second has been gradually phased out in +scummvm. Be sure to update your add-on packs and/or recompress your sound. + +This is still a 2-binary distribution. Here's what engines are compiled in +the two executables: +scummvm1.exe: + - scumm, sword1, sword2, queen, sky, lure, agi, touche, tinsel, cruise +scummvm2.exe: + - gob, cine, saga, kyra, agos, parallaction, drascula, groovie, tucker, made + + ------------------------------------------------------------------------ This document is intended to give common answers to specific ScummVM diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp index ac93e8f714..2d9765b0f2 100644 --- a/backends/platform/wince/missing/missing.cpp +++ b/backends/platform/wince/missing/missing.cpp @@ -42,6 +42,7 @@ #endif #include "time.h" #include "dirent.h" +#include "common/debug.h" char *strdup(const char *strSource); @@ -182,11 +183,19 @@ int _access(const char *path, int mode) { HANDLE h = FindFirstFile(fname, &ffd); FindClose(h); - if (h == INVALID_HANDLE_VALUE) - return -1; //Can't find file + if (h == INVALID_HANDLE_VALUE) { + // WORKAROUND: WinCE 3.0 doesn't find paths ending in '\' + if (path[strlen(path)-1] == '\\') { + char p2[MAX_PATH]; + strncpy(p2, path, strlen(path)-1); + p2[strlen(path) - 1]= '\0'; + return _access(p2, mode); + } else + return -1; //Can't find file + } - if (ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) { - // WORKAROUND: WinCE (or the emulator) sometimes returns bogus direcotry + if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + // WORKAROUND: WinCE (or the emulator) sometimes returns bogus directory // hits for files that don't exist. TRIPLE checking for the same fname // seems to weed out those false positives. // Exhibited in kyra engine. @@ -206,7 +215,7 @@ int _access(const char *path, int mode) { return 0; case 06: //Check Read & Write permission case 02: //Check Write permission - return ffd.dwFileAttributes&FILE_ATTRIBUTE_READONLY?-1:0; + return ffd.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? -1 : 0; case 04: //Check Read permission return 0; //Assume always have read permission } diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 5d75b76805..65082014da 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -1934,8 +1934,7 @@ void OSystem_WINCE3::setMouseCursor(const byte *buf, uint w, uint h, int hotspot _mouseData = (byte *) malloc(w * h); memcpy(_mouseData, buf, w * h); - if (w > _mouseBackupDim || h > _mouseBackupDim) - { + if (w > _mouseBackupDim || h > _mouseBackupDim) { // mouse has been undrawn, adjust sprite backup area free(_mouseBackupOld); free(_mouseBackupToolbar); @@ -2050,7 +2049,6 @@ void OSystem_WINCE3::undrawMouse() { if (_mouseNeedsRedraw) return; - _mouseNeedsRedraw = true; int old_mouse_x = _mouseCurState.x - _mouseHotspotX; int old_mouse_y = _mouseCurState.y - _mouseHotspotY; @@ -2101,6 +2099,22 @@ void OSystem_WINCE3::undrawMouse() { addDirtyRect(old_mouse_x, old_mouse_y, old_mouse_w, old_mouse_h); SDL_UnlockSurface(_overlayVisible ? _overlayscreen : _screen); + + _mouseNeedsRedraw = true; +} + +bool OSystem_WINCE3::showMouse(bool visible) { + if (_mouseVisible == visible) + return visible; + + if (visible == false) + undrawMouse(); + + bool last = _mouseVisible; + _mouseVisible = visible; + _mouseNeedsRedraw = true; + + return last; } void OSystem_WINCE3::drawToolbarMouse(SDL_Surface *surf, bool draw) { @@ -2457,9 +2471,12 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) { } if (_toolbarHandler.action(event.mouse.x, event.mouse.y, false)) { - if (!_toolbarHandler.drawn()) + if (!_toolbarHandler.drawn()) { _toolbarHighDrawn = false; internUpdateScreen(); + } + return false; + } return true; diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index cc2948f93d..deafde6d80 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -94,6 +94,7 @@ public: void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale); // overloaded by CE backend void undrawMouse(); void blitCursor(); + bool showMouse(bool visible); void setMousePos(int x, int y); void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); // overloaded by CE backend (FIXME) void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); |