[Scummvm-cvs-logs] SF.net SVN: scummvm: [27400] scummvm/branches/branch-0-10-0/backends/ platform/ds/arm9/source/osystem_ds.cpp

tramboi at users.sourceforge.net tramboi at users.sourceforge.net
Thu Jun 14 13:21:55 CEST 2007


Revision: 27400
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27400&view=rev
Author:   tramboi
Date:     2007-06-14 04:14:55 -0700 (Thu, 14 Jun 2007)

Log Message:
-----------
DS :
* grabRawScreen should work with the scaler enabled
* the address given to DC_FlushRange in grabRawScreen was mixing a u16 base address and a u8 stride, skipping every odd line and buffer-overrunning (if I'm not mistaken :) )

Modified Paths:
--------------
    scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/osystem_ds.cpp

Modified: scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/osystem_ds.cpp
===================================================================
--- scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/osystem_ds.cpp	2007-06-14 11:04:45 UTC (rev 27399)
+++ scummvm/branches/branch-0-10-0/backends/platform/ds/arm9/source/osystem_ds.cpp	2007-06-14 11:14:55 UTC (rev 27400)
@@ -477,14 +477,17 @@
 	surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
 
 	// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
-	// TODO: Change this to work with the software scalar (hint: video ram format is different)
+	
+    size_t imageStrideInBytes = isCpuScalerEnabled() DS::getGameWidth() ? 512;
+    size_t imageStrideInWords = imageStrideInBytes / 2;
+
 	u16* image = (u16 *) DS::get8BitBackBuffer();
 	for (int y = 0; y <  DS::getGameHeight(); y++)
 	{
-		DC_FlushRange((image + (y * 512)), DS::getGameWidth());
+		DC_FlushRange(image + (y * imageStrideInWords), DS::getGameWidth());
 		for (int x = 0; x < DS::getGameWidth() >> 1; x++)
 		{
-			*(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = *(image + y * 256 + x);
+			*(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y * imageStrideInWords + x];
 		}
 	}
 


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