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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Jan 21 05:27:33 CET 2009


Revision: 35977
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35977&view=rev
Author:   fingolfin
Date:     2009-01-21 04:27:32 +0000 (Wed, 21 Jan 2009)

Log Message:
-----------
More cleanup

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

Modified: scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2009-01-21 04:03:22 UTC (rev 35976)
+++ scummvm/trunk/backends/platform/ds/arm9/source/dsmain.cpp	2009-01-21 04:27:32 UTC (rev 35977)
@@ -325,8 +325,7 @@
 TransferSound soundControl;
 
 
-bool isCpuScalerEnabled()
-{
+bool isCpuScalerEnabled() {
 	return cpuScalerEnable || !displayModeIs8Bit;
 }
 
@@ -372,8 +371,7 @@
 
 
 //plays an 8 bit mono sample at 11025Hz
-void playSound(const void* data, u32 length, bool loop, bool adpcm, int rate)
-{
+void playSound(const void* data, u32 length, bool loop, bool adpcm, int rate) {
 
 	if (!IPC->soundData) {
 		soundControl.count = 0;
@@ -445,7 +443,7 @@
 	// Sometimes the only copy of the game screen is in video memory.
 	// So, I lock the video memory here, as if I'm going to modify it.  This
 	// forces OSystem_DS to create a system memory copy if one doesn't exist.
-	// This will be automatially resotred by OSystem_DS::updateScreen().
+	// This will be automatially restored by OSystem_DS::updateScreen().
 
 	OSystem_DS::instance()->lockScreen();
 	OSystem_DS::instance()->unlockScreen();
@@ -578,8 +576,7 @@
 
 	displayModeIs8Bit = true;
 
-	if (isCpuScalerEnabled())
-	{
+	if (isCpuScalerEnabled()) {
 		videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
 		videoSetModeSub(MODE_3_2D /*| DISPLAY_BG0_ACTIVE*/ | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
 
@@ -598,9 +595,7 @@
 	    BG3_YDX = 0;
 	    BG3_YDY = (int) ((200.0f / 192.0f) * 256);
 
-	}
-	else
-	{
+	} else {
 		videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
 		videoSetModeSub(MODE_3_2D /*| DISPLAY_BG0_ACTIVE*/ | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
 
@@ -693,10 +688,8 @@
 	}
 }
 
-void setShowCursor(bool enable)
-{
-	if ((currentGame) && (currentGame->control == CONT_SCUMM_SAMNMAX))
-	{
+void setShowCursor(bool enable) {
+	if ((currentGame) && (currentGame->control == CONT_SCUMM_SAMNMAX)) {
 		if (cursorEnable) {
 			sprites[1].attribute[0] = ATTR0_BMP | 150;
 		} else {
@@ -708,42 +701,40 @@
 	cursorEnable = enable;
 }
 
-void setMouseCursorVisible(bool enable)
-{
+void setMouseCursorVisible(bool enable) {
 	mouseCursorVisible = enable;
 }
 
 void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY) {
 
+	int off;
+
 	mouseHotspotX = hotspotX;
 	mouseHotspotY = hotspotY;
 
 	//consolePrintf("Set cursor icon %d, %d\n", w, h);
 
-	{
-		int off = 128*64;
+	off = 128*64;
 
 
-		memset(SPRITE_GFX + off, 0, 32 * 32 * 2);
-		memset(SPRITE_GFX_SUB + off, 0, 32 * 32 * 2);
+	memset(SPRITE_GFX + off, 0, 32 * 32 * 2);
+	memset(SPRITE_GFX_SUB + off, 0, 32 * 32 * 2);
 
 
-		for (uint y=0; y<h; y++) {
-			for (uint x=0; x<w; x++) {
-				int color = icon[y*w+x];
+	for (uint y=0; y<h; y++) {
+		for (uint x=0; x<w; x++) {
+			int color = icon[y*w+x];
 
-				//consolePrintf("%d:%d ", color, OSystem_DS::instance()->getDSPaletteEntry(color));
+			//consolePrintf("%d:%d ", color, OSystem_DS::instance()->getDSPaletteEntry(color));
 
-				if (color == keycolor) {
-					SPRITE_GFX[off+(y)*32+x] = 0x0000; // black background
-					SPRITE_GFX_SUB[off+(y)*32+x] = 0x0000; // black background
-				} else {
-					SPRITE_GFX[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
-					SPRITE_GFX_SUB[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
-				}
+			if (color == keycolor) {
+				SPRITE_GFX[off+(y)*32+x] = 0x0000; // black background
+				SPRITE_GFX_SUB[off+(y)*32+x] = 0x0000; // black background
+			} else {
+				SPRITE_GFX[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
+				SPRITE_GFX_SUB[off+(y)*32+x] = OSystem_DS::instance()->getDSCursorPaletteEntry(color) | 0x8000;
 			}
 		}
-
 	}
 
 	if (currentGame->control != CONT_SCUMM_SAMNMAX)
@@ -752,7 +743,7 @@
 	uint16 border = RGB15(24,24,24) | 0x8000;
 
 
-	int off = 176*64;
+	off = 176*64;
 	memset(SPRITE_GFX_SUB+off, 0, 64*64*2);
 	memset(SPRITE_GFX+off, 0, 64*64*2);
 
@@ -793,7 +784,7 @@
 	}
 
 
-	if ((cursorEnable)) {
+	if (cursorEnable) {
 		sprites[1].attribute[0] = ATTR0_BMP | 150;
 		sprites[1].attribute[1] = ATTR1_SIZE_64 | pos;
 		sprites[1].attribute[2] = ATTR2_ALPHA(1) | 176;
@@ -891,19 +882,14 @@
 //		highBuffer = !highBuffer;
 //		BG3_CR = BG_BMP16_512x256 |	BG_BMP_RAM(highBuffer? 1: 0);
 
-		if (isCpuScalerEnabled())
-		{
+		if (isCpuScalerEnabled()) {
 			Rescale_320x256x1555_To_256x256x1555(BG_GFX, back, 512, 512);
-		}
-		else
-		{
+		} else {
 			for (int r = 0; r < 512 * 256; r++) {
 				*(BG_GFX + r) = *(back + r);
 			}
 		}
-	}
-	else if (isCpuScalerEnabled())
-	{
+	} else if (isCpuScalerEnabled()) {
         //#define SCALER_PROFILE
 
         #ifdef SCALER_PROFILE

Modified: scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp	2009-01-21 04:03:22 UTC (rev 35976)
+++ scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.cpp	2009-01-21 04:27:32 UTC (rev 35977)
@@ -59,7 +59,7 @@
 }
 
 int OSystem_DS::timerHandler(int t) {
-	DSTimerManager *tm = (DSTimerManager *)g_system->getTimerManager();
+	DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager();
 	tm->handler();
 	return t;
 }
@@ -68,9 +68,9 @@
 	ConfMan.setInt("autosave_period", 0);
 	ConfMan.setBool("FM_medium_quality", true);
 
-	_mixer = new DSAudioMixer(this);
-	_timer = new DSTimerManager();
-    	DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
+	_mixer = new Audio::MixerImpl(this);
+	_timer = new DefaultTimerManager();
+    DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
 
 	if (ConfMan.hasKey("22khzaudio", "ds") && ConfMan.getBool("22khzaudio", "ds")) {
 		DS::startSound(22050, 8192);
@@ -370,8 +370,7 @@
 	// FIXME: Evil game specific hack.
 	// Force back buffer usage for Nippon Safes, as it doesn't double buffer it's output
 	if (DS::getControlType() == DS::CONT_NIPPON) {
-		OSystem_DS::instance()->lockScreen();
-		OSystem_DS::instance()->unlockScreen();
+		lockScreen();
 	}
 }
 

Modified: scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.h
===================================================================
--- scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.h	2009-01-21 04:03:22 UTC (rev 35976)
+++ scummvm/trunk/backends/platform/ds/arm9/source/osystem_ds.h	2009-01-21 04:27:32 UTC (rev 35977)
@@ -33,16 +33,6 @@
 #include "sound/mixer_intern.h"
 #include "graphics/surface.h"
 
-class DSAudioMixer : public Audio::MixerImpl {
-
-public:
-	DSAudioMixer(OSystem* system) : Audio::MixerImpl(system) { }
-};
-
-class DSTimerManager : public DefaultTimerManager {
-};
-
-
 class OSystem_DS : public OSystem {
 protected:
 
@@ -56,8 +46,8 @@
 	DSSaveFileManager saveManager;
 #endif
 	GBAMPSaveFileManager mpSaveManager;
-	DSAudioMixer* _mixer;
-	DSTimerManager* _timer;
+	Audio::MixerImpl* _mixer;
+	DefaultTimerManager* _timer;
 	Graphics::Surface _framebuffer;
 	bool _frameBufferExists;
 	bool _graphicsEnable;


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