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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Apr 12 09:28:55 CEST 2010


Revision: 48634
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48634&view=rev
Author:   fingolfin
Date:     2010-04-12 07:28:54 +0000 (Mon, 12 Apr 2010)

Log Message:
-----------
PSP: Fix code formatting using astyle

Modified Paths:
--------------
    scummvm/trunk/backends/fs/psp/psp-fs.cpp
    scummvm/trunk/backends/fs/psp/psp-stream.cpp
    scummvm/trunk/backends/fs/psp/psp-stream.h
    scummvm/trunk/backends/platform/psp/cursor.cpp
    scummvm/trunk/backends/platform/psp/cursor.h
    scummvm/trunk/backends/platform/psp/default_display_client.cpp
    scummvm/trunk/backends/platform/psp/default_display_client.h
    scummvm/trunk/backends/platform/psp/display_client.cpp
    scummvm/trunk/backends/platform/psp/display_client.h
    scummvm/trunk/backends/platform/psp/display_manager.cpp
    scummvm/trunk/backends/platform/psp/display_manager.h
    scummvm/trunk/backends/platform/psp/elf32.h
    scummvm/trunk/backends/platform/psp/input.cpp
    scummvm/trunk/backends/platform/psp/input.h
    scummvm/trunk/backends/platform/psp/memory.cpp
    scummvm/trunk/backends/platform/psp/memory.h
    scummvm/trunk/backends/platform/psp/osys_psp.cpp
    scummvm/trunk/backends/platform/psp/osys_psp.h
    scummvm/trunk/backends/platform/psp/powerman.cpp
    scummvm/trunk/backends/platform/psp/powerman.h
    scummvm/trunk/backends/platform/psp/psp_main.cpp
    scummvm/trunk/backends/platform/psp/pspkeyboard.cpp
    scummvm/trunk/backends/platform/psp/pspkeyboard.h
    scummvm/trunk/backends/platform/psp/psploader.cpp
    scummvm/trunk/backends/platform/psp/psppixelformat.cpp
    scummvm/trunk/backends/platform/psp/psppixelformat.h
    scummvm/trunk/backends/platform/psp/trace.cpp
    scummvm/trunk/backends/platform/psp/trace.h

Modified: scummvm/trunk/backends/fs/psp/psp-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/psp/psp-fs.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/fs/psp/psp-fs.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -100,10 +100,10 @@
 	_isDirectory = true;
 
 	PSP_DEBUG_PRINT_FUNC("path [%s]\n", _path.c_str());
-	
+
 	if (verify) {
 		struct stat st;
-		if (PowerMan.beginCriticalSection()==PowerManager::Blocked)
+		if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 			PSP_DEBUG_PRINT_FUNC("Suspended\n");
 		_isValid = (0 == stat(_path.c_str(), &st));
 		PowerMan.endCriticalSection();
@@ -120,7 +120,7 @@
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");	// Make sure to block in case of suspend
 
 	PSP_DEBUG_PRINT_FUNC("path [%s]\n", _path.c_str());
-		
+
 	ret = access(_path.c_str(), F_OK);
 	PowerMan.endCriticalSection();
 
@@ -135,8 +135,8 @@
 	if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");	// Make sure to block in case of suspend
 
-	PSP_DEBUG_PRINT_FUNC("path [%s]\n", _path.c_str());	
-		
+	PSP_DEBUG_PRINT_FUNC("path [%s]\n", _path.c_str());
+
 	ret = access(_path.c_str(), R_OK);
 	PowerMan.endCriticalSection();
 
@@ -152,7 +152,7 @@
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");	// Make sure to block in case of suspend
 
 	PSP_DEBUG_PRINT_FUNC("path [%s]\n", _path.c_str());
-		
+
 	ret = access(_path.c_str(), W_OK);
 	PowerMan.endCriticalSection();
 
@@ -173,9 +173,9 @@
 	newPath += n;
 
 	PSP_DEBUG_PRINT_FUNC("child [%s]\n", newPath.c_str());
-	
+
 	AbstractFSNode *node = new PSPFilesystemNode(newPath, true);
-	
+
 	DEBUG_EXIT_FUNC();
 	return node;
 }
@@ -191,8 +191,8 @@
 	if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");	// Make sure to block in case of suspend
 
-	PSP_DEBUG_PRINT_FUNC("Current path[%s]\n", _path.c_str());	
-		
+	PSP_DEBUG_PRINT_FUNC("Current path[%s]\n", _path.c_str());
+
 	int dfd  = sceIoDopen(_path.c_str());
 	if (dfd > 0) {
 		SceIoDirent dir;
@@ -215,12 +215,12 @@
 
 			entry._path = newPath;
 			entry._isDirectory = dir.d_stat.st_attr & FIO_SO_IFDIR;
-			
-			PSP_DEBUG_PRINT_FUNC("Child[%s], %s\n", entry._path.c_str(), entry._isDirectory ? "dir" : "file");	
-			
+
+			PSP_DEBUG_PRINT_FUNC("Child[%s], %s\n", entry._path.c_str(), entry._isDirectory ? "dir" : "file");
+
 			// Honor the chosen mode
 			if ((mode == Common::FSNode::kListFilesOnly && entry._isDirectory) ||
-			   (mode == Common::FSNode::kListDirectoriesOnly && !entry._isDirectory))
+			        (mode == Common::FSNode::kListDirectoriesOnly && !entry._isDirectory))
 				continue;
 
 			myList.push_back(new PSPFilesystemNode(entry));
@@ -233,7 +233,7 @@
 	}
 
 	PowerMan.endCriticalSection();
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
@@ -243,8 +243,8 @@
 	if (_path == ROOT_PATH)
 		return 0;
 
-	PSP_DEBUG_PRINT_FUNC("current[%s]\n", _path.c_str());	
-		
+	PSP_DEBUG_PRINT_FUNC("current[%s]\n", _path.c_str());
+
 	const char *start = _path.c_str();
 	const char *end = lastPathComponent(_path, '/');
 

Modified: scummvm/trunk/backends/fs/psp/psp-stream.cpp
===================================================================
--- scummvm/trunk/backends/fs/psp/psp-stream.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/fs/psp/psp-stream.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -38,9 +38,9 @@
 #include "backends/platform/psp/trace.h"
 
 PSPIoStream::PSPIoStream(const Common::String &path, bool writeMode)
-: StdioStream((void *)1), _path(path), _writeMode(writeMode) {
+		: StdioStream((void *)1), _path(path), _writeMode(writeMode) {
 	DEBUG_ENTER_FUNC();
-	
+
 	assert(!path.empty());
 
 	_handle = (void *)0;		// Need to do this since base class asserts not 0.
@@ -54,23 +54,23 @@
 	_errorPos = 0;
 	_errorHandle = 0;
 	_suspendCount = 0;
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 PSPIoStream::~PSPIoStream() {
 	DEBUG_ENTER_FUNC();
-	
+
 	if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");
 
 	PowerMan.unregisterSuspend(this); // Unregister with powermanager to be suspended
-									  // Must do this before fclose() or resume() will reopen.
+	// Must do this before fclose() or resume() will reopen.
 
 	fclose((FILE *)_handle);	// We don't need a critical section(?). Worst case, the handle gets closed on its own
 
 	PowerMan.endCriticalSection();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -98,7 +98,7 @@
 	DEBUG_ENTER_FUNC();
 	if (_ferror)
 		PSP_ERROR("mem_ferror[%d], source[%d], suspend error[%d], pos[%d], _errorPos[%d], _errorHandle[%p], suspendCount[%d]\n",
-			_ferror, _errorSource, _errorSuspend, _pos, _errorPos, _errorHandle, _suspendCount);
+		          _ferror, _errorSource, _errorSuspend, _pos, _errorPos, _errorHandle, _suspendCount);
 
 	DEBUG_EXIT_FUNC();
 	return _ferror;
@@ -142,7 +142,7 @@
 
 bool PSPIoStream::seek(int32 offs, int whence) {
 	DEBUG_ENTER_FUNC();
-	
+
 	// Check if we can access the file
 	if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");
@@ -155,8 +155,7 @@
 		clearerr((FILE *)_handle);
 		_feof = feof((FILE *)_handle);
 		_errorSource = 3;
-	}
-	else {					// everything ok
+	} else {					// everything ok
 		_feof = false;		// Reset eof flag since we know it was ok
 	}
 
@@ -173,7 +172,7 @@
 	// Check if we can access the file
 	if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");
-		
+
 	PSP_DEBUG_PRINT_FUNC("filename[%s], len[%d]\n", _path.c_str(), len);
 
 	size_t ret = fread((byte *)ptr, 1, len, (FILE *)_handle);
@@ -203,8 +202,8 @@
 	if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
 		PSP_DEBUG_PRINT_FUNC("Suspended\n");
 
-	PSP_DEBUG_PRINT_FUNC("filename[%s], len[%d]\n", _path.c_str(), len);	
-		
+	PSP_DEBUG_PRINT_FUNC("filename[%s], len[%d]\n", _path.c_str(), len);
+
 	size_t ret = fwrite(ptr, 1, len, (FILE *)_handle);
 
 	_pos += ret;
@@ -255,7 +254,7 @@
 		delete stream;
 		stream = 0;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 	return stream;
 }

Modified: scummvm/trunk/backends/fs/psp/psp-stream.h
===================================================================
--- scummvm/trunk/backends/fs/psp/psp-stream.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/fs/psp/psp-stream.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -55,7 +55,7 @@
 	int _suspendCount;
 
 public:
-	
+
 	const char *getObjectName() const { return "PSPIoStream"; }
 	/**
 	 * Given a path, invoke fopen on that path and wrap the result in a

Modified: scummvm/trunk/backends/platform/psp/cursor.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/cursor.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/cursor.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -29,33 +29,33 @@
 #include "backends/platform/psp/cursor.h"
 
 //#define __PSP_DEBUG_FUNCS__	/* For debugging the stack */
-//#define __PSP_DEBUG_PRINT__ 
+//#define __PSP_DEBUG_PRINT__
 
-#include "backends/platform/psp/trace.h" 
- 
+#include "backends/platform/psp/trace.h"
+
 void Cursor::init() {
 	DEBUG_ENTER_FUNC();
-	
+
 	_renderer.setBuffer(&_buffer);			// We do this explicitly
 	_renderer.setPalette(&_screenPalette);	// because we want to choose screenpalette by default
 	_renderer.setUseGlobalScaler(true);
 	setRendererModePalettized(true);		// Assume we start in 8bit mode
-	
+
 	// Default modes
 	_palette.setPixelFormats(PSPPixelFormat::Type_5551, PSPPixelFormat::Type_Palette_8bit); // default
 	_screenPalette.setPixelFormats(PSPPixelFormat::Type_5551, PSPPixelFormat::Type_Palette_8bit);
 	_buffer.setPixelFormat(PSPPixelFormat::Type_5551);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void Cursor::deallocate() {
 	DEBUG_ENTER_FUNC();
-	
+
 	_buffer.deallocate();
 	_palette.deallocate();
 	_screenPalette.deallocate();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -65,17 +65,17 @@
 	if (!_palette.isAllocated()) {
 		_palette.allocate();
 	}
-	
+
 	// Workaround: This is wrong, but we seem to not be getting setScreenPalette
 	if (!_screenPalette.isAllocated()) {
 		_screenPalette.allocate();
-	}	
-	
+	}
+
 	_palette.setPartial(colors, start, num);
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
-}	
+}
 
 void Cursor::setScreenPalette(const byte *colors, uint start, uint num) {
 	DEBUG_ENTER_FUNC();
@@ -83,17 +83,17 @@
 	if (!_screenPalette.isAllocated()) {
 		_screenPalette.allocate();
 	}
-	
+
 	_screenPalette.setPartial(colors, start, num);
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void Cursor::setKeyColor(uint32 color) {
 	DEBUG_ENTER_FUNC();
 	PSP_DEBUG_PRINT("new color[%u], old color[%u]\n", color, _keyColor);
-	
+
 	// If it's a different color, undo the last keycolor
 	if (_buffer.hasPalette() && color != _keyColor) {
 		if (_screenPalette.isAllocated())
@@ -103,7 +103,7 @@
 	}
 	// Don't need anything special for 16-bit
 	_keyColor = color;
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -114,29 +114,29 @@
 	// We need 2 mechanisms: one for palettized and one for 16 bit
 	if (_buffer.hasPalette()) {
 		if (_screenPalette.isAllocated())
-			_screenPalette.setColorPositionAlpha(_keyColor, false);		// set keycolor to 0	
+			_screenPalette.setColorPositionAlpha(_keyColor, false);		// set keycolor to 0
 		if (_palette.isAllocated())
-			_palette.setColorPositionAlpha(_keyColor, false);	
+			_palette.setColorPositionAlpha(_keyColor, false);
 	} else {	// 16bit
 		_renderer.setKeyColor(_keyColor);
 	}
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void Cursor::enableCursorPalette(bool enable) {
 	DEBUG_ENTER_FUNC();
 	PSP_DEBUG_PRINT("enable[%s]\n", enable ? "true" : "false");
-	
+
 	_useCursorPalette = enable;
 	if (enable)
 		_renderer.setPalette(&_palette);	// very important that we do this switch
 	else
 		_renderer.setPalette(&_screenPalette);
-	
+
 	setDirty();
-	DEBUG_EXIT_FUNC();		
+	DEBUG_EXIT_FUNC();
 }
 
 inline void Cursor::setSize(uint32 width, uint32 height) {
@@ -145,21 +145,21 @@
 
 	_buffer.setSize(width, height, Buffer::kSizeByTextureSize);	// we'll use texture size for mouse
 	_renderer.setDrawWholeBuffer();		// We need to let the renderer know how much to draw
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void Cursor::copyFromArray(const byte *array) {
 	DEBUG_ENTER_FUNC();
-	
+
 	if (!_buffer.isAllocated())	{
 		_buffer.allocate();
 	}
 
 	_buffer.copyFromArray(array, _buffer.getSourceWidthInBytes());	// pitch is source width
 	setDirty();
-	
-	// debug	
+
+	// debug
 	//PSP_DEBUG_DO(_buffer.print(0xF));
 
 	DEBUG_EXIT_FUNC();
@@ -179,16 +179,16 @@
 
 // Returns true if change in x or y
 bool Cursor::increaseXY(int32 incX, int32 incY) {
-	DEBUG_ENTER_FUNC();	
+	DEBUG_ENTER_FUNC();
 
 	int32 oldX = _x, oldY = _y;
 
 	// adjust for differences in X and Y
 	adjustXYForScreenSize(incX, incY);
-	
+
 	_x += incX;
 	_y += incY;
-	
+
 	// Clamp mouse
 	if (_x < 0)
 		_x = 0;
@@ -198,62 +198,62 @@
 		_x = (int)_mouseLimitWidth - 1;
 	if (_y >= (int)_mouseLimitHeight)
 		_y = (int)_mouseLimitHeight - 1;
-	
+
 	PSP_DEBUG_PRINT("X[%d], Y[%d]\n", _x, _y);
-	
+
 	if (oldX != _x || oldY != _y) {
 		updateRendererOffset();
 		setDirty();
 		DEBUG_EXIT_FUNC();
 		return true;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 	return false;
 }
 
 // Set limits on the movement of the cursor ie. screen size
-void Cursor::setLimits(uint32 width, uint32 height) { 
-	#define PSP_SCREEN_WIDTH 480
-	#define PSP_SCREEN_HEIGHT 272
+void Cursor::setLimits(uint32 width, uint32 height) {
+#define PSP_SCREEN_WIDTH 480
+#define PSP_SCREEN_HEIGHT 272
 	DEBUG_ENTER_FUNC();
-	
+
 	PSP_DEBUG_PRINT("width[%u], height[%u]\n", width, height);
-	_mouseLimitWidth = width; 
-	_mouseLimitHeight = height; 
-	
+	_mouseLimitWidth = width;
+	_mouseLimitHeight = height;
+
 	DEBUG_EXIT_FUNC();
 }
-	
-// Adjust X,Y movement for the screen size to keep it consistent	
+
+// Adjust X,Y movement for the screen size to keep it consistent
 inline void Cursor::adjustXYForScreenSize(int32 &x, int32 &y) {
 	DEBUG_ENTER_FUNC();
 	// We have our speed calibrated for the y axis at 480x272. The idea is to adjust this for other
 	// resolutions and for x, which is wider.
 	int32 newX = x, newY = y;
-	
+
 	// adjust width movement to match height (usually around 1.5)
 	if (_mouseLimitWidth >= _mouseLimitHeight + (_mouseLimitHeight >> 1))
 		newX = newX + (newX >> 1);
-	
+
 	if (_mouseLimitWidth >= 600) {	// multiply by 2
-		newX <<= 1; 
+		newX <<= 1;
 		newY <<= 1;
 	} else if (_mouseLimitWidth >= 480) {	// multiply by 1.5
 		newX = newX + (newX >> 1);
 		newY = newY + (newY >> 1);
 	}
-	
+
 	// Divide all movements by 8
 	newX >>= 3;
 	newY >>= 3;
-	
-	// Make sure we didn't destroy minimum movement	
-	if (!((x && !newX) || (y && !newY))) {	
+
+	// Make sure we didn't destroy minimum movement
+	if (!((x && !newX) || (y && !newY))) {
 		x = newX;
 		y = newY;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -264,55 +264,55 @@
 	uint32 oldPaletteSize = 0;
 	if (_screenPalette.isAllocated())
 		oldPaletteSize = _screenPalette.getSizeInBytes();
-	
+
 	PSPPixelFormat::Type bufferType = PSPPixelFormat::Type_Unknown;
 	PSPPixelFormat::Type paletteType = PSPPixelFormat::Type_Unknown;
 	bool swapRedBlue = false;
-	
+
 	// Convert Scummvm Pixel Format to PSPPixelFormat
 	PSPPixelFormat::convertFromScummvmPixelFormat(format, bufferType, paletteType, swapRedBlue);
-	
+
 	if (paletteType == PSPPixelFormat::Type_None) {
 		//_screenPalette.deallocate();		// leave palette for default CLUT8
 		setRendererModePalettized(false);	// use 16-bit mechanism
 	} else {	// We have a palette
-		_screenPalette.setPixelFormats(paletteType, bufferType);	
-		_palette.setPixelFormats(paletteType, bufferType);		
+		_screenPalette.setPixelFormats(paletteType, bufferType);
+		_palette.setPixelFormats(paletteType, bufferType);
 		setRendererModePalettized(true);	// use palettized mechanism
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 // This is called many many times
 void Cursor::setSizeAndScummvmPixelFormat(uint32 width, uint32 height, const Graphics::PixelFormat *format) {
 	DEBUG_ENTER_FUNC();
-	
+
 	PSP_DEBUG_PRINT("useCursorPalette[%s]\n", _useCursorPalette ? "true" : "false");
-	
+
 	uint32 oldBufferSize = 0, oldPaletteSize = 0;
-	
-	if (_buffer.isAllocated()) 
+
+	if (_buffer.isAllocated())
 		oldBufferSize = _buffer.getSizeInBytes();
-		
+
 	if (_palette.isAllocated())
 		oldPaletteSize = _palette.getSizeInBytes();
-	
+
 	setSize(width, height);
-	
+
 	PSPPixelFormat::Type bufferType = PSPPixelFormat::Type_Unknown;
 	PSPPixelFormat::Type paletteType = PSPPixelFormat::Type_Unknown;
 	bool swapRedBlue = false;
-	
+
 	PSPPixelFormat::convertFromScummvmPixelFormat(format, bufferType, paletteType, swapRedBlue);
 	PSP_DEBUG_PRINT("bufferType[%u], paletteType[%u]\n", bufferType, paletteType);
-	
+
 	// Check if we need to set new pixel format
 	if (_buffer.getPixelFormat() != bufferType) {
 		PSP_DEBUG_PRINT("new buffer pixel format[%u] is different from [%u]. Setting it.\n", bufferType, _buffer.getPixelFormat());
 		_buffer.setPixelFormat(bufferType);
 	}
-	
+
 	// Check if we need to reallocate
 	if (_buffer.getSizeInBytes() != oldBufferSize) {
 		_buffer.allocate();
@@ -320,29 +320,29 @@
 	}
 
 	PSP_DEBUG_PRINT("palette pixel format[%u]\n", paletteType);
-		
+
 	if (paletteType == PSPPixelFormat::Type_None) {
 		setRendererModePalettized(false);	// use palettized mechanism
 	} else {	// We have a palette
-		_palette.setPixelFormats(paletteType, bufferType);		
+		_palette.setPixelFormats(paletteType, bufferType);
 		setRendererModePalettized(true);	// use palettized mechanism
-	}	
+	}
 
 	// debug
 	// PSP_DEBUG_DO(_palette.print(10));
 	// PSP_DEBUG_DO(_screenPalette.print(10));
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void Cursor::setXY(int x, int y) {
-	DEBUG_ENTER_FUNC(); 
-	
-    _x = x; 
-	_y = y; 
+	DEBUG_ENTER_FUNC();
+
+	_x = x;
+	_y = y;
 	updateRendererOffset();	// Very important to let renderer know things changed
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 

Modified: scummvm/trunk/backends/platform/psp/cursor.h
===================================================================
--- scummvm/trunk/backends/platform/psp/cursor.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/cursor.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -22,7 +22,7 @@
  * $Id: osys_psp.h 46120 2009-11-24 10:33:30Z Bluddy $
  *
  */
- 
+
 #ifndef MOUSE_H
 #define MOUSE_H
 
@@ -37,16 +37,16 @@
 	uint32	_mouseLimitHeight;
 	int32	_x, _y;
 	Palette _screenPalette;			// separate palette for screen. default 'palette' is cursor palette.
-	
+
 	void updateRendererOffset();
 
 public:
-	Cursor() : _hotspotX(0), _hotspotY(0), _keyColor(0), _cursorTargetScale(0), 
-		_useCursorPalette(false), _hasCursorPalette(false), _mouseLimitWidth(0),
-		_mouseLimitHeight(0), _x(0), _y(0) { }
+	Cursor() : _hotspotX(0), _hotspotY(0), _keyColor(0), _cursorTargetScale(0),
+			_useCursorPalette(false), _hasCursorPalette(false), _mouseLimitWidth(0),
+			_mouseLimitHeight(0), _x(0), _y(0) { }
 	virtual ~Cursor() { deallocate(); }
-	
-	void setKeyColor(uint32 color); 
+
+	void setKeyColor(uint32 color);
 	void setCursorTargetScale(int scale) { _cursorTargetScale = scale; }
 	void setScreenPalette(const byte *colors, uint start, uint num);
 	void copyFromArray(const byte *array);
@@ -54,7 +54,7 @@
 	Buffer &buffer() { return _buffer; }
 	void setCursorPalette(const byte *colors, uint start, uint num);
 	void enableCursorPalette(bool enable);
-	void setLimits(uint32 width, uint32 height); 
+	void setLimits(uint32 width, uint32 height);
 	void setXY(int x, int y);
 	int32 getX() { return _x; }
 	int32 getY() { return _y; }
@@ -68,14 +68,14 @@
 	void useGlobalScaler(bool val) { _renderer.setUseGlobalScaler(val); }
 	bool allocate();
 	void deallocate();
-	
+
 private:
 	void setSize(uint32 width, uint32 height);
 	void getPixelFormatsFromScummvmPixelFormat(const Graphics::PixelFormat *format,
-													PSPPixelFormat::Type &bufferFormat,
-													PSPPixelFormat::Type &paletteFormat,
-													uint32 &numOfEntries);
-	void setRendererModePalettized(bool palettized);													
+	        PSPPixelFormat::Type &bufferFormat,
+	        PSPPixelFormat::Type &paletteFormat,
+	        uint32 &numOfEntries);
+	void setRendererModePalettized(bool palettized);
 };
 
 #endif /* MOUSE_H */

Modified: scummvm/trunk/backends/platform/psp/default_display_client.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/default_display_client.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/default_display_client.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -36,15 +36,14 @@
 
 bool DefaultDisplayClient::allocate(bool bufferInVram /* = false */, bool paletteInVram /* = false */) {
 	DEBUG_ENTER_FUNC();
-	
+
 	if (!_buffer.allocate(bufferInVram)) {
-			PSP_ERROR("Couldn't allocate buffer.\n");
-			DEBUG_EXIT_FUNC();
-			return false;
-		}
+		PSP_ERROR("Couldn't allocate buffer.\n");
+		DEBUG_EXIT_FUNC();
+		return false;
+	}
 
-	if (_buffer.hasPalette())
-	{
+	if (_buffer.hasPalette()) {
 		PSP_DEBUG_PRINT("_palette[%p]\n", &_palette);
 
 		if (!_palette.allocate()) {
@@ -53,7 +52,7 @@
 			return false;
 		}
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 	return true;
 }
@@ -88,12 +87,12 @@
 
 void DefaultDisplayClient::copyFromRect(const byte *buf, int pitch, int destX, int destY, int recWidth, int recHeight) {
 	DEBUG_ENTER_FUNC();
-	_buffer.copyFromRect(buf, pitch, destX, destY, recWidth, recHeight); 
+	_buffer.copyFromRect(buf, pitch, destX, destY, recWidth, recHeight);
 	setDirty();
 	DEBUG_EXIT_FUNC();
 }
 
-void DefaultDisplayClient::copyToArray(byte *dst, int pitch) { 
+void DefaultDisplayClient::copyToArray(byte *dst, int pitch) {
 	DEBUG_ENTER_FUNC();
 	_buffer.copyToArray(dst, pitch);
 	DEBUG_EXIT_FUNC();
@@ -115,7 +114,7 @@
 
 void Overlay::setBytesPerPixel(uint32 size) {
 	DEBUG_ENTER_FUNC();
-	
+
 	switch (size) {
 	case 1:
 		_buffer.setPixelFormat(PSPPixelFormat::Type_Palette_8bit);
@@ -128,7 +127,7 @@
 		_buffer.setPixelFormat(PSPPixelFormat::Type_8888);
 		break;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -147,7 +146,7 @@
 
 void Overlay::copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
 	DEBUG_ENTER_FUNC();
-	
+
 	_buffer.copyFromRect((byte *)buf, pitch * sizeof(OverlayColor), x, y, w, h);	// Change to bytes
 	// debug
 	//_buffer.print(0xFF);
@@ -157,9 +156,9 @@
 
 bool Overlay::allocate() {
 	DEBUG_ENTER_FUNC();
-	
+
 	bool ret = DefaultDisplayClient::allocate(true, false);	// buffer in VRAM
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
@@ -179,7 +178,7 @@
 }
 
 void Screen::setShakePos(int pos) {
-	_shakePos = pos; 
+	_shakePos = pos;
 	_renderer.setOffsetOnScreen(0, pos);
 	setDirty();
 }
@@ -189,7 +188,7 @@
 
 	_buffer.setSize(width, height, Buffer::kSizeBySourceSize);
 	_renderer.setDrawWholeBuffer();	// We need to let the renderer know how much to draw
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -203,36 +202,36 @@
 	} else {
 		_pixelFormat = *format;
 	}
-	
+
 	PSPPixelFormat::Type bufferFormat, paletteFormat;
 	bool swapRedBlue = false;
-	
+
 	PSPPixelFormat::convertFromScummvmPixelFormat(format, bufferFormat, paletteFormat, swapRedBlue);
 	_buffer.setPixelFormat(bufferFormat, swapRedBlue);
 	_palette.setPixelFormats(paletteFormat, bufferFormat, swapRedBlue);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 Graphics::Surface *Screen::lockAndGetForEditing() {
 	DEBUG_ENTER_FUNC();
-	
+
 	_frameBuffer.pixels = _buffer.getPixels();
 	_frameBuffer.w = _buffer.getSourceWidth();
 	_frameBuffer.h = _buffer.getSourceHeight();
 	_frameBuffer.pitch = _buffer.getBytesPerPixel() * _buffer.getWidth();
 	_frameBuffer.bytesPerPixel = _buffer.getBytesPerPixel();
 	// We'll set to dirty once we unlock the screen
-	
+
 	DEBUG_EXIT_FUNC();
-	
+
 	return &_frameBuffer;
 }
 
 bool Screen::allocate() {
 	DEBUG_ENTER_FUNC();
-	
+
 	return DefaultDisplayClient::allocate(true, false);	// buffer in VRAM
-	
+
 	DEBUG_EXIT_FUNC();
 }

Modified: scummvm/trunk/backends/platform/psp/default_display_client.h
===================================================================
--- scummvm/trunk/backends/platform/psp/default_display_client.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/default_display_client.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -24,7 +24,7 @@
  */
 
 #ifndef PSP_DEF_DISPLAY_CLIENT_H
-#define PSP_DEF_DISPLAY_CLIENT_H 
+#define PSP_DEF_DISPLAY_CLIENT_H
 
 /**
  *	Default display client that is useful for most purposes.
@@ -32,7 +32,7 @@
 class DefaultDisplayClient : public DisplayClient {
 public:
 	DefaultDisplayClient() : _visible(false), _dirty(true) {}
-	
+
 	bool isVisible() { return _visible; }
 	void setVisible(bool v) { _visible = v; setDirty(); }
 	Buffer &buffer() { return _buffer; }
@@ -46,8 +46,8 @@
 	uint32 getWidth() { return _buffer.getSourceWidth(); }
 	uint32 getHeight() { return _buffer.getSourceHeight(); }
 	void setPartialPalette(const byte *colors, uint start, uint num) { setDirty(); return _palette.setPartial(colors, start, num); }
-	void getPartialPalette(byte *colors, uint start, uint num) { 
-		return _palette.getPartial(colors, start, num); 
+	void getPartialPalette(byte *colors, uint start, uint num) {
+		return _palette.getPartial(colors, start, num);
 	}
 	void copyFromRect(const byte *buf, int pitch, int destX, int destY, int recWidth, int recHeight);
 	void copyToArray(byte *dst, int pitch);
@@ -70,13 +70,13 @@
 public:
 	Overlay() {}
 	~Overlay() { }
-	
+
 	void init();
 	bool allocate();
 	void setBytesPerPixel(uint32 size);
 	void setSize(uint32 width, uint32 height);
 	void copyToArray(OverlayColor *buf, int pitch);
-	void copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h);	
+	void copyFromRect(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
 };
 
 /**
@@ -89,16 +89,16 @@
 		memset(&_frameBuffer, 0, sizeof(_frameBuffer));
 	}
 	~Screen() {}
-	
+
 	void init();
 	bool allocate();
 	void setShakePos(int pos);
 	void setScummvmPixelFormat(const Graphics::PixelFormat *format);
 	const Graphics::PixelFormat &getScummvmPixelFormat() const { return _pixelFormat; }
 	Graphics::Surface *lockAndGetForEditing();
-	void unlock() { setDirty(); } // set dirty here because of changes 
-	void setSize(uint32 width, uint32 height);	
-	
+	void unlock() { setDirty(); } // set dirty here because of changes
+	void setSize(uint32 width, uint32 height);
+
 private:
 	uint32 _shakePos;
 	Graphics::PixelFormat _pixelFormat;

Modified: scummvm/trunk/backends/platform/psp/display_client.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/display_client.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/display_client.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -27,7 +27,7 @@
 #include <pspdisplay.h>
 #include <psputils.h>
 
-#include "common/scummsys.h" 
+#include "common/scummsys.h"
 #include "backends/platform/psp/display_client.h"
 #include "backends/platform/psp/display_manager.h"
 #include "backends/platform/psp/memory.h"
@@ -51,9 +51,9 @@
 
 	if (_values && _numOfEntries)
 		memset(_values, 0, getSizeInBytes());
-		
+
 	PSP_DEBUG_PRINT("_values[%p]\n", _values);
-		
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -61,33 +61,33 @@
 //
 void Palette::setColorPositionAlpha(uint32 position, bool alpha) {
 	DEBUG_ENTER_FUNC();
-	
+
 	assert(_values);
 	assert(position < _numOfEntries);
-	
+
 	PSP_DEBUG_PRINT("position[%d], numofEntries[%u], bpp[%u], values[%p]\n", position, _numOfEntries,
-			_pixelFormat.bitsPerPixel, _values);
+	                _pixelFormat.bitsPerPixel, _values);
 
 	if (_numOfEntries <= 16)
 		position &= 0xF;
 	else if (_numOfEntries <= 256)
 		position &= 0xFF;
-	
+
 	switch (_pixelFormat.bitsPerPixel) {
-	case 16: {		
-		uint16 *shortVal = (uint16 *)&_values[_pixelFormat.pixelsToBytes(position)];
-		*shortVal = _pixelFormat.setColorAlpha((uint32)*shortVal, alpha ? 255 : 0);
-		}
-		break;
+	case 16: {
+		uint16 *shortVal = (uint16 *) & _values[_pixelFormat.pixelsToBytes(position)];
+		*shortVal = _pixelFormat.setColorAlpha((uint32) * shortVal, alpha ? 255 : 0);
+	}
+	break;
 	case 32: {
-		uint32 *wordVal = (uint32 *)&_values[_pixelFormat.pixelsToBytes(position)];
-		*wordVal = _pixelFormat.setColorAlpha((uint32)*wordVal, alpha ? 255 : 0);
-		}
-		break;
+		uint32 *wordVal = (uint32 *) & _values[_pixelFormat.pixelsToBytes(position)];
+		*wordVal = _pixelFormat.setColorAlpha((uint32) * wordVal, alpha ? 255 : 0);
+	}
+	break;
 	default:
 		PSP_ERROR("Incorrect bits per pixel value[%u]\n", _pixelFormat.bitsPerPixel);
 	}
-		
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -98,43 +98,42 @@
 
 	assert(_values);
 	assert(_numOfEntries);
-	
+
 	const byte *src = colors;
-	
+
 	if (start + num > _numOfEntries)	// Check boundary
 		num = _numOfEntries - start;
 
 	if (_pixelFormat.bitsPerPixel == 16) {
 		uint16 *palette = (uint16 *)_values;
 		palette += start;
-		
+
 		for (uint32 i = 0; i < num; ++i) {
 			byte alphaVal = supportsAlpha ? src[3] : 0xFF;
 			*palette = (uint16)_pixelFormat.rgbaToColor(src[0], src[1], src[2], alphaVal);
-			src += 4;	
+			src += 4;
 			palette++;
 		}
-	}
-	else if (_pixelFormat.bitsPerPixel == 32) {
+	} else if (_pixelFormat.bitsPerPixel == 32) {
 		uint32 *palette = (uint32 *)_values;
 		palette += start;
-		
+
 		for (uint32 i = 0; i < num; ++i) {
 			byte alphaVal = supportsAlpha ? src[3] : 0xFF;
 			*palette = _pixelFormat.rgbaToColor(src[0], src[1], src[2], alphaVal);
-			src += 4;	
+			src += 4;
 			palette++;
 		}
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 // Sets pixel format and number of entries by the buffer's pixel format */
 void Palette::setPixelFormats(PSPPixelFormat::Type paletteType, PSPPixelFormat::Type bufferType, bool swapRedBlue /* = false */) {
 	DEBUG_ENTER_FUNC();
-	
-	if (paletteType == PSPPixelFormat::Type_Unknown) 
+
+	if (paletteType == PSPPixelFormat::Type_Unknown)
 		PSP_ERROR("Unknown paletteType[%u]\n", paletteType);
 
 	switch (bufferType) {
@@ -152,9 +151,9 @@
 		_numOfEntries = 0;
 		break;
 	}
-	
+
 	_pixelFormat.set(paletteType, swapRedBlue);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -164,40 +163,40 @@
 	PSP_DEBUG_PRINT("_pixelFormat: format[%u], bpp[%u]\n", _pixelFormat.format, _pixelFormat.bitsPerPixel);
 
 	if (_values) {
-		free (CACHED(_values));
+		free(CACHED(_values));
 		_values = 0;
 	}
 
 	// We allocate on 64bytes to get a cache line, and round up to 64bytes to get the full line
 	uint32 amountInBytes = getSizeInBytes();
-	if (amountInBytes < 64) 
+	if (amountInBytes < 64)
 		amountInBytes = 64;
 	_values = (byte *)memalign(64, amountInBytes);
 
 	// Use uncached memory
 	GuRenderer::cacheInvalidate(_values, amountInBytes);
 	_values = UNCACHED(_values);
-	
+
 	if (!_values) {
 		PSP_ERROR("Couldn't allocate palette.\n");
 		DEBUG_EXIT_FUNC();
 		return false;
 	}
-	
+
 	PSP_DEBUG_PRINT("_values[%p]\n", _values);
 	clear();
-	
+
 	DEBUG_EXIT_FUNC();
 	return true;
 }
 
 void Palette::deallocate() {
 	DEBUG_ENTER_FUNC();
-	
-	free (CACHED(_values));
+
+	free(CACHED(_values));
 	_values = 0;
 	_numOfEntries = 0;
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -208,32 +207,32 @@
 
 	assert(_values);
 	assert(_numOfEntries);
-	
+
 	uint32 r, g, b, a;
 
 	if (start + num > _numOfEntries)	// Check boundary
 		num = _numOfEntries - start;
-	
-	if (_pixelFormat.bitsPerPixel == 16) {	
+
+	if (_pixelFormat.bitsPerPixel == 16) {
 		uint16 *palette = (uint16 *)_values;
 		palette += start;
-		
+
 		for (uint32 i = start; i < start + num; i++) {
 			_pixelFormat.colorToRgba(*palette, r, g, b, a);
-			
+
 			*colors++ = (byte)r;
 			*colors++ = (byte)g;
 			*colors++ = (byte)b;
 			*colors++ = (byte)a;
 			palette++;
 		}
-	} else if (_pixelFormat.bitsPerPixel == 32) {	
+	} else if (_pixelFormat.bitsPerPixel == 32) {
 		uint32 *palette = (uint32 *)_values;
 		palette += start;
-		
+
 		for (uint32 i = start; i < start + num; i++) {
 			_pixelFormat.colorToRgba(*palette, r, g, b, a);
-			
+
 			*colors++ = (byte)r;
 			*colors++ = (byte)g;
 			*colors++ = (byte)b;
@@ -241,26 +240,26 @@
 			palette++;
 		}
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
-void Palette::setSingleColorRGBA(uint32 num, byte r, byte g, byte b, byte a) {	
+void Palette::setSingleColorRGBA(uint32 num, byte r, byte g, byte b, byte a) {
 	// DEBUG_ENTER_FUNC();
 	uint16 *shortValues;
 	uint32 *wordValues;
-	
-	assert (_values);
-	assert (num < _numOfEntries);
-	
+
+	assert(_values);
+	assert(num < _numOfEntries);
+
 	switch (_pixelFormat.bitsPerPixel) {
-	case 16: 
+	case 16:
 		shortValues = (uint16 *)_values;
 		shortValues[num] = _pixelFormat.rgbaToColor(r, g, b, a);
 		break;
-	case 32: 
+	case 32:
 		wordValues = (uint32 *)_values;
-		wordValues[num] = _pixelFormat.rgbaToColor(r, g, b, a);		
+		wordValues[num] = _pixelFormat.rgbaToColor(r, g, b, a);
 		break;
 	default:
 		PSP_ERROR("Incorrect bitsPerPixel[%d]\n", _pixelFormat.bitsPerPixel);
@@ -272,20 +271,20 @@
 // Print to screen
 void Palette::print(uint32 numToPrint /* = 0 */) {
 	if (_numOfEntries > 0) {
-		assert (_values);
-		
-		if (numToPrint > _numOfEntries || numToPrint == 0) 
+		assert(_values);
+
+		if (numToPrint > _numOfEntries || numToPrint == 0)
 			numToPrint = _numOfEntries;
-		
+
 		PSP_INFO_PRINT("cursor palette:\n");
-		
-		for (unsigned int i=0; i<numToPrint; i++) {
+
+		for (unsigned int i = 0; i < numToPrint; i++) {
 			byte *pcolor = &_values[_pixelFormat.pixelsToBytes(i)];
 			uint32 color = _pixelFormat.getColorValueAt(pcolor);
-			
+
 			PSP_INFO_PRINT("[%u=%x] ", i, color);
 		}
-	
+
 		PSP_INFO_PRINT("\n");
 	}
 }
@@ -305,17 +304,17 @@
 
 // class Buffer ---------------------------------------------------
 
-void Buffer::setPixelFormat(PSPPixelFormat::Type type, bool swapRedBlue) { 
+void Buffer::setPixelFormat(PSPPixelFormat::Type type, bool swapRedBlue) {
 	if (type == PSPPixelFormat::Type_None ||
-		type == PSPPixelFormat::Type_Unknown)
+	        type == PSPPixelFormat::Type_Unknown)
 		PSP_ERROR("Unhandled buffer format[%u]\n", type);
-		
-	_pixelFormat.set(type, swapRedBlue); 
+
+	_pixelFormat.set(type, swapRedBlue);
 }
 
 bool Buffer::hasPalette() {
 	if (_pixelFormat.format == PSPPixelFormat::Type_Palette_8bit ||
-		_pixelFormat.format == PSPPixelFormat::Type_Palette_4bit)
+	        _pixelFormat.format == PSPPixelFormat::Type_Palette_4bit)
 		return true;
 
 	return false;
@@ -324,10 +323,10 @@
 /* pitch is in bytes */
 void Buffer::copyFromArray(const byte *buffer, int pitch) {
 	DEBUG_ENTER_FUNC();
-	
+
 	// We use sourceSize because outside, they won't know what the true size is
 	copyFromRect(buffer, pitch, 0, 0, _sourceSize.width, _sourceSize.height);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -335,8 +334,8 @@
 void Buffer::copyFromRect(const byte *buf, uint32 pitch, int destX, int destY, uint32 recWidth, uint32 recHeight) {
 	// Removed silly clipping code
 	DEBUG_ENTER_FUNC();
-	assert (_pixels);
-	
+	assert(_pixels);
+
 	if (recWidth > _sourceSize.width - destX) {
 		recWidth = _sourceSize.width - destX;
 	}
@@ -351,7 +350,7 @@
 	}
 
 	byte *dst = _pixels + _pixelFormat.pixelsToBytes((destY * _width) + destX);
-	
+
 	uint32 recWidthInBytes = _pixelFormat.pixelsToBytes(recWidth);
 	uint32 realWidthInBytes = _pixelFormat.pixelsToBytes(_width);
 
@@ -366,15 +365,15 @@
 			dst += realWidthInBytes;
 		} while (--recHeight);
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 /* pitch is in bytes */
 void Buffer::copyToArray(byte *dst, int pitch) {
 	DEBUG_ENTER_FUNC();
-	assert (_pixels);
-	
+	assert(_pixels);
+
 	uint32 h = _height;
 	byte *src = _pixels;
 	uint32 sourceWidthInBytes = _pixelFormat.pixelsToBytes(_sourceSize.width);
@@ -386,7 +385,7 @@
 		src += realWidthInBytes;
 		dst += pitch;
 	} while (--h);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -395,7 +394,7 @@
 void Buffer::setSize(uint32 width, uint32 height, HowToSize textureOrSource/*=kSizeByTextureSize*/) {
 	DEBUG_ENTER_FUNC();
 	PSP_DEBUG_PRINT("w[%u], h[%u], %s\n", width, height, textureOrSource ? "size by source" : "size by texture");
-	
+
 	_sourceSize.width = width;
 	_sourceSize.height = height;
 
@@ -405,18 +404,17 @@
 	if (textureOrSource == kSizeByTextureSize) {
 		_width = _textureSize.width;
 		_height = _textureSize.height;
-	}
-	else { /* kSizeBySourceSize */
+	} else { /* kSizeBySourceSize */
 		_width = _sourceSize.width;
 		_height = _sourceSize.height;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 /* Scale a dimension (width/height) up to power of 2 for the texture */
 uint32 Buffer::scaleUpToPowerOfTwo(uint32 size) {
-	
+
 	uint32 textureDimension = 0;
 	if (size <= 16)
 		textureDimension = 16;
@@ -430,7 +428,7 @@
 		textureDimension = 256;
 	else
 		textureDimension = 512;
-	
+
 	PSP_DEBUG_PRINT("power of 2 = %u\n", textureDimension);
 
 	return textureDimension;
@@ -438,7 +436,7 @@
 
 bool Buffer::allocate(bool inVram/*=false*/) {
 	DEBUG_ENTER_FUNC();
-	
+
 	PSP_DEBUG_PRINT("_width[%u], _height[%u]\n", _width, _height);
 	PSP_DEBUG_PRINT("_pixelFormat: format[%u], bpp[%u]\n", _pixelFormat.format, _pixelFormat.bitsPerPixel);
 
@@ -446,17 +444,17 @@
 		if (VramAllocator::isAddressInVram(_pixels)) 	// Check if in VRAM
 			VramAllocator::instance().deallocate(_pixels);
 		else	// not in VRAM
-			free (CACHED(_pixels));
-			
-		_pixels = 0;	
+			free(CACHED(_pixels));
+
+		_pixels = 0;
 	}
 
 	uint32 size = getSizeInBytes();
-	
+
 	if (inVram) {
 		_pixels = (byte *)VramAllocator::instance().allocate(size);
-	} 
-	
+	}
+
 	if (!_pixels) {	// Either we are not in vram or we didn't manage to allocate in vram
 		// Align to 64 bytes. All normal buffer sizes are multiples of 64 anyway
 		_pixels = (byte *)memalign(64, size);
@@ -467,7 +465,7 @@
 		DEBUG_EXIT_FUNC();
 		return false;
 	}
-	
+
 	// Use uncached memory
 	GuRenderer::cacheInvalidate(_pixels, size);
 	_pixels = UNCACHED(_pixels);
@@ -482,35 +480,35 @@
 
 	if (!_pixels)
 		return;
-		
+
 	if (VramAllocator::isAddressInVram(_pixels)) 	// Check if in VRAM
 		VramAllocator::instance().deallocate(_pixels);
 	else
 		free(CACHED(_pixels));
-		
+
 	_pixels = 0;
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void Buffer::clear() {
 	DEBUG_ENTER_FUNC();
-	
+
 	if (_pixels)
 		memset(_pixels, 0, getSizeInBytes());
-		
+
 	DEBUG_EXIT_FUNC();
 }
 
 /* Convert 4 bit images to match weird PSP format */
 void Buffer::flipNibbles() {
 	DEBUG_ENTER_FUNC();
-	
-	if (_pixelFormat.bitsPerPixel != 4) 
+
+	if (_pixelFormat.bitsPerPixel != 4)
 		return;
-		
-	assert(_pixels);	
-	
+
+	assert(_pixels);
+
 	uint32 *dest = (uint32 *)_pixels;
 
 	for (uint32 i = 0; i < getSourceHeight(); i++) {
@@ -526,24 +524,24 @@
 // Print buffer contents to screen (only source size is printed out)
 void Buffer::print(uint32 mask, uint32 numToPrint /*=0*/) {
 	assert(_pixels);
-	
+
 	if (numToPrint > _sourceSize.width * _sourceSize.height || numToPrint == 0)
 		numToPrint = _sourceSize.width * _sourceSize.height;
-	
+
 	PSP_INFO_PRINT("buffer: \n");
 	PSP_INFO_PRINT("width[%u], height[%u]\n\n", _sourceSize.width, _sourceSize.height);
-	
-	for (unsigned int i=0; i < _sourceSize.height; i++) {
-		for (unsigned int j=0; j < _sourceSize.width; j++) {
+
+	for (unsigned int i = 0; i < _sourceSize.height; i++) {
+		for (unsigned int j = 0; j < _sourceSize.width; j++) {
 			if (numToPrint <= 0)	// check if done
 				break;
-				
+
 			byte *pcolor = &_pixels[_pixelFormat.pixelsToBytes((i * _width) + j)];
 			uint32 color = _pixelFormat.getColorValueAt(pcolor);
- 
+
 			//if (color != 0) PSP_INFO_PRINT("[%x] ", color);
 			PSP_INFO_PRINT("[%x] ", mask & color);
-				
+
 			numToPrint--;
 		}
 		PSP_INFO_PRINT("\n");
@@ -563,16 +561,16 @@
 	PSP_DEBUG_PRINT("Buffer[%p] Palette[%p]\n", _buffer->getPixels(), _palette->getRawValues());
 
 	setMaxTextureOffsetByIndex(0, 0);
-	
+
 	guProgramDrawBehavior();
-	
+
 	if (_buffer->hasPalette())
 		guLoadPalette();
-	
+
 	guProgramTextureFormat();
 	guLoadTexture();
-	
-	Vertex *vertices = guGetVertices();	
+
+	Vertex *vertices = guGetVertices();
 	fillVertices(vertices);
 
 	guDrawVertices(vertices);
@@ -581,17 +579,17 @@
 		setMaxTextureOffsetByIndex(1, 0);
 
 		guLoadTexture();
-		
+
 		vertices = guGetVertices();
 		fillVertices(vertices);
 
 		guDrawVertices(vertices);
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
-inline void GuRenderer::setMaxTextureOffsetByIndex(uint32 x, uint32 y) { 
+inline void GuRenderer::setMaxTextureOffsetByIndex(uint32 x, uint32 y) {
 	DEBUG_ENTER_FUNC();
 	const uint32 maxTextureSizeShift = 9; /* corresponds to 512 = max texture size*/
 
@@ -603,18 +601,18 @@
 inline void GuRenderer::guProgramDrawBehavior() {
 	DEBUG_ENTER_FUNC();
 	PSP_DEBUG_PRINT("blending[%s] colorTest[%s] reverseAlpha[%s] keyColor[%u]\n", _blending ? "on" : "off", _colorTest ? "on" : "off", _alphaReverse ? "on" : "off", _keyColor);
-	
+
 	if (_blending) {
 		sceGuEnable(GU_BLEND);
 
 		if (_alphaReverse)	// Reverse the alpha value (0 is 1)
 			sceGuBlendFunc(GU_ADD, GU_ONE_MINUS_SRC_ALPHA, GU_SRC_ALPHA, 0, 0);
 		else	// Normal alpha values
-			sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);		
+			sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
 
-	} else 
+	} else
 		sceGuDisable(GU_BLEND);
-	
+
 	if (_colorTest) {
 		sceGuEnable(GU_COLOR_TEST);
 		sceGuColorFunc(GU_NOTEQUAL, _keyColor, 0x00ffffff);
@@ -626,9 +624,9 @@
 
 inline void GuRenderer::guLoadPalette() {
 	DEBUG_ENTER_FUNC();
-	
+
 	uint32 mask;
-	
+
 	if (_buffer->getBitsPerPixel() == 4)
 		mask = 0x0F;
 	else if (_buffer->getBitsPerPixel() == 8)
@@ -637,70 +635,70 @@
 		assert(0);	/* error */
 
 	PSP_DEBUG_PRINT("numOfEntries[%d]\n", _palette->getNumOfEntries());
-	PSP_DEBUG_PRINT("bpp[%d], pixelformat[%d], mask[%x]\n", _buffer->getBitsPerPixel(), _palette->getPixelFormat(), mask); 
-		
+	PSP_DEBUG_PRINT("bpp[%d], pixelformat[%d], mask[%x]\n", _buffer->getBitsPerPixel(), _palette->getPixelFormat(), mask);
+
 	sceGuClutMode(convertToGuPixelFormat(_palette->getPixelFormat()), 0, mask, 0);
 	sceGuClutLoad(_palette->getNumOfEntries() >> 3, _palette->getRawValues());
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 inline void GuRenderer::guProgramTextureFormat() {
 	DEBUG_ENTER_FUNC();
 	PSP_DEBUG_PRINT("pixelFormat[%d]\n", _buffer->getPixelFormat());
-	
+
 	sceGuTexMode(convertToGuPixelFormat(_buffer->getPixelFormat()), 0, 0, 0);
 	DEBUG_EXIT_FUNC();
 }
 
-inline uint32 GuRenderer::convertToGuPixelFormat(PSPPixelFormat::Type format) { 
-		DEBUG_ENTER_FUNC();
-		
-		uint32 guFormat = 0;
-		
-		switch (format) {
-		case PSPPixelFormat::Type_4444:
-			guFormat = GU_PSM_4444;
-			break;
-		case PSPPixelFormat::Type_5551:
-			guFormat = GU_PSM_5551;
-			break;
-		case PSPPixelFormat::Type_5650:
-			guFormat = GU_PSM_5650;
-			break;
-		case PSPPixelFormat::Type_8888:
-			guFormat = GU_PSM_8888;
-			break;
-		case PSPPixelFormat::Type_Palette_8bit:
-			guFormat = GU_PSM_T8;
-			break;
-		case PSPPixelFormat::Type_Palette_4bit:
-			guFormat = GU_PSM_T4;
-			break;
-		default:
-			break;			
+inline uint32 GuRenderer::convertToGuPixelFormat(PSPPixelFormat::Type format) {
+	DEBUG_ENTER_FUNC();
+
+	uint32 guFormat = 0;
+
+	switch (format) {
+	case PSPPixelFormat::Type_4444:
+		guFormat = GU_PSM_4444;
+		break;
+	case PSPPixelFormat::Type_5551:
+		guFormat = GU_PSM_5551;
+		break;
+	case PSPPixelFormat::Type_5650:
+		guFormat = GU_PSM_5650;
+		break;
+	case PSPPixelFormat::Type_8888:
+		guFormat = GU_PSM_8888;
+		break;
+	case PSPPixelFormat::Type_Palette_8bit:
+		guFormat = GU_PSM_T8;
+		break;
+	case PSPPixelFormat::Type_Palette_4bit:
+		guFormat = GU_PSM_T4;
+		break;
+	default:
+		break;
 	}
-	
+
 	PSP_DEBUG_PRINT("Pixelformat[%d], guFormat[%d]\n", format, guFormat);
-	
+
 	DEBUG_EXIT_FUNC();
 	return guFormat;
-	
+
 }
 
 inline void GuRenderer::guLoadTexture() {
 	DEBUG_ENTER_FUNC();
-	
+
 	sceGuTexImage(0, _buffer->getTextureWidth(), _buffer->getTextureHeight(), _buffer->getWidth(), _buffer->getPixels() + _buffer->_pixelFormat.pixelsToBytes(_maxTextureOffset.x));
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 inline Vertex *GuRenderer::guGetVertices() {
 	DEBUG_ENTER_FUNC();
-	
+
 	Vertex *ret = (Vertex *)sceGuGetMemory(2 * sizeof(Vertex));
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
@@ -708,19 +706,19 @@
 // Fills the vertices. Most of the logic is here.
 void GuRenderer::fillVertices(Vertex *vertices) {
 	DEBUG_ENTER_FUNC();
-	
+
 	uint32 outputWidth = _displayManager->getOutputWidth();
 	uint32 outputHeight = _displayManager->getOutputHeight();
 
 	float textureStartX, textureStartY, textureEndX, textureEndY;
-	
+
 	// Texture adjustments for eliminating half-pixel artifacts from scaling
 	// Not necessary if we don't scale
 	float textureAdjustment = 0.0f;
-	if (_useGlobalScaler && 
-	   (_displayManager->getScaleX() != 1.0f || _displayManager->getScaleX() != 1.0f))
-			textureAdjustment = 0.5f;
-	
+	if (_useGlobalScaler &&
+	        (_displayManager->getScaleX() != 1.0f || _displayManager->getScaleX() != 1.0f))
+		textureAdjustment = 0.5f;
+
 	textureStartX = textureAdjustment + _offsetInBuffer.x; //debug
 	textureStartY = textureAdjustment + _offsetInBuffer.y;
 	// We subtract maxTextureOffset because our shifted texture starts at 512 and will go to 640
@@ -730,15 +728,15 @@
 	// For scaling to the final image size, calculate the gaps on both sides
 	uint32 gapX = _useGlobalScaler ? (PSP_SCREEN_WIDTH - outputWidth) >> 1 : 0;
 	uint32 gapY = _useGlobalScaler ? (PSP_SCREEN_HEIGHT - outputHeight) >> 1 : 0;
-	
+
 	float imageStartX, imageStartY, imageEndX, imageEndY;
 
-	imageStartX = gapX + ( scaleSourceToOutputX(_maxTextureOffset.x) );
+	imageStartX = gapX + (scaleSourceToOutputX(_maxTextureOffset.x));
 	imageStartY = gapY;
 
 	imageStartX += scaleSourceToOutputX(_offsetOnScreen.x);
 	imageStartY += scaleSourceToOutputY(_offsetOnScreen.y);
-	
+
 	if (_fullScreen) { // shortcut
 		imageEndX = PSP_SCREEN_WIDTH - gapX;
 		imageEndY = PSP_SCREEN_HEIGHT - gapY;
@@ -751,52 +749,52 @@
 	vertices[0].v = textureStartY;
 	vertices[1].u = textureEndX;
 	vertices[1].v = textureEndY;
-	
+
 	vertices[0].x = imageStartX;
 	vertices[0].y = imageStartY;
 	vertices[0].z = 0;
 	vertices[1].x = imageEndX;
 	vertices[1].y = imageEndY;
 	vertices[1].z = 0;
-	
+
 	PSP_DEBUG_PRINT("TextureStart: X[%f] Y[%f] TextureEnd: X[%.1f] Y[%.1f]\n", textureStartX, textureStartY, textureEndX, textureEndY);
 	PSP_DEBUG_PRINT("ImageStart:   X[%f] Y[%f] ImageEnd:   X[%.1f] Y[%.1f]\n", imageStartX, imageStartY, imageEndX, imageEndY);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 /* Scale the input X offset to appear in proper position on the screen */
 inline float GuRenderer::scaleSourceToOutputX(float offset) {
 	float result;
-	
+
 	if (!_useGlobalScaler)
 		result = offset;
 	else if (!offset)
-		result = 0.0f;	
+		result = 0.0f;
 	else
 		result = offset * _displayManager->getScaleX();
-	
+
 	return result;
 }
 
 /* Scale the input Y offset to appear in proper position on the screen */
 inline float GuRenderer::scaleSourceToOutputY(float offset) {
 	float result;
-	
+
 	if (!_useGlobalScaler)
 		result = offset;
 	else if (!offset)
 		result = 0.0f;
-	else 
+	else
 		result = offset * _displayManager->getScaleY();
-		
+
 	return result;
 }
 
 inline void GuRenderer::guDrawVertices(Vertex *vertices) {
 	DEBUG_ENTER_FUNC();
-	
-	sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices);
+
+	sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_2D, 2, 0, vertices);
 	DEBUG_EXIT_FUNC();
 }
 

Modified: scummvm/trunk/backends/platform/psp/display_client.h
===================================================================
--- scummvm/trunk/backends/platform/psp/display_client.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/display_client.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -22,7 +22,7 @@
  * $Id: osys_psp.cpp 46126 2009-11-24 14:18:46Z fingolfin $
  *
  */
- 
+
 #ifndef PSP_GRAPHICS_H
 #define PSP_GRAPHICS_H
 
@@ -31,9 +31,9 @@
 #include "common/system.h"
 #include "backends/platform/psp/psppixelformat.h"
 #include "backends/platform/psp/memory.h"
- 
-#define MAX_TEXTURE_SIZE 512 
 
+#define MAX_TEXTURE_SIZE 512
+
 class DisplayManager;
 class GuRenderer;
 
@@ -50,13 +50,13 @@
 	void render() {}
 	virtual ~DisplayClient() {}
 };
- 
+
 /**
  * Vertex used for GU rendering
  */
 struct Vertex {
-	float u,v;
-	float x,y,z;
+	float u, v;
+	float x, y, z;
 };
 
 struct Point {
@@ -101,7 +101,7 @@
 	bool isAllocated() { return (_values != 0); }
 	PSPPixelFormat::Type getPixelFormat() { return _pixelFormat.format; }
 	void print(uint32 numToPrint = 0);					// print to screen
-	
+
 protected:
 	byte *_values;					///< array of palette data
 	uint32 _numOfEntries;			///< number of palette entries
@@ -122,9 +122,9 @@
 
 	Buffer() : _pixels(0), _width(0), _height(0)  {}
 	virtual ~Buffer() { deallocate(); }
-	
+
 	// setters
-	void setSize(uint32 width, uint32 height, HowToSize textureOrSource=kSizeByTextureSize);
+	void setSize(uint32 width, uint32 height, HowToSize textureOrSource = kSizeByTextureSize);
 	void setBitsPerPixel(uint32 bits) { _pixelFormat.bitsPerPixel = bits; }
 	void setBytesPerPixel(uint32 bytes) { setBitsPerPixel(bytes << 3); }
 	void setPixelFormat(PSPPixelFormat::Type type, bool swapRedBlue = false);
@@ -135,7 +135,7 @@
 	uint32 getHeight() { return _height; }
 	uint32 getSourceWidth() { return _sourceSize.width; }
 	uint32 getSourceWidthInBytes() { return _pixelFormat.pixelsToBytes(_sourceSize.width); }
-	uint32 getSourceHeight() { return _sourceSize.height; }	
+	uint32 getSourceHeight() { return _sourceSize.height; }
 	uint32 getTextureWidth() { return _textureSize.width; }
 	uint32 getTextureHeight() { return _textureSize.height; }
 	PSPPixelFormat::Type getPixelFormat() { return _pixelFormat.format; }
@@ -143,7 +143,7 @@
 	uint32 getBytesPerPixel() { return getBitsPerPixel() >> 3; } /* won't work for 4-bit */
 	byte *getPixels() { return _pixels; }
 	uint32 getSizeInBytes() { return _pixelFormat.pixelsToBytes(_width * _height); }
-	
+
 	bool hasPalette();
 	void copyFromArray(const byte *buffer, int pitch);
 	void copyFromRect(const byte *buf, uint32 pitch, int destX, int destY, uint32 recWidth, uint32 recHeight);
@@ -155,7 +155,7 @@
 	void flipNibbles();		// To handle peculiarities of PSP's 4 bit textures
 	static uint32 scaleUpToPowerOfTwo(uint32 size);
 	void print(uint32 mask, uint32 numToPrint = 0);
-	
+
 protected:
 	friend class GuRenderer;
 	byte *_pixels;
@@ -163,7 +163,7 @@
 	uint32 _height;					///< True allocated height
 	Dimensions _textureSize;		///< Size rounded up to power of 2. Used for drawing
 	Dimensions _sourceSize;			///< Original size of the buffer
-	PSPPixelFormat _pixelFormat;	///< Format of the buffer	
+	PSPPixelFormat _pixelFormat;	///< Format of the buffer
 };
 
 /**
@@ -177,19 +177,19 @@
 	GuRenderer() : _useGlobalScaler(false), _buffer(0), _palette(0), _blending(false), _alphaReverse(false), _colorTest(false), _keyColor(0), _fullScreen(false) {}
 	GuRenderer(Buffer *buffer, Palette *palette) : _useGlobalScaler(false), _buffer(buffer), _palette(palette), _blending(false), _alphaReverse(false), _colorTest(false), _keyColor(0), _fullScreen(false) {}
 	static void setDisplayManager(DisplayManager *dm) { _displayManager = dm; } // Called by the Display Manager
-	
+
 	// Setters
 	void setDrawSize(uint32 width, uint32 height) {	// How big of an area to draw
-			_drawSize.width = width;
-			_drawSize.height = height;
+		_drawSize.width = width;
+		_drawSize.height = height;
 	}
 	void setDrawWholeBuffer() {						// Draw the full size of the current buffer
 		assert(_buffer);
 		_drawSize.width = _buffer->getSourceWidth();
 		_drawSize.height = _buffer->getSourceHeight();
 	}
-    void setBuffer(Buffer *buffer) { _buffer = buffer; }
-    void setPalette(Palette *palette) { _palette = palette; }
+	void setBuffer(Buffer *buffer) { _buffer = buffer; }
+	void setPalette(Palette *palette) { _palette = palette; }
 	void setMaxTextureOffsetByIndex(uint32 x, uint32 y);	// For drawing multiple textures
 	void setOffsetOnScreen(uint32 x, uint32 y) { _offsetOnScreen.x = x; _offsetOnScreen.y = y; }
 	void setOffsetInBuffer(uint32 x, uint32 y) { _offsetInBuffer.x = x; _offsetInBuffer.y = y; }
@@ -199,9 +199,9 @@
 	void setAlphaReverse(bool value) { _alphaReverse = value; }
 	void setFullScreen(bool value) { _fullScreen = value; }		// Shortcut for rendering
 	void setUseGlobalScaler(bool value) { _useGlobalScaler = value; }	// Scale to screen
-	
+
 	static void cacheInvalidate(void *pointer, uint32 size);
-	
+
 	void render();							// Default rendering function. This should be good enough for most purposes
 
 protected:
@@ -209,7 +209,7 @@
 	void fillVertices(Vertex *vertices);	// Fill in vertices with coordinates
 	void guProgramDrawBehavior();
 	Vertex *guGetVertices();
-	void guLoadTexture();	
+	void guLoadTexture();
 	void guLoadPalette();
 	void guProgramTextureFormat();
 	void guProgramTextureBitDepth();
@@ -218,7 +218,7 @@
 	uint32 convertToGuPixelFormat(PSPPixelFormat::Type format);
 	float scaleSourceToOutputX(float offset);
 	float scaleSourceToOutputY(float offset);
-	
+
 	friend class MasterGuRenderer;
 	Point _maxTextureOffset;		///> For rendering textures > 512 pixels
 	Point _offsetOnScreen;			///> Where on screen to draw

Modified: scummvm/trunk/backends/platform/psp/display_manager.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/display_manager.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/display_manager.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -48,7 +48,7 @@
 
 uint32 __attribute__((aligned(16))) MasterGuRenderer::_displayList[2048];
 
- const OSystem::GraphicsMode DisplayManager::_supportedModes[] = {
+const OSystem::GraphicsMode DisplayManager::_supportedModes[] = {
 	{ "320x200 (centered)", "320x200 16-bit centered", CENTERED_320X200 },
 	{ "435x272 (best-fit, centered)", "435x272 16-bit centered", CENTERED_435X272 },
 	{ "480x272 (full screen)", "480x272 16-bit stretched", STRETCHED_480X272 },
@@ -61,13 +61,13 @@
 
 void MasterGuRenderer::guInit() {
 	DEBUG_ENTER_FUNC();
-	
+
 	sceGuInit();
 	sceGuStart(0, _displayList);
-	
+
 	guProgramDisplayBufferSizes();
-	
-	sceGuOffset(2048 - (PSP_SCREEN_WIDTH/2), 2048 - (PSP_SCREEN_HEIGHT/2));
+
+	sceGuOffset(2048 - (PSP_SCREEN_WIDTH / 2), 2048 - (PSP_SCREEN_HEIGHT / 2));
 	sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
 	sceGuDepthRange(0xC350, 0x2710);
 	sceGuDisable(GU_DEPTH_TEST);	// We'll use depth buffer area
@@ -77,13 +77,13 @@
 	sceGuFrontFace(GU_CW);
 	sceGuEnable(GU_TEXTURE_2D);
 
-	sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
+	sceGuClear(GU_COLOR_BUFFER_BIT | GU_DEPTH_BUFFER_BIT);
 	sceGuFinish();
-	sceGuSync(0,0);
+	sceGuSync(0, 0);
 
 	sceDisplayWaitVblankStart();
 	sceGuDisplay(1);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -91,7 +91,7 @@
 	DEBUG_ENTER_FUNC();
 
 	PSP_DEBUG_PRINT("Outputbits[%u]\n", GuRenderer::_displayManager->getOutputBitsPerPixel());
-	
+
 	switch (GuRenderer::_displayManager->getOutputBitsPerPixel()) {
 	case 16:
 		sceGuDrawBuffer(GU_PSM_4444, (void *)0, PSP_BUFFER_WIDTH);
@@ -106,7 +106,7 @@
 		VramAllocator::instance().allocate(PSP_FRAME_SIZE * sizeof(uint32) * 2);
 		break;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -116,38 +116,38 @@
 
 #ifdef ENABLE_RENDER_MEASURE
 	_lastRenderTime = g_system->getMillis();
-#endif /* ENABLE_RENDER_MEASURE */	
-	
+#endif /* ENABLE_RENDER_MEASURE */
+
 	sceGuStart(0, _displayList);
 
 	sceGuClearColor(0xFF000000);
 	sceGuClear(GU_COLOR_BUFFER_BIT);
-	
+
 	sceGuAmbientColor(0xFFFFFFFF);
 	sceGuColor(0xFFFFFFFF);
-	sceGuTexOffset(0,0);
+	sceGuTexOffset(0, 0);
 	sceGuTexFilter(GU_LINEAR, GU_LINEAR);
-	
+
 	sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); // Also good enough for all purposes
 	sceGuAlphaFunc(GU_GREATER, 0, 0xFF);	   // Also good enough for all purposes
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 inline void MasterGuRenderer::guPostRender() {
 	DEBUG_ENTER_FUNC();
-	
+
 	sceGuFinish();
-	sceGuSync(0,0);
+	sceGuSync(0, 0);
 
 #ifdef ENABLE_RENDER_MEASURE
 	uint32 now = g_system->getMillis();
 	PSP_INFO_PRINT("Render took %d milliseconds\n", now - _lastRenderTime);
 #endif /* ENABLE_RENDER_MEASURE */
-	
+
 	sceDisplayWaitVblankStart();
 	sceGuSwapBuffers();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -164,16 +164,16 @@
 
 void DisplayManager::init() {
 	DEBUG_ENTER_FUNC();
-	
+
 	_displayParams.outputBitsPerPixel = 32;	// can be changed to produce 16-bit output
-	
+
 	GuRenderer::setDisplayManager(this);
 	_screen->init();
 	_overlay->init();
 	_cursor->init();
-	
+
 	_masterGuRenderer.guInit();				// start up the renderer
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -184,21 +184,21 @@
 
 	_overlay->deallocate();
 	_screen->deallocate();
-	
+
 	_screen->setScummvmPixelFormat(format);
 	_screen->setSize(width, height);
 	_screen->allocate();
-	
+
 	_cursor->setScreenPaletteScummvmPixelFormat(format);
 
 	_overlay->setBytesPerPixel(sizeof(OverlayColor));
 	_overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
 	_overlay->allocate();
-	
+
 	_displayParams.screenSource.width = width;
 	_displayParams.screenSource.height = height;
 	calculateScaleParams();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -245,16 +245,16 @@
 	default:
 		PSP_ERROR("Unsupported graphics mode[%d].\n", _graphicsMode);
 	}
-	
+
 	calculateScaleParams();
-	
+
 	DEBUG_EXIT_FUNC();
 	return true;
 }
 
 void DisplayManager::calculateScaleParams() {
 	if (_displayParams.screenOutput.width && _displayParams.screenSource.width &&
-	    _displayParams.screenOutput.height && _displayParams.screenSource.height) {
+	        _displayParams.screenOutput.height && _displayParams.screenSource.height) {
 		_displayParams.scaleX = ((float)_displayParams.screenOutput.width) / _displayParams.screenSource.width;
 		_displayParams.scaleY = ((float)_displayParams.screenOutput.height) / _displayParams.screenSource.height;
 	}
@@ -268,43 +268,43 @@
 		return;
 	}
 
-	if (!_screen->isDirty() && 
-		(!_overlay->isDirty()) && 
-		(!_cursor->isDirty()) && 
-		(!_keyboard->isDirty())) {
+	if (!_screen->isDirty() &&
+	        (!_overlay->isDirty()) &&
+	        (!_cursor->isDirty()) &&
+	        (!_keyboard->isDirty())) {
 		PSP_DEBUG_PRINT("Nothing dirty\n");
 		DEBUG_EXIT_FUNC();
 		return;
 	}
-	
+
 	PSP_DEBUG_PRINT("screen[%s], overlay[%s], cursor[%s], keyboard[%s]\n",
-		_screen->isDirty() ? "true" : "false",
-		_overlay->isDirty() ? "true" : "false",
-		_cursor->isDirty() ? "true" : "false",
-		_keyboard->isDirty() ? "true" : "false"
-		);
+	                _screen->isDirty() ? "true" : "false",
+	                _overlay->isDirty() ? "true" : "false",
+	                _cursor->isDirty() ? "true" : "false",
+	                _keyboard->isDirty() ? "true" : "false"
+	               );
 
 	_masterGuRenderer.guPreRender();	// Set up rendering
 
 	_screen->render();
-	
+
 	_screen->setClean();				// clean out dirty bit
 
 	if (_overlay->isVisible())
 		_overlay->render();
-		
+
 	_overlay->setClean();
-		
+
 	if (_cursor->isVisible())
 		_cursor->render();
-		
+
 	_cursor->setClean();
 
 	if (_keyboard->isVisible())
 		_keyboard->render();
-		
+
 	_keyboard->setClean();
-		
+
 	_masterGuRenderer.guPostRender();
 
 	DEBUG_EXIT_FUNC();
@@ -321,16 +321,16 @@
 	_lastUpdateTime = now;
 	return true;
 }
-	
+
 Common::List<Graphics::PixelFormat> DisplayManager::getSupportedPixelFormats() {
 	Common::List<Graphics::PixelFormat> list;
-	
+
 	// In order of preference
 	list.push_back(PSPPixelFormat::convertToScummvmPixelFormat(PSPPixelFormat::Type_5650));
 	list.push_back(PSPPixelFormat::convertToScummvmPixelFormat(PSPPixelFormat::Type_5551));
 	list.push_back(PSPPixelFormat::convertToScummvmPixelFormat(PSPPixelFormat::Type_4444));
 	list.push_back(Graphics::PixelFormat::createFormatCLUT8());
-	
+
 	return list;
 }
 

Modified: scummvm/trunk/backends/platform/psp/display_manager.h
===================================================================
--- scummvm/trunk/backends/platform/psp/display_manager.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/display_manager.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -24,7 +24,7 @@
  */
 
 #ifndef PSP_DISPLAY_MAN_H
-#define PSP_DISPLAY_MAN_H 
+#define PSP_DISPLAY_MAN_H
 
 /**
  *	Class used only by DisplayManager to start/stop GU rendering
@@ -60,13 +60,13 @@
 	};
 	DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0), _lastUpdateTime(0), _graphicsMode(0) {}
 	~DisplayManager();
-	
+
 	void init();
 	void renderAll();
 	bool setGraphicsMode(int mode);
 	bool setGraphicsMode(const char *name);
 	int getGraphicsMode() const { return _graphicsMode; }
-    uint32 getDefaultGraphicsMode() const { return STRETCHED_480X272; }
+	uint32 getDefaultGraphicsMode() const { return STRETCHED_480X272; }
 	const OSystem::GraphicsMode* getSupportedGraphicsModes() const { return _supportedModes; }
 
 	// Setters
@@ -99,15 +99,15 @@
 	Cursor *_cursor;
 	Overlay *_overlay;
 	PSPKeyboard *_keyboard;
-	
+
 	MasterGuRenderer _masterGuRenderer;
 	uint32 _lastUpdateTime;					// For limiting FPS
 	int _graphicsMode;
 	GlobalDisplayParams _displayParams;
 	static const OSystem::GraphicsMode _supportedModes[];
-	
+
 	void calculateScaleParams();	// calculates scaling factor
-	bool isTimeToUpdate();			// should we update the screen now	
+	bool isTimeToUpdate();			// should we update the screen now
 };
 
 

Modified: scummvm/trunk/backends/platform/psp/elf32.h
===================================================================
--- scummvm/trunk/backends/platform/psp/elf32.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/elf32.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -23,10 +23,10 @@
  *
  */
 
- #ifndef BACKENDS_ELF_H
- #define BACKENDS_ELF_H
+#ifndef BACKENDS_ELF_H
+#define BACKENDS_ELF_H
 
- /* ELF stuff */
+/* ELF stuff */
 
 typedef unsigned short Elf32_Half, Elf32_Section;
 typedef unsigned int Elf32_Word, Elf32_Addr, Elf32_Off;
@@ -39,22 +39,21 @@
 /* ELF File format structures. Look up ELF structure for more details */
 
 // ELF header (contains info about the file)
-typedef struct
-{
-  unsigned char e_ident[EI_NIDENT];     /* Magic number and other info */
-  Elf32_Half    e_type;                 /* Object file type */
-  Elf32_Half    e_machine;              /* Architecture */
-  Elf32_Word    e_version;              /* Object file version */
-  Elf32_Addr    e_entry;                /* Entry point virtual address */
-  Elf32_Off     e_phoff;                /* Program header table file offset */
-  Elf32_Off     e_shoff;                /* Section header table file offset */
-  Elf32_Word    e_flags;                /* Processor-specific flags */
-  Elf32_Half    e_ehsize;               /* ELF header size in bytes */
-  Elf32_Half    e_phentsize;            /* Program header table entry size */
-  Elf32_Half    e_phnum;                /* Program header table entry count */
-  Elf32_Half    e_shentsize;            /* Section header table entry size */
-  Elf32_Half    e_shnum;                /* Section header table entry count */
-  Elf32_Half    e_shstrndx;             /* Section header string table index */
+typedef struct {
+	unsigned char e_ident[EI_NIDENT];     /* Magic number and other info */
+	Elf32_Half    e_type;                 /* Object file type */
+	Elf32_Half    e_machine;              /* Architecture */
+	Elf32_Word    e_version;              /* Object file version */
+	Elf32_Addr    e_entry;                /* Entry point virtual address */
+	Elf32_Off     e_phoff;                /* Program header table file offset */
+	Elf32_Off     e_shoff;                /* Section header table file offset */
+	Elf32_Word    e_flags;                /* Processor-specific flags */
+	Elf32_Half    e_ehsize;               /* ELF header size in bytes */
+	Elf32_Half    e_phentsize;            /* Program header table entry size */
+	Elf32_Half    e_phnum;                /* Program header table entry count */
+	Elf32_Half    e_shentsize;            /* Section header table entry size */
+	Elf32_Half    e_shnum;                /* Section header table entry count */
+	Elf32_Half    e_shstrndx;             /* Section header string table index */
 } Elf32_Ehdr;
 
 // Should be in e_ident
@@ -72,16 +71,15 @@
 
 
 // Program header (contains info about segment)
-typedef struct
-{
-  Elf32_Word    p_type;                 /* Segment type */
-  Elf32_Off     p_offset;               /* Segment file offset */
-  Elf32_Addr    p_vaddr;                /* Segment virtual address */
-  Elf32_Addr    p_paddr;                /* Segment physical address */
-  Elf32_Word    p_filesz;               /* Segment size in file */
-  Elf32_Word    p_memsz;                /* Segment size in memory */
-  Elf32_Word    p_flags;                /* Segment flags */
-  Elf32_Word    p_align;                /* Segment alignment */
+typedef struct {
+	Elf32_Word    p_type;                 /* Segment type */
+	Elf32_Off     p_offset;               /* Segment file offset */
+	Elf32_Addr    p_vaddr;                /* Segment virtual address */
+	Elf32_Addr    p_paddr;                /* Segment physical address */
+	Elf32_Word    p_filesz;               /* Segment size in file */
+	Elf32_Word    p_memsz;                /* Segment size in memory */
+	Elf32_Word    p_flags;                /* Segment flags */
+	Elf32_Word    p_align;                /* Segment alignment */
 } Elf32_Phdr;
 
 // p_type values
@@ -100,18 +98,17 @@
 #define PF_R	4	/* read */
 
 // Section header (contains info about section)
-typedef struct
-{
-  Elf32_Word    sh_name;                /* Section name (string tbl index) */
-  Elf32_Word    sh_type;                /* Section type */
-  Elf32_Word    sh_flags;               /* Section flags */
-  Elf32_Addr    sh_addr;                /* Section virtual addr at execution */
-  Elf32_Off     sh_offset;              /* Section file offset */
-  Elf32_Word    sh_size;                /* Section size in bytes */
-  Elf32_Word    sh_link;                /* Link to another section */
-  Elf32_Word    sh_info;                /* Additional section information */
-  Elf32_Word    sh_addralign;           /* Section alignment */
-  Elf32_Word    sh_entsize;             /* Entry size if section holds table */
+typedef struct {
+	Elf32_Word    sh_name;                /* Section name (string tbl index) */
+	Elf32_Word    sh_type;                /* Section type */
+	Elf32_Word    sh_flags;               /* Section flags */
+	Elf32_Addr    sh_addr;                /* Section virtual addr at execution */
+	Elf32_Off     sh_offset;              /* Section file offset */
+	Elf32_Word    sh_size;                /* Section size in bytes */
+	Elf32_Word    sh_link;                /* Link to another section */
+	Elf32_Word    sh_info;                /* Additional section information */
+	Elf32_Word    sh_addralign;           /* Section alignment */
+	Elf32_Word    sh_entsize;             /* Entry size if section holds table */
 } Elf32_Shdr;
 
 // sh_type values
@@ -139,14 +136,13 @@
 
 
 // Symbol entry (contain info about a symbol)
-typedef struct
-{
-  Elf32_Word    st_name;                /* Symbol name (string tbl index) */
-  Elf32_Addr    st_value;               /* Symbol value */
-  Elf32_Word    st_size;                /* Symbol size */
-  unsigned char st_info;                /* Symbol type and binding */
-  unsigned char st_other;               /* Symbol visibility */
-  Elf32_Section st_shndx;               /* Section index */
+typedef struct {
+	Elf32_Word    st_name;                /* Symbol name (string tbl index) */
+	Elf32_Addr    st_value;               /* Symbol value */
+	Elf32_Word    st_size;                /* Symbol size */
+	unsigned char st_info;                /* Symbol type and binding */
+	unsigned char st_other;               /* Symbol visibility */
+	Elf32_Section st_shndx;               /* Section index */
 } Elf32_Sym;
 
 // Extract from the st_info
@@ -175,10 +171,9 @@
 #define SHN_HIRESERVE 	0xFFFF
 
 // Relocation entry (info about how to relocate)
-typedef struct
-{
-  Elf32_Addr    r_offset;               /* Address */
-  Elf32_Word    r_info;                 /* Relocation type and symbol index */
+typedef struct {
+	Elf32_Addr    r_offset;               /* Address */
+	Elf32_Word    r_info;                 /* Relocation type and symbol index */
 } Elf32_Rel;
 
 // Access macros for the relocation info
@@ -211,4 +206,4 @@
 	__valgp; \
 })
 
- #endif /* BACKENDS_ELF_H */
+#endif /* BACKENDS_ELF_H */

Modified: scummvm/trunk/backends/platform/psp/input.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/input.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/input.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -21,14 +21,14 @@
  * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $
  * $Id: osys_psp.cpp 43618 2009-08-21 22:44:49Z joostp $
  *
- */ 
+ */
 
-// Todo: handle events that should fire because of shift going off 
+// Todo: handle events that should fire because of shift going off
 // Solution: handle shift on a button-by-button basis, only allowing it when the button is up. Also a inputmap-wide button. At buttonup, shiftstate is inspected per button.
- 
+
 //#define __PSP_DEBUG_FUNCS__	/* Uncomment for debugging the stack */
 //#define __PSP_DEBUG_PRINT__ /* Uncomment for debug prints */
- 
+
 #include "backends/platform/psp/trace.h"
 
 #include "backends/platform/psp/input.h"
@@ -52,7 +52,7 @@
 
 bool InputHandler::getAllInputs(Common::Event &event) {
 	DEBUG_ENTER_FUNC();
-	
+
 	uint32 time = g_system->getMillis();	// may not be necessary with read
 	if (time - _lastPadCheckTime < PAD_CHECK_TIME) {
 		DEBUG_EXIT_FUNC();
@@ -70,17 +70,16 @@
 
 	if (_keyboard->isVisible())
 		haveEvent = _keyboard->processInput(event, pad);
-	else 
+	else
 		haveEvent = getEvent(event, pad);
 
-	if (haveEvent)
-	{	
+	if (haveEvent) {
 		PSP_DEBUG_PRINT("Have event[%s]\n", haveEvent ? "true" : "false");
 		PSP_DEBUG_PRINT("event.type[%d]\n", event.type);
-	}	
+	}
 
 	DEBUG_EXIT_FUNC();
-	
+
 	return haveEvent;
 }
 
@@ -92,22 +91,22 @@
 
 	// Collect events from different sources
 	haveEvent = getDpadEvent(event, pad);
-		
+
 	if (!haveEvent)
 		haveEvent = getButtonEvent(event, pad);
-		
+
 	if (!haveEvent)
-		haveEvent = getNubEvent(event, pad);		
+		haveEvent = getNubEvent(event, pad);
 
 	_prevButtons = pad.Buttons;
-	
+
 	DEBUG_EXIT_FUNC();
 	return haveEvent;
 }
 
 bool InputHandler::getDpadEvent(Common::Event &event, SceCtrlData &pad) {
 	DEBUG_ENTER_FUNC();
-	
+
 	int newDpadX = 0, newDpadY = 0;
 	bool haveEvent = false;
 
@@ -131,7 +130,7 @@
 		if (DOWN(PSP_CTRL_RTRIGGER))
 			newDpadY++;
 	}
-	
+
 	if (newDpadX != _dpadX || newDpadY != _dpadY) {
 		if (_dpadX == 0 && _dpadY == 0)	{		// We were in the middle so we pressed dpad
 			event.type = Common::EVENT_KEYDOWN;
@@ -139,8 +138,7 @@
 			event.kbd.ascii = event.kbd.keycode - Common::KEYCODE_KP0 + '0';	// Get ascii
 			_dpadX = newDpadX;
 			_dpadY = newDpadY;
-		}
-		else if (newDpadX == 0 && newDpadY == 0) {// We're now centered so we unpressed dpad
+		} else if (newDpadX == 0 && newDpadY == 0) {// We're now centered so we unpressed dpad
 			event.type = Common::EVENT_KEYUP;
 			event.kbd.keycode = translateDpad(_dpadX, _dpadY);
 			event.kbd.ascii = event.kbd.keycode - Common::KEYCODE_KP0 + '0';
@@ -153,7 +151,7 @@
 			_dpadX = 0; // so that we'll pick up a new dpad movement the next round
 			_dpadY = 0;
 		}
-		
+
 		PSP_DEBUG_PRINT("Keypad event. DpadX[%d], DpadY[%d]\n", _dpadX, _dpadY);
 		haveEvent = true;
 	}
@@ -204,7 +202,7 @@
 			event.type = DOWN(PSP_CTRL_CROSS) ? Common::EVENT_LBUTTONDOWN : Common::EVENT_LBUTTONUP;
 			event.mouse.x = _cursor->getX();	// Could this have to do with SCI enter problem?
 			event.mouse.y = _cursor->getY();
-			PSP_DEBUG_PRINT("%s\n", event.type == Common::EVENT_LBUTTONDOWN ? "LButtonDown" : "LButtonUp");	
+			PSP_DEBUG_PRINT("%s\n", event.type == Common::EVENT_LBUTTONDOWN ? "LButtonDown" : "LButtonUp");
 		} else if (CHANGED(PSP_CTRL_CIRCLE)) {
 			event.type = DOWN(PSP_CTRL_CIRCLE) ? Common::EVENT_RBUTTONDOWN : Common::EVENT_RBUTTONUP;
 			event.mouse.x = _cursor->getX();
@@ -234,12 +232,12 @@
 			} else if (DOWN(PSP_CTRL_RTRIGGER)) {			// An event
 				event.kbd.flags |= Common::KBD_SHIFT;
 			}
-			PSP_DEBUG_PRINT("Ascii[%d]. Key %s.\n", event.kbd.ascii, event.type == Common::EVENT_KEYDOWN ? "down" : "up" );
+			PSP_DEBUG_PRINT("Ascii[%d]. Key %s.\n", event.kbd.ascii, event.type == Common::EVENT_KEYDOWN ? "down" : "up");
 		}
-		
+
 		haveEvent = true;
 	}
-	
+
 	DEBUG_EXIT_FUNC();
 	return haveEvent;
 }
@@ -248,7 +246,7 @@
 	DEBUG_ENTER_FUNC();
 
 	bool haveEvent = false;
-	int32 analogStepX = pad.Lx;		// Goes up to 255. 
+	int32 analogStepX = pad.Lx;		// Goes up to 255.
 	int32 analogStepY = pad.Ly;
 
 	int32 oldX = _cursor->getX();
@@ -256,27 +254,27 @@
 
 	analogStepX = modifyNubAxisMotion(analogStepX);
 	analogStepY = modifyNubAxisMotion(analogStepY);
-	
+
 	if (analogStepX != 0 || analogStepY != 0) {
-	
+
 		PSP_DEBUG_PRINT("raw x[%d], y[%d]\n", analogStepX, analogStepY);
-		
+
 		// If no movement then this has no effect
 		if (DOWN(PSP_CTRL_RTRIGGER)) {
 			// Fine control mode for analog
-				if (analogStepX != 0) {
-					if (analogStepX > 0)
-						_cursor->increaseXY(2, 0);
-					else
-						_cursor->increaseXY(-2, 0);
-				}
+			if (analogStepX != 0) {
+				if (analogStepX > 0)
+					_cursor->increaseXY(2, 0);
+				else
+					_cursor->increaseXY(-2, 0);
+			}
 
-				if (analogStepY != 0) {
-					if (analogStepY > 0)
-						_cursor->increaseXY(0, 2);
-					else
-						_cursor->increaseXY(0, -2);
-				}
+			if (analogStepY != 0) {
+				if (analogStepY > 0)
+					_cursor->increaseXY(0, 2);
+				else
+					_cursor->increaseXY(0, -2);
+			}
 		} else {	// Regular speed movement
 			_cursor->increaseXY(analogStepX, 0);
 			_cursor->increaseXY(0, analogStepY);
@@ -290,7 +288,7 @@
 			event.mouse.x = newX;
 			event.mouse.y = newY;
 			haveEvent = true;
-			
+
 			PSP_DEBUG_PRINT("Nub event. X[%d], Y[%d]\n", newX, newY);
 		}
 	}
@@ -301,17 +299,17 @@
 inline int32 InputHandler::modifyNubAxisMotion(int32 input) {
 	DEBUG_ENTER_FUNC();
 	const int MIN_NUB_MOTION = 30;
-	
+
 	input -= 128;	// Center on 0.
-	
+
 	if (input < -MIN_NUB_MOTION - 1)
 		input += MIN_NUB_MOTION + 1;	// reduce the velocity
 	else if (input > MIN_NUB_MOTION)
 		input -= MIN_NUB_MOTION;	// same
-	else 				// between these points, dampen the response to 0	
+	else 				// between these points, dampen the response to 0
 		input = 0;
-	
-	
+
+
 	DEBUG_EXIT_FUNC();
-	return input;	
+	return input;
 }

Modified: scummvm/trunk/backends/platform/psp/input.h
===================================================================
--- scummvm/trunk/backends/platform/psp/input.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/input.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -21,7 +21,7 @@
  * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $
  * $Id: osys_psp.cpp 43618 2009-08-21 22:44:49Z joostp $
  *
- */ 
+ */
 
 #ifndef PSP_INPUT_H
 #define PSP_INPUT_H
@@ -37,7 +37,7 @@
 class InputHandler {
 public:
 	InputHandler() : _cursor(0), _keyboard(0), _prevButtons(0), _lastPadCheckTime(0), _buttonsChanged(0), _dpadX(0), _dpadY(0) {}
-	
+
 	void init();
 	bool getAllInputs(Common::Event &event);
 	void setKeyboard(PSPKeyboard *keyboard) { _keyboard = keyboard; }
@@ -51,11 +51,11 @@
 	uint32 _buttonsChanged;
 	int32 _dpadX, _dpadY;
 	int32 _accelX, _accelY;
-	
+
 	bool getEvent(Common::Event &event, SceCtrlData &pad);
 	bool getDpadEvent(Common::Event &event, SceCtrlData &pad);
 	bool getButtonEvent(Common::Event &event, SceCtrlData &pad);
-	bool getNubEvent(Common::Event &event, SceCtrlData &pad);	
+	bool getNubEvent(Common::Event &event, SceCtrlData &pad);
 	int32 modifyNubAxisMotion(int32 input);
 	Common::KeyCode translateDpad(int x, int y);
 };

Modified: scummvm/trunk/backends/platform/psp/memory.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/memory.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/memory.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -23,12 +23,12 @@
  *
  */
 
-#include "common/scummsys.h" 
+#include "common/scummsys.h"
 #include "common/singleton.h"
 #include "common/list.h"
 #include "backends/platform/psp/psppixelformat.h"
 #include "backends/platform/psp/memory.h"
- 
+
 // Class Copier --------------------------------------------------------------------------
 //#define __PSP_DEBUG_FUNCS__	/* For debugging the stack */
 //#define __PSP_DEBUG_PRINT__
@@ -37,7 +37,7 @@
 
 void Copier::copy(byte *dst, const byte *src, uint32 bytes, PSPPixelFormat *format /* = NULL */) {
 	DEBUG_ENTER_FUNC();
-	
+
 	uint32 prefixDst = (((uint32)dst) & 0x3);
 	prefixDst = prefixDst ? 4 - prefixDst : 0;	// prefix only if we have address % 4 != 0
 	uint32 prefixSrc = (((uint32)src) & 0x3);
@@ -47,11 +47,11 @@
 #ifdef __PSP_DEBUG_PRINT__
 	uint32 debugBytes = bytes;
 	const byte *debugDst = dst, *debugSrc = src;
-#endif	
+#endif
 	uint32 words, remainingBytes;
-	
+
 	//PSP_DEBUG_PRINT("dst[%p], src[%p], bytes[%d], swap[%s], prefixDst[%u], prefixSrc[%u]\n", dst, src, bytes, swapRB ? "true" : "false", prefixDst, prefixSrc);
-	
+
 	if (prefixDst || prefixSrc) { 			// we're not aligned to word boundaries
 		if (prefixDst != prefixSrc) {		// worst case: we can never be aligned. this mode is highly inefficient. try to get engines not to use this mode too much
 			PSP_DEBUG_PRINT("misaligned copy of %u bytes from %p to %p\n", bytes, src, dst);
@@ -59,10 +59,10 @@
 				copy8(dst, src, bytes);	// no swap is possible on 8 bit
 			else
 				copy16((uint16 *)dst, (uint16 *)src, bytes, format);
-				
-			goto test;	
+
+			goto test;
 		}
-		
+
 		// Do the prefix: the part to get us aligned
 		if (prefixDst & 1) { 			// byte
 			copy8(dst, src, prefixDst);	// no swap available
@@ -72,7 +72,7 @@
 		if (bytes > prefixDst)	// check that we can afford to subtract from bytes
 			bytes -= prefixDst;
 		else {
-			DEBUG_EXIT_FUNC();	
+			DEBUG_EXIT_FUNC();
 			return;
 		}
 		dst32 = (uint32 *)(dst + prefixDst);
@@ -80,11 +80,11 @@
 	} else { // We're aligned to word boundaries
 		dst32 = (uint32 *)dst;
 		src32 = (uint32 *)src;
-	}	
-	
+	}
+
 	words = bytes >> 2;
 	remainingBytes = bytes & 0x3;
-	
+
 	if (swapRB) {	// need to swap
 		for (; words > 0; words--) {
 			*dst32 = format->swapRedBlue32(*src32);
@@ -107,13 +107,13 @@
 			copy16((uint16*)dst32, (uint16 *)src32, remainingBytes, format);
 	}
 
-test:	
+test:
 	// debug
 #ifdef __PSP_DEBUG_PRINT__
 	bool mismatch = false;
 
-	for (uint32 i=0; i<debugBytes; i++) {
-		if (debugDst[i] != debugSrc[i]) { 
+	for (uint32 i = 0; i < debugBytes; i++) {
+		if (debugDst[i] != debugSrc[i]) {
 			if (mismatch == false) {
 				PSP_DEBUG_PRINT_SAMELN("mismatch in copy:\n");
 				PSP_DEBUG_PRINT("dst[%p], src[%p], bytes[%u], swap[%s], prefixDst[%u], prefixSrc[%u]\n", debugDst, debugSrc, debugBytes, swapRB ? "true" : "false", prefixDst, prefixSrc);
@@ -122,7 +122,7 @@
 			PSP_DEBUG_PRINT_SAMELN("%x!=%x ", debugSrc[i], debugDst[i]);
 		}
 	}
-	if (mismatch) 
+	if (mismatch)
 		PSP_DEBUG_PRINT("\n");
 #endif
 
@@ -134,7 +134,7 @@
 		*dst = *src;
 		dst++;
 		src++;
-	}	
+	}
 }
 
 inline void Copier::copy16(uint16 *dst, const uint16 *src, uint32 bytes, PSPPixelFormat *format /* = NULL */) {
@@ -147,7 +147,7 @@
 			*dst = format->swapRedBlue16(*src);
 			dst++;
 			src++;
-		}	
+		}
 	} else {
 		for (; shorts > 0 ; shorts--) {
 			*dst = *src;
@@ -158,8 +158,8 @@
 	if (remainingBytes)
 		*(byte *)dst = *(byte *)src;
 }
- 
- 
+
+
 // Class VramAllocator -----------------------------------
 
 DECLARE_SINGLETON(VramAllocator)
@@ -172,34 +172,34 @@
 
 void *VramAllocator::allocate(int32 size, bool smallAllocation /* = false */) {
 	DEBUG_ENTER_FUNC();
-	assert (size > 0);
-	
+	assert(size > 0);
+
 	byte *lastAddress = smallAllocation ? (byte *)VRAM_SMALL_ADDRESS : (byte *)VRAM_START_ADDRESS;
 	Common::List<Allocation>::iterator i;
 
 	// Find a block that fits, starting from the beginning
 	for (i = _allocList.begin(); i != _allocList.end(); ++i) {
 		byte *currAddress = (*i).address;
-		
+
 		if (currAddress - lastAddress >= size) // We found a match
 			break;
-		
+
 		if ((*i).getEnd() > lastAddress)
 			lastAddress = (byte *)(*i).getEnd();
 	}
 
 	if (lastAddress + size > (byte *)VRAM_END_ADDRESS) {
 		PSP_DEBUG_PRINT("No space for allocation of %d bytes. %d bytes already allocated.\n",
-						size, _bytesAllocated);
+		                size, _bytesAllocated);
 		return NULL;
 	}
 
 	_allocList.insert(i, Allocation(lastAddress, size));
 	_bytesAllocated += size;
-	
+
 	PSP_DEBUG_PRINT("Allocated in VRAM, size %u at %p.\n", size, lastAddress);
 	PSP_DEBUG_PRINT("Total allocated %u, remaining %u.\n", _bytesAllocated, (2 * 1024 * 1024) - _bytesAllocated);
-	
+
 	DEBUG_EXIT_FUNC();
 	return lastAddress;
 }
@@ -208,9 +208,9 @@
 void VramAllocator::deallocate(void *address) {
 	DEBUG_ENTER_FUNC();
 	address = (byte *)CACHED(address);	// Make sure all addresses are the same
-	
+
 	Common::List<Allocation>::iterator i;
-	
+
 	// Find the Allocator to deallocate
 	for (i = _allocList.begin(); i != _allocList.end(); ++i) {
 		if ((*i).address == address) {
@@ -220,8 +220,8 @@
 			DEBUG_EXIT_FUNC();
 			return;
 		}
-	}	
-	
+	}
+
 	PSP_DEBUG_PRINT("Address[%p] not allocated.\n", address);
 	DEBUG_EXIT_FUNC();
-}		
+}

Modified: scummvm/trunk/backends/platform/psp/memory.h
===================================================================
--- scummvm/trunk/backends/platform/psp/memory.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/memory.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -25,11 +25,11 @@
  */
 
 #ifndef PSP_MEMORY_H
-#define PSP_MEMORY_H 
+#define PSP_MEMORY_H
 
 #define UNCACHED(x)		((byte *)(((uint32)(x)) | 0x40000000))	/* make an uncached access */
 #define CACHED(x)		((byte *)(((uint32)(x)) & 0xBFFFFFFF))	/* make an uncached access into a cached one */
- 
+
 /**
  *	Class that does memory copying and swapping if needed
  */
@@ -50,10 +50,10 @@
 	void deallocate(void *pointer);
 
 	static inline bool isAddressInVram(void *address) {
-	if ((uint32)(CACHED(address)) >= VRAM_START_ADDRESS && (uint32)(CACHED(address)) < VRAM_END_ADDRESS)
-		return true;
-	return false;
-}
+		if ((uint32)(CACHED(address)) >= VRAM_START_ADDRESS && (uint32)(CACHED(address)) < VRAM_END_ADDRESS)
+			return true;
+		return false;
+	}
 
 
 private:
@@ -71,10 +71,10 @@
 	enum {
 		VRAM_START_ADDRESS = 0x04000000,
 		VRAM_END_ADDRESS   = 0x04200000,
-		VRAM_SMALL_ADDRESS = VRAM_END_ADDRESS - (4*1024)	// 4K in the end for small allocations
+		VRAM_SMALL_ADDRESS = VRAM_END_ADDRESS - (4 * 1024)	// 4K in the end for small allocations
 	};
 	Common::List <Allocation> _allocList;		// List of allocations
 	uint32 _bytesAllocated;
 };
- 
+
 #endif /* PSP_MEMORY_H */

Modified: scummvm/trunk/backends/platform/psp/osys_psp.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/osys_psp.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/osys_psp.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -23,7 +23,7 @@
  *
  */
 
-#include <pspuser.h> 
+#include <pspuser.h>
 #include <pspgu.h>
 #include <pspdisplay.h>
 
@@ -70,7 +70,7 @@
 
 	_cursor.enableCursorPalette(false);
 	_cursor.setXY(PSP_SCREEN_WIDTH >> 1, PSP_SCREEN_HEIGHT >> 1);	// Mouse in the middle of the screen
-	
+
 	// Set pointers for display manager
 	_displayManager.setCursor(&_cursor);
 	_displayManager.setScreen(&_screen);
@@ -83,7 +83,7 @@
 	_inputHandler.setKeyboard(&_keyboard);
 	_inputHandler.init();
 
-	initSDL();		
+	initSDL();
 
 	_savefile = new PSPSaveFileManager;
 
@@ -91,13 +91,13 @@
 
 	PSP_DEBUG_PRINT("calling keyboard.load()\n");
 	_keyboard.load();	// Load virtual keyboard files into memory
-	
+
 	setTimerCallback(&timer_handler, 10);
 
 	setupMixer();
 
 	OSystem::initBackend();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -127,27 +127,27 @@
 
 bool OSystem_PSP::setGraphicsMode(int mode) {
 	DEBUG_ENTER_FUNC();
-	
+
 	int ret = _displayManager.setGraphicsMode(mode);
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
 
 bool OSystem_PSP::setGraphicsMode(const char *name) {
 	DEBUG_ENTER_FUNC();
-	
+
 	int ret = _displayManager.setGraphicsMode(name);
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
 
 int OSystem_PSP::getGraphicsMode() const {
 	DEBUG_ENTER_FUNC();
-	
+
 	int ret = _displayManager.getGraphicsMode();
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
@@ -166,7 +166,7 @@
 
 void OSystem_PSP::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
 	DEBUG_ENTER_FUNC();
-	
+
 	_displayManager.setSizeAndPixelFormat(width, height, format);
 
 	_cursor.setVisible(false);
@@ -179,7 +179,7 @@
 	DEBUG_ENTER_FUNC();
 
 	int16 ret = (int16)_screen.getWidth();
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
@@ -188,14 +188,14 @@
 	DEBUG_ENTER_FUNC();
 
 	int16 ret = (int16)_screen.getHeight();
-	
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
 
 void OSystem_PSP::setPalette(const byte *colors, uint start, uint num) {
 	DEBUG_ENTER_FUNC();
-	
+
 	_screen.setPartialPalette(colors, start, num);
 	_cursor.setScreenPalette(colors, start, num);
 	_cursor.clearKeyColor();
@@ -217,7 +217,7 @@
 	DEBUG_ENTER_FUNC();
 
 	_cursor.enableCursorPalette(!disable);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -232,8 +232,8 @@
 Graphics::Surface *OSystem_PSP::lockScreen() {
 	DEBUG_ENTER_FUNC();
 
-	Graphics::Surface *ret = _screen.lockAndGetForEditing();	
-	
+	Graphics::Surface *ret = _screen.lockAndGetForEditing();
+
 	DEBUG_EXIT_FUNC();
 	return ret;
 }
@@ -242,7 +242,7 @@
 	DEBUG_ENTER_FUNC();
 	// The screen is always completely updated anyway, so we don't have to force a full update here.
 	_screen.unlock();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -250,16 +250,16 @@
 	DEBUG_ENTER_FUNC();
 
 	_displayManager.renderAll();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 void OSystem_PSP::setShakePos(int shakeOffset) {
-	DEBUG_ENTER_FUNC();	
+	DEBUG_ENTER_FUNC();
 
 	_screen.setShakePos(shakeOffset);
-	
-	DEBUG_EXIT_FUNC();	
+
+	DEBUG_EXIT_FUNC();
 }
 
 void OSystem_PSP::showOverlay() {
@@ -268,7 +268,7 @@
 	_overlay.setVisible(true);
 	_cursor.setLimits(_overlay.getWidth(), _overlay.getHeight());
 	_cursor.useGlobalScaler(false);	// mouse with overlay is 1:1
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -278,7 +278,7 @@
 	_overlay.setVisible(false);
 	_cursor.setLimits(_screen.getWidth(), _screen.getHeight());
 	_cursor.useGlobalScaler(true);	// mouse needs to be scaled with screen
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -318,7 +318,7 @@
 	DEBUG_ENTER_FUNC();
 
 	_screen.getPartialPalette(colors, start, num);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -328,17 +328,17 @@
 	PSP_DEBUG_PRINT("%s\n", v ? "true" : "false");
 	bool last = _cursor.isVisible();
 	_cursor.setVisible(v);
-	
+
 	DEBUG_EXIT_FUNC();
-	
+
 	return last;
 }
 
 void OSystem_PSP::warpMouse(int x, int y) {
 	DEBUG_ENTER_FUNC();
 
-	_cursor.setXY(x,y);
-	
+	_cursor.setXY(x, y);
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -349,14 +349,14 @@
 	if (format) {
 		PSP_DEBUG_PRINT("format: bpp[%d], rLoss[%d], gLoss[%d], bLoss[%d], aLoss[%d], rShift[%d], gShift[%d], bShift[%d], aShift[%d]\n", format->bytesPerPixel, format->rLoss, format->gLoss, format->bLoss, format->aLoss, format->rShift, format->gShift, format->bShift, format->aShift);
 	}
-	
-	_cursor.setKeyColor(keycolor);	
+
+	_cursor.setKeyColor(keycolor);
 	_cursor.setCursorTargetScale(cursorTargetScale);
 	_cursor.setSizeAndScummvmPixelFormat(w, h, format);
 	_cursor.setHotspot(hotspotX, hotspotY);
 	_cursor.clearKeyColor();
 	_cursor.copyFromArray(buf);
-	
+
 	DEBUG_EXIT_FUNC();
 }
 

Modified: scummvm/trunk/backends/platform/psp/osys_psp.h
===================================================================
--- scummvm/trunk/backends/platform/psp/osys_psp.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/osys_psp.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -43,7 +43,7 @@
 
 class OSystem_PSP : public BaseBackend {
 private:
-	
+
 	Common::SaveFileManager *_savefile;
 	Audio::MixerImpl *_mixer;
 	Common::TimerManager *_timer;
@@ -63,14 +63,14 @@
 	~OSystem_PSP();
 
 	static OSystem *instance();
-	
+
 	void initBackend();
-	
+
 	// Feature related
 	bool hasFeature(Feature f);
 	void setFeatureState(Feature f, bool enable);
 	bool getFeatureState(Feature f);
-	
+
 	// Graphics related
 	const GraphicsMode *getSupportedGraphicsModes() const;
 	int getDefaultGraphicsMode() const;
@@ -81,25 +81,25 @@
 	virtual Graphics::PixelFormat getScreenFormat() const;
 	virtual Common::List<Graphics::PixelFormat> getSupportedFormats();
 #endif
-	
+
 	// Screen size
 	void initSize(uint width, uint height, const Graphics::PixelFormat *format);
 	int16 getWidth();
 	int16 getHeight();
-	
+
 	// Palette related
 	void setPalette(const byte *colors, uint start, uint num);
 	void grabPalette(byte *colors, uint start, uint num);
 	void setCursorPalette(const byte *colors, uint start, uint num);
 	void disableCursorPalette(bool disable);
-	
+
 	// Screen related
 	void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
 	Graphics::Surface *lockScreen();
 	void unlockScreen();
 	void updateScreen();
 	void setShakePos(int shakeOffset);
-	
+
 	// Overlay related
 	void showOverlay();
 	void hideOverlay();
@@ -109,7 +109,7 @@
 	int16 getOverlayHeight();
 	int16 getOverlayWidth();
 	Graphics::PixelFormat getOverlayFormat() const { return Graphics::createPixelFormat<4444>(); }
-	
+
 	// Mouse related
 	bool showMouse(bool visible);
 	void warpMouse(int x, int y);
@@ -138,7 +138,7 @@
 	static void mixCallback(void *sys, byte *samples, int len);
 	void setupMixer(void);
 	Audio::Mixer *getMixer() { return _mixer; }
-	
+
 	// Misc
 	Common::SaveFileManager *getSavefileManager() { return _savefile; }
 	FilesystemFactory *getFilesystemFactory() { return &PSPFilesystemFactory::instance(); }

Modified: scummvm/trunk/backends/platform/psp/powerman.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/powerman.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/powerman.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -26,7 +26,7 @@
 //#define __PSP_DEBUG_FUNCS__	/* can put this locally too */
 //#define __PSP_DEBUG_PRINT__
 #include "backends/platform/psp/trace.h"
- 
+
 #include <psppower.h>
 #include <pspthreadman.h>
 
@@ -37,19 +37,19 @@
 
 // Function to debug the Power Manager (we have no output to screen)
 inline void PowerManager::debugPM() {
-	PSP_DEBUG_PRINT("PM status[%d]. Listcount[%d]. CriticalCount[%d]. ThreadId[%x]. Error[%d]\n", 
-					_PMStatus, _listCounter, _criticalCounter, sceKernelGetThreadId(), _error);
+	PSP_DEBUG_PRINT("PM status[%d]. Listcount[%d]. CriticalCount[%d]. ThreadId[%x]. Error[%d]\n",
+	                _PMStatus, _listCounter, _criticalCounter, sceKernelGetThreadId(), _error);
 }
 
 
- /*******************************************
+/*******************************************
 *
 *	Constructor
 *
 ********************************************/
 PowerManager::PowerManager() {
 	DEBUG_ENTER_FUNC();
-	
+
 	_flagMutex = NULL;					/* Init mutex handle */
 	_listMutex = NULL;					/* Init mutex handle */
 	_condSuspendable = NULL;			/* Init condition variable */
@@ -78,14 +78,14 @@
 	_suspendFlag = false;
 	_criticalCounter = 0;	// How many are in the critical section
 	_pauseFlag = 0;
-	_pauseFlagOld = 0; 
+	_pauseFlagOld = 0;
 	_pauseClientState = 0;
 	_listCounter = 0;
 	PMStatusSet(kInitDone);
 	_error = 0;
 
 	DEBUG_EXIT_FUNC();
- }
+}
 
 /*******************************************
 *
@@ -107,7 +107,7 @@
 	if (SDL_mutexV(_listMutex) != 0) {
 		PSP_ERROR("Couldn't unlock _listMutex[%p]\n", _listMutex);
 	}
-	
+
 	debugPM();
 
 	DEBUG_EXIT_FUNC();
@@ -123,7 +123,7 @@
 	DEBUG_ENTER_FUNC();
 	debugPM();
 
-	 // Unregister from stream list
+	// Unregister from stream list
 	if (SDL_mutexP(_listMutex) != 0) {
 		PSP_ERROR("Couldn't unlock _listMutex[%p]\n", _listMutex);
 	}
@@ -140,16 +140,16 @@
 
 	DEBUG_EXIT_FUNC();
 	return 0;
- }
+}
 
- /*******************************************
+/*******************************************
 *
 *	Destructor
 *
 ********************************************/
- PowerManager::~PowerManager() {
+PowerManager::~PowerManager() {
 	DEBUG_ENTER_FUNC();
- 
+
 	PMStatusSet(kDestroyPM);
 
 	SDL_DestroyCond(_condSuspendable);
@@ -163,9 +163,9 @@
 
 	SDL_DestroyMutex(_listMutex);
 	_listMutex = 0;
-	
+
 	DEBUG_EXIT_FUNC();
- }
+}
 
 /*******************************************
 *
@@ -186,8 +186,7 @@
 			g_engine->pauseEngine(true);
 			PSP_DEBUG_PRINT_FUNC("Pausing engine\n");
 			_pauseClientState = PowerManager::Paused;		// Tell PM we're done pausing
-		}
-		else if (!pause && _pauseClientState == PowerManager::Paused) {
+		} else if (!pause && _pauseClientState == PowerManager::Paused) {
 			g_engine->pauseEngine(false);
 			PSP_DEBUG_PRINT_FUNC("Unpausing for resume\n");
 			_pauseClientState = PowerManager::Unpaused;	// Tell PM we're in the middle of pausing
@@ -216,7 +215,7 @@
 
 int PowerManager::beginCriticalSection(bool justBlock) {
 	DEBUG_ENTER_FUNC();
-	
+
 	int ret = NotBlocked;
 
 	if (SDL_mutexP(_flagMutex) != 0) {
@@ -290,7 +289,7 @@
 	return ret;
 }
 
- /*******************************************
+/*******************************************
 *
 *	Callback function to be called to put every Suspendable to suspend
 *

Modified: scummvm/trunk/backends/platform/psp/powerman.h
===================================================================
--- scummvm/trunk/backends/platform/psp/powerman.h	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/powerman.h	2010-04-12 07:28:54 UTC (rev 48634)
@@ -31,25 +31,25 @@
 #include "common/singleton.h"
 #include "common/list.h"
 
- /*
-  *  Implement this class (interface) if you want to use PowerManager's suspend callback functionality
-  *
-  */
- class Suspendable {
- public:
+/*
+ *  Implement this class (interface) if you want to use PowerManager's suspend callback functionality
+ *
+ */
+class Suspendable {
+public:
 	virtual ~Suspendable() {}
 	virtual int suspend() = 0;
 	virtual int resume() = 0;
- };
+};
 
- /******************************************************************************************************
- *
- *  This class will call a Suspendable when the PSP goes to suspend/resumes. It also provides the ability to block
- *  a thread when the PSP is going to suspend/suspending, and to wake it up when the PSP is resumed.
- *	This ability is very useful for managing the PSPIoStream class, but may be found useful by other classes as well.
- *
- *******************************************************************************************************/
- class PowerManager: public Common::Singleton<PowerManager> {
+/******************************************************************************************************
+*
+*  This class will call a Suspendable when the PSP goes to suspend/resumes. It also provides the ability to block
+*  a thread when the PSP is going to suspend/suspending, and to wake it up when the PSP is resumed.
+*	This ability is very useful for managing the PSPIoStream class, but may be found useful by other classes as well.
+*
+*******************************************************************************************************/
+class PowerManager: public Common::Singleton<PowerManager> {
 
 public:
 	int blockOnSuspend();								/* block if suspending */
@@ -76,7 +76,7 @@
 		Paused
 	};
 
- private:
+private:
 	friend class Common::Singleton<PowerManager>;
 	PowerManager();
 	~PowerManager();
@@ -125,12 +125,12 @@
 	void PMStatusSet(PMState s) { _PMStatus = s; }
 	volatile int _PMStatus;							/* What the PM is doing */
 
- public:
- 	int getPMStatus() { return _PMStatus; }
+public:
+	int getPMStatus() { return _PMStatus; }
 
- };
+};
 
- // For easy access
+// For easy access
 #define PowerMan	PowerManager::instance()
 
 #endif /* POWERMAN_H */

Modified: scummvm/trunk/backends/platform/psp/psp_main.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/psp_main.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/psp_main.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -26,10 +26,10 @@
 #define	USERSPACE_ONLY	//don't use kernel mode features
 
 #ifndef USERSPACE_ONLY
-	#include <pspkernel.h>
-	#include <pspdebug.h>
+#include <pspkernel.h>
+#include <pspdebug.h>
 #else
-	#include <pspuser.h>
+#include <pspuser.h>
 #endif
 
 #include <psppower.h>
@@ -87,7 +87,7 @@
  * Function that is called from _init in kernelmode before the
  * main thread is started in usermode.
  */
-__attribute__ ((constructor))
+__attribute__((constructor))
 void loaderInit() {
 	pspKernelSetKernelPC();
 	pspDebugInstallErrorHandler(MyExceptionHandler);
@@ -150,7 +150,7 @@
 	SetupCallbacks();
 
 	static const char *argv[] = { "scummvm", NULL };
-	static int argc = sizeof(argv)/sizeof(char *)-1;
+	static int argc = sizeof(argv) / sizeof(char *) - 1;
 
 	g_system = new OSystem_PSP();
 	assert(g_system);

Modified: scummvm/trunk/backends/platform/psp/pspkeyboard.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/pspkeyboard.cpp	2010-04-12 07:20:54 UTC (rev 48633)
+++ scummvm/trunk/backends/platform/psp/pspkeyboard.cpp	2010-04-12 07:28:54 UTC (rev 48634)
@@ -26,7 +26,7 @@
 //#define PSP_KB_SHELL	/* Need a hack to properly load the keyboard from the PSP shell */
 
 #ifdef PSP_KB_SHELL
-	#define PSP_KB_SHELL_PATH 	"ms0:/psp/game4xx/scummvm-solid/"	/* path to kbd.zip */
+#define PSP_KB_SHELL_PATH 	"ms0:/psp/game4xx/scummvm-solid/"	/* path to kbd.zip */
 #endif
 
 //#define __PSP_DEBUG_FUNCS__	/* For debugging the stack */
@@ -80,7 +80,7 @@
 	},
 	{	//symbols
 		{ K('!'),  K(')'), K('?'), K('('), K('<'), K('>') },
-		{ K('+'),  K('/'), K('='), K('\\'),K('\''),K('"') },
+		{ K('+'),  K('/'), K('='), K('\\'), K('\''), K('"') },
 		{ K(':'),  K(']'), K(';'), K('['), K('@'), K('#') },
 		{ K('-'),  K('}'), K('_'), K('{'), K('*'), K('$') },
 		{ K('\b'), K('.'), K(' '), K(','), K(0),   K(0)   }
@@ -108,7 +108,7 @@
 // Constructor
 PSPKeyboard::PSPKeyboard() {
 	DEBUG_ENTER_FUNC();
-	
+
 	_init = false;			// we're not initialized yet
 	_prevButtons = 0;		// Reset previous buttons
 	_dirty = false;        	// keyboard needs redrawing
@@ -119,19 +119,19 @@
 	_moved = false;			// Keyboard wasn't moved recently
 	_state = kInvisible;	// We start invisible
 	_lastState = kInvisible;
-	
+
 	// Constant renderer settings
 	_renderer.setAlphaBlending(true);
 	_renderer.setColorTest(false);
-	_renderer.setUseGlobalScaler(false);	
-	
+	_renderer.setUseGlobalScaler(false);
+
 	DEBUG_EXIT_FUNC();
 }
 
 // Destructor
 PSPKeyboard::~PSPKeyboard() {
 	DEBUG_ENTER_FUNC();
-	
+
 	if (!_init) {
 		DEBUG_EXIT_FUNC();
 		return;
@@ -142,18 +142,17 @@
 		_palettes[i].deallocate();
 	}
 	_init = false;
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
-void PSPKeyboard::setVisible(bool val) { 
+void PSPKeyboard::setVisible(bool val) {
 	if (val && _state == kInvisible && _init) {	// Check also that were loaded correctly
 		_lastState = _state;
-		_state = kMove; 
-	}
-	else if ( !val && _state != kInvisible) {
+		_state = kMove;
+	} else if (!val && _state != kInvisible) {
 		_lastState = _state;
-		_state = kInvisible; 
+		_state = kInvisible;
 	}
 	setDirty();
 }
@@ -161,34 +160,34 @@
 /* move the position the keyboard is currently drawn at */
 void PSPKeyboard::moveTo(const int newX, const int newY) {
 	DEBUG_ENTER_FUNC();
-	
+
 	_movedX = newX;
 	_movedY = newY;
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 /* move the position the keyboard is currently drawn at */
 void PSPKeyboard::increaseKeyboardLocationX(int amount) {
 	DEBUG_ENTER_FUNC();
-	
+
 	int newX = _movedX + amount;
 
 	if (newX > PSP_SCREEN_WIDTH - 5 || newX < 0 - 140) {	// clamp
 		DEBUG_EXIT_FUNC();
 		return;
-	}	
+	}
 	_movedX = newX;
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
 /* move the position the keyboard is currently drawn at */
 void PSPKeyboard::increaseKeyboardLocationY(int amount) {
 	DEBUG_ENTER_FUNC();
-	
+
 	int newY = _movedY + amount;
 
 	if (newY > PSP_SCREEN_HEIGHT - 5 || newY < 0 - 140)	{ // clamp
@@ -197,7 +196,7 @@
 	}
 	_movedY = newY;
 	setDirty();
-	
+
 	DEBUG_EXIT_FUNC();
 }
 
@@ -205,8 +204,8 @@
 void PSPKeyboard::render() {
 	DEBUG_ENTER_FUNC();
 
-	unsigned int currentBuffer = _mode<<1;
-	
+	unsigned int currentBuffer = _mode << 1;
+
 	// Draw the background letters
 	// Set renderer to current buffer & palette
 	_renderer.setBuffer(&_buffers[currentBuffer]);
@@ -215,14 +214,14 @@
 	_renderer.setOffsetInBuffer(0, 0);
 	_renderer.setDrawWholeBuffer();
 	_renderer.render();
-	
+
 	// Get X and Y coordinates for the orange block
 	int x, y;
 	convertCursorToXY(_oldCursor, x, y);
-	
+
 	const int OrangeBlockSize = 64;
 	const int GrayBlockSize = 43;
-	
+
 	// Draw the current Highlighted Selector (orange block)
 	_renderer.setBuffer(&_buffers[currentBuffer + 1]);
 	_renderer.setPalette(&_palettes[currentBuffer + 1]);
@@ -230,12 +229,12 @@
 	_renderer.setOffsetInBuffer(x * OrangeBlockSize, y * OrangeBlockSize);
 	_renderer.setDrawSize(OrangeBlockSize, OrangeBlockSize);
 	_renderer.render();
-	
-	DEBUG_EXIT_FUNC();		
+
+	DEBUG_EXIT_FUNC();
 }
 
 inline void PSPKeyboard::convertCursorToXY(CursorDirections cur, int &x, int &y) {
-	switch(cur) {
+	switch (cur) {
 	case kUp:
 		x = 1;
 		y = 0;
@@ -291,7 +290,7 @@
 	}
 
 	int i;
-	
+
 	// Loop through all png images
 	for (i = 0; i < guiStringsSize; i++) {
 		uint32 height = 0, width = 0, paletteSize = 0;
@@ -326,13 +325,13 @@
 			// Allocate memory for image
 			PSP_DEBUG_PRINT("width[%d], height[%d], paletteSize[%d]\n", width, height, paletteSize);
 			_buffers[i].setSize(width, height, Buffer::kSizeByTextureSize);
-			
+
 			if (paletteSize) {	// 8 or 4-bit image
 				if (paletteSize <= 16) { // 4 bit
 					_buffers[i].setPixelFormat(PSPPixelFormat::Type_Palette_4bit);
 					_palettes[i].setPixelFormats(PSPPixelFormat::Type_4444, PSPPixelFormat::Type_Palette_4bit);
-					paletteSize = 16;					
-				} else if (paletteSize <= 256){			// 8-bit image
+					paletteSize = 16;
+				} else if (paletteSize <= 256) {			// 8-bit image
 					paletteSize = 256;
 					_buffers[i].setPixelFormat(PSPPixelFormat::Type_Palette_8bit);
 					_palettes[i].setPixelFormats(PSPPixelFormat::Type_4444, PSPPixelFormat::Type_Palette_8bit);
@@ -340,11 +339,11 @@
 					PSP_ERROR("palette of %d too big!\n", paletteSize);
 					goto ERROR;
 				}
-				
+
 			} else {				// 32-bit image
 				_buffers[i].setPixelFormat(PSPPixelFormat::Type_8888);
 			}
-			
+
 			_buffers[i].allocate();
 			_palettes[i].allocate();
 
@@ -361,13 +360,12 @@
 
 				delete file;
 			}
-		}
-		else {
+		} else {
 			PSP_ERROR("couldn't obtain PNG image size\n");
 			goto ERROR;
 		}
 	} /* for loop */
-	
+
 	_init = true;
 
 	delete fileArchive;
@@ -387,7 +385,7 @@
 		_palettes[j].deallocate();
 	}
 	_init = false;
-	
+
 	DEBUG_EXIT_FUNC();
 	return false;
 }
@@ -399,7 +397,7 @@
 /* Get the width and height of a png image */
 int PSPKeyboard::getPngImageSize(Common::SeekableReadStream *file, uint32 *png_width, uint32 *png_height, u32 *paletteSize) {
 	DEBUG_ENTER_FUNC();
-	
+
 	png_structp png_ptr;
 	png_infop info_ptr;
 	unsigned int sig_read = 0;
@@ -433,7 +431,7 @@
 
 	*png_width = width;
 	*png_height = height;
-	
+
 	DEBUG_EXIT_FUNC();
 	return 0;
 }
@@ -442,7 +440,7 @@
 //
 int PSPKeyboard::loadPngImage(Common::SeekableReadStream *file, Buffer &buffer, Palette &palette) {
 	DEBUG_ENTER_FUNC();
-	
+
 	png_structp png_ptr;
 	png_infop info_ptr;
 	unsigned int sig_read = 0;
@@ -480,7 +478,7 @@
 	if (color_type == PNG_COLOR_TYPE_PALETTE) {
 		// Copy the palette
 		png_colorp srcPal = info_ptr->palette;
-		for(int i=0; i < info_ptr->num_palette; i++) {
+		for (int i = 0; i < info_ptr->num_palette; i++) {
 			unsigned char alphaVal = (i < info_ptr->num_trans) ? info_ptr->trans[i] : 0xFF;	// Load alpha if it's there
 			palette.setSingleColorRGBA(i, srcPal->red, srcPal->green, srcPal->blue, alphaVal);
 			srcPal++;
@@ -492,7 +490,7 @@
 		if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
 		// Filler for alpha?
 		png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
-	}	
+	}
 
 	unsigned char *line = (unsigned char*) malloc(info_ptr->rowbytes);
 	if (!line) {
@@ -509,7 +507,7 @@
 	}
 
 	free(line);
-	
+
 	png_read_end(png_ptr, info_ptr);
 	png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
 
@@ -533,21 +531,20 @@
  */
 bool PSPKeyboard::processInput(Common::Event &event, SceCtrlData &pad) {
 	DEBUG_ENTER_FUNC();
-	
+
 	bool haveEvent = false;		// Whether we have an event for the event manager to process
 	event.kbd.flags = 0;
-	
+
 	_buttonsChanged = _prevButtons ^ pad.Buttons;
 
 	if (!_init)					// In case we never had init
 		return false;
 	if (_state == kInvisible)	// Return if we're invisible
-		return false;	
+		return false;
 	if (_state != kMove && PRESSED(PSP_CTRL_SELECT)) {
 		_lastState = _state;
 		_state = kMove;			// Check for move or visible state
-	}
-	else if (CHANGED(PSP_CTRL_START)) {		// Handle start button: enter, make KB invisible
+	} else if (CHANGED(PSP_CTRL_START)) {		// Handle start button: enter, make KB invisible
 		event.kbd.ascii = '\r';
 		event.kbd.keycode = Common::KEYCODE_RETURN;

@@ Diff output truncated at 100000 characters. @@

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