[Scummvm-cvs-logs] SF.net SVN: scummvm: [24129] scummvm/trunk/backends/platform/ds/arm9/source

Tramboi at users.sourceforge.net Tramboi at users.sourceforge.net
Fri Oct 6 00:44:17 CEST 2006


Revision: 24129
          http://svn.sourceforge.net/scummvm/?rev=24129&view=rev
Author:   Tramboi
Date:     2006-10-05 15:44:11 -0700 (Thu, 05 Oct 2006)

Log Message:
-----------
DS CPU scaling prototype, in 16 bit mode (for menu), not plugged(switch cpuScaler to test)

Modified Paths:
--------------
    scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
    scummvm/trunk/backends/platform/ds/arm9/source/dsmain.h

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2006-10-05 20:27:09 UTC (rev 24128)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2006-10-05 22:44:11 UTC (rev 24129)
@@ -40,6 +40,7 @@
 #include "registers_alt.h"
 //#include "compact_flash.h"
 #include "dsoptions.h"
+#include "blitters.h"
 
 namespace DS {
 
@@ -114,7 +115,13 @@
 
 bool consoleEnable = true;
 bool gameScreenSwap = false;
+bool cpuScaler = false;
+bool isCpuScalerEnabled()
+{
+	return cpuScaler;	
+}
 
+
 MouseMode mouseMode;
 
 // Sprites
@@ -522,7 +529,7 @@
 	BG3_CR = BG_BMP16_512x256;
 	highBuffer = false;
 	
-	BG3_XDX = (int) (1.25f * 256);
+	BG3_XDX = cpuScaler ? 256 : (int) (1.25f * 256);
     BG3_XDY = 0;
     BG3_YDX = 0;
     BG3_YDY = (int) ((200.0f / 192.0f) * 256);
@@ -567,9 +574,19 @@
 //		highBuffer = !highBuffer;
 //		BG3_CR = BG_BMP16_512x256 |	BG_BMP_RAM(highBuffer? 1: 0);
 		
-		for (int r = 0; r < 512 * 256; r++) {
-			*(BG_GFX + r) = *(back + r);
+		if (cpuScaler)
+		{
+			for(int i=0; i<200; ++i)
+			{                 
+				DS::Rescale_320x1555Scanline_To_256x1555Scanline(BG_GFX+i*512, back+i*512);
+			}
 		}
+		else
+		{
+			for (int r = 0; r < 512 * 256; r++) {
+				*(BG_GFX + r) = *(back + r);
+			}
+		}
 	}
 }
 
@@ -1169,11 +1186,21 @@
 		SUB_BG3_YDX = 0;
 		SUB_BG3_YDY = y;
 	} else {
-		BG3_XDX = x;
-		BG3_XDY = 0;
-		BG3_YDX = 0;
-		BG3_YDY = y;
-		
+		if (cpuScaler && (!displayModeIs8Bit) && (x==320))
+		{
+			BG3_XDX = 256;
+			BG3_XDY = 0;
+			BG3_YDX = 0;
+			BG3_YDY = y;
+		}
+		else
+		{	
+			BG3_XDX = x;
+			BG3_XDY = 0;
+			BG3_YDX = 0;
+			BG3_YDY = y;
+		}
+				
 		touchScX = x;
 		touchScY = y;
 	}
@@ -1941,4 +1968,3 @@
 int main() {
 	DS::main();
 }
-

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.h	2006-10-05 20:27:09 UTC (rev 24128)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.h	2006-10-05 22:44:11 UTC (rev 24129)
@@ -106,7 +106,9 @@
 void 	setUnscaledMode(bool enable);
 void 	setIndyFightState(bool st);
 bool 	getIndyFightState();
+bool    isCpuScalerEnabled();
 
+
 // Display
 bool 	getIsDisplayMode8Bit();
 void 	setGameSize(int width, int height);


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