diff --git a/pcsx2/CDVD/CDVDisoReader.cpp b/pcsx2/CDVD/CDVDisoReader.cpp index a503beb306..3858f4aa7d 100644 --- a/pcsx2/CDVD/CDVDisoReader.cpp +++ b/pcsx2/CDVD/CDVDisoReader.cpp @@ -1,4 +1,36 @@ -#include "PrecompiledHeader.h" +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ +/* + * Original code from libcdvd by Hiryu & Sjeep (C) 2002 + * Modified by Florin for PCSX2 emu + * Fixed CdRead by linuzappz + */ + + #ifdef __LINUX__ + // Just in case. + #define __USE_LARGEFILE64 +#define __USE_FILE_OFFSET64 +#define _FILE_OFFSET_BITS 64 +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#endif + + #include "PrecompiledHeader.h" #include "CDVDisoReader.h" @@ -23,9 +55,12 @@ int isoSectorSize = 0; int isoSectorOffset = 0; #ifndef _WIN32 -// if this doesn't work in linux, sorry -#define _ftelli64 ftell64 -#define _fseeki64 fseek64 +// if this doesn't work in linux, sorry. -gigaherz +// +// Hope this works. Think it will, but it isn't used yet. +// CDVDiso uses ftell, then switches to ftello64 if it fails. -arcum42 +#define _ftelli64 ftello64 +#define _fseeki64 fseeko64 #endif // This var is used to detect resume-style behavior of the Pcsx2 emulator, diff --git a/pcsx2/CDVD/IsoFStools.cpp b/pcsx2/CDVD/IsoFStools.cpp index e7dad6044a..6deb61bb74 100644 --- a/pcsx2/CDVD/IsoFStools.cpp +++ b/pcsx2/CDVD/IsoFStools.cpp @@ -172,19 +172,16 @@ int IsoFS_readSectors(u32 lsn, u32 sectors, void *buf) { u32 i; u8* buff; - int rmode; for (i=0; i