From badf41b33bf879f8facf99a68374a8451ba4319d Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 26 Dec 2003 20:02:02 +0000 Subject: Backport --- Xenogears/Makefile | 4 ++-- lib/cdutils.cpp | 16 +++++++++++++--- 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 #include @@ -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); } } -- cgit v1.2.3