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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun May 24 23:53:29 CEST 2009


Revision: 40872
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40872&view=rev
Author:   lordhoto
Date:     2009-05-24 21:53:29 +0000 (Sun, 24 May 2009)

Log Message:
-----------
Also strip trailing whitespaces in C and Objective-C source files. (Seems I forgot that we got those too :-P)

Modified Paths:
--------------
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_efa2.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_fcsr.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3_common.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3cf.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3sd.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mmcf.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mpcf.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_njsd.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_nmmc.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sccf.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_scsd.c
    scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sd_common.c
    scummvm/trunk/backends/platform/iphone/iphone_keyboard.m
    scummvm/trunk/backends/platform/iphone/iphone_main.m
    scummvm/trunk/backends/platform/iphone/iphone_video.m
    scummvm/trunk/backends/platform/ps2/cd.c
    scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c
    scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c
    scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c
    scummvm/trunk/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c
    scummvm/trunk/backends/platform/ps2/rpckbd.c

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_efa2.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_efa2.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_efa2.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -47,7 +47,7 @@
 // ID of Samsung K9K1G NAND flash chip
 #define EFA2_NAND_ID 0xEC79A5C0
 
-// first sector of udisk 
+// first sector of udisk
 #define EFA2_UDSK_START 0x40
 
 //
@@ -101,7 +101,7 @@
 
 //
 // Set NAND Flash chip enable and write protection bits ?
-// 
+//
 //   val | ~CE | ~WP |
 //  -----+-----+-----+
 //     0 |  0  |  0  |
@@ -125,7 +125,7 @@
 
 //
 // Read out NAND ID information, could be used for card detection
-// 
+//
 //                    | EFA2 1GBit |
 //  ------------------+------------+
 //         maker code |    0xEC    |
@@ -166,7 +166,7 @@
 Reads and checks NAND status information
 bool return OUT:  true if NAND is idle
 -----------------------------------------------------------------*/
-bool EFA2_ClearStatus (void) 
+bool EFA2_ClearStatus (void)
 {
 	// tbd: currently there is no write support, so always return
 	// true, there is no possibility for pending operations
@@ -178,7 +178,7 @@
 Checks to see if the NAND chip used by the EFA2 is present
 bool return OUT:  true if the correct NAND chip is found
 -----------------------------------------------------------------*/
-bool EFA2_IsInserted (void) 
+bool EFA2_IsInserted (void)
 {
 	EFA2_ClearStatus();
 	return (efa2_nand_id() == EFA2_NAND_ID);
@@ -223,7 +223,7 @@
 	efa2_nand_reset();
 
 	// set NAND to READ1 operation mode and transfer page address
-	REG_EFA2_NAND_CMD = 0x00;                // write READ1 command  
+	REG_EFA2_NAND_CMD = 0x00;                // write READ1 command
 	REG_EFA2_NAND_WR  = 0x00;                // write address  [7:0]
 	REG_EFA2_NAND_WR  = (page      ) & 0xff; // write address [15:8]
 	REG_EFA2_NAND_WR  = (page >> 8 ) & 0xff; // write address[23:16]
@@ -280,7 +280,7 @@
 EFA2_Shutdown
 unload the EFA2 interface
 -----------------------------------------------------------------*/
-bool EFA2_Shutdown(void) 
+bool EFA2_Shutdown(void)
 {
 	return EFA2_ClearStatus();
 }
@@ -368,7 +368,7 @@
 // ID of Samsung K9K1G NAND flash chip
 #define EFA2_NAND_ID 0xEC79A5C0
 
-// first sector of udisk 
+// first sector of udisk
 #define EFA2_UDSK_START 0x40
 
 //
@@ -422,7 +422,7 @@
 
 //
 // Set NAND Flash chip enable and write protection bits ?
-// 
+//
 //   val | ~CE | ~WP |
 //  -----+-----+-----+
 //     0 |  0  |  0  |
@@ -446,7 +446,7 @@
 
 //
 // Read out NAND ID information, could be used for card detection
-// 
+//
 //                    | EFA2 1GBit |
 //  ------------------+------------+
 //         maker code |    0xEC    |
@@ -487,7 +487,7 @@
 Reads and checks NAND status information
 bool return OUT:  true if NAND is idle
 -----------------------------------------------------------------*/
-bool EFA2_ClearStatus (void) 
+bool EFA2_ClearStatus (void)
 {
 	// tbd: currently there is no write support, so always return
 	// true, there is no possibility for pending operations
@@ -499,7 +499,7 @@
 Checks to see if the NAND chip used by the EFA2 is present
 bool return OUT:  true if the correct NAND chip is found
 -----------------------------------------------------------------*/
-bool EFA2_IsInserted (void) 
+bool EFA2_IsInserted (void)
 {
 	EFA2_ClearStatus();
 	return (efa2_nand_id() == EFA2_NAND_ID);
@@ -544,7 +544,7 @@
 	efa2_nand_reset();
 
 	// set NAND to READ1 operation mode and transfer page address
-	REG_EFA2_NAND_CMD = 0x00;                // write READ1 command  
+	REG_EFA2_NAND_CMD = 0x00;                // write READ1 command
 	REG_EFA2_NAND_WR  = 0x00;                // write address  [7:0]
 	REG_EFA2_NAND_WR  = (page      ) & 0xff; // write address [15:8]
 	REG_EFA2_NAND_WR  = (page >> 8 ) & 0xff; // write address[23:16]
@@ -601,7 +601,7 @@
 EFA2_Shutdown
 unload the EFA2 interface
 -----------------------------------------------------------------*/
-bool EFA2_Shutdown(void) 
+bool EFA2_Shutdown(void)
 {
 	return EFA2_ClearStatus();
 }

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_fcsr.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_fcsr.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_fcsr.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -4,7 +4,7 @@
 	compact_flash.c
 	By chishm (Michael Chisholm)
 
-	Hardware Routines for using a GBA Flash Cart and SRAM as a 
+	Hardware Routines for using a GBA Flash Cart and SRAM as a
 	block device.
 
 	This software is completely free. No warranty is provided.
@@ -57,7 +57,7 @@
 Is a GBA Flash Cart with a valid file system inserted?
 bool return OUT:  true if a GBA FC card is inserted
 -----------------------------------------------------------------*/
-bool FCSR_IsInserted (void) 
+bool FCSR_IsInserted (void)
 {
 	bool flagFoundFileSys = false;
 
@@ -85,7 +85,7 @@
 Finish any pending operations
 bool return OUT:  always true for GBA FC
 -----------------------------------------------------------------*/
-bool FCSR_ClearStatus (void) 
+bool FCSR_ClearStatus (void)
 {
 	return true;
 }
@@ -101,7 +101,7 @@
 bool return OUT: true if successful
 -----------------------------------------------------------------*/
 bool FCSR_ReadSectors (u32 sector, u8 numSecs, void* buffer)
-{	
+{
 	int i;
 	bool flagSramSector = false;
 	int numSectors = (numSecs > 0 ? numSecs : 256);
@@ -208,14 +208,14 @@
 FCSR_Shutdown
 unload the Flash Cart interface
 -----------------------------------------------------------------*/
-bool FCSR_Shutdown(void) 
+bool FCSR_Shutdown(void)
 {
 	int i;
 	if (FCSR_ClearStatus() == false)
 		return false;
 
 	FCSR_FileSysPointer = 0;
-	
+
 	for (i=0; i < 4; i++)
 	{
 		FCSR_SramSectorPointer[i] = 0;
@@ -262,11 +262,11 @@
 	// Get SRAM sector regions from header block
 	for (i = 0; i < 4; i++)
 	{
-		FCSR_SramSectorStart[i] = fileSysPointer[i+4];	
+		FCSR_SramSectorStart[i] = fileSysPointer[i+4];
 		SramRegionSize[i] = fileSysPointer[i+8];
 		FCSR_SramSectorEnd[i] = FCSR_SramSectorStart[i] + SramRegionSize[i];
 	}
-	
+
 	// Calculate SRAM region pointers
 	FCSR_SramSectorPointer[0] = (u8*)(SRAM_START + 4);
 	for (i = 1; i < 4; i++)

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3_common.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3_common.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3_common.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -1,13 +1,13 @@
 /*
-	io_m3_common.c 
+	io_m3_common.c
 
 	Routines common to all version of the M3
-	
+
 	Some code based on M3 SD drivers supplied by M3Adapter.
 	Some code written by SaTa may have been unknowingly used.
 
  Copyright (c) 2006 Michael "Chishm" Chisholm
-	
+
  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:
 
@@ -47,7 +47,7 @@
 	_M3_readHalfword (0x08000000 + (mode << 1));
 	_M3_readHalfword (0x0800080e);
 	_M3_readHalfword (0x08000000);
-	
+
 	if ((mode & 0x0f) != 4) {
 		_M3_readHalfword (0x09000000);
 	} else {
@@ -56,5 +56,5 @@
 		_M3_readHalfword (0x08000188);
 		_M3_readHalfword (0x08000188);
 	}
-}	
+}
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3cf.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3cf.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3cf.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -73,7 +73,7 @@
 Is a compact flash card inserted?
 bool return OUT:  true if a CF card is inserted
 -----------------------------------------------------------------*/
-bool M3CF_IsInserted (void) 
+bool M3CF_IsInserted (void)
 {
 	// Change register, then check if value did change
 	M3_REG_STS = CF_STS_INSERTED;
@@ -86,17 +86,17 @@
 Tries to make the CF card go back to idle mode
 bool return OUT:  true if a CF card is idle
 -----------------------------------------------------------------*/
-bool M3CF_ClearStatus (void) 
+bool M3CF_ClearStatus (void)
 {
 	int i;
-	
+
 	// Wait until CF card is finished previous commands
 	i=0;
 	while ((M3_REG_CMD & CF_STS_BUSY) && (i < CARD_TIMEOUT))
 	{
 		i++;
 	}
-	
+
 	// Wait until card is ready for commands
 	i = 0;
 	while ((!(M3_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -128,7 +128,7 @@
 	u8 *buff_u8 = (u8*)buffer;
 	int temp;
 #endif
-	
+
 #if defined _CF_USE_DMA && defined NDS && defined ARM9
 	DC_FlushRange( buffer, j * BYTE_PER_READ);
 #endif
@@ -139,7 +139,7 @@
 	{
 		i++;
 	}
-	
+
 	// Wait until card is ready for commands
 	i = 0;
 	while ((!(M3_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -148,20 +148,20 @@
 	}
 	if (i >= CARD_TIMEOUT)
 		return false;
-	
+
 	// Set number of sectors to read
-	M3_REG_SEC = numSecs;	
-	
+	M3_REG_SEC = numSecs;
+
 	// Set read sector
 	M3_REG_LBA1 = sector & 0xFF;						// 1st byte of sector number
 	M3_REG_LBA2 = (sector >> 8) & 0xFF;					// 2nd byte of sector number
 	M3_REG_LBA3 = (sector >> 16) & 0xFF;				// 3rd byte of sector number
 	M3_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA;	// last nibble of sector number
-	
+
 	// Set command to read
 	M3_REG_CMD = CF_CMD_READ;
-	
-	
+
+
 	while (j--)
 	{
 		// Wait until card is ready for reading
@@ -172,7 +172,7 @@
 		}
 		if (i >= CARD_TIMEOUT)
 			return false;
-		
+
 		// Read data
 #ifdef _CF_USE_DMA
  #ifdef NDS
@@ -194,12 +194,12 @@
 			}
 		} else {
 		while(i--)
-			*buff++ = *M3_DATA; 
+			*buff++ = *M3_DATA;
 		}
 #else
 		i=256;
 		while(i--)
-			*buff++ = *M3_DATA; 
+			*buff++ = *M3_DATA;
 #endif
 	}
 #if defined _CF_USE_DMA && defined NDS
@@ -230,7 +230,7 @@
 	u8 *buff_u8 = (u8*)buffer;
 	int temp;
 #endif
-	
+
 #if defined _CF_USE_DMA && defined NDS && defined ARM9
 	DC_FlushRange( buffer, j * BYTE_PER_READ);
 #endif
@@ -241,7 +241,7 @@
 	{
 		i++;
 	}
-	
+
 	// Wait until card is ready for commands
 	i = 0;
 	while ((!(M3_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -250,19 +250,19 @@
 	}
 	if (i >= CARD_TIMEOUT)
 		return false;
-	
+
 	// Set number of sectors to write
-	M3_REG_SEC = numSecs;	
-	
+	M3_REG_SEC = numSecs;
+
 	// Set write sector
 	M3_REG_LBA1 = sector & 0xFF;						// 1st byte of sector number
 	M3_REG_LBA2 = (sector >> 8) & 0xFF;					// 2nd byte of sector number
 	M3_REG_LBA3 = (sector >> 16) & 0xFF;				// 3rd byte of sector number
 	M3_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA;	// last nibble of sector number
-	
+
 	// Set command to write
 	M3_REG_CMD = CF_CMD_WRITE;
-	
+
 	while (j--)
 	{
 		// Wait until card is ready for writing
@@ -273,7 +273,7 @@
 		}
 		if (i >= CARD_TIMEOUT)
 			return false;
-		
+
 		// Write data
 #ifdef _CF_USE_DMA
  #ifdef NDS
@@ -295,19 +295,19 @@
 			}
 		} else {
 		while(i--)
-			*M3_DATA = *buff++; 
+			*M3_DATA = *buff++;
 		}
 #else
 		i=256;
 		while(i--)
-			*M3_DATA = *buff++; 
+			*M3_DATA = *buff++;
 #endif
 	}
 #if defined _CF_USE_DMA && defined NDS
 	// Wait for end of transfer before returning
 	while(DMA3_CR & DMA_BUSY);
 #endif
-	
+
 	return true;
 }
 
@@ -317,7 +317,7 @@
 Returns true if M3 was unlocked, false if failed
 Added by MightyMax
 -----------------------------------------------------------------*/
-bool M3_Unlock(void) 
+bool M3_Unlock(void)
 {
 	// run unlock sequence
 	volatile unsigned short tmp ;

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3sd.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3sd.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_m3sd.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -218,7 +218,7 @@
 		}
 
 	} while ((verify > 0) && (tries < 16));
-	
+
 	free(data);
 	free(check);
 }	// */
@@ -356,7 +356,7 @@
 bool M3SD_StartUp(void)
 {
 	vu16* waitCr = (vu16*)0x4000204;
-	
+
 	*waitCr |= 0x6000;
 //	*(vu16*)0x4000204=0x6000;
 	// Try unlocking 3 times, because occationally it fails to detect the reader.

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mmcf.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mmcf.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mmcf.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -74,14 +74,14 @@
   do
   {
     while (!(CF_RD_STATUS & 0x40));
-  } while (CF_RD_STATUS & 0x80); 
+  } while (CF_RD_STATUS & 0x80);
   */
 
   do
   {
     i++;
-    while ( (!(CF_RD_STATUS & 0x40)) && (i < CARD_TIMEOUT) ) i++;    
-  } while ( (CF_RD_STATUS & 0x80) && (i < CARD_TIMEOUT) ); 
+    while ( (!(CF_RD_STATUS & 0x40)) && (i < CARD_TIMEOUT) ) i++;
+  } while ( (CF_RD_STATUS & 0x80) && (i < CARD_TIMEOUT) );
 
   if (i >= CARD_TIMEOUT) {
 	return false;
@@ -110,7 +110,7 @@
 Is a compact flash card inserted?
 bool return OUT:  true if a CF card is inserted
 -----------------------------------------------------------------*/
-bool MMCF_IsInserted (void) 
+bool MMCF_IsInserted (void)
 {
   if ( !cf_set_features(0xAA) ) return false;
 
@@ -123,7 +123,7 @@
 Tries to make the CF card go back to idle mode
 bool return OUT:  true if a CF card is idle
 -----------------------------------------------------------------*/
-bool MMCF_ClearStatus (void) 
+bool MMCF_ClearStatus (void)
 {
 	return true;
 }
@@ -185,7 +185,7 @@
 			}
 		} else {
 		while(i--)
-			*buff++ = *MP_DATA; 
+			*buff++ = *MP_DATA;
 		}
 #else
 		i=256;
@@ -222,15 +222,15 @@
 	u8 *buff_u8 = (u8*)buffer;
 	int temp;
 #endif
-	
+
 #if defined _CF_USE_DMA && defined NDS && defined ARM9
 	DC_FlushRange( buffer, j * BYTE_PER_READ);
 #endif
 
-	if (numSecs > 1) 
+	if (numSecs > 1)
 	{
 		int r = 0;
-		
+
 		for (r = 0; r < numSecs; r++)
 		{
 			MMCF_WriteSectors(sector + r, 1, ((unsigned char *) (buffer)) + 512);
@@ -270,12 +270,12 @@
 			}
 		} else {
 		while(i--)
-			*MP_DATA = *buff++; 
+			*MP_DATA = *buff++;
 		}
 #else
 		i=256;
 		while(i--)
-			*MP_DATA = *buff++; 
+			*MP_DATA = *buff++;
 #endif
 
   }
@@ -283,7 +283,7 @@
 #if defined _CF_USE_DMA && defined NDS
 	// Wait for end of transfer before returning
 	while(DMA3_CR & DMA_BUSY);
-#endif  
+#endif
 
 //#define _CF_VERIFY
 
@@ -312,7 +312,7 @@
 MMCF_Shutdown
 unload the GBAMP CF interface
 -----------------------------------------------------------------*/
-bool MMCF_Shutdown(void) 
+bool MMCF_Shutdown(void)
 {
 	return MMCF_ClearStatus() ;
 }

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mpcf.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mpcf.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_mpcf.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -73,7 +73,7 @@
 Is a compact flash card inserted?
 bool return OUT:  true if a CF card is inserted
 -----------------------------------------------------------------*/
-bool MPCF_IsInserted (void) 
+bool MPCF_IsInserted (void)
 {
 	// Change register, then check if value did change
 	MP_REG_STS = CF_STS_INSERTED;
@@ -86,17 +86,17 @@
 Tries to make the CF card go back to idle mode
 bool return OUT:  true if a CF card is idle
 -----------------------------------------------------------------*/
-bool MPCF_ClearStatus (void) 
+bool MPCF_ClearStatus (void)
 {
 	int i;
-	
+
 	// Wait until CF card is finished previous commands
 	i=0;
 	while ((MP_REG_CMD & CF_STS_BUSY) && (i < CARD_TIMEOUT))
 	{
 		i++;
 	}
-	
+
 	// Wait until card is ready for commands
 	i = 0;
 	while ((!(MP_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -139,7 +139,7 @@
 	{
 		i++;
 	}
-	
+
 	// Wait until card is ready for commands
 	i = 0;
 	while ((!(MP_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -148,20 +148,20 @@
 	}
 	if (i >= CARD_TIMEOUT)
 		return false;
-	
+
 	// Set number of sectors to read
-	MP_REG_SEC = numSecs;	
-	
+	MP_REG_SEC = numSecs;
+
 	// Set read sector
 	MP_REG_LBA1 = sector & 0xFF;						// 1st byte of sector number
 	MP_REG_LBA2 = (sector >> 8) & 0xFF;					// 2nd byte of sector number
 	MP_REG_LBA3 = (sector >> 16) & 0xFF;				// 3rd byte of sector number
 	MP_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA;	// last nibble of sector number
-	
+
 	// Set command to read
 	MP_REG_CMD = CF_CMD_READ;
-	
-	
+
+
 	while (j--)
 	{
 		// Wait until card is ready for reading
@@ -172,7 +172,7 @@
 		}
 		if (i >= CARD_TIMEOUT)
 			return false;
-		
+
 		// Read data
 #ifdef _CF_USE_DMA
  #ifdef NDS
@@ -194,12 +194,12 @@
 			}
 		} else {
 		while(i--)
-			*buff++ = *MP_DATA; 
+			*buff++ = *MP_DATA;
 		}
 #else
 		i=256;
 		while(i--)
-			*buff++ = *MP_DATA; 
+			*buff++ = *MP_DATA;
 #endif
 	}
 #if (defined _CF_USE_DMA) && (defined NDS)
@@ -229,7 +229,7 @@
 	u8 *buff_u8 = (u8*)buffer;
 	int temp;
 #endif
-	
+
 #if defined _CF_USE_DMA && defined NDS && defined ARM9
 	DC_FlushRange( buffer, j * BYTE_PER_READ);
 #endif
@@ -240,7 +240,7 @@
 	{
 		i++;
 	}
-	
+
 	// Wait until card is ready for commands
 	i = 0;
 	while ((!(MP_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -249,19 +249,19 @@
 	}
 	if (i >= CARD_TIMEOUT)
 		return false;
-	
+
 	// Set number of sectors to write
-	MP_REG_SEC = numSecs;	
-	
+	MP_REG_SEC = numSecs;
+
 	// Set write sector
 	MP_REG_LBA1 = sector & 0xFF;						// 1st byte of sector number
 	MP_REG_LBA2 = (sector >> 8) & 0xFF;					// 2nd byte of sector number
 	MP_REG_LBA3 = (sector >> 16) & 0xFF;				// 3rd byte of sector number
 	MP_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA;	// last nibble of sector number
-	
+
 	// Set command to write
 	MP_REG_CMD = CF_CMD_WRITE;
-	
+
 	while (j--)
 	{
 		// Wait until card is ready for writing
@@ -272,7 +272,7 @@
 		}
 		if (i >= CARD_TIMEOUT)
 			return false;
-		
+
 		// Write data
 #ifdef _CF_USE_DMA
  #ifdef NDS
@@ -294,19 +294,19 @@
 			}
 		} else {
 		while(i--)
-			*MP_DATA = *buff++; 
+			*MP_DATA = *buff++;
 		}
 #else
 		i=256;
 		while(i--)
-			*MP_DATA = *buff++; 
+			*MP_DATA = *buff++;
 #endif
 	}
 #if defined _CF_USE_DMA && defined NDS
 	// Wait for end of transfer before returning
 	while(DMA3_CR & DMA_BUSY);
 #endif
-	
+
 	return true;
 }
 
@@ -314,7 +314,7 @@
 MPCF_Shutdown
 unload the GBAMP CF interface
 -----------------------------------------------------------------*/
-bool MPCF_Shutdown(void) 
+bool MPCF_Shutdown(void)
 {
 	return MPCF_ClearStatus() ;
 }

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_njsd.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_njsd.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_njsd.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -3,11 +3,11 @@
 
 	Hardware Routines for reading an SD card using
 	a NinjaDS SD adapter.
-	
+
 	Original code supplied by NinjaMod
-	
+
  Copyright (c) 2006 Michael "Chishm" Chisholm
-	
+
  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:
 
@@ -28,7 +28,7 @@
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 
+
 	2006-08-05 - Chishm
 		* First release
 */
@@ -84,7 +84,7 @@
 static inline bool _NJSD_waitIRQ(void) {
 /*#ifdef _NJSD_SYNC
 	int i = IRQ_TIMEOUT;
-	while (!(REG_IF & 0x100000) && --i); 
+	while (!(REG_IF & 0x100000) && --i);
 	REG_IF = 0x100000;
 	if (i <= 0) {
 		return false;
@@ -96,7 +96,7 @@
 	//if (!(REG_IME & 1))
 	//{
 		// irq's disabled...
-		while (!(REG_IF & 0x100000) && (!(_NJSD_irqFlag)) && --i); 
+		while (!(REG_IF & 0x100000) && (!(_NJSD_irqFlag)) && --i);
 		_NJSD_irqFlag = 0;
 		REG_IF = 0x100000;
 		if (i <= 0) {
@@ -106,7 +106,7 @@
 		}
 	//} else {
 		// irq's enabled
-	//	while (!(_NJSD_irqFlag) && --i); 
+	//	while (!(_NJSD_irqFlag) && --i);
 	//	_NJSD_irqFlag = 0;
 	//	REG_IF = 0x100000;
 	//	if (i <= 0) {
@@ -118,8 +118,8 @@
 //#endif
 }
 
-static inline void _NJSD_writeCardCommand 
-	(u8 cmd0, u8 cmd1, u8 cmd2, u8 cmd3, u8 cmd4, u8 cmd5, u8 cmd6, u8 cmd7) 
+static inline void _NJSD_writeCardCommand
+	(u8 cmd0, u8 cmd1, u8 cmd2, u8 cmd3, u8 cmd4, u8 cmd5, u8 cmd6, u8 cmd7)
 {
 	CARD_COMMAND[0] = cmd0;
 	CARD_COMMAND[1] = cmd1;
@@ -142,7 +142,7 @@
 	if (i <= 0) {
 		return false;
 	}
-	
+
 	return true;
 }
 
@@ -179,7 +179,7 @@
 	REG_IME = 0;
 #endif
 
-	REG_IE &= ~0x100000; 
+	REG_IE &= ~0x100000;
 	REG_IF =   0x100000;
 
 	CARD_CR1H = CARD_CR1_ENABLE;
@@ -191,7 +191,7 @@
 	} else {
 		CARD_COMMAND[0] = 0xF0 | (speed << 2) | 0 | (1 << 1);
 	}
-	
+
 	CARD_COMMAND[1] = (type & 0x40) | ((( type >> 2) & 7) << 3);
 	CARD_COMMAND[2] = 0x40 | cmd;
 	CARD_COMMAND[3] = (param>>24) & 0xFF;
@@ -301,7 +301,7 @@
 	}
 
 
-	REG_IE &= ~0x100000; 
+	REG_IE &= ~0x100000;
 	REG_IF =   0x100000;
 
 	CARD_CR1H = CARD_CR1_ENABLE;
@@ -334,7 +334,7 @@
 			i++;
 		}
 	} while (CARD_CR2 & CARD_BUSY);
-	
+
 	i = WRITE_TIMEOUT;
 	responseBuffer[3] = 0;
 	do {
@@ -352,7 +352,7 @@
 #ifdef _NJSD_SYNC
 	REG_IME = old_REG_IME;
 #endif
-	
+
 	return true;
 }
 
@@ -365,12 +365,12 @@
 	REG_IME = 0;
 
 #endif
-	REG_IE &= ~0x100000; 
+	REG_IE &= ~0x100000;
 	REG_IF =   0x100000;
 
 	//CARD_CR1H = CARD_CR1_ENABLE; // | CARD_CR1_IRQ;
 	_NJSD_writeCardCommand (0xE0 | ((speed & 3) << 2), 0, (count - 1), 0, 0, 0, 0, 0);
-	
+
 	CARD_CR2 = _NJSD_cardFlags;
 	i = COMMAND_TIMEOUT;
 	while ((CARD_CR2 & CARD_BUSY) && --i);
@@ -404,7 +404,7 @@
 	REG_IME = 0;
 #endif
 
-	REG_IE &= ~0x100000; 
+	REG_IE &= ~0x100000;
 	REG_IF =   0x100000;
 
 	CARD_CR1H = CARD_CR1_ENABLE; // | CARD_CR1_IRQ;
@@ -438,22 +438,22 @@
 static bool _NJSD_cardInit (void) {
 	u8 responseBuffer[17];
 	int i;
- 
+
 	// If the commands succeed the first time, assume they'll always succeed
 	if (! _NJSD_sendCLK (SD_CLK_200KHz, 256) ) return false;
 	if (! _NJSD_sendCMDN (SD_CLK_200KHz, GO_IDLE_STATE, 0) ) return false;
 	_NJSD_sendCLK (SD_CLK_200KHz, 8);
- 
+
 	_NJSD_sendCLK (SD_CLK_200KHz, 256);
  	_NJSD_sendCMDN (SD_CLK_200KHz, GO_IDLE_STATE, 0);
 	_NJSD_sendCLK (SD_CLK_200KHz, 8);
- 
+
 	for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
 		_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, APP_CMD, 0);
-		if ( 
+		if (
 			_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SD_APP_OP_COND, SD_OCR_VALUE) &&
 			((responseBuffer[1] & 0x80) != 0))
-		{	
+		{
 			// Card is ready to receive commands now
 			break;
 		}
@@ -461,10 +461,10 @@
 	if (i >= MAX_STARTUP_TRIES) {
 		return false;
 	}
- 
+
 	// The card's name, as assigned by the manufacturer
 	_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_136, ALL_SEND_CID, 0);
- 
+
 	// Get a new address
 	for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
 		_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SEND_RELATIVE_ADDR, 0);
@@ -479,17 +479,17 @@
 
 	// Some cards won't go to higher speeds unless they think you checked their capabilities
 	_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_136, SEND_CSD, _NJSD_relativeCardAddress);
- 
+
 	// Only this card should respond to all future commands
 	_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SELECT_CARD, _NJSD_relativeCardAddress);
- 
+
 	// Set a 4 bit data bus
 	_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, APP_CMD, _NJSD_relativeCardAddress);
 	_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SET_BUS_WIDTH, 2); // 4-bit mode.
 
 	// Use 512 byte blocks
 	_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SET_BLOCKLEN, 512); // 512 byte blocks
- 
+
 	return true;
 }
 
@@ -521,7 +521,7 @@
 		return false;
 	}
 	return true;
-} 
+}
 
 
 bool _NJSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
@@ -531,7 +531,7 @@
 
 	while (numSectors--) {
 		_SD_CRC16 ( data, BYTES_PER_READ, crc);
-		
+
 		if (! _NJSD_writeSector (data, crc, offset)) {
 			return false;
 		}
@@ -549,7 +549,7 @@
 #ifdef _NJSD_SYNC
 	u32 old_REG_IME;
 #endif
-	
+
 	u8* tbuf = (u8*)buffer;
 
 	if (numSectors == 0) {
@@ -573,7 +573,7 @@
 			if (!_NJSD_waitIRQ ()) {
 #ifdef _NJSD_SYNC
 				REG_IME = old_REG_IME;
-#endif		
+#endif
 				return false;
 			}
 		}
@@ -586,10 +586,10 @@
 		if (!_NJSD_waitIRQ ()) {
 #ifdef _NJSD_SYNC
 			REG_IME = old_REG_IME;
-#endif		
+#endif
 			return false;
 		}
-		
+
 		if (((int)buffer & 0x03) != 0){
 			cardPolledTransfer (0xA1406000, tmp, BYTES_PER_READ, (u8*)_NJSD_read_cmd);
 			memcpy (tbuf + (numSectors - 1) * BYTES_PER_READ, tmp, BYTES_PER_READ);
@@ -618,7 +618,7 @@
 #ifdef _NJSD_SYNC
 	u32 old_REG_IME;
 #endif
-	
+
 	u8* tbuf = (u8*)buffer;
 
 	if (numSectors == 0) {
@@ -637,7 +637,7 @@
 			if (!_NJSD_waitIRQ ()) {
 #ifdef _NJSD_SYNC
 				REG_IME = old_REG_IME;
-#endif		
+#endif
 				return false;
 			}
 		}
@@ -645,10 +645,10 @@
 		if (!_NJSD_waitIRQ ()) {
 #ifdef _NJSD_SYNC
 			REG_IME = old_REG_IME;
-#endif		
+#endif
 			return false;
 		}
-		
+
 		cardPolledTransfer (0xA1406000, (u32*)(tbuf + (numSectors - 1) * BYTES_PER_READ), BYTES_PER_READ, (u8*)_NJSD_read_cmd);
 	} else {
 		_NJSD_sendCMDR (_NJSD_speed, NULL, SD_RSP_STREAM, READ_SINGLE_BLOCK, sector * BYTES_PER_READ);

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_nmmc.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_nmmc.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_nmmc.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -13,10 +13,10 @@
 	project at chishm at hotmail.com
 
 	See gba_nds_fat.txt for help and license details.
-	
+
 	2006-02-09 - www.neoflash.com:
 	 * First stable release
-	
+
 	2006-02-13 - Chishm
 	 * Added ReadMK2Config function
 	 * Added read config test to init function so no unnecessary card commands are sent
@@ -87,7 +87,7 @@
 	Neo_EnableEEPROM(false);
 }
 
-u8 Neo_ReadMK2Config(void) 
+u8 Neo_ReadMK2Config(void)
 {
 	u8 config;
 	Neo_EnableEEPROM(true);
@@ -104,7 +104,7 @@
 
 u8 selectMMC_command [8] = {0xFF, 0x00, 0x6A, 0xDF, 0x37, 0x59, 0x33, 0xA3};
 
-void Neo_SelectMMC (u8 dataByte) 
+void Neo_SelectMMC (u8 dataByte)
 {
 	selectMMC_command[1] = dataByte;	// Set enable / disable byte
 	cardWriteCommand (selectMMC_command);	// Send "5. Use the EEPROM CS to access the MK2 MMC/SD card"
@@ -154,12 +154,12 @@
 bool Neo_InitMMC()	{
 	Neo_MK2GameMode();
 	Neo_WriteMK2Config( MK2_CONFIG_ZIP_RAM_CLOSE | MK2_CONFIG_GAME_FLASH_CLOSE);
-	
+
 	// Make sure the configuration was accepted
 	if (Neo_ReadMK2Config() != (MK2_CONFIG_ZIP_RAM_CLOSE | MK2_CONFIG_GAME_FLASH_CLOSE)) {
 		return false;	// If not, then it wasn't initialised properly
 	}
-	
+
 	return true;
 }
 
@@ -167,7 +167,7 @@
 
 bool NMMC_IsInserted(void)	{
 	int i;
-	
+
 	Neo_EnableMMC( true );		// Open SPI port to MMC card
 	Neo_SendMMCCommand(MMC_SEND_CSD, 0);
 	if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false )	{				// Make sure no errors occured
@@ -183,13 +183,13 @@
 	for (i = 0; i < 28; i++) {
 		Neo_SPI(0xff);
 	}
-		
+
 	return true;
 }
 
 bool NMMC_ClearStatus (void) {
 	u32 i;
-	
+
 	Neo_EnableMMC( true );		// Open SPI port to MMC card
 	for (i = 0; i < 10; i++) {
 		Neo_SPI(0xFF);			// Send 10 0xFF bytes to MMC card
@@ -224,14 +224,14 @@
 		return false;
 	}
 	Neo_EnableMMC( true );		// Open SPI port to MMC card
-	
+
 	// Set block length
 	Neo_SendMMCCommand(MMC_SET_BLOCKLEN, BYTE_PER_READ );
 	if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false )	{				// Make sure no errors occured
 		Neo_EnableMMC( false );
 		return false;
 	}
-	
+
 	// Check if we can use a higher SPI frequency
 	Neo_SendMMCCommand(MMC_SEND_CSD, 0);
 	if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false )	{				// Make sure no errors occured
@@ -252,77 +252,77 @@
 	if ((transSpeed & 0xf0) >= 0x30) {
 		spi_freq = 0;
 	}
-	
+
 	Neo_EnableMMC( false );
 	return true;
-} 
+}
 
 
-bool NMMC_WriteSectors (u32 sector, u8 numSecs, void* buffer)	
+bool NMMC_WriteSectors (u32 sector, u8 numSecs, void* buffer)
 {
 	u32 i;
 	u8 *p=buffer;
-	
+
 	int totalSecs = (numSecs == 0) ? 256 : numSecs;
 	sector *= BYTE_PER_READ;
-	
+
 	Neo_EnableMMC( true );												// Open SPI port to MMC card
 	Neo_SendMMCCommand( 25, sector );
 	if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false )	{				// Make sure no errors occured
 		Neo_EnableMMC( false );
 		return false;
 	}
-	
+
 	while (totalSecs--) {
 		Neo_SPI( 0xFC );												// Send Start Block token
 		for( i = 0; i < BYTE_PER_READ; i++ )							// Send a block of data
 			Neo_SPI( *p++ );
 		Neo_SPI( 0xFF );												// Send fake CRC16
 		Neo_SPI( 0xFF );												// Send fake CRC16
-		
+
 		if( ( Neo_SPI( 0xFF ) & 0x0F ) != 0x05 )	{					// Make sure the block was accepted
 			Neo_EnableMMC( false );
 			return false;
 		}
 		while( Neo_SPI( 0xFF ) == 0x00 );								// Wait for the block to be written
 	}
-	
+
 	// Stop transmission block
 	Neo_SPI( 0xFD );													// Send Stop Transmission Block token
 	for( i = 0; i < BYTE_PER_READ; i++ )								// Send a block of fake data
 		Neo_SPI( 0xFF );
 	Neo_SPI( 0xFF );													// Send fake CRC16
 	Neo_SPI( 0xFF );													// Send fake CRC16
-		
+
 	Neo_SPI (0xFF); 													// Send 8 clocks
 	while( Neo_SPI( 0xFF ) == 0x00 );									// Wait for the busy signal to clear
 
-	
-	for ( i = 0; i < 0x10; i++) {	
+
+	for ( i = 0; i < 0x10; i++) {
 		Neo_SPI (0xFF);													// Send clocks for the MMC card to finish what it's doing
 	}
-	
+
 	Neo_EnableMMC( false );											// Close SPI port to MMC card
 	return true;
 }
 
-bool NMMC_ReadSectors (u32 sector, u8 numSecs, void* buffer)	
+bool NMMC_ReadSectors (u32 sector, u8 numSecs, void* buffer)
 {
 	u32 i;
 	u8 *p=buffer;
-	
+
 	int totalSecs = (numSecs == 0) ? 256 : numSecs;
 	sector *= BYTE_PER_READ;
-	
+
 	Neo_EnableMMC( true );												// Open SPI port to MMC card
-	
+
 	while (totalSecs--) {
 		Neo_SendMMCCommand(MMC_READ_BLOCK, sector );
 		if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false )	{			// Make sure no errors occured
 			Neo_EnableMMC( false );
 			return false;
 		}
-	
+
 		if( Neo_CheckMMCResponse( 0xFE, 0xFF ) == false )	{			// Check for Start Block token
 			Neo_EnableMMC( false );
 			return false;
@@ -333,7 +333,7 @@
 		Neo_SPI( 0xFF );												// Ignore CRC16
 		sector += BYTE_PER_READ;
 	}
-	
+
 	Neo_EnableMMC( false );											// Close SPI port to MMC card
 	return true;
 }

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sccf.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sccf.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sccf.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -57,7 +57,7 @@
 	temp = (~temp & 0xFF);
 	return (CF_REG_LBA1 == temp);
 #undef CF_REG_LBA1
-} 
+}
 
 bool SCCF_Shutdown(void) {
 	return MPCF_ClearStatus() ;

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_scsd.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_scsd.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_scsd.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -1,8 +1,8 @@
 /*
 	io_scsd.c by SaTa.
 	based on io_sccf.c
-	
-	
+
+
 */
 
 /*
@@ -43,7 +43,7 @@
 extern void ReadSector(u16 *buff,u32 sector,u8 ReadNumber);
 extern void WriteSector(u16 *buff,u32 sector,u8 writeNumber);
 extern bool MemoryCard_IsInserted(void);	//	CF\x82ƈႤ
-//	
+//
 
 /*-----------------------------------------------------------------
 SCSD_Unlock
@@ -55,7 +55,7 @@
 {
 	InitSCMode();
 	return MemoryCard_IsInserted();
-} 
+}
 
 bool SCSD_Shutdown(void) {
 	return MPCF_ClearStatus() ;

Modified: scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sd_common.c
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sd_common.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ds/arm9/source/fat/io_sd_common.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -5,10 +5,10 @@
 
 	Common SD card routines
 
-	SD routines partially based on sd.s by Romman 
+	SD routines partially based on sd.s by Romman
 
  Copyright (c) 2006 Michael "Chishm" Chisholm
-	
+
  Redistribution and use in source and binary forms, with or without modification,
  are permitted provided that the following conditions are met:
 
@@ -29,7 +29,7 @@
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-		
+
 	2006-08-07 - Chishm
 		* Moved the SD initialization to a common function
 		* Increased timeouts for slower cards
@@ -61,10 +61,10 @@
     }
     crc = (crc << 1) | 1;
     return(crc);
-} 
+}
 
 /*
-Calculates the CRC16 for a sector of data. Calculates it 
+Calculates the CRC16 for a sector of data. Calculates it
 as 4 separate lots, merged into one buffer. This is used
 for 4 SD data lines, not for 1 data line alone.
 */
@@ -79,53 +79,53 @@
 	b = 0;	// r4
 	c = 0;	// r5
 	d = 0;	// r6
-	
+
 	buffLength = buffLength * 8;
-	
-	
+
+
 	do {
 		if (bitPattern & 0x80) dataByte = *buff++;
-		
+
 		a = a << 1;
 		if ( a & 0x10000) a ^= crcConst;
 		if (dataByte & (bitPattern >> 24)) a ^= crcConst;
-		
+
 		b = b << 1;
 		if (b & 0x10000) b ^= crcConst;
 		if (dataByte & (bitPattern >> 25)) b ^= crcConst;
-	
+
 		c = c << 1;
 		if (c & 0x10000) c ^= crcConst;
 		if (dataByte & (bitPattern >> 26)) c ^= crcConst;
-		
+
 		d = d << 1;
 		if (d & 0x10000) d ^= crcConst;
 		if (dataByte & (bitPattern >> 27)) d ^= crcConst;
-		
+
 		bitPattern = (bitPattern >> 4) | (bitPattern << 28);
 	} while (buffLength-=4);
-	
+
 	count = 16;	// r8
-	
+
 	do {
 		bitPattern = bitPattern << 4;
 		if (a & 0x8000) bitPattern |= 8;
 		if (b & 0x8000) bitPattern |= 4;
 		if (c & 0x8000) bitPattern |= 2;
 		if (d & 0x8000) bitPattern |= 1;
-	
+
 		a = a << 1;
 		b = b << 1;
 		c = c << 1;
 		d = d << 1;
-		
+
 		count--;
-		
+
 		if (!(count & 0x01)) {
 			*crc16buff++ = (u8)(bitPattern & 0xff);
 		}
 	} while (count != 0);
-	
+
 	return;
 }
 
@@ -136,20 +136,20 @@
 use4bitBus: initialise card to use a 4 bit data bus when communicating with the card
 RCA: a pointer to the location to store the card's Relative Card Address, preshifted up by 16 bits.
 */
-bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response, 
+bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
 					_SD_FN_CMD_17BYTE_RESPONSE cmd_17byte_response,
 					bool use4bitBus,
 					u32 *RCA)
 {
 	u8 responseBuffer[17] = {0};
 	int i;
-	
+
 	for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
 		cmd_6byte_response (responseBuffer, APP_CMD, 0);
-		if ( 
+		if (
 			cmd_6byte_response (responseBuffer, SD_APP_OP_COND, SD_OCR_VALUE) &&
 			((responseBuffer[1] & 0x80) != 0))
-		{	
+		{
 			// Card is ready to receive commands now
 			break;
 		}
@@ -157,10 +157,10 @@
 	if (i >= MAX_STARTUP_TRIES) {
 		return false;
 	}
- 
+
 	// The card's name, as assigned by the manufacturer
 	cmd_17byte_response (responseBuffer, ALL_SEND_CID, 0);
- 
+
 	// Get a new address
 	for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
 		cmd_6byte_response (responseBuffer, SEND_RELATIVE_ADDR, 0);
@@ -175,10 +175,10 @@
 
 	// Some cards won't go to higher speeds unless they think you checked their capabilities
 	cmd_17byte_response (responseBuffer, SEND_CSD, *RCA);
- 
+
 	// Only this card should respond to all future commands
 	cmd_6byte_response (responseBuffer, SELECT_CARD, *RCA);
- 
+
 	if (use4bitBus) {
 		// Set a 4 bit data bus
 		cmd_6byte_response (responseBuffer, APP_CMD, *RCA);
@@ -187,7 +187,7 @@
 
 	// Use 512 byte blocks
 	cmd_6byte_response (responseBuffer, SET_BLOCKLEN, 512); // 512 byte blocks
-	
+
 	// Wait until card is ready for data
 	i = 0;
 	do {
@@ -196,7 +196,7 @@
 		}
 		i++;
 	} while (!cmd_6byte_response (responseBuffer, SEND_STATUS, *RCA) && ((responseBuffer[3] & 0x1f) != ((SD_STATE_TRAN << 1) | READY_FOR_DATA)));
- 
+
 	return true;
 }
 

Modified: scummvm/trunk/backends/platform/iphone/iphone_keyboard.m
===================================================================
--- scummvm/trunk/backends/platform/iphone/iphone_keyboard.m	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/iphone/iphone_keyboard.m	2009-05-24 21:53:29 UTC (rev 40872)
@@ -45,11 +45,11 @@
 - (id)initWithKeyboard:(SoftKeyboard*)keyboard; {
 	self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
 	softKeyboard = keyboard;
-	
+
 	[[self textInputTraits] setAutocorrectionType:1];
 	[[self textInputTraits] setAutocapitalizationType:0];
 	[[self textInputTraits] setEnablesReturnKeyAutomatically:NO];
-	
+
 	return self;
 }
 
@@ -67,7 +67,7 @@
 	}
 
 	[softKeyboard handleKeyPress:[character characterAtIndex:0]];
-	
+
 	return NO;
 }
 

Modified: scummvm/trunk/backends/platform/iphone/iphone_main.m
===================================================================
--- scummvm/trunk/backends/platform/iphone/iphone_main.m	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/iphone/iphone_main.m	2009-05-24 21:53:29 UTC (rev 40872)
@@ -48,7 +48,7 @@
 	gArgc = argc;
 	gArgv = argv;
 
-    NSAutoreleasePool *autoreleasePool = [ 
+    NSAutoreleasePool *autoreleasePool = [
         [ NSAutoreleasePool alloc ] init
     ];
 
@@ -99,7 +99,7 @@
 	[[NSNotificationCenter defaultCenter] addObserver:self
 											 selector:@selector(didRotate:)
 												 name:@"UIDeviceOrientationDidChangeNotification" object:nil];
-	
+
 	[NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil];
 }
 
@@ -111,7 +111,7 @@
 - (void)applicationResume:(struct __GSEvent *)event {
 	[self removeApplicationBadge];
 	[_view applicationResume];
-	
+
 	// Workaround, need to "hide" and unhide the statusbar to properly remove it,
 	// since the Springboard has put it back without apparently flagging our application.
     [self setStatusBarHidden:YES animated:YES];

Modified: scummvm/trunk/backends/platform/iphone/iphone_video.m
===================================================================
--- scummvm/trunk/backends/platform/iphone/iphone_video.m	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/iphone/iphone_video.m	2009-05-24 21:53:29 UTC (rev 40872)
@@ -48,13 +48,13 @@
 
 void iPhone_updateScreenRect(unsigned short* screen, int x1, int y1, int x2, int y2) {
 	[_lock lock];
-	
+
 	int y;
 	for (y = y1; y < y2; ++y) {
 		memcpy(&_textureBuffer[(y * _textureWidth + x1 )* 2], &screen[y * _width + x1], (x2 - x1) * 2);
 	}
 
-	[_lock unlock];	
+	[_lock unlock];
 }
 
 
@@ -104,13 +104,13 @@
 uint getSizeNextPOT(uint size) {
     if ((size & (size - 1)) || !size) {
         int log = 0;
-		
+
         while (size >>= 1)
             ++log;
-		
+
         size = (2 << log);
     }
-	
+
     return size;
 }
 
@@ -129,7 +129,7 @@
 	_screenLayer = nil;
 
 	sharedInstance = self;
-	
+
 	_lock = [NSLock new];
 	_keyboardView = nil;
 	_context = nil;
@@ -144,7 +144,7 @@
 	if (_keyboardView != nil) {
 		[_keyboardView dealloc];
 	}
-	
+
 	if (_screenTexture)
 		free(_textureBuffer);
 }
@@ -188,7 +188,7 @@
 		texWidth, texHeight,
 		0.0f, texHeight
 	};
-	
+
 	glVertexPointer(2, GL_FLOAT, 0, vertices);
 	glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
 
@@ -201,7 +201,7 @@
 
 	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 	glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer);
-	[_context presentRenderbuffer:GL_RENDERBUFFER_OES];		
+	[_context presentRenderbuffer:GL_RENDERBUFFER_OES];
 
 }
 
@@ -212,55 +212,55 @@
 	UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
 
 	//printf("Window: (%d, %d), Surface: (%d, %d), Texture(%d, %d)\n", _fullWidth, _fullHeight, _width, _height, _textureWidth, _textureHeight);
-	
+
 	if (_context == nil) {
 		orientation = UIDeviceOrientationLandscapeRight;
 		CAEAGLLayer *eaglLayer = (CAEAGLLayer*) self.layer;
-		
+
 		eaglLayer.opaque = YES;
 		eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
 										[NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGB565, kEAGLDrawablePropertyColorFormat, nil];
-		
+
 		_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
 		if (!_context || [EAGLContext setCurrentContext:_context]) {
 			glGenFramebuffersOES(1, &_viewFramebuffer);
 			glGenRenderbuffersOES(1, &_viewRenderbuffer);
-			
+
 			glBindFramebufferOES(GL_FRAMEBUFFER_OES, _viewFramebuffer);
 			glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer);
 			[_context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id<EAGLDrawable>)self.layer];
 			glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, _viewRenderbuffer);
-			
+
 			glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &_backingWidth);
 			glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &_backingHeight);
-			
+
 			if (glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES) {
 				NSLog(@"Failed to make complete framebuffer object %x.", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
 				return;
 			}
-			
+
 			glViewport(0, 0, _backingWidth, _backingHeight);
 			glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-			
+
 			glEnable(GL_TEXTURE_2D);
 			glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-			glEnableClientState(GL_VERTEX_ARRAY);			
+			glEnableClientState(GL_VERTEX_ARRAY);
 		}
 	}
 
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
-	
+
 	if (orientation ==  UIDeviceOrientationLandscapeRight) {
 		glRotatef(-90, 0, 0, 1);
 	} else if (orientation == UIDeviceOrientationLandscapeLeft) {
-		glRotatef(90, 0, 0, 1);		
+		glRotatef(90, 0, 0, 1);
 	} else {
 		glRotatef(180, 0, 0, 1);
 	}
-	
+
 	glOrthof(0, _backingWidth, 0, _backingHeight, 0, 1);
-	
+
 	if (_screenTexture > 0) {
 		glDeleteTextures(1, &_screenTexture);
 	}
@@ -268,7 +268,7 @@
 	glGenTextures(1, &_screenTexture);
 	glBindTexture(GL_TEXTURE_2D, _screenTexture);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-	
+
 	if (_textureBuffer) {
 		free(_textureBuffer);
 	}
@@ -276,7 +276,7 @@
 	int textureSize = _textureWidth * _textureHeight * 2;
 	_textureBuffer = (char*)malloc(textureSize);
 	memset(_textureBuffer, 0, textureSize);
-	
+
 	glBindRenderbufferOES(GL_RENDERBUFFER_OES, _viewRenderbuffer);
 
 	// The color buffer is triple-buffered, so we clear it multiple times right away to avid doing any glClears later.
@@ -285,7 +285,7 @@
 		glClear(GL_COLOR_BUFFER_BIT);
 		[_context presentRenderbuffer:GL_RENDERBUFFER_OES];
 	}
-		
+
 	if (_keyboardView != nil) {
 		[_keyboardView removeFromSuperview];
 		[[_keyboardView inputView] removeFromSuperview];
@@ -327,7 +327,7 @@
 			_keyboardView = [[SoftKeyboard alloc] initWithFrame:keyFrame];
 			[_keyboardView setInputDelegate:self];
 		}
-		
+
 		[self addSubview:[_keyboardView inputView]];
 		[self addSubview: _keyboardView];
 		[[_keyboardView inputView] becomeFirstResponder];
@@ -370,7 +370,7 @@
 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
 {
 	NSSet *allTouches = [event allTouches];
-	
+
 	switch ([allTouches count]) {
 		case 1:
 		{
@@ -378,7 +378,7 @@
 			CGPoint point = [touch locationInView:self];
 			if (!getLocalMouseCoords(&point))
 				return;
-			
+
 			[self addEvent:
 			 [[NSDictionary alloc] initWithObjectsAndKeys:
 			  [NSNumber numberWithInt:kInputMouseDown], @"type",
@@ -386,16 +386,16 @@
 			  [NSNumber numberWithFloat:point.y], @"y",
 			  nil
 			  ]
-			 ];		
+			 ];
 			break;
-		}			
+		}
 		case 2:
 		{
 			UITouch *touch = [[allTouches allObjects] objectAtIndex:1];
 			CGPoint point = [touch locationInView:self];
 			if (!getLocalMouseCoords(&point))
 				return;
-			
+
 			[self addEvent:
 			 [[NSDictionary alloc] initWithObjectsAndKeys:
 			  [NSNumber numberWithInt:kInputMouseSecondDown], @"type",
@@ -403,16 +403,16 @@
 			  [NSNumber numberWithFloat:point.y], @"y",
 			  nil
 			  ]
-			 ];		
+			 ];
 			break;
-		}						
+		}
 	}
 }
 
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
 {
 	NSSet *allTouches = [event allTouches];
-	
+
 	switch ([allTouches count]) {
 		case 1:
 		{
@@ -420,7 +420,7 @@
 			CGPoint point = [touch locationInView:self];
 			if (!getLocalMouseCoords(&point))
 				return;
-			
+
 			[self addEvent:
 			 [[NSDictionary alloc] initWithObjectsAndKeys:
 			  [NSNumber numberWithInt:kInputMouseDragged], @"type",
@@ -428,16 +428,16 @@
 			  [NSNumber numberWithFloat:point.y], @"y",
 			  nil
 			  ]
-			 ];		
+			 ];
 			break;
-		}			
+		}
 		case 2:
 		{
 			UITouch *touch = [[allTouches allObjects] objectAtIndex:1];
 			CGPoint point = [touch locationInView:self];
 			if (!getLocalMouseCoords(&point))
 				return;
-			
+
 			[self addEvent:
 			 [[NSDictionary alloc] initWithObjectsAndKeys:
 			  [NSNumber numberWithInt:kInputMouseSecondDragged], @"type",
@@ -445,16 +445,16 @@
 			  [NSNumber numberWithFloat:point.y], @"y",
 			  nil
 			  ]
-			 ];		
+			 ];
 			break;
-		}						
+		}
 	}
 }
 
 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
 {
 	NSSet *allTouches = [event allTouches];
-	
+
 	switch ([allTouches count]) {
 		case 1:
 		{
@@ -462,7 +462,7 @@
 			CGPoint point = [touch locationInView:self];
 			if (!getLocalMouseCoords(&point))
 				return;
-			
+
 			[self addEvent:
 			 [[NSDictionary alloc] initWithObjectsAndKeys:
 			  [NSNumber numberWithInt:kInputMouseUp], @"type",
@@ -470,16 +470,16 @@
 			  [NSNumber numberWithFloat:point.y], @"y",
 			  nil
 			  ]
-			 ];		
+			 ];
 			break;
-		}			
+		}
 		case 2:
 		{
 			UITouch *touch = [[allTouches allObjects] objectAtIndex:1];
 			CGPoint point = [touch locationInView:self];
 			if (!getLocalMouseCoords(&point))
 				return;
-			
+
 			[self addEvent:
 			 [[NSDictionary alloc] initWithObjectsAndKeys:
 			  [NSNumber numberWithInt:kInputMouseSecondUp], @"type",
@@ -487,15 +487,15 @@
 			  [NSNumber numberWithFloat:point.y], @"y",
 			  nil
 			  ]
-			 ];		
+			 ];
 			break;
-		}						
+		}
 	}
 }
 
 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
 {
-	
+
 }
 
 - (void)handleKeyPress:(unichar)c {

Modified: scummvm/trunk/backends/platform/ps2/cd.c
===================================================================
--- scummvm/trunk/backends/platform/ps2/cd.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ps2/cd.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -29,7 +29,7 @@
     u8  *pkt;
 
     cdvdCd.server = NULL;
-    
+
     do {
         if ((ret = SifBindRpc(&cdvdCd, CDVD_INIT_BIND_RPC, 0)) < 0) {
             return -1;
@@ -40,14 +40,14 @@
     }
 	while(!cdvdCd.server);
 
-    pkt = sendBuffer; 
+    pkt = sendBuffer;
     PUSHDATA( int, pkt, mode, i);
     pkt += i; len += i;
 
 	if ((ret = SifCallRpc(&cdvdCd, 0, 0, sendBuffer, len, NULL, 0, 0, 0)) < 0)
         return -1;
-  
+
     cdvdInitialised = 1;
-    
+
     return 0;
 }

Modified: scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c
===================================================================
--- scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/codyvdfs.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -76,7 +76,7 @@
 	cacheName = cachedDir + strlen(cachedDir);
 	memcpy(cacheName, dir->name, dir->len_fi);
     cacheName[dir->len_fi] = '/';
-	cacheName[dir->len_fi + 1] = '\0';	
+	cacheName[dir->len_fi + 1] = '\0';
 	return cdReadSectors(cachedDirLba, 1, cacheBuf, &rmode);
 }
 
@@ -144,7 +144,7 @@
 			initRootCache();
 		return (ISODirectoryRecord *)cacheBuf;
 	}
-	
+
 	do {
 		tok = strchr(path, '/');
 		if (tok)

Modified: scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c
===================================================================
--- scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/fiofs.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -162,7 +162,7 @@
 			doCopy = 0x800 - readPos;
 			if (doCopy > bytesLeft)
 				doCopy = bytesLeft;
-			
+
 			memcpy(destPos, fd->buf + readPos, doCopy);
 			readPos += doCopy;
 			readLba += readPos >> 11;
@@ -180,7 +180,7 @@
 			bytesLeft &= 0x7FF;
 		}
 	}
-    return destPos - (uint8*)dest;    
+    return destPos - (uint8*)dest;
 }
 
 int cd_close(iop_file_t *handle) {
@@ -204,7 +204,7 @@
 		return -ENOENT;
 
 	fdSlot = allocDioHandle();
-	
+
 	if (fdSlot < 0)
 		return -ENFILE;
 

Modified: scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c
===================================================================
--- scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ps2/iop/CoDyVDfs/iop/rpcfs.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -48,7 +48,7 @@
 	thread.attr = 0;
 
 	tid = CreateThread(&thread);
-	if (tid >= 0) 
+	if (tid >= 0)
 		StartThread(tid, 0);
 	else {
 		printf("Unable to start RPC Thread!\n");

Modified: scummvm/trunk/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c
===================================================================
--- scummvm/trunk/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ps2/iop/rpckbd/src/ps2kbd.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -137,7 +137,7 @@
   //printf("PS2Kbd_probe devId %d\n", devId);
 
   dev = UsbGetDeviceStaticDescriptor(devId, NULL, USB_DT_DEVICE); /* Get device descriptor */
-  if(!dev) 
+  if(!dev)
     {
       printf("ERROR: Couldn't get device descriptor\n");
       return 0;
@@ -164,7 +164,7 @@
       printf("ERROR: No interfaces available\n");
       return 0;
     }
-     
+
   intf = (UsbInterfaceDescriptor *) ((char *) conf + conf->bLength); /* Get first interface */
 /*   printf("Interface Length %d Endpoints %d Class %d Sub %d Proto %d\n", intf->bLength, */
 /* 	 intf->bNumEndpoints, intf->bInterfaceClass, intf->bInterfaceSubClass, */
@@ -182,7 +182,7 @@
   endp = (UsbEndpointDescriptor *) ((char *) endp + endp->bLength); /* Go to the data endpoint */
 
   //printf("Endpoint 1 Addr %d, Attr %d, MaxPacket %d\n", endp->bEndpointAddress, endp->bmAttributes, endp->wMaxPacketSizeLB);
-  
+
   if(((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) ||
      ((endp->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN))
     {
@@ -210,7 +210,7 @@
   //printf("PS2Kbd_connect devId %d\n", devId);
 
   dev = UsbGetDeviceStaticDescriptor(devId, NULL, USB_DT_DEVICE); /* Get device descriptor */
-  if(!dev) 
+  if(!dev)
     {
       printf("ERROR: Couldn't get device descriptor\n");
       return 1;
@@ -222,7 +222,7 @@
       printf("ERROR: Couldn't get configuration descriptor\n");
       return 1;
     }
-     
+
   intf = (UsbInterfaceDescriptor *) ((char *) conf + conf->bLength); /* Get first interface */
   endp = (UsbEndpointDescriptor *) ((char *) intf + intf->bLength);
   endp = (UsbEndpointDescriptor *) ((char *) endp + endp->bLength); /* Go to the data endpoint */
@@ -311,7 +311,7 @@
 {
   u8 buf[200];
   char *desc;
-} string_descriptor; 
+} string_descriptor;
 
 void ps2kbd_getstring_set(int resultCode, int bytes, void *arg)
 
@@ -334,7 +334,7 @@
 	}
       printf("%s: %s\n", strBuf->desc, string);
     }
-  
+
   FreeSysMemory(arg);
 }
 
@@ -343,7 +343,7 @@
 {
   u8 *data;
   string_descriptor *str;
-  int ret; 
+  int ret;
 
   data = (u8 *) AllocSysMemory(0, sizeof(string_descriptor), NULL);
   str = (string_descriptor *) data;
@@ -351,7 +351,7 @@
   if(data != NULL)
     {
       str->desc = desc;
-      ret = UsbControlTransfer(endp, 0x80, USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) | index, 
+      ret = UsbControlTransfer(endp, 0x80, USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) | index,
 			       0, sizeof(string_descriptor) - 4, data, ps2kbd_getstring_set, data);
       if(ret != USB_RC_OK)
 	{
@@ -380,7 +380,7 @@
   if(dev != NULL)
     {
       int ret;
-      
+
       ret = UsbControlTransfer(dev->configEndp, 0x21, USB_REQ_SET_IDLE, 0, dev->interfaceNo, 0, NULL, ps2kbd_idlemode_set, arg);
     }
 }
@@ -397,12 +397,12 @@
       printf("PS2KBD: Idlemode set error res %d, bytes %d, arg %p\n", resultCode, bytes, arg);
       return;
     }
-  
+
   dev = (kbd_dev *) arg;
   if(dev != NULL)
     {
       int ret;
-      
+
       ret = UsbInterruptTransfer(dev->dataEndp, &dev->data, dev->packetSize, ps2kbd_data_recv, arg);
     }
 }
@@ -474,7 +474,7 @@
     {
       tempPos = lineStartP;
     }
-  
+
   for(loopKey = 0; loopKey < PS2KBD_MAXKEYS; loopKey++)
     {
       u8 currKey = keys[loopKey];
@@ -581,7 +581,7 @@
 	}
     }
 
-  if(byteCount > 0) 
+  if(byteCount > 0)
     {
       iop_sys_clock_t t;
       /* Set alarm to do repeat rate */
@@ -619,11 +619,11 @@
     {
       tempPos = lineStartP;
     }
-  
+
   for(loopKey = 0; loopKey < 8; loopKey++)
     {
       int currMod = (1 << loopKey);
-      if(keyMods & currMod) 
+      if(keyMods & currMod)
 	{
 	  if(lineEndP == (tempPos - 2))
 	    {
@@ -708,7 +708,7 @@
       printf("PS2KEYBOARD: Data Recv set res %d, bytes %d, arg %p\n", resultCode, bytes, arg);
       return;
     }
-  
+
   //printf("PS2KBD: Data Recv set res %d, bytes %d, arg %p\n", resultCode, bytes, arg);
 
   dev = (kbd_dev *) arg;
@@ -717,7 +717,7 @@
       printf("PS2KBD: dev == NULL\n");
       return;
     }
-    
+
 /*       printf("PS2KBD Modifiers %02X, Keys ", dev->data.mod_keys); */
 /*       for(loop = 0; loop < PS2KBD_MAXKEYS; loop++) */
 /* 	{ */
@@ -737,7 +737,7 @@
 	  break;
 	}
     }
-  
+
   if(!phantom) /* If not in a phantom state */
     {
       u8 uniqueKeys[PS2KBD_MAXKEYS];
@@ -763,23 +763,23 @@
 /* 	  printf("%02X ", missingKeys[loopKey]); */
 /* 	} */
 /*       printf("\n"); */
-      
+
       if(kbd_readmode == PS2KBD_READMODE_NORMAL)
 	{
 	  u8 ledStatus;
 
 	  ledStatus = dev->ledStatus;
 	  //printf("ledStatus %02X\n", ledStatus);
-	  
+
 	  for(loopKey = 0; loopKey < PS2KBD_MAXKEYS; loopKey++) /* Process key codes */
 	    {
 	      switch(uniqueKeys[loopKey])
 		{
-		case USB_KEYB_NUMLOCK : 
+		case USB_KEYB_NUMLOCK :
 		  ledStatus ^= PS2KBD_LED_NUMLOCK;
 		  uniqueKeys[loopKey] = 0;
 		  break;
-		case USB_KEYB_CAPSLOCK : 
+		case USB_KEYB_CAPSLOCK :
 		  ledStatus ^= PS2KBD_LED_CAPSLOCK;
 		  uniqueKeys[loopKey] = 0;
 		  break;
@@ -789,16 +789,16 @@
 		  break;
 		}
 	    }
-	  
+
 	  if(ledStatus != dev->ledStatus)
 	    {
 	      dev->ledStatus = ledStatus & PS2KBD_LED_MASK;
 	      //printf("LEDS %02X\n", dev->ledStatus);
 	      /* Call Set LEDS */
-	      UsbControlTransfer(dev->configEndp, 0x21, USB_REQ_SET_REPORT, 0x200, 
+	      UsbControlTransfer(dev->configEndp, 0x21, USB_REQ_SET_REPORT, 0x200,
 				 dev->interfaceNo, 1, &dev->ledStatus, ps2kbd_led_set, arg);
 	    }
-	  
+
 	  WaitSema(lineSema); /* Make sure no other thread is going to manipulate the buffer */
 	  ps2kbd_getkeys(dev->data.mod_keys, dev->ledStatus, uniqueKeys, dev); /* read in remaining keys */
 	  SignalSema(lineSema);
@@ -812,7 +812,7 @@
 
       memcpy(&dev->oldData, &dev->data, sizeof(kbd_data_recv));
     }
-  
+
   ret = UsbInterruptTransfer(dev->dataEndp, &dev->data, dev->packetSize, ps2kbd_data_recv, arg);
 }
 
@@ -824,14 +824,14 @@
   lineStartP = 0;
   lineEndP = 0;
   memset(lineBuffer, 0, lineSize);
-  
+
   DeleteSema(bufferSema);
   s.initial = 0;
   s.max = lineSize;
   s.option = 0;
   s.attr = 0;
   bufferSema = CreateSema(&s); /* Create a sema to maintain status of readable data */
-  
+
   if(bufferSema <= 0)
     {
       printf("Error creating buffer sema\n");
@@ -843,7 +843,7 @@
 {
   int devLoop;
 
-  if(readmode == kbd_readmode) return; 
+  if(readmode == kbd_readmode) return;
 
   if((readmode == PS2KBD_READMODE_NORMAL) || (readmode == PS2KBD_READMODE_RAW))
     {
@@ -1006,7 +1006,7 @@
 		  if(lineEndP != (tempPos - 2))
 		    {
 		      lineBuffer[lineEndP++] = devices[devLoop]->repeatkeys[0];
-		      lineEndP %= lineSize;	      
+		      lineEndP %= lineSize;
 		      lineBuffer[lineEndP++] = devices[devLoop]->repeatkeys[1];
 		      lineEndP %= lineSize;
 		      SignalSema(bufferSema);
@@ -1018,7 +1018,7 @@
 		  if(lineEndP != (tempPos - 1))
 		    {
 		      lineBuffer[lineEndP++] = devices[devLoop]->repeatkeys[0];
-		      lineEndP %= lineSize;	      
+		      lineEndP %= lineSize;
 		      SignalSema(bufferSema);
 		    }
 		}
@@ -1051,7 +1051,7 @@
     StartThread(repeat_tid, 0);
     return 0;
   }
-  else 
+  else
     {
       return 1;
     }
@@ -1171,7 +1171,7 @@
   lineEndP = 0;
   lineSize = PS2KBD_DEFLINELEN;
   memset(lineBuffer, 0, PS2KBD_DEFLINELEN);
-  
+
   memset(devices, 0, sizeof(kbd_dev *) * PS2KBD_MAXDEV);
   dev_count = 0;
   kbd_readmode = PS2KBD_READMODE_NORMAL;

Modified: scummvm/trunk/backends/platform/ps2/rpckbd.c
===================================================================
--- scummvm/trunk/backends/platform/ps2/rpckbd.c	2009-05-24 21:19:02 UTC (rev 40871)
+++ scummvm/trunk/backends/platform/ps2/rpckbd.c	2009-05-24 21:53:29 UTC (rev 40872)
@@ -58,7 +58,7 @@
 	int res;
 	if ((!kbdInitialized) || (curr_readmode != PS2KBD_READMODE_NORMAL))
 		return -1;
-	
+
 	if (PollSema(kbdRpcSema) >= 0) {
 		// last rpc call completed
 		res = (rpcKey != 0);


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