[Scummvm-cvs-logs] SF.net SVN: scummvm:[42964] scummvm/trunk/backends/platform

djwillis at users.sourceforge.net djwillis at users.sourceforge.net
Fri Jul 31 19:10:21 CEST 2009


Revision: 42964
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42964&view=rev
Author:   djwillis
Date:     2009-07-31 17:10:20 +0000 (Fri, 31 Jul 2009)

Log Message:
-----------
GP2XWiz: Small cleanup of render code to slave as much of loadGFXMode() code back to the OSystem_SDL::loadGFXMode(). version. Also update README-GP2XWIZ.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/gp2xwiz/build/README-GP2XWIZ
    scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp
    scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp
    scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.h
    scummvm/trunk/backends/platform/sdl/graphics.cpp

Modified: scummvm/trunk/backends/platform/gp2xwiz/build/README-GP2XWIZ
===================================================================
--- scummvm/trunk/backends/platform/gp2xwiz/build/README-GP2XWIZ	2009-07-31 15:20:02 UTC (rev 42963)
+++ scummvm/trunk/backends/platform/gp2xwiz/build/README-GP2XWIZ	2009-07-31 17:10:20 UTC (rev 42964)
@@ -11,19 +11,27 @@
     * 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 @@
 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 @@
 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 @@
     * 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)

Modified: scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp	2009-07-31 15:20:02 UTC (rev 42963)
+++ scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-graphics.cpp	2009-07-31 17:10:20 UTC (rev 42964)
@@ -35,6 +35,7 @@
 
 static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
 	{"1x", "Fullscreen", GFX_NORMAL},
+	{"\xBDx", "Downscale", GFX_HALF},
 	{0, 0, 0}
 };
 
@@ -47,11 +48,6 @@
 	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 @@
 }
 
 bool OSystem_GP2XWIZ::loadGFXMode() {
-	assert(_inited);
-	_forceFull = true;
+	_videoMode.overlayWidth = 320;
+	_videoMode.overlayHeight = 240;
+	_videoMode.fullscreen = 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;
-    }
-
 	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() {

Modified: scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp
===================================================================
--- scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp	2009-07-31 15:20:02 UTC (rev 42963)
+++ scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.cpp	2009-07-31 17:10:20 UTC (rev 42964)
@@ -35,10 +35,6 @@
 }
 
 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]);
 }

Modified: scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.h
===================================================================
--- scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.h	2009-07-31 15:20:02 UTC (rev 42963)
+++ scummvm/trunk/backends/platform/gp2xwiz/gp2xwiz-scaler.h	2009-07-31 17:10:20 UTC (rev 42964)
@@ -36,10 +36,7 @@
     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

Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp	2009-07-31 15:20:02 UTC (rev 42963)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp	2009-07-31 17:10:20 UTC (rev 42964)
@@ -364,7 +364,7 @@
 
 	int hwW, hwH;
 
-#ifndef __MAEMO__
+#if !defined(__MAEMO__) && !defined(GP2XWIZ)
 	_videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
 	_videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list