aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Willis2009-07-31 17:10:20 +0000
committerJohn Willis2009-07-31 17:10:20 +0000
commitc51298957864acb8bbc5016ac5131afd2bb9292f (patch)
treef122bf5a2d91193143cff3cadb97da0c42bae5e2
parent4888aa9fa07d5db2f144e7a7d14dfdbe6cb3a772 (diff)
downloadscummvm-rg350-c51298957864acb8bbc5016ac5131afd2bb9292f.tar.gz
scummvm-rg350-c51298957864acb8bbc5016ac5131afd2bb9292f.tar.bz2
scummvm-rg350-c51298957864acb8bbc5016ac5131afd2bb9292f.zip
GP2XWiz: Small cleanup of render code to slave as much of loadGFXMode() code back to the OSystem_SDL::loadGFXMode(). version. Also update README-GP2XWIZ.
svn-id: r42964
-rw-r--r--backends/platform/gp2xwiz/build/README-GP2XWIZ36
-rw-r--r--backends/platform/gp2xwiz/gp2xwiz-graphics.cpp135
-rw-r--r--backends/platform/gp2xwiz/gp2xwiz-scaler.cpp6
-rw-r--r--backends/platform/gp2xwiz/gp2xwiz-scaler.h3
-rw-r--r--backends/platform/sdl/graphics.cpp2
5 files changed, 25 insertions, 157 deletions
diff --git a/backends/platform/gp2xwiz/build/README-GP2XWIZ b/backends/platform/gp2xwiz/build/README-GP2XWIZ
index b085006f54..ec8142a6f3 100644
--- a/backends/platform/gp2xwiz/build/README-GP2XWIZ
+++ b/backends/platform/gp2xwiz/build/README-GP2XWIZ
@@ -11,19 +11,27 @@ Contents:
* Recent changes <#Recent_changes>
* How to save <#How_to_save>
* Controller mappings <#Controller_mappings>
- * Know issues <#Know_issues>
- * Major TODO's <#Major_TODOs>
+ * Known issues <#Knonw_issues>
* Additional resources/links <#Additional_resourceslinks>
* Credits <#Credits>
+------------------------------------------------------------------------
+
+Please refer to the:
+
+GP2X/GP2XWiz ScummVM Forum: <http://forums.scummvm.org/viewforum.php?f=14>
+WiKi: <http://wiki.scummvm.org/index.php/GP2XWiz>
+
+for the most current information on the port and any updates to this
+documentation.
------------------------------------------------------------------------
About the backend/port
-This is the readme for the offficial GP2X WIZ ScummVM backend (also known as
-the GP2X WIZ port).
+This is the readme for the official GP2XWiz ScummVM backend (also known as
+the GP2XWiz port).
-This is an SVN test release of ScummVM for the GP2X WIZ, it would be
+This is an SVN test release of ScummVM for the GP2XWiz, it would be
appreciated if this SVN test distribution was not mirrored and that
people be directed to http://scummvm.distant-earth.com/ instead for
updated SVN builds.
@@ -35,19 +43,12 @@ downloads page <http://www.scummvm.org/downloads.php>.
This build is in an active state of development and as such no
"expected" behavior can be guaranteed ;).
-SVN builds are quickly tested with firmware 1.0.0 for reference.
-
-Please refer to the GP2X/GP2X WIZ ScummVM forum
-<http://forums.scummvm.org/viewforum.php?f=14> and WiKi
-<http://wiki.scummvm.org/index.php/GP2X> for the latest information on
-the port.
-
------------------------------------------------------------------------
Game compatibility
For information on the compatability of a specific game please refer to
-the GP2X compatability section of the ScummVM WiKi
-<http://wiki.scummvm.org/index.php/GP2X#Compatibility_List>.
+the GP2XWiz compatability section of the ScummVM WiKi
+<http://wiki.scummvm.org/index.php/GP2XWiz#Compatibility_List>.
Please note the version and date of the ScummVM build you are running
when reviewing the above list.
@@ -105,19 +106,18 @@ Right Trigger: Return
Select: Escape
Y: Space Bar (Pause)
Menu: Game Menu (Save, Load, Quit etc.)
-Volume Buttons: Increase and Decrease volume (5% per press)
+Volume Buttons: Increase and Decrease volume
Fancy button combos:
NOTE: To use button combos press and hold the Left Trigger then...
Right Trigger: Display Virtual Keyboard
- (or if it VKeybd is disabled 0 (For skipping the copy protection in Monkey Island 2)
Menu: Bring up the Global main menu for ScummVM
Select: Exit ScummVM completely (and gracefully)
------------------------------------------------------------------------
-Know issues
+Known issues
No major known issues
@@ -127,7 +127,7 @@ Additional resources/links
* ScummVM WiKi GP2X page <http://wiki.scummvm.org/index.php/GP2X>
* ScummVM forums GP2X forum
<http://forums.scummvm.org/viewforum.php?f=14>
- * My own ScummVM page <http://www.distant-earth.com/scummvm> (for
+ * My own ScummVM page <http://scummvm.distant-earth.com/> (for
SVN/test builds)
* Main ScummVM site <http://www.scummvm.org> (for official supported
release builds)
diff --git a/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp b/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp
index 0d575b15e8..d036aad232 100644
--- a/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp
+++ b/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp
@@ -35,6 +35,7 @@
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{"1x", "Fullscreen", GFX_NORMAL},
+ {"½x", "Downscale", GFX_HALF},
{0, 0, 0}
};
@@ -47,11 +48,6 @@ int OSystem_GP2XWIZ::getDefaultGraphicsMode() const {
return GFX_NORMAL;
}
-//bool OSystem_GP2XWIZ::setGraphicsMode(const char *name) {
-// // let parent OSystem_SDL handle it
-// return setGraphicsMode(GFX_NORMAL);
-//}
-
bool OSystem_GP2XWIZ::setGraphicsMode(int mode) {
Common::StackLock lock(_graphicsMutex);
@@ -142,135 +138,14 @@ void OSystem_GP2XWIZ::initSize(uint w, uint h) {
}
bool OSystem_GP2XWIZ::loadGFXMode() {
- assert(_inited);
- _forceFull = true;
-
- int hwW, hwH;
- if(_videoMode.mode == GFX_HALF){
- _videoMode.overlayWidth = _videoMode.screenWidth/2;
- _videoMode.overlayHeight = _videoMode.screenHeight/2;
- } else {
- _videoMode.overlayWidth = _videoMode.screenWidth;
- _videoMode.overlayHeight = _videoMode.screenHeight;
- }
+ _videoMode.overlayWidth = 320;
+ _videoMode.overlayHeight = 240;
+ _videoMode.fullscreen = true;
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
_videoMode.aspectRatioCorrection = false;
- if (_videoMode.aspectRatioCorrection)
- _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
-
- if(_videoMode.mode == GFX_HALF){
- hwW = _videoMode.screenWidth/2;
- hwH = effectiveScreenHeight()/2;
- } else {
- hwW = _videoMode.screenWidth;
- hwH = effectiveScreenHeight();
- }
-
- //
- // Create the surface that contains the 8 bit game data
- //
- _screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight, 8, 0, 0, 0, 0);
- if (_screen == NULL)
- error("allocating _screen failed");
-
- //
- // 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
- );
- 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.
-
- if (!_oldVideoMode.setup) {
- warning("SDL_SetVideoMode says we can't switch to that mode (%s)", SDL_GetError());
- quit();
- } else {
- return false;
- }
- }
-
- //
- // Create the surface used for the graphics in 16 bit before scaling, and also the overlay
- //
-
- // Need some extra bytes around when using 2xSaI
- _tmpscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth + 3, _videoMode.screenHeight + 3,
- 16,
- _hwscreen->format->Rmask,
- _hwscreen->format->Gmask,
- _hwscreen->format->Bmask,
- _hwscreen->format->Amask);
-
- if (_tmpscreen == NULL)
- error("allocating _tmpscreen failed");
-
- _overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.overlayWidth, _videoMode.overlayHeight,
- 16,
- _hwscreen->format->Rmask,
- _hwscreen->format->Gmask,
- _hwscreen->format->Bmask,
- _hwscreen->format->Amask);
-
- if (_overlayscreen == NULL)
- error("allocating _overlayscreen failed");
-
- _overlayFormat.bytesPerPixel = _overlayscreen->format->BytesPerPixel;
-
- _overlayFormat.rLoss = _overlayscreen->format->Rloss;
- _overlayFormat.gLoss = _overlayscreen->format->Gloss;
- _overlayFormat.bLoss = _overlayscreen->format->Bloss;
- _overlayFormat.aLoss = _overlayscreen->format->Aloss;
-
- _overlayFormat.rShift = _overlayscreen->format->Rshift;
- _overlayFormat.gShift = _overlayscreen->format->Gshift;
- _overlayFormat.bShift = _overlayscreen->format->Bshift;
- _overlayFormat.aShift = _overlayscreen->format->Ashift;
-
- _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.overlayWidth + 3, _videoMode.overlayHeight + 3,
- 16,
- _hwscreen->format->Rmask,
- _hwscreen->format->Gmask,
- _hwscreen->format->Bmask,
- _hwscreen->format->Amask);
-
- if (_tmpscreen2 == NULL)
- error("allocating _tmpscreen2 failed");
-
-#ifdef USE_OSD
- _osdSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA,
- _hwscreen->w,
- _hwscreen->h,
- 16,
- _hwscreen->format->Rmask,
- _hwscreen->format->Gmask,
- _hwscreen->format->Bmask,
- _hwscreen->format->Amask);
- if (_osdSurface == NULL)
- error("allocating _osdSurface failed");
- SDL_SetColorKey(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kOSDColorKey);
-#endif
-
- // keyboard cursor control, some other better place for it?
- _km.x_max = _videoMode.screenWidth * _videoMode.scaleFactor - 1;
- _km.y_max = effectiveScreenHeight() - 1;
- _km.delay_time = 25;
- _km.last_time = 0;
-
- // Distinguish 555 and 565 mode
- if (_hwscreen->format->Rmask == 0x7C00)
- InitScalers(555);
- else
- InitScalers(565);
-
- // We need this to tell HalfScale the pixel format.
- // TODO: Find a better home.
- screenPixelFormat = _hwscreen->format;
- return true;
+ OSystem_SDL::loadGFXMode();
}
void OSystem_GP2XWIZ::drawMouse() {
diff --git a/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp b/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp
index 774b0b0e11..3a95280eab 100644
--- a/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp
+++ b/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp
@@ -35,10 +35,6 @@ extern "C" {
}
void HalfScale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
- int maskUsed;
- if (screenPixelFormat->Rmask == 0x7C00)
- maskUsed = (gBitFormat == 555);
- else
- maskUsed = (gBitFormat == 565);
+ int maskUsed = (gBitFormat == 565);
PocketPCHalfARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed],roundingconstants[maskUsed]);
}
diff --git a/backends/platform/gp2xwiz/gp2xwiz-scaler.h b/backends/platform/gp2xwiz/gp2xwiz-scaler.h
index 604b9c450b..5867693dfb 100644
--- a/backends/platform/gp2xwiz/gp2xwiz-scaler.h
+++ b/backends/platform/gp2xwiz/gp2xwiz-scaler.h
@@ -36,10 +36,7 @@ enum {
GFX_HALF = 12
};
-extern SDL_PixelFormat *screenPixelFormat;
-
// TODO/FIXME: Move this platform specific scaler into /graphics/scaler and properly merge with the WinCE PocketPCHalf that it is based on.
-
DECLARE_SCALER(HalfScale);
#endif
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 78b8bd8c63..5fe4f12fe3 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -364,7 +364,7 @@ bool OSystem_SDL::loadGFXMode() {
int hwW, hwH;
-#ifndef __MAEMO__
+#if !defined(__MAEMO__) && !defined(GP2XWIZ)
_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;