[Scummvm-cvs-logs] CVS: scummvm/backends/ps2/iop/CoDyVDfs/iop cdtypes.h,1.1.2.1,1.1.2.2 codyvdfs.c,1.1.2.2,1.1.2.3 codyvdfs.h,1.1.2.1,1.1.2.2 fiofs.c,1.1.2.2,1.1.2.3 fiofs.h,1.1.2.1,1.1.2.2 irx_imports.h,1.1.2.1,1.1.2.2 rpcfs.c,1.1.2.1,1.1.2.2

Robert Göffringmann lavosspawn at users.sourceforge.net
Mon Nov 21 18:52:01 CET 2005


Update of /cvsroot/scummvm/scummvm/backends/ps2/iop/CoDyVDfs/iop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2791/backends/ps2/iop/CoDyVDfs/iop

Modified Files:
      Tag: branch-0-8-0
	cdtypes.h codyvdfs.c codyvdfs.h fiofs.c fiofs.h irx_imports.h 
	rpcfs.c 
Log Message:
various ps2 bugfixes

Index: cdtypes.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/ps2/iop/CoDyVDfs/iop/Attic/cdtypes.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- cdtypes.h	17 Nov 2005 01:52:47 -0000	1.1.2.1
+++ cdtypes.h	22 Nov 2005 02:51:18 -0000	1.1.2.2
@@ -29,15 +29,13 @@
 typedef signed short int16;
 typedef signed char int8;
 
-struct __ISOPathTableRecord {
+typedef struct {
 	uint8	len_di;
 	uint8	attributeLength;
 	uint8	lba[4];
 	uint16	parent;
 	char	name[256]; // arbitrary number
-} __attribute__ ((packed));
-
-typedef struct __ISOPathTableRecord ISOPathTableRecord;
+} ISOPathTableRecord __attribute__ ((packed));
 
 typedef struct {
     uint8 year; // Number of years since 1900

Index: codyvdfs.c
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/ps2/iop/CoDyVDfs/iop/Attic/codyvdfs.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- codyvdfs.c	18 Nov 2005 15:58:10 -0000	1.1.2.2
+++ codyvdfs.c	22 Nov 2005 02:51:18 -0000	1.1.2.3
@@ -49,12 +49,14 @@
 	int res;
 	u32 trayStat;
 	res = CdTrayReq(CdTrayCheck, &trayStat);
-	if ((res == 0) || (trayStat == 1)) {
+	if ((mediaType == DISC_UNKNOWN) || (res == 0) || (trayStat == 1)) {
 		// media was exchanged
-		if (checkDiscReady(300) == 0) // wait up to 3 seconds
+		if (checkDiscReady(100) == 0) // wait up to 1 second
 			return initDisc();
-		else
-			return -1; // drive still not ready			
+		else {
+			mediaType = DISC_UNKNOWN;
+			return -1; // drive still not ready
+		}
 	}
     if (mediaType == DISC_NONE)
 		return -1;
@@ -133,8 +135,11 @@
 	if (path[0] == '/')
 		path++;
 
-	if (!path[0]) // open root dir
+	if (!path[0]) { // open root dir
+		if (cachedDirOfs)
+			initRootCache();
 		return (ISODirectoryRecord *)cacheBuf;
+	}
 	
 	do {
 		tok = strchr(path, '/');
@@ -172,10 +177,12 @@
 	ISOPvd *pvd;
 	CdRMode rmode = { 16, 0, CdSect2048, 0 };
 	ISOPathTableRecord *rootRec;
-	mediaType = DISC_NONE;
 
-	if (checkDiscReady(0) < 0)
+	if (checkDiscReady(0) < 0) {
+		printf("disc not ready\n");
+		mediaType = DISC_UNKNOWN; // retry later
 		return -1;
+	}
 
 	do {	// wait until drive detected disc type
 		type = CdGetDiskType();
@@ -208,6 +215,7 @@
 	}
 
 	for (sector = 16; sector < 32; sector++) {
+		printf("sec %d\n", sector);
 		if (cdReadSectors(sector, 1, cacheBuf, &rmode) == 0) {
 			if (discType == DISC_DVD)
 				pvd = (ISOPvd *)cacheBuf;
@@ -252,6 +260,7 @@
 			}
 		}
 	}
+	mediaType = DISC_NONE;
 	// PVD not found
 	return -1;
 }
@@ -272,12 +281,10 @@
 }
 
 int cd_init(iop_device_t *dev) {
+	printf("FS init\n");
 	memset(cachedDir, 0, 256);
 	cachedDirLba = cachedDirOfs = 0;
-
-	mediaType = DISC_NONE;
-
-	initDisc();
+	mediaType = DISC_UNKNOWN;
 	return 0;
 }
 
@@ -312,12 +319,10 @@
     &FS_ops
 };
 
-void checkCC(void);
-
 int _start(void) {
     printf("CoDyVDfs v0.01\n");
 
-    CdInit(0);
+	CdInit(1);
     DelDrv(FS_NAME);
     AddDrv(&fsdriver);
 

Index: codyvdfs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/ps2/iop/CoDyVDfs/iop/Attic/codyvdfs.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- codyvdfs.h	17 Nov 2005 01:52:47 -0000	1.1.2.1
+++ codyvdfs.h	22 Nov 2005 02:51:18 -0000	1.1.2.2
@@ -37,6 +37,7 @@
 
 #define IS_DIR(a)  ((a)->flags & 2)
 
+#define DISC_UNKNOWN 0xFE
 #define DISC_NONE  0xFF
 #define DISC_DVD   0
 #define DISC_MODE1 1




Index: rpcfs.c
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/ps2/iop/CoDyVDfs/iop/Attic/rpcfs.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- rpcfs.c	17 Nov 2005 01:52:47 -0000	1.1.2.1
+++ rpcfs.c	22 Nov 2005 02:51:18 -0000	1.1.2.2
@@ -77,6 +77,7 @@
 }
 
 void *driveStandby(void *data) {
+	int type;
 	if (CdStandby() == 1) {
 		if (CdSync(0) == 0) {
 			*(int*)data = CdGetError();
@@ -84,6 +85,14 @@
 			*(int*)data = -0x100;
 	} else
 		*(int*)data = -0x101;
+
+	do {	// wait until drive detected disc type
+		type = CdGetDiskType();
+		if (DISC_NOT_READY(type))
+			DelayThread(10 * 1000);
+	} while (DISC_NOT_READY(type));
+	printf("Standby: Disc type: %02X\n", type);
+
 	return data;
 }
 





More information about the Scummvm-git-logs mailing list