summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-12-26 20:02:02 +0000
committerpixel <pixel>2003-12-26 20:02:02 +0000
commitbadf41b33bf879f8facf99a68374a8451ba4319d (patch)
tree2e58f0d14d0d58b10b5befdf7cd97c873f57e24a
parent47b21c600265c30f679861f8c460784530f52354 (diff)
Backport
-rwxr-xr-xXenogears/Makefile4
-rw-r--r--lib/cdutils.cpp16
2 files changed, 15 insertions, 5 deletions
diff --git a/Xenogears/Makefile b/Xenogears/Makefile
index 6c18bab..3b839c4 100755
--- a/Xenogears/Makefile
+++ b/Xenogears/Makefile
@@ -30,10 +30,10 @@ script-dec: script-dec.o ../includes/lzss.h ../lib/lib.a Makefile
${CXX} ${LDFLAGS} script-dec.o ../lib/lib.a -o script-dec
compil: compil.o
- ${CC} ${LDFLAGS} compil.o -o compil
+ ${CC} compil.o -o compil
compil-2: compil-2.o
- ${CC} ${LDFLAGS} compil-2.o -o compil-2
+ ${CC} compil-2.o -o compil-2
compil.c: compil.lex
${LEX} -ocompil.c compil.lex
diff --git a/lib/cdutils.cpp b/lib/cdutils.cpp
index 4e25aed..214964a 100644
--- a/lib/cdutils.cpp
+++ b/lib/cdutils.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: cdutils.cpp,v 1.21 2003-12-26 19:05:31 pixel Exp $ */
+/* $Id: cdutils.cpp,v 1.22 2003-12-26 20:03:32 pixel Exp $ */
#include <stdio.h>
#include <string.h>
@@ -235,12 +235,22 @@ void cdutils::read_file(Handle * file, long size, int type, int number) {
sector_seek(number);
for (i = 0; i < n; i++) {
- read_sector(sector, type);
+ try {
+ read_sector(sector, type);
+ }
+ catch(...) {
+ memset(sector, 0, 2352);
+ }
file->write(sector, sec_sizes[type]);
}
if (reste) {
- read_sector(sector, type);
+ try {
+ read_sector(sector, type);
+ }
+ catch(...) {
+ memset(sector, 0, 2352);
+ }
file->write(sector, reste);
}
}