[Scummvm-cvs-logs] scummvm master -> 6d4b0a2c9f422d4c3fd51e7c68644c16ddd805d4

digitall dgturner at iee.org
Tue Nov 27 04:57:32 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6d4b0a2c9f PS2: Fix three compiler warnings and minor code formatting fixes.


Commit: 6d4b0a2c9f422d4c3fd51e7c68644c16ddd805d4
    https://github.com/scummvm/scummvm/commit/6d4b0a2c9f422d4c3fd51e7c68644c16ddd805d4
Author: D G Turner (digitall at scummvm.org)
Date: 2012-11-26T19:55:06-08:00

Commit Message:
PS2: Fix three compiler warnings and minor code formatting fixes.

Changed paths:
    backends/platform/ps2/Gs2dScreen.cpp
    backends/platform/ps2/Gs2dScreen.h
    backends/platform/ps2/ps2pad.cpp



diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp
index f93166e..e818305 100644
--- a/backends/platform/ps2/Gs2dScreen.cpp
+++ b/backends/platform/ps2/Gs2dScreen.cpp
@@ -102,8 +102,7 @@ int vblankEndHandler(int cause) {
 
 void createAnimThread(Gs2dScreen *screen);
 
-Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
-
+Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode mode) {
 	_systemQuit = false;
 	ee_sema_t newSema;
 	newSema.init_count = 1;
@@ -118,7 +117,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 
 	_vblankStartId = AddIntcHandler(INT_VBLANK_START, vblankStartHandler, 0);
 	_vblankEndId   = AddIntcHandler(INT_VBLANK_END, vblankEndHandler, 0);
-	_dmacId		   = AddDmacHandler(2, dmacHandler, 0);
+	_dmacId        = AddDmacHandler(2, dmacHandler, 0);
 
 	_dmaPipe = new DmaPipe(0x2000);
 
@@ -139,7 +138,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 	_clut[1] = GS_RGBA(0xC0, 0xC0, 0xC0, 0);
 	clearOverlay();
 
-	if (tvMode == TV_DONT_CARE) {
+	if (mode == TV_DONT_CARE) {
 #if 1
 	char romver[8];
 	int fd = fioOpen("rom0:ROMVER", O_RDONLY);
@@ -157,12 +156,12 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 			_tvMode = TV_NTSC;
 #endif
 	} else
-		_tvMode = tvMode;
+		_tvMode = mode;
 
 	// _tvMode = TV_NTSC;
 	printf("Setting up %s mode\n", (_tvMode == TV_PAL) ? "PAL" : "NTSC");
 
-    // set screen size, 640x512 for pal, 640x448 for ntsc
+	// set screen size, 640x512 for pal, 640x448 for ntsc
 	_tvWidth = 640;
 	_tvHeight = ((_tvMode == TV_PAL) ? 512 /*544*/ : 448);
 	kFullScreen[0].z = kFullScreen[1].z = 0;
@@ -186,8 +185,8 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 	_clutPtrs[MOUSE]  = _clutPtrs[SCREEN] + 0x1000; // the cluts in PSMCT32 take up half a memory page each
 	_clutPtrs[TEXT]   = _clutPtrs[SCREEN] + 0x2000;
 	_texPtrs[SCREEN]  = _clutPtrs[SCREEN] + 0x3000;
-	_texPtrs[TEXT]    = 0;						  // these buffers are stored in the alpha gaps of the frame buffers
-	_texPtrs[MOUSE]	  = 128 * 256 * 4;
+	_texPtrs[TEXT]    = 0;                          // these buffers are stored in the alpha gaps of the frame buffers
+	_texPtrs[MOUSE]   = 128 * 256 * 4;
 	_texPtrs[PRINTF]  = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4;
 
 	_showOverlay = false;
@@ -201,14 +200,14 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 	_overlayFormat.bytesPerPixel = 2;
 
 	_overlayFormat.rLoss = 3;
-    _overlayFormat.gLoss = 3;
-    _overlayFormat.bLoss = 3;
-    _overlayFormat.aLoss = 7;
+	_overlayFormat.gLoss = 3;
+	_overlayFormat.bLoss = 3;
+	_overlayFormat.aLoss = 7;
 
-    _overlayFormat.rShift = 0;
-    _overlayFormat.gShift = 5;
-    _overlayFormat.bShift = 10;
-    _overlayFormat.aShift = 15;
+	_overlayFormat.rShift = 0;
+	_overlayFormat.gShift = 5;
+	_overlayFormat.bShift = 10;
+	_overlayFormat.aShift = 15;
 
 	// setup hardware now.
 	GS_CSR = CSR_RESET; // Reset GS
@@ -249,18 +248,18 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 
 	createAnimTextures();
 
-	// create anim thread
-	ee_thread_t animThread, thisThread;
+	// create animation thread
+	ee_thread_t animationThread, thisThread;
 	ReferThreadStatus(GetThreadId(), &thisThread);
 
 	_animStack = malloc(ANIM_STACK_SIZE);
-	animThread.initial_priority = thisThread.current_priority - 3;
-	animThread.stack	  = _animStack;
-	animThread.stack_size = ANIM_STACK_SIZE;
-	animThread.func		  = (void *)runAnimThread;
-	animThread.gp_reg	  = &_gp;
+	animationThread.initial_priority = thisThread.current_priority - 3;
+	animationThread.stack      = _animStack;
+	animationThread.stack_size = ANIM_STACK_SIZE;
+	animationThread.func       = (void *)runAnimThread;
+	animationThread.gp_reg     = &_gp;
 
-	_animTid = CreateThread(&animThread);
+	_animTid = CreateThread(&animationThread);
 	assert(_animTid >= 0);
 	StartThread(_animTid, this);
 }
@@ -268,13 +267,13 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
 void Gs2dScreen::quit(void) {
 	_systemQuit = true;
 	ee_thread_t statAnim;
-	do {	// wait until thread called ExitThread()
+	do { // wait until thread called ExitThread()
 		SignalSema(g_AnimSema);
 		ReferThreadStatus(_animTid, &statAnim);
 	} while (statAnim.status != 0x10);
 	DeleteThread(_animTid);
 	free(_animStack);
-	_dmaPipe->waitForDma();	// wait for dmac and vblank for the last time
+	_dmaPipe->waitForDma(); // wait for dmac and vblank for the last time
 	while (g_DmacCmd || g_VblankCmd);
 
 	sioprintf("kill handlers\n");
@@ -606,7 +605,7 @@ void Gs2dScreen::grabOverlay(byte *buf, uint16 pitch) {
 	for (uint32 cnt = 0; cnt < _height; cnt++) {
 		memcpy(buf, src, _width * 2);
 		buf += pitch;
-        src += _width;
+		src += _width;
 	}
 }
 
diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h
index 005dabc..1a70dad 100644
--- a/backends/platform/ps2/Gs2dScreen.h
+++ b/backends/platform/ps2/Gs2dScreen.h
@@ -29,7 +29,6 @@
 #include "backends/platform/ps2/DmaPipe.h"
 #include "graphics/surface.h"
 
-
 enum TVMode {
 	TV_DONT_CARE = 0,
 	TV_PAL,
@@ -41,10 +40,9 @@ enum GsInterlace {
 	GS_INTERLACED
 };
 
-
 class Gs2dScreen {
 public:
-	Gs2dScreen(uint16 width, uint16 height, TVMode tvMode);
+	Gs2dScreen(uint16 width, uint16 height, TVMode mode);
 	~Gs2dScreen(void);
 	void newScreenSize(uint16 width, uint16 height);
 	uint8 tvMode(void);
@@ -94,27 +92,26 @@ private:
 
 	uint8  _curDrawBuf;
 	uint32 _frameBufPtr[2]; //
-	uint32 _clutPtrs[3];    //   vram pointers
+	uint32 _clutPtrs[3];    // vram pointers
 	uint32 _texPtrs[4];     //
 
 	Graphics::Surface _framebuffer;
 
-	/* TODO : check if we do need this */
-    struct VideoState {
-        bool setup;
+	// TODO : check if we do need this
+	struct VideoState {
+		bool setup;
 
-        bool fullscreen;
-        bool aspectRatio;
+		bool fullscreen;
+		bool aspectRatio;
 
-        int mode;
-        int scaleFactor;
+		int mode;
+		int scaleFactor;
 
-        int screenWidth, screenHeight;
-        int overlayWidth, overlayHeight;
-    };
+		int screenWidth, screenHeight;
+		int overlayWidth, overlayHeight;
+	};
 
 	VideoState _videoMode;
-	/* */
 
 	uint16 _width, _height, _pitch;
 	int16  _mouseX, _mouseY, _hotSpotX, _hotSpotY;
diff --git a/backends/platform/ps2/ps2pad.cpp b/backends/platform/ps2/ps2pad.cpp
index b6afc21..607b614 100644
--- a/backends/platform/ps2/ps2pad.cpp
+++ b/backends/platform/ps2/ps2pad.cpp
@@ -51,6 +51,9 @@ void Ps2Pad::initPad(void) {
 	} else {
 		if (checkPadReady(_port, _slot)) {
 			switch (_padStatus) {
+				case STAT_NONE:
+					printf("Pad Status is None. Shouldn't happen\n");
+					break;
 				case STAT_OPEN:
 					_padStatus = STAT_DETECT;
 					break;






More information about the Scummvm-git-logs mailing list