[Scummvm-cvs-logs] SF.net SVN: scummvm:[42401] scummvm/branches/branch-0-13-0

sunmax at users.sourceforge.net sunmax at users.sourceforge.net
Sun Jul 12 07:04:59 CEST 2009


Revision: 42401
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42401&view=rev
Author:   sunmax
Date:     2009-07-12 05:04:59 +0000 (Sun, 12 Jul 2009)

Log Message:
-----------
ScummVM/PS2 bugs fixed by this commit:

 - general file write corruption (eg. ScummVM.ini, etc.)

 - COMI specific save crash / corruption
   (added option in engines/scumm/saveload.cpp to disable
    thumbnails on PS2, as emergency fallback in case the
    fix should prove to be insufficient)

 - implemented _screenChange logic
   (fixes grabOverlay & COMI popup menu)

 - fixed higher pitch (chipmunk fx)

 - made NET IRXs optional to allow it to work on fat PS2 without net+hd

 - fixed cursor restore on RTL

 - added "." as R2 to skip single lines of dialog

 - added write cache

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/backends/platform/ps2/Gs2dScreen.cpp
    scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.ps2
    scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.cpp
    scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.h
    scummvm/branches/branch-0-13-0/backends/platform/ps2/irxboot.cpp
    scummvm/branches/branch-0-13-0/backends/platform/ps2/ps2input.cpp
    scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.cpp
    scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.h
    scummvm/branches/branch-0-13-0/engines/scumm/saveload.cpp

Added Paths:
-----------
    scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.gdb

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/Gs2dScreen.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/Gs2dScreen.cpp	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/Gs2dScreen.cpp	2009-07-12 05:04:59 UTC (rev 42401)
@@ -35,6 +35,8 @@
 #include "graphics/surface.h"
 #include "backends/platform/ps2/ps2debug.h"
 
+extern "C" void breakpoint(void);
+
 extern void *_gp;
 
 enum Buffers {
@@ -188,7 +190,7 @@
 	_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[MOUSE]	  = 128 * 256 * 4;
 	_texPtrs[PRINTF]  = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4;
 
 	_showOverlay = false;
@@ -312,6 +314,8 @@
 	WaitSema(g_DmacSema);
 	WaitSema(g_VblankSema);
 
+	// breakpoint();
+
 	_dmaPipe->flush();
 	_width = width;
 	_height = height;
@@ -325,6 +329,7 @@
 	memset(_screenBuf, 0, _width * height);
 	memset(_overlayBuf, 0, _width * height * 2);
 	memset(_clut, 0, 256 * sizeof(uint32));
+	_clut[1] = GS_RGBA(0xC0, 0xC0, 0xC0, 0);
 
 	// clear video ram
 	_dmaPipe->uploadTex(_clutPtrs[MOUSE], 64, 0, 0, GS_PSMCT32, _clut, 16, 16);
@@ -333,7 +338,8 @@
 	_dmaPipe->flush();
 	_dmaPipe->waitForDma();
 
-	_clutChanged = _screenChanged = _overlayChanged = false;
+	/*_clutChanged = */ _screenChanged = _overlayChanged = false;
+	_clutChanged = true; // reload palette on scr change
 
 	_texCoords[1].u = SCALE(_width);
 	_texCoords[1].v = SCALE(_height);
@@ -570,6 +576,9 @@
 
 void Gs2dScreen::clearOverlay(void) {
 	WaitSema(g_DmacSema);
+
+	// breakpoint();
+
 	_overlayChanged = true;
 	// first convert our clut to 16 bit RGBA for the overlay...
 	uint16 palette[256];
@@ -584,6 +593,9 @@
 }
 
 void Gs2dScreen::grabOverlay(uint16 *buf, uint16 pitch) {
+
+	// breakpoint();
+
 	uint16 *src = _overlayBuf;
 	for (uint32 cnt = 0; cnt < _height; cnt++) {
 		memcpy(buf, src, _width * 2);

Added: scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.gdb
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.gdb	                        (rev 0)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.gdb	2009-07-12 05:04:59 UTC (rev 42401)
@@ -0,0 +1,94 @@
+# $Header: Exp $
+ include $(PS2SDK)/Defs.make
+
+PS2_EXTRA = /media/disk/nw8240/extras/scummvm/ports
+PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
+PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
+
+ENABLED=STATIC_PLUGIN
+
+#control build
+DISABLE_SCALERS = true
+DISABLE_HQ_SCALERS = true
+
+ENABLE_SCUMM = $(ENABLED)
+ENABLE_SCUMM_7_8 = $(ENABLED)
+#ENABLE_HE = $(ENABLED)
+#ENABLE_AGI = $(ENABLED)
+#ENABLE_AGOS = $(ENABLED)
+#ENABLE_CINE = $(ENABLED)
+#ENABLE_CRUISE = $(ENABLED)
+#ENABLE_DRASCULA = $(ENABLED)
+#ENABLE_GOB = $(ENABLED)
+#ENABLE_IGOR = $(ENABLED)
+#ENABLE_KYRA = $(ENABLED)
+#ENABLE_LURE = $(ENABLED)
+ # ENABLE_M4 = $(ENABLED)
+#ENABLE_MADE = $(ENABLED)
+#ENABLE_PARALLACTION = $(ENABLED)
+#ENABLE_QUEEN = $(ENABLED)
+#ENABLE_SAGA = $(ENABLED)
+#ENABLE_SAGA2 = $(ENABLED)
+#ENABLE_IHNM = $(ENABLED)
+#ENABLE_SKY = $(ENABLED)
+#ENABLE_SWORD1 = $(ENABLED)
+#ENABLE_SWORD2 = $(ENABLED)
+ # ENABLE_TINSEL = $(ENABLED)
+#ENABLE_TOUCHE = $(ENABLED)
+
+HAVE_GCC3 = true
+
+CC		= ee-gcc
+CXX     = ee-g++
+AS      = ee-gcc
+LD      = ee-gcc
+AR      = ee-ar cru
+RANLIB  = ee-ranlib
+STRIP   = ee-strip
+MKDIR   = mkdir -p
+RM      = rm -f
+
+srcdir = ../../..
+VPATH = $(srcdir)
+INCDIR = ../../../
+# DEPDIR = .deps
+
+DEFINES  = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -D__PS2_DEBUG__ -g -Wall -Wno-multichar
+
+
+INCLUDES  = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS)) 
+INCLUDES += -I $(PS2GDB)/ee -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines
+
+TARGET = elf/scummvm.elf
+
+OBJS := backends/platform/ps2/DmaPipe.o \
+    backends/platform/ps2/Gs2dScreen.o \
+    backends/platform/ps2/irxboot.o \
+	backends/platform/ps2/ps2input.o \
+	backends/platform/ps2/ps2pad.o \
+	backends/platform/ps2/savefilemgr.o \
+    backends/platform/ps2/fileio.o \
+    backends/platform/ps2/asyncfio.o \
+	backends/platform/ps2/icon.o \
+    backends/platform/ps2/cd.o \
+    backends/platform/ps2/eecodyvdfs.o \
+    backends/platform/ps2/rpckbd.o \
+    backends/platform/ps2/systemps2.o \
+    backends/platform/ps2/ps2mutex.o \
+    backends/platform/ps2/ps2time.o \
+	backends/platform/ps2/ps2debug.o
+    
+MODULE_DIRS += .
+
+include $(srcdir)/Makefile.common
+
+LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -T $(PS2SDK)/ee/startup/linkfile 
+LDFLAGS += -L $(PS2GDB)/lib  -L $(PS2SDK)/ee/lib -L .
+LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS)) 
+LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lps2gdbStub -lps2ip -ldebug -lkernel -lstdc++
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS)
+	$(LD) $^ $(LDFLAGS) -o $@
+


Property changes on: scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.gdb
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.ps2
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.ps2	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/Makefile.ps2	2009-07-12 05:04:59 UTC (rev 42401)
@@ -1,7 +1,7 @@
 # $Header: Exp $
  include $(PS2SDK)/Defs.make
 
-PS2_EXTRA = /media/disk-1/nw8240/extras/scummvm/ports
+PS2_EXTRA = /media/disk/nw8240/extras/scummvm/ports
 PS2_EXTRA_INCS = /zlib/include /libmad/ee/include /SjPcm/ee/src /tremor
 PS2_EXTRA_LIBS = /zlib/lib /libmad/ee/lib /SjPcm/ee/lib /tremor/tremor
 
@@ -45,8 +45,8 @@
 AR      = ee-ar cru
 RANLIB  = ee-ranlib
 STRIP   = ee-strip
-MKDIR 	= mkdir -p
-RM 	= rm -f
+MKDIR   = mkdir -p
+RM      = rm -f
 
 srcdir = ../../..
 VPATH = $(srcdir)
@@ -86,7 +86,7 @@
 LDFLAGS += -L $(PS2SDK)/ee/lib -L .
 LDFLAGS += $(addprefix -L$(PS2_EXTRA),$(PS2_EXTRA_LIBS)) 
 LDFLAGS += -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm -lmad -ltremor -lz -lm -lc -lfileXio -lkernel -lstdc++ 
-# LDFLAGS += -s 
+LDFLAGS += -s 
 
 all: $(TARGET)
 

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.cpp	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.cpp	2009-07-12 05:04:59 UTC (rev 42401)
@@ -61,7 +61,7 @@
 
 	// _cache = (uint8 *)malloc(PS2_CACHE_MAX);
 
-	_cacheBuf = (uint8*)memalign(64, CACHE_SIZE);
+	_cacheBuf = (uint8*)memalign(64, CACHE_SIZE * 2);
 
 	_cacheOpRunning = 0;
 	_filePos = _physFilePos = _cachePos = 0;
@@ -80,7 +80,16 @@
 }
 
 Ps2File::~Ps2File(void) {
+	uint32 w;
 	if (_fd >= 0) {
+
+		if (_mode != O_RDONLY) {
+			fio.seek(_fd, 0, SEEK_SET);
+			fio.write(_fd, _cacheBuf, _filePos);
+			w = fio.sync(_fd);
+			printf("flushed wbuf: %x of %x\n", w, _filePos);
+		}
+
 		fio.close(_fd);
 		uint32 r = fio.sync(_fd);
 		printf("close [%d] - sync'd = %d\n", _fd, r);
@@ -95,24 +104,87 @@
 }
 
 bool Ps2File::open(const char *name, int mode) {
-	assert(_fd < 0);
-
+#if 1
 	_fd = fio.open(name, mode);
 
 	printf("open %s [%d]\n", name, _fd);
 
 	if (_fd >= 0) {
-		_fileSize = fio.seek(_fd, 0, SEEK_END);
-		if (mode == O_RDONLY)
-		// if (!(mode & O_APPEND))
+		_mode = mode;
+		_filePos = 0;
+
+		if (_mode == O_RDONLY) {
+			_fileSize = fio.seek(_fd, 0, SEEK_END);
 			fio.seek(_fd, 0, SEEK_SET);
+		}
+		else
+			_fileSize = 0;
 
+		printf("  _mode = %x\n", _mode);
 		printf("  _fileSize = %d\n", _fileSize);
+		// printf("  _filePos = %d\n", _filePos);
+
+		return true;
+	}
+
+	return false;
+#else
+	uint32 r;
+
+	// hack: FIO does not reports size for RW (?)
+	_fd = fio.open(name, O_RDONLY);
+	if (_fd >= 0) {
+		_fileSize = fio.seek(_fd, 0, SEEK_END);
+		fio.seek(_fd, 0, SEEK_SET); /* rewind ! */
+
+		if (_fileSize && mode != O_RDONLY) {
+			fio.read(_fd, _cacheBuf, _fileSize);
+			r = fio.sync(_fd);
+			printf(" sz=%d, read=%d\n", _fileSize, r);
+			assert(r == _fileSize);
+		}
+
+		fio.close(_fd);
+	}
+	else
+		_fileSize = 0; /* new file */
+
+	_fd = fio.open(name, mode);
+
+	printf("open %s [%d]\n", name, _fd);
+
+	if (_fd >= 0) {
+		_mode = mode;
+		_filePos = 0;
+
+		if (_fileSize) { /* existing data */
+			if (mode == O_RDONLY) {
+				/* DANGER: for w* modes it will truncate your fine files */
+				fio.seek(_fd, 0, SEEK_SET);
+			}
+			else if (_mode & O_APPEND) {
+				fio.seek(_fd, 0, _fileSize);
+				_filePos = _fileSize;
+			}
+			#if 0 /* file already trunc'd when opened as w* -> moved up */
+			if (mode != O_RDONLY) {
+				fio.read(_fd, _cacheBuf, _fileSize);
+				r = fio.sync(_fd);
+				printf(" sz=%d, read=%d\n", _fileSize, r);
+				assert(r == _fileSize);
+				// _fileSize = fio.seek(_fd, 0, SEEK_END);
+			}
+			#endif
+		}
+
+		printf("  _mode = %x\n", _mode);
+		printf("  _fileSize = %d\n", _fileSize);
 		printf("  _filePos = %d\n", _filePos);
 
 		return true;
 	} else
 		return false;
+#endif
 }
 
 int32 Ps2File::tell(void) {
@@ -225,7 +297,7 @@
 			_cachePos = cachePosEnd = _filePos & ~READ_ALIGN_MASK;
 			assert(_filePos == _physFilePos);
 		} else {
-            		uint32 cacheDiff = _filePos - _cachePos;
+			uint32 cacheDiff = _filePos - _cachePos;
 			assert(_bytesInCache >= cacheDiff);
 			cacheDiff &= ~READ_ALIGN_MASK;
 			_bytesInCache -= cacheDiff;
@@ -267,7 +339,7 @@
 	}
 }
 
-uint32 Ps2File::read(void *dest, uint32 len) {	
+uint32 Ps2File::read(void *dest, uint32 len) {
 	// uint32 r=0, d=0, ds=0, sz=0;
 #ifdef __PS2_FILE_SEMA__
 	WaitSema(_sema);
@@ -344,32 +416,18 @@
 }
 
 uint32 Ps2File::write(const void *src, uint32 len) {
-	uint32 w;
 #ifdef __PS2_FILE_SEMA__
 	WaitSema(_sema);
 #endif
-	_cacheSize = 0;
 
-	w = fio.sync(_fd);
-	assert(w==0);
+	memcpy(&_cacheBuf[_filePos], src, len);
+	_filePos += len;
 
-	fio.seek(_fd, _filePos, SEEK_SET);
-	fio.write(_fd, src, len);
-
-	w = fio.sync(_fd);
-
 #ifdef __PS2_FILE_SEMA__
 	SignalSema(_sema);
 #endif
 
-	if (w) {
-		_filePos += w;
-		if (w < len)
-			_eof = true;
-		return w;
-	}
-
-	return 0;
+	return len;
 }
 
 FILE *ps2_fopen(const char *fname, const char *mode) {

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.h
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.h	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/fileio.h	2009-07-12 05:04:59 UTC (rev 42401)
@@ -56,18 +56,18 @@
 	virtual bool getErr(void);
 	virtual void setErr(bool);
 
-	
+
 private:
 	void cacheReadAhead(void);
 	void cacheReadSync(void);
 
 	int _fd;
+	uint32 _mode;
 	uint32 _fileSize;
 	uint32 _filePos;
 	uint32 _cacheSize;
 	uint32 _cachePos;
 
-	// uint8 cache[2048];
 	uint8 *_cache;
 
 	int _eof;

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/irxboot.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/irxboot.cpp	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/irxboot.cpp	2009-07-12 05:04:59 UTC (rev 42401)
@@ -41,7 +41,7 @@
 
 IrxFile irxFiles[] = {
 	{ "SIO2MAN", BIOS, NOTHING, NULL, 0 },
-	{ "MCMAN",   BIOS, NOTHING, NULL, 0 }, 
+	{ "MCMAN",   BIOS, NOTHING, NULL, 0 },
 	{ "MCSERV",  BIOS, NOTHING, NULL, 0 },
 	{ "PADMAN",  BIOS, NOTHING, NULL, 0 },
 	{ "LIBSD",   BIOS, NOTHING, NULL, 0 },
@@ -55,15 +55,16 @@
 	{ "USB_MASS.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 },
 	{ "PS2MOUSE.IRX", USB | OPTIONAL, MOUSE_DRIVER, NULL, 0 },
 	{ "RPCKBD.IRX",   USB | OPTIONAL, KBD_DRIVER, NULL, 0 },
-
+#ifndef NO_ADAPTOR
 	{ "POWEROFF.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
 	{ "PS2DEV9.IRX",  HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 },
 	{ "PS2ATAD.IRX",  HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 },
 	{ "PS2HDD.IRX",   HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, hddArg, sizeof(hddArg) },
 	{ "PS2FS.IRX",    HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, pfsArg, sizeof(pfsArg) },
-	{ "PS2IP.IRX",    NET | NOT_HOST, NET_DRIVER, NULL, 0 },
-	{ "PS2SMAP.IRX",  NET | NOT_HOST, NET_DRIVER, netArg, sizeof(netArg) },
-	{ "PS2HOST.IRX",  NET | NOT_HOST, NET_DRIVER, NULL, 0 }
+	{ "PS2IP.IRX",    NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, NULL, 0 },
+	{ "PS2SMAP.IRX",  NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, netArg, sizeof(netArg) },
+	{ "PS2HOST.IRX",  NET | OPTIONAL | NOT_HOST | DEPENDANCY, NET_DRIVER, NULL, 0 }
+#endif
 };
 
 static const int numIrxFiles = sizeof(irxFiles) / sizeof(irxFiles[0]);
@@ -73,7 +74,7 @@
 	PS2Device device = _getDev(elfPath);
 
 	printf("elf path: %s, device %d\n", elfPath, device);
-	
+
 	strcpy(bootPath, elfPath);
 
 	char *pathPos = bootPath;
@@ -115,7 +116,7 @@
 	return device;
 }
 
-int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {	
+int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
 
 	IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference));
 	IrxReference *curModule = resModules;

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/ps2input.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/ps2input.cpp	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/ps2input.cpp	2009-07-12 05:04:59 UTC (rev 42401)
@@ -510,22 +510,22 @@
 };
 
 const Common::KeyCode Ps2Input::_padCodes[16] = {
-	Common::KEYCODE_1,		 // Select
-	Common::KEYCODE_INVALID,			 // L3
-	Common::KEYCODE_INVALID,			 // R3
-	Common::KEYCODE_F5,	 // Start
-	Common::KEYCODE_INVALID,			 //	Up
-	Common::KEYCODE_INVALID,			 //	Right
-	Common::KEYCODE_INVALID,			 //	Down
-	Common::KEYCODE_INVALID,			 //	Left
-	Common::KEYCODE_KP0,	 //	L2
-	Common::KEYCODE_INVALID,			 //	R2
-	Common::KEYCODE_n,		 //	L1
-	Common::KEYCODE_y,		 //	R1
-	Common::KEYCODE_ESCAPE, // Triangle
-	Common::KEYCODE_INVALID,			 //	Circle  => Right mouse button
-	Common::KEYCODE_INVALID,			 //	Cross	=> Left mouse button
-	Common::KEYCODE_RETURN	 //	Square
+	Common::KEYCODE_1,					// Select
+	Common::KEYCODE_INVALID,			// L3
+	Common::KEYCODE_INVALID,			// R3
+	Common::KEYCODE_F5,					// Start
+	Common::KEYCODE_INVALID,			// Up
+	Common::KEYCODE_INVALID,			// Right
+	Common::KEYCODE_INVALID,			// Down
+	Common::KEYCODE_INVALID,			// Left
+	Common::KEYCODE_KP0,				// L2
+	Common::KEYCODE_PERIOD,				// R2
+	Common::KEYCODE_n,					// L1
+	Common::KEYCODE_y,					// R1
+	Common::KEYCODE_ESCAPE,				// Triangle
+	Common::KEYCODE_INVALID,			// Circle  => Right mouse button
+	Common::KEYCODE_INVALID,			// Cross	=> Left mouse button
+	Common::KEYCODE_RETURN				// Square
 };
 
 const Common::KeyCode Ps2Input::_padFlags[16] = {
@@ -544,7 +544,7 @@
 	Common::KEYCODE_INVALID,			 // Triangle
 	Common::KEYCODE_INVALID,			 //	Circle
 	Common::KEYCODE_INVALID,			 //	Cross
-	Common::KEYCODE_INVALID			 //	Square
+	Common::KEYCODE_INVALID				 //	Square
 };
 
 

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.cpp	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.cpp	2009-07-12 05:04:59 UTC (rev 42401)
@@ -66,6 +66,10 @@
 #include "icon.h"
 #include "ps2temp.h"
 
+#ifdef __PS2_DEBUG__
+#include <debug.h>
+#endif
+
 // asm("mfc0	%0, $9\n" : "=r"(tickStart));
 
 extern void *_gp;
@@ -95,6 +99,11 @@
 
 extern AsyncFio fio;
 
+#ifdef __PS2_DEBUG__
+extern "C" int gdb_stub_main(int argc, char *argv[]);
+extern "C" void breakpoint(void);
+#endif
+
 extern "C" int scummvm_main(int argc, char *argv[]);
 
 extern "C" int main(int argc, char *argv[]) {
@@ -117,6 +126,9 @@
 		sioprintf("Result = %d\n", res);
 	}
 
+#ifdef __PS2_DEBUG__
+	gdb_stub_main(argc, argv);
+#endif
 	sioprintf("Creating system\n");
 	g_system = g_systemPs2 = new OSystem_PS2(argv[0]);
 
@@ -209,7 +221,7 @@
 				}
 			} else
 				sioprintf("Module \"%s\" wasn't found: %d\n", modules[i].path, modules[i].errorCode);
-			
+
 			if ((modules[i].errorCode < 0) || (res < 0) || (rv < 0)) {
 				if (!(modules[i].fileRef->flags & OPTIONAL)) {
 					if (modules[i].errorCode < 0)
@@ -220,7 +232,7 @@
 					quit();
 				}
 			}
-			
+
 			if (modules[i].buffer)
 				free(modules[i].buffer);
 		} else {
@@ -241,6 +253,8 @@
 	_printY = 0;
 	_msgClearTime = 0;
 	_systemQuit = false;
+	_modeChanged = false;
+	_screenChangeCount = 0;
 
 	_screen = new Gs2dScreen(320, 200, TV_DONT_CARE);
 
@@ -328,7 +342,7 @@
 	sioprintf("Timer...\n");
 	_scummTimerManager = new DefaultTimerManager();
 	_scummMixer = new Audio::MixerImpl(this);
-	_scummMixer->setOutputRate(44100);
+	_scummMixer->setOutputRate(48000);
 	_scummMixer->setReady(true);
 	initTimer();
 
@@ -519,6 +533,9 @@
 
 	_oldMouseX = width / 2;
 	_oldMouseY = height / 2;
+
+	_modeChanged = true;
+	_screenChangeCount++;
 	printf("done\n");
 }
 
@@ -643,11 +660,11 @@
 	_screen->copyOverlayRect((uint16*)buf, (uint16)pitch, (uint16)x, (uint16)y, (uint16)w, (uint16)h);
 }
 
-Graphics::Surface *OSystem_PS2::lockScreen() {
+Graphics::Surface *OSystem_PS2::lockScreen(void) {
 	return _screen->lockScreen();
 }
 
-void OSystem_PS2::unlockScreen() {
+void OSystem_PS2::unlockScreen(void) {
 	_screen->unlockScreen();
 }
 
@@ -670,7 +687,16 @@
 }
 
 bool OSystem_PS2::pollEvent(Common::Event &event) {
-	bool res = _input->pollEvent(&event);
+	bool res;
+
+	if (_modeChanged) {
+		_modeChanged = false;
+		event.type = Common::EVENT_SCREEN_CHANGED;
+		return true;
+	}
+
+	res = _input->pollEvent(&event);
+
 	if (res && (event.type == Common::EVENT_MOUSEMOVE))
 		_screen->setMouseXy(event.mouse.x, event.mouse.y);
 	return res;
@@ -705,7 +731,7 @@
 		while ((*lnEnd) && (*lnEnd != '\n'))
 			lnEnd++;
 		*lnEnd = '\0';
-		
+
 		Common::String str(lnSta);
 		int width = Graphics::g_sysfont.getStringWidth(str);
 		if (width > maxWidth)
@@ -803,17 +829,17 @@
 		// ("", 0, NULL);
 
 		/* back to PS2 Browser */
-/*		
+/*
 		__asm__ __volatile__(
 			"   li $3, 0x04;"
 			"   syscall;"
 			"   nop;"
         );
 */
-	
+
 /*
 		SifIopReset("rom0:UNDL ", 0);
-		while (!SifIopSync()) ; 
+		while (!SifIopSync()) ;
 		// SifIopReboot(...);
 */
 		#else
@@ -941,7 +967,7 @@
 		sprintf(path, "mc0:ScummVM/ScummVM.ini");
 	else
 		ps2_fclose(src);
-		
+
 	_configFile = strdup(path);
 }
 
@@ -949,7 +975,7 @@
 	Common::FSNode file(_configFile);
 	return file.openForReading();
 }
-    
+ 
 Common::WriteStream *OSystem_PS2::openConfigFileForWriting() {
 	Common::FSNode file(_configFile);
 	return file.openForWriting();

Modified: scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.h
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.h	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/backends/platform/ps2/systemps2.h	2009-07-12 05:04:59 UTC (rev 42401)
@@ -105,6 +105,7 @@
 	virtual int getDefaultGraphicsMode() const;
 	virtual bool setGraphicsMode(int mode);
 	virtual int getGraphicsMode() const;
+	virtual int getScreenChangeID() const { return _screenChangeCount; }
 
 	virtual void quit();
 
@@ -144,7 +145,6 @@
 	DefaultTimerManager *_scummTimerManager;
 	Audio::MixerImpl *_scummMixer;
 
-
 	bool _mouseVisible;
 	bool _useMouse, _useKbd, _useHdd, _usbMassLoaded, _useNet;
 
@@ -156,6 +156,8 @@
 	uint16		_oldMouseX, _oldMouseY;
 	uint32		_msgClearTime;
 	uint16		_printY;
+	bool _modeChanged;
+	int _screenChangeCount;
 
 	int			_mutexSema;
 	Ps2Mutex	_mutex[MAX_MUTEXES];
@@ -172,4 +174,3 @@
 };
 
 #endif // SYSTEMPS2_H
-

Modified: scummvm/branches/branch-0-13-0/engines/scumm/saveload.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/scumm/saveload.cpp	2009-07-12 03:54:16 UTC (rev 42400)
+++ scummvm/branches/branch-0-13-0/engines/scumm/saveload.cpp	2009-07-12 05:04:59 UTC (rev 42401)
@@ -145,7 +145,7 @@
 
 	memcpy(hdr.name, _saveLoadName, sizeof(hdr.name));
 	saveSaveGameHeader(out, hdr);
-#if !defined(__DS__)
+#if !defined(__DS__) /* && !defined(__PLAYSTATION2__) */
 	Graphics::saveThumbnail(*out);
 #endif
 	saveInfos(out);


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