[Scummvm-cvs-logs] SF.net SVN: scummvm:[42404] scummvm/trunk

sunmax at users.sourceforge.net sunmax at users.sourceforge.net
Sun Jul 12 07:38:09 CEST 2009


Revision: 42404
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42404&view=rev
Author:   sunmax
Date:     2009-07-12 05:38:08 +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/trunk/backends/platform/ps2/Gs2dScreen.cpp
    scummvm/trunk/backends/platform/ps2/Gs2dScreen.h
    scummvm/trunk/backends/platform/ps2/Makefile.ps2
    scummvm/trunk/backends/platform/ps2/fileio.cpp
    scummvm/trunk/backends/platform/ps2/fileio.h
    scummvm/trunk/backends/platform/ps2/irxboot.cpp
    scummvm/trunk/backends/platform/ps2/ps2input.cpp
    scummvm/trunk/backends/platform/ps2/savefilemgr.cpp
    scummvm/trunk/backends/platform/ps2/systemps2.cpp
    scummvm/trunk/backends/platform/ps2/systemps2.h
    scummvm/trunk/engines/scumm/saveload.cpp

Added Paths:
-----------
    scummvm/trunk/backends/platform/ps2/Makefile.gdb

Modified: scummvm/trunk/backends/platform/ps2/Gs2dScreen.cpp
===================================================================
--- scummvm/trunk/backends/platform/ps2/Gs2dScreen.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/Gs2dScreen.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -337,6 +337,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);
@@ -345,7 +346,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);
@@ -396,6 +398,13 @@
 	SignalSema(g_DmacSema);
 }
 
+void Gs2dScreen::fillScreen(uint32 col) {
+	WaitSema(g_DmacSema);
+	memset(_screenBuf, col, _width * _height);
+	_screenChanged = true;
+	SignalSema(g_DmacSema);
+}
+
 Graphics::Surface *Gs2dScreen::lockScreen() {
 	WaitSema(g_DmacSema);
 
@@ -541,11 +550,11 @@
 }
 
 int16 Gs2dScreen::getOverlayWidth(void) {
-	return _videoMode.overlayWidth;
+	return _width; // _videoMode.overlayWidth;
 }
 
 int16 Gs2dScreen::getOverlayHeight(void) {
-	return _videoMode.overlayHeight;
+	return _height; // _videoMode.overlayHeight;
 }
 
 void Gs2dScreen::setShakePos(int shake) {

Modified: scummvm/trunk/backends/platform/ps2/Gs2dScreen.h
===================================================================
--- scummvm/trunk/backends/platform/ps2/Gs2dScreen.h	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/Gs2dScreen.h	2009-07-12 05:38:08 UTC (rev 42404)
@@ -61,6 +61,7 @@
 	void copyPrintfOverlay(const uint8* buf);
 	void clearPrintfOverlay(void);
 	void clearScreen(void);
+	void fillScreen(uint32 col);
 
 	Graphics::Surface *lockScreen();
 	void unlockScreen();

Added: scummvm/trunk/backends/platform/ps2/Makefile.gdb
===================================================================
--- scummvm/trunk/backends/platform/ps2/Makefile.gdb	                        (rev 0)
+++ scummvm/trunk/backends/platform/ps2/Makefile.gdb	2009-07-12 05:38:08 UTC (rev 42404)
@@ -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/trunk/backends/platform/ps2/Makefile.gdb
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Modified: scummvm/trunk/backends/platform/ps2/Makefile.ps2
===================================================================
--- scummvm/trunk/backends/platform/ps2/Makefile.ps2	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/Makefile.ps2	2009-07-12 05:38:08 UTC (rev 42404)
@@ -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,15 +45,15 @@
 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)
 INCDIR = ../../../
 # DEPDIR = .deps
 
-DEFINES  = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -D_EE -D__PLAYSTATION2__ -O2 -Wall -Wno-multichar
+DEFINES  = -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -D_EE -D__PLAYSTATION2__ -O2 -Wall -Wno-multichar
 
 
 INCLUDES  = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS)) 
@@ -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/trunk/backends/platform/ps2/fileio.cpp
===================================================================
--- scummvm/trunk/backends/platform/ps2/fileio.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/fileio.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -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;
@@ -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) {
@@ -471,7 +529,8 @@
 	if (err)
 		printf("ferror -> %d\n", err);
 
-	return err;
+	return 0; // kyra temp
+	// return err;
 }
 
 void ps2_clearerr(FILE *stream) {

Modified: scummvm/trunk/backends/platform/ps2/fileio.h
===================================================================
--- scummvm/trunk/backends/platform/ps2/fileio.h	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/fileio.h	2009-07-12 05:38:08 UTC (rev 42404)
@@ -62,12 +62,12 @@
 	void cacheReadSync(void);
 
 	int _fd;
+	uint32 _mode;
 	uint32 _fileSize;
 	uint32 _filePos;
 	uint32 _cacheSize;
 	uint32 _cachePos;
 
-	// uint8 cache[2048];
 	uint8 *_cache;
 
 	int _eof;

Modified: scummvm/trunk/backends/platform/ps2/irxboot.cpp
===================================================================
--- scummvm/trunk/backends/platform/ps2/irxboot.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/irxboot.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -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]);

Modified: scummvm/trunk/backends/platform/ps2/ps2input.cpp
===================================================================
--- scummvm/trunk/backends/platform/ps2/ps2input.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/ps2input.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -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/trunk/backends/platform/ps2/savefilemgr.cpp
===================================================================
--- scummvm/trunk/backends/platform/ps2/savefilemgr.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/savefilemgr.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -239,10 +239,10 @@
 	if (!savePath.exists() || !savePath.isDirectory())
 		return Common::StringList();
 
-	printf("listSavefiles = %s\n", pattern);
+	printf("listSavefiles = %s\n", pattern.c_str());
 
 	if (_mc) {
-		strcpy(temp, pattern);
+		strcpy(temp, pattern.c_str());
 
 		// mcSplit(temp, game, ext);
 		game = strdup(strtok(temp, "."));
@@ -255,7 +255,7 @@
 	}
 	else {
 		_dir = Common::String(savePath.getPath());
-		search = Common::String(pattern);
+		search = pattern;
 	}
 
 	Common::FSDirectory dir(_dir);

Modified: scummvm/trunk/backends/platform/ps2/systemps2.cpp
===================================================================
--- scummvm/trunk/backends/platform/ps2/systemps2.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/systemps2.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -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,10 @@
 		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]);
 
@@ -241,6 +254,8 @@
 	_printY = 0;
 	_msgClearTime = 0;
 	_systemQuit = false;
+	_modeChanged = false;
+	_screenChangeCount = 0;
 
 	_screen = new Gs2dScreen(320, 200, TV_DONT_CARE);
 
@@ -327,9 +342,8 @@
 void OSystem_PS2::init(void) {
 	sioprintf("Timer...\n");
 	_scummTimerManager = new DefaultTimerManager();
-	_scummEventManager = new DefaultEventManager();
 	_scummMixer = new Audio::MixerImpl(this);
-	_scummMixer->setOutputRate(44100);
+	_scummMixer->setOutputRate(48000);
 	_scummMixer->setReady(true);
 	initTimer();
 
@@ -520,6 +534,9 @@
 
 	_oldMouseX = width / 2;
 	_oldMouseY = height / 2;
+
+	_modeChanged = true;
+	_screenChangeCount++;
 	printf("done\n");
 }
 
@@ -574,11 +591,11 @@
 Common::TimerManager *OSystem_PS2::getTimerManager() {
 	return _scummTimerManager;
 }
-
+/*
 Common::EventManager *OSystem_PS2::getEventManager() {
-	return _scummEventManager;
+	return getEventManager();
 }
-
+*/
 Audio::Mixer *OSystem_PS2::getMixer() {
 	return _scummMixer;
 }
@@ -661,7 +678,7 @@
 	return _screen->getOverlayHeight();
 }
 
-Graphics::Surface *OSystem_PS2::lockScreen() {
+Graphics::Surface *OSystem_PS2::lockScreen(void) {
 	return _screen->lockScreen();
 }
 
@@ -669,6 +686,10 @@
 	_screen->unlockScreen();
 }
 
+void OSystem_PS2::fillScreen(uint32 col) {
+	_screen->fillScreen(col);
+}
+
 const OSystem::GraphicsMode OSystem_PS2::_graphicsMode = { NULL, NULL, 0 };
 
 const OSystem::GraphicsMode *OSystem_PS2::getSupportedGraphicsModes(void) const {
@@ -688,7 +709,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;

Modified: scummvm/trunk/backends/platform/ps2/systemps2.h
===================================================================
--- scummvm/trunk/backends/platform/ps2/systemps2.h	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/backends/platform/ps2/systemps2.h	2009-07-12 05:38:08 UTC (rev 42404)
@@ -27,9 +27,9 @@
 #define SYSTEMPS2_H
 
 #include "common/system.h"
+#include "backends/base-backend.h"
 
 class DefaultTimerManager;
-class DefaultEventManager;
 class DefaultSaveFileManager;
 
 class Gs2dScreen;
@@ -54,7 +54,7 @@
 	class MixerImpl;
 };
 
-class OSystem_PS2 : public OSystem {
+class OSystem_PS2 : public BaseBackend {
 public:
 	OSystem_PS2(const char *elfPath);
 	virtual ~OSystem_PS2(void);
@@ -72,6 +72,7 @@
 	virtual Graphics::Surface *lockScreen();
 	virtual void unlockScreen();
 	virtual void updateScreen();
+	virtual void fillScreen(uint32);
 	/* TODO : check */
 	virtual void displayMessageOnOSD(const char *msg) { printf("displayMessageOnOSD: %s\n", msg); };
 	/* */
@@ -92,7 +93,7 @@
 	virtual uint32 getMillis();
 	virtual void delayMillis(uint msecs);
 	virtual Common::TimerManager *getTimerManager();
-	virtual Common::EventManager *getEventManager();
+//	virtual Common::EventManager *getEventManager();
 	virtual bool pollEvent(Common::Event &event);
 
 	virtual Audio::Mixer *getMixer();
@@ -112,14 +113,14 @@
 	virtual int getDefaultGraphicsMode() const;
 	virtual bool setGraphicsMode(int mode);
 	virtual int getGraphicsMode() const;
+	virtual int getScreenChangeID() const { return _screenChangeCount; }
 
 	virtual void quit();
 
 	virtual Common::SeekableReadStream *createConfigReadStream();
 	virtual Common::WriteStream *createConfigWriteStream();
 
-	virtual Graphics::PixelFormat getOverlayFormat() const;
-
+	virtual Graphics::PixelFormat getOverlayFormat() const; 
 	virtual Common::SaveFileManager *getSavefileManager();
 	virtual FilesystemFactory *getFilesystemFactory();
 
@@ -149,7 +150,6 @@
 	void readRtcTime(void);
 
 	DefaultTimerManager *_scummTimerManager;
-	DefaultEventManager *_scummEventManager;
 	Audio::MixerImpl *_scummMixer;
 
 	bool _mouseVisible;
@@ -163,6 +163,8 @@
 	uint16		_oldMouseX, _oldMouseY;
 	uint32		_msgClearTime;
 	uint16		_printY;
+	bool _modeChanged;
+	int _screenChangeCount;
 
 	int			_mutexSema;
 	Ps2Mutex	_mutex[MAX_MUTEXES];
@@ -179,4 +181,3 @@
 };
 
 #endif // SYSTEMPS2_H
-

Modified: scummvm/trunk/engines/scumm/saveload.cpp
===================================================================
--- scummvm/trunk/engines/scumm/saveload.cpp	2009-07-12 05:35:56 UTC (rev 42403)
+++ scummvm/trunk/engines/scumm/saveload.cpp	2009-07-12 05:38:08 UTC (rev 42404)
@@ -137,7 +137,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